Skip to content

Zondax/ledger-plugin-ens

Repository files navigation

Code style check Compilation & tests

Ledger ENS Plugin

This is a plugin for the Ethereum application which helps parsing and displaying relevant information when signing a ENS smart contract.

Prerequisite

Clone the plugin to a new folder.

git clone https://github.com/libertify/ledger-plugin-ens.git

Then in the same folder clone the app-ethereum.

git clone --recurse-submodules https://github.com/LedgerHQ/app-ethereum.git     #app-ethereum

Documentation

Need more information about the interface, the architecture, or general stuff about ethereum plugins? You can find more about them in the ethereum-app documentation.

Smart Contracts

Smart contracts covered by this plugin are:

Network Smart Contract Smart Contract Address
Ethereum ETH Registrar Controller 0x253553366da8546fc250f225fe3d25d0c782303b
Ethereum ETH Registrar Controller Old 0x283af0b28c62c092c9727f1ee09c02ca627eb7f5
Ethereum Reverse Registrar 0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb
Ethereum Reverse Registrar Old 0x9062C0A6Dbd6108336BcBe4593a3D1cE05512069
Ethereum Reverse Registrar Old 2 0x084b1c3C81545d370f3634392De611CaaBFf8148
Ethereum Bulk Renewal 0xff252725f6122a92551a5fa9a6b6bf10eb0be035
Ethereum StaticBulkRenewal 0xa12159e5131b1eEf6B4857EEE3e1954744b5033A
Ethereum ENS Registry With Fallback 0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e
Ethereum DNS Registrar 0x58774bb8acd458a640af0b88238369a167546ef2
Ethereum Public Resolver 0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63

Functions implemented:

Function Selector Displayed Parameters
commit 0xf14fcbc8 bytes32 commitment
register 0x85f6d155
string name
address owner
uint256 duration
bytes32 secret
registerWithConfig 0xf7a16963
string name
address owner
bytes32 secret
address resolver
address addr
renew 0xacf1a841
string name
uint256 duration
setName 0xc47f0027 string name
renewAll* 0xe8d6dbb4
string names
uint256 duration
bytes proof
proveAndClaim* 0x8bbedf75
bytes names
uint256 #inputs
bytes proof
proveAndClaimWithResolver* 0x224199c2
bytes names
uint256 #inputs
bytes proof
address resolver
address addr
setOwner 0x5b0fc9c3
bytes32 node
address owner
setResolver 0x1896f70a
bytes32 node
address resolver
SetSubnodeRecord 0x5ef2c7f0
bytes32 node
bytes32 label
address owner
address resolver
uint256 ttl
SetAddr* 0x8b95dd71 </td
bytes32 node
uint256 coinType
bytes a
SetText* 0x10f13a8c
bytes32 node
string Key
string Value
SetContentHash* 0x304e6ade
bytes32 node
bytes hash
Multicall* 0xac9650d8
bytes calls

*For renewAll, ENS plugin will only support signing transactions with 2 names maximum. For multicall, ENS plugin will only support signing transactions with 3 calls maximum. For strings and byte arrays bigger then 32, plugin is showing the first and last 16 bytes in "16...16" format, due to memory limitations.

Build

To build the plugin, go to your folder with Ethereum app and plugin. Open a new terminal window and run:

sudo docker run --rm -ti -v "$(realpath .):/app" -v "$(realpath app-ethereum):/plugin_dev/app-ethereum" --user $(id -u $USER):$(id -g $USER) ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest

In the container, go to the plugin repository, then to the tests/ folder.

cd ledger-plugin-swell/tests
./build_local_test_elfs.sh

Tests

To test the plugin go to the tests folder from the "ledger-plugin-swell" and run the script "test"

cd ledger-plugin-swell/tests         # go to the tests folder in ledger-plugin-swell
yarn test                       # run the script test