feat: Implement Permit2

- Retrieve allowance data from an RPC
- Encode approvals:
  - Create PermitSingle (and PermitDetails)
  - Use alloy eip712 to get signing hash on typed data
  - Sign data
- Add chrono and alloy eip712 and signer-local to Cargo.toml

--- don't change below this line ---
ENG-4063 Took 1 hour 58 minutes

Took 18 seconds

Took 32 seconds

Took 9 seconds

Took 1 minute


Took 32 minutes
This commit is contained in:
Diana Carvalho
2025-01-21 18:26:44 +00:00
parent 7bfd6c981c
commit ce9ae49e6f
5 changed files with 1330 additions and 55 deletions

View File

@@ -13,8 +13,9 @@ serde = { version = "1.0.217", features = ["derive"] }
serde_json = "1.0.135"
thiserror = "1.0.69"
tokio = { version = "1.38.0", features = ["full"] }
chrono = "0.4.39"
alloy = { version = "0.5.4", features = ["providers", "rpc-types-eth"], optional = true }
alloy = { version = "0.5.4", features = ["providers", "rpc-types-eth", "eip712", "signer-local"], optional = true }
alloy-sol-types = { version = "0.8.14", optional = true }
alloy-primitives = { version = "0.8.9", optional = true }
tycho-core = { git = "https://github.com/propeller-heads/tycho-indexer.git", package = "tycho-core", tag = "0.46.0" }