This is a plugin for the Ethereum application which helps parsing and displaying relevant information when signing a Swell smart contract.
Clone the plugin to a new folder.
git clone https://github.com/libertify/ledger-plugin-lens.git
Then in the same folder clone the app-ethereum.
git clone --recurse-submodules https://github.com/LedgerHQ/app-ethereum.git #app-ethereum
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 covered by this plugin are:
Function |
Selector |
Displayed Parameters |
addNewValidatorDetails* |
0x60ec5216 |
|
addOperator* |
0x54741d6d |
string name | address operator | address reward | |
deleteActiveValidators* |
0xeda74e71 |
|
deletePendingValidators* |
0x242eba0e |
|
usePubKeysForValidatorSetup* |
0xc3953502 |
|
deposit |
0xd0e30db0 |
|
disableOperator |
0xf56408ed |
|
enableOperator |
0xdd307b99 |
|
initialize |
0xc4d66de8 |
|
updateOperatorControllingAddress |
0x32f73258 |
address operator | address new_operator | |
updateOperatorRewardAddress |
0xe8f28a6c |
address operator | address reward | |
updateOperatorName* |
0x9f5db69c |
address operator | string name | |
withdrawERC20 |
0xf4f3b200 |
|
*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.
For addNewValidatorDetails, deleteActiveValidators, deletePendingValidators, usePubKeysForValidatorSetup, plugin can only verify transactions with 4 pubkeys maximum due to memory limitation.
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.
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