[SC-3] Deployment Scripts, Base Sepolia Deploy & Rust Backend EIP712 Integration
Labels: smart-contract, integration, priority:high, week-4
Assignee: Yash
Context
Per the Source of Truth (Sections 10, 11, and Week 3-4 milestone), the FishnetWallet needs deployment scripts for Base Sepolia and an end-to-end integration test proving that permits signed by the Rust backend are accepted by the on-chain contract. The Rust backend already has EIP712 signing logic (crates/server/src/signer.rs) — this issue ensures the two sides match exactly.
1. Foundry Deployment Script
File: contracts/script/Deploy.s.sol
2. Deploy to Base Sepolia
3. EIP712 Compatibility Verification (Rust ↔ Solidity)
The Rust backend (crates/server/src/signer.rs) already generates EIP712 permit signatures. Ensure the two sides are perfectly aligned:
4. End-to-End Integration Test
The Week 4 milestone test: "gateway signs permit, wallet executes swap"
5. Nonce Management Sync
6. Multi-Chain Preparation
Per Source of Truth: chain_ids = [8453, 42161] (Base + Arbitrum)
Acceptance Criteria
- FishnetWallet deployed and verified on Base Sepolia
- Rust-signed EIP712 permits are accepted by the on-chain contract (proven by integration test)
- Typehash, domain separator, and struct encoding match exactly between Rust and Solidity
- Nonce management prevents replays and handles gaps gracefully
- Deployment is documented and reproducible
- Integration test is automated and can run in CI
[SC-3] Deployment Scripts, Base Sepolia Deploy & Rust Backend EIP712 Integration
Labels:
smart-contract,integration,priority:high,week-4Assignee: Yash
Context
Per the Source of Truth (Sections 10, 11, and Week 3-4 milestone), the FishnetWallet needs deployment scripts for Base Sepolia and an end-to-end integration test proving that permits signed by the Rust backend are accepted by the on-chain contract. The Rust backend already has EIP712 signing logic (
crates/server/src/signer.rs) — this issue ensures the two sides match exactly.1. Foundry Deployment Script
File:
contracts/script/Deploy.s.solforge script:OWNER_ADDRESS,SIGNER_ADDRESSdeployments/base-sepolia.json)2. Deploy to Base Sepolia
contracts/deployments/base-sepolia.json:{ "network": "base-sepolia", "chainId": 84532, "fishnetWallet": "0x...", "owner": "0x...", "signer": "0x...", "deployedAt": "2026-..." }contracts/README.md3. EIP712 Compatibility Verification (Rust ↔ Solidity)
The Rust backend (
crates/server/src/signer.rs) already generates EIP712 permit signatures. Ensure the two sides are perfectly aligned:signer.rsmatches the Solidity constantkeccak256hashname = "Fishnet"(both sides)version = "1"(both sides)chainId— Rust uses the chain from permit request, Solidity usesblock.chainidverifyingContract— Rust must use the deployed wallet address, Solidity usesaddress(this)abi.encode()must match between Rust and Solidityuint64for chainId,uint48for expiry, etc.)(v, r, s)or 65-byte packed signatureecrecoverexpects the correct unpacking4. End-to-End Integration Test
The Week 4 milestone test: "gateway signs permit, wallet executes swap"
fishnetSignerFishnetPermitscripts/integration-test.shor Rust integration test that:contracts/README.md5. Nonce Management Sync
nonce_countertable in SQLite) must stay in sync with contract stateusedNonces[nonce] = trueafter each execution6. Multi-Chain Preparation
Per Source of Truth:
chain_ids = [8453, 42161](Base + Arbitrum)deployments/directory structure:chainIdandverifyingContract)Acceptance Criteria