feat(evm): week 2 contracts (EIP-712 + EndorsementVerifier)#1879
Open
atharrva01 wants to merge 7 commits into
Open
feat(evm): week 2 contracts (EIP-712 + EndorsementVerifier)#1879atharrva01 wants to merge 7 commits into
atharrva01 wants to merge 7 commits into
Conversation
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
…/hash types (LFDT-Panurus#1850) Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
…s#1853) Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
Working branch was rebuilt on the merged upstream (post LFDT-Panurus#1850/LFDT-Panurus#1853). Restores our finalized design doc, implementation plan (Week 2 updated for the snMarker fix and new digest) and plan.md tracker, none of which are meant to be upstreamed. Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
938b22f to
2207162
Compare
Foundry project under x/token/services/network/evm/contracts, kept out of the Go module so forge never links into the driver. - StateDelta.sol: frozen structs, same field order as the Go/EIP-712 type - EIP712.sol: domain separator, type hashes, hashStruct, digest, mirroring the Go eip712 package - EndorsementVerifier.sol: ecrecover, low-s, v check, unique signers and threshold over a digest; endorser set seeded at deploy 21 forge tests pass. Solidity reproduces both golden digests from the Go fixture (transfer 0xc9326b72, setup 0xdca9a011), also checked with ethers v6. Also tightens StateDelta.Validate (rejects setup params on non-setup deltas and unsorted or duplicate metadata keys) and adds the setup digest vector on the Go side. verify takes the final digest, since TokenState is the per-TMS clone that owns the domain separator. Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
- Besu is the acceptance backend, fabric-x-evm is a stretch - working rules R1-R7, each from an actual slip on this branch - module stays isolated under x/.../evm, core must not import it - snMarker query-surface decision noted for PR 2b Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
2207162 to
7180b6d
Compare
- remove em dashes from code comments in the contracts and Go files - document configNetworkResolver.IsEVMNetwork Signed-off-by: atharrva01 <atharvaborade568@gmail.com>
5a6fa6f to
259b560
Compare
adecaro
approved these changes
Jul 13, 2026
adecaro
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Please, rebase and run make checks and make lint to make sure everything is fine.
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.
First half of week 2. Adds the Solidity contracts under x/token/services/network/evm/contracts (Foundry), kept out of the Go module. TokenState.sol and the integration tests come in PR 2b.
What's here:
21 forge tests pass. The Solidity digest matches the Go fixture for both the transfer and setup deltas (0xc9326b72 and 0xdca9a011), also checked against ethers v6.
On the Go side, StateDelta.Validate now rejects a few malformed deltas, and there's a second golden vector for the setup case.
The docs commit resyncs the plan and design (Besu as the backend, working rules, module isolation).
Note: forge-std is a git submodule, so run
git submodule update --init.