-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
3,096 additions
and
8,105 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
--- | ||
name: 🤖 format descriptors | ||
|
||
on: | ||
schedule: | ||
- cron: '0 7 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
BRANCH: "master" | ||
|
||
jobs: | ||
format: | ||
name: format descriptors | ||
runs-on: public-ledgerhq-shared-small | ||
timeout-minutes: 60 | ||
steps: | ||
|
||
- name: Checkout | ||
timeout-minutes: 10 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get date | ||
timeout-minutes: 10 | ||
run: echo "CURRENT_DATE=$(date +"%Y-%m-%d %H:%M")" >> $GITHUB_ENV | ||
|
||
- name: Setup python | ||
timeout-minutes: 10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
|
||
- name: Login to Ledger JFrog | ||
timeout-minutes: 10 | ||
uses: LedgerHQ/actions-security/actions/jfrog-login@actions/jfrog-login-1 | ||
|
||
- name: Setup pip | ||
timeout-minutes: 10 | ||
run: jf pipc --global --repo-resolve=virtual-pypi-prod-green | ||
|
||
- name: Install ERC-7730 library | ||
timeout-minutes: 10 | ||
run: jf pip install erc7730 | ||
|
||
- name: Format ERC-7730 descriptors | ||
timeout-minutes: 10 | ||
run: erc7730 format | ||
|
||
- name: Check changes | ||
id: changes | ||
timeout-minutes: 10 | ||
shell: bash | ||
run: | | ||
[[ -n "$(git status -s)" ]] && echo "changes=true" >> $GITHUB_OUTPUT || true | ||
- name: Open pull request | ||
if: ${{ !cancelled() && steps.changes.outputs.changes == 'true' }} | ||
timeout-minutes: 10 | ||
uses: peter-evans/create-pull-request@v7 | ||
with: | ||
token: ${{ secrets.CI_BOT_TOKEN }} | ||
author: ${{ secrets.CI_BOT_USERNAME }} <${{ secrets.CI_BOT_USERNAME }}@users.noreply.github.com> | ||
branch: ${{ env.BRANCH }}-format-descriptors | ||
base: ${{ env.BRANCH }} | ||
delete-branch: false | ||
commit-message: 'chore: format descriptors - ${{ env.CURRENT_DATE }}' | ||
title: 'chore: format descriptors - ${{ env.CURRENT_DATE }}' | ||
body: ${{ steps.submodules.outputs.prBody }} | ||
draft: false | ||
signoff: false |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
.vscode/ | ||
.idea/ | ||
.jfrog/ | ||
.lh/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,65 @@ | ||
{ | ||
"$schema": "../specs/erc7730-v1.schema.json", | ||
"context": { | ||
"contract" : { | ||
"abi": [ | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "_spender", | ||
"type": "address" | ||
}, | ||
{ | ||
"name": "_value", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "approve", | ||
"outputs": [ | ||
{ | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [ | ||
{ | ||
"name": "_to", | ||
"type": "address" | ||
}, | ||
{ | ||
"name": "_value", | ||
"type": "uint256" | ||
} | ||
], | ||
"name": "transfer", | ||
"outputs": [ | ||
{ | ||
"name": "", | ||
"type": "bool" | ||
} | ||
], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
] | ||
"$schema": "../specs/erc7730-v1.schema.json", | ||
"context": { | ||
"contract": { | ||
"abi": [ | ||
{ | ||
"constant": false, | ||
"inputs": [{ "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }], | ||
"name": "approve", | ||
"outputs": [{ "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"constant": false, | ||
"inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }], | ||
"name": "transfer", | ||
"outputs": [{ "name": "", "type": "bool" }], | ||
"payable": false, | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
} | ||
}, | ||
|
||
"display": { | ||
"formats": { | ||
"transfer(address,uint256)": { | ||
"intent": "Send", | ||
"fields": [ | ||
{ | ||
"path": "_to", | ||
"label": "To", | ||
"format": "addressName", | ||
"params": { | ||
"types": [ | ||
"eoa" | ||
], | ||
"sources": [ | ||
"local", | ||
"ens" | ||
] | ||
} | ||
}, | ||
{ | ||
"path": "_value", | ||
"label": "Amount", | ||
"format": "tokenAmount", | ||
"params": { | ||
"tokenPath": "$.context.contract.deployments.[0].address" | ||
} | ||
} | ||
], | ||
"required": ["_to", "_value"] | ||
}, | ||
"approve(address,uint256)": { | ||
"intent": "Approve", | ||
"fields": [ | ||
{ | ||
"path": "_spender", | ||
"label": "Spender", | ||
"format": "addressName", | ||
"params": { | ||
"types": [ | ||
"eoa" | ||
], | ||
"sources": [ | ||
"local", | ||
"ens" | ||
] | ||
} | ||
}, | ||
{ | ||
"path": "_value", | ||
"label": "Amount", | ||
"format": "tokenAmount", | ||
"params": { | ||
"tokenPath": "$.context.contract.deployments.[0].address", | ||
"threshold": "0x8000000000000000000000000000000000000000000000000000000000000000" | ||
} | ||
} | ||
], | ||
"required": ["_spender", "_value"] | ||
] | ||
} | ||
}, | ||
"display": { | ||
"formats": { | ||
"transfer(address,uint256)": { | ||
"intent": "Send", | ||
"fields": [ | ||
{ "path": "_to", "label": "To", "format": "addressName", "params": { "types": ["eoa"], "sources": ["local", "ens"] } }, | ||
{ | ||
"path": "_value", | ||
"label": "Amount", | ||
"format": "tokenAmount", | ||
"params": { "tokenPath": "$.context.contract.deployments.[0].address" } | ||
} | ||
], | ||
"required": ["_to", "_value"] | ||
}, | ||
"approve(address,uint256)": { | ||
"intent": "Approve", | ||
"fields": [ | ||
{ | ||
"path": "_spender", | ||
"label": "Spender", | ||
"format": "addressName", | ||
"params": { "types": ["eoa"], "sources": ["local", "ens"] } | ||
}, | ||
{ | ||
"path": "_value", | ||
"label": "Amount", | ||
"format": "tokenAmount", | ||
"params": { | ||
"tokenPath": "$.context.contract.deployments.[0].address", | ||
"threshold": "0x8000000000000000000000000000000000000000000000000000000000000000" | ||
} | ||
} | ||
} | ||
], | ||
"required": ["_spender", "_value"] | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.