Skip to content

Commit

Permalink
add hackathon sample (#62)
Browse files Browse the repository at this point in the history
* add hackathon sample

* fix path

* fix enums
  • Loading branch information
lcastillo-ledger authored Oct 18, 2024
1 parent 2c1bc50 commit 61fee49
Showing 1 changed file with 123 additions and 0 deletions.
123 changes: 123 additions & 0 deletions registry/demo-dapp/eip712-demo3.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
}
}
}

0 comments on commit 61fee49

Please sign in to comment.