From 61fee497e61dbb1db803375854e2065fc165fed6 Mon Sep 17 00:00:00 2001 From: lcastillo-ledger <78589616+lcastillo-ledger@users.noreply.github.com> Date: Fri, 18 Oct 2024 21:54:52 +0200 Subject: [PATCH] add hackathon sample (#62) * add hackathon sample * fix path * fix enums --- registry/demo-dapp/eip712-demo3.json | 123 +++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 registry/demo-dapp/eip712-demo3.json diff --git a/registry/demo-dapp/eip712-demo3.json b/registry/demo-dapp/eip712-demo3.json new file mode 100644 index 0000000..3864ed5 --- /dev/null +++ b/registry/demo-dapp/eip712-demo3.json @@ -0,0 +1,123 @@ +{ + "$schema": "../../specs/erc7730-v1.schema.json", + + "context" : { + "eip712" : { + "deployments": [ + { + "chainId": 1, + "address": "0x4c415552454e5400000000000000000000000003" + } + ], + "domain": { + "name": "LedgerClearSigning" + }, + "schemas": [ + { + "primaryType": "PermitLike", + "types": { + "EIP712Domain": [ + { + "name": "name", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type": "address" + } + ], + "PermitLike": [ + { + "name": "token", + "type": "address" + }, + { + "name": "amount", + "type": "uint160" + }, + { + "name": "expiration", + "type": "uint48" + }, + { + "name": "nonce", + "type": "uint48" + }, + { + "name": "spender", + "type": "address" + }, + { + "name": "mode", + "type": "uint48" + } + ] + } + } + ] + } + }, + + "metadata" : { + "owner": "LedgerHackathon", + "info": { + "legalName": "Ledger Inc", + "url": "https://ledger.com" + }, + "enums": { + "mode": { + "0": "Strict", + "1": "Allow Delegation" + } + } + }, + + "display": { + "formats": { + "PermitLike": { + "intent": "Authorize spending", + "required": [ + "amount", "spender" + ], + "excluded": [ + "nonce" + ], + "fields": [ + { + "path": "amount", + "label": "Amount to delegate", + "format": "tokenAmount", + "params": { + "tokenPath": "token" + } + }, + { + "path": "spender", + "label": "Allowed Spender", + "format": "addressName" + }, + { + "path": "expiration", + "label": "Expires", + "format": "date", + "params": { + "encoding": "timestamp" + } + }, + { + "path": "mode", + "label": "Delegation mode", + "format": "enum", + "params": { + "$ref": "$.metadata.mode" + } + } + ] + } + } + } +} \ No newline at end of file