This is a plugin for the Ethereum application which helps parsing and displaying relevant information when signing a StakeKit transaction.
Clone the plugin to a new folder.
git clone https://github.com/blooo-io/LedgerHQ-app-plugin-stakekit.git
Then in the same folder clone one more repository, which is 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:
Module | Network | Smart Contract Name | Smart Contract Address | Proxy Name | Proxy smart contract | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
APE Native Staking | Ethereum | ApeCoinStaking | 0x5954ab967bc958940b7eb73ee84797dc8a2afbb9 | X | X | ||||||||||||||||||||
ETH Lido Staking | Ethereum | AppProxyUpgradeable | 0xae7ab96520de3a18e5e111b5eaab095312d7fe84 | Lido | 0x17144556fd3424EDC8Fc8A4C940B2D04936d17eb | ||||||||||||||||||||
ETH rETH Staking | Ethereum | RocketSwapRouter | 0x16d5a408e807db8ef7c578279beeee6b228f1c1c | X | X | ||||||||||||||||||||
ETH Stakewise Liquid Staking | Ethereum | AdminUpgradeabilityProxy | 0xc874b064f465bdd6411d45734b56fac750cda29a | Pool | 0x61975c09207c5DFe794b0A652C8CAf8458159AAe | ||||||||||||||||||||
MATIC Lido Liquid | Ethereum | TransparentUpgradeableProxy | 0x9ee91f9f426fa633d227f7a9b000e28b9dfd8599 | StMATIC | 0x6c25AEbD494a9984A3d7C8CF395c8713E0C74D98 | ||||||||||||||||||||
MATIC Native Staking | Ethereum | ValidatorShareProxy | 0x857679d69fe50e7b722f94acd2629d80c355163d | ValidatorShare | 0xf98864DA30a5bd657B13e70A57f5718aBf7BAB31 | ||||||||||||||||||||
Morpho Lending | Ethereum | TransparentUpgradeableProxy | 0x777777c9898d384f785ee44acfe945efdff5f3e0 | Morpho | 0xFBc7693f114273739C74a3FF028C13769C49F2d0 | ||||||||||||||||||||
Paraspace cAPE Staking | Ethereum | InitializableAdminUpgradeabilityProxy | 0xc5c9fb6223a989208df27dcee33fc59ff5c26fff | AutoCompoundApe | 0x1Ba6891D74b3B1f84b3EdFa6538D99eE979E8B63 | ||||||||||||||||||||
GRT Native Staking | Ethereum | GraphProxy | 0xf55041e37e12cd407ad00ce2910b8269b01263b9 | L1Staking | 0x20a14D78848BC8B3F3d4B77239F2adC3C0259A10 | ||||||||||||||||||||
SUSHI xSUSHI Staking | Ethereum | SushiBar | 0x8798249c2e607446efb7ad49ec89dd1865ff4272 | X | X | ||||||||||||||||||||
Compound V3 USDC |
|
|
|
|
|
||||||||||||||||||||
BNB Native Staking (Legacy) | BSC | TokenHub | 0x0000000000000000000000000000000000001004 | X | X | ||||||||||||||||||||
Celo Native Staking | Celo |
|
|
|
|
||||||||||||||||||||
Avalanche Liquid Staking | Avalanche | TransparentUpgradeableProxy | 0x2b2c81e08f1af8835a78bb2a90ae924ace0ea4be | StakedAvax | 0x0CE7F620Eb645a4FbF688a1C1937bC6CB0CbDd29 | ||||||||||||||||||||
Aave v3 Lending DAI |
|
InitializableImmutableAdminUpgradeabilityProxy | 0x794a61358d6845594f94dc1db02a252b5b4814ad |
|
|
||||||||||||||||||||
Yearn Vault |
|
Yearn Vault | Token json | ||||||||||||||||||||||
Angle Protocol |
|
TransparentUpgradeableProxy | 0x004626A008B1aCdC4c74ab51644093b155e59A23 | Savings | 0xfD2cCc920d498db30FBE9c13D5705aE2C72670F9 | ||||||||||||||||||||
Lido stETH Withdrawal NFT | Ethereum | OssifiableProxy | 0x889edC2eDab5f40e902b864aD4d7AdE8E412F9B1 | WithdrawalQueueERC721 | 0xE42C659Dc09109566720EA8b2De186c2Be7D94D9 | ||||||||||||||||||||
VIC Native Staking | Viction | TomoValidator | 0x0000000000000000000000000000000000000088 | X | X | ||||||||||||||||||||
BNB Native Staking | BSC | StakeHub | 0x0000000000000000000000000000000000002002 | X | X |
Methods covered by this plugin are:
Module | Conrtact Name | Selector | Method Name | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
APE Native Staking | ApeCoinStaking |
|
|
||||||||||||||||||
ETH Lido Staking | Lido | 0xa1903eab | submit | ||||||||||||||||||
ETH rETH Staking | RocketSwapRouter |
|
|
||||||||||||||||||
ETH stakewise Liquid Staking | Pool | 0x3a4b66f1 | stake | ||||||||||||||||||
MATIC Lido Liquid | StMATIC |
|
|
||||||||||||||||||
MATIC Native Staking | ValidatorShare |
|
|
||||||||||||||||||
Morpho lending | Morpho |
|
|
||||||||||||||||||
Paraspace cAPE Staking | AutoCompoundApe |
|
|
||||||||||||||||||
GRT Native Staking | L1Staking |
|
|
||||||||||||||||||
SUSHI xSUSHI Staking | SushiBar |
|
|
||||||||||||||||||
Compound V3 USDC |
|
|
|
||||||||||||||||||
BNB Native Staking (Legacy) | TokenHub | 0xaa7415f5 | transferOut | ||||||||||||||||||
Celo Native Staking |
|
|
|
||||||||||||||||||
Aave v3 Lending DAI |
|
|
|
||||||||||||||||||
Avalanche Liquid Staking | StakedAvax |
|
|
||||||||||||||||||
Yearn Vault | Yearn Vault |
|
|
||||||||||||||||||
Angle Protocol | Savings |
|
|
||||||||||||||||||
Lido stETH Withdrawal NFT | WithdrawalQueueERC721 |
|
|
||||||||||||||||||
VIC Native Staking | TomoValidator |
|
|
||||||||||||||||||
BNB Native Staking | StakeHub |
|
|
Go to the global folder and run the below command.
sudo docker run --rm -ti -v "$(realpath .):/app" --user $(id -u $USER):$(id -g $USER) ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
The script will build a docker image and attach a console. When the docker image is running go to the "LedgerHQ-app-plugin-stakekit" folder and build the ".elf" files.
cd LedgerHQ-app-plugin-stakekit/tests # go to the tests folder in LedgerHQ-app-plugin-stakekit
./build_local_test_elfs.sh # run the script build_local_test_elfs.sh
To test the plugin go to the tests folder from the "LedgerHQ-app-plugin-stakekit" and run the script "test"
cd LedgerHQ-app-plugin-stakekit/tests # go to the tests folder in LedgerHQ-app-plugin-stakekit
yarn test # run the script test
This step will vary slightly depending on your platform.
Your physical device must be connected, unlocked and the screen showing the dashboard (not inside an application).
Linux (Ubuntu)
First make sure you have the proper udev rules added on your host :
# Run these commands on your host, from the app's source folder.
sudo cp .vscode/20-ledger.ledgerblue.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
Then once you have opened a terminal in the app-builder
image and built the app for the device you want, run the following command :
# Run this command from the app-builder container terminal.
make load # load the app on a Nano S by default
Setting the BOLOS_SDK environment variable will allow you to load on whichever supported device you want.
macOS / Windows (with PowerShell)
It is assumed you have Python installed on your computer.
Run these commands on your host from the app's source folder once you have built the app for the device you want :
# Install Python virtualenv
python3 -m pip install virtualenv
# Create the 'ledger' virtualenv
python3 -m virtualenv ledger
Enter the Python virtual environment
- macOS :
source ledger/bin/activate
- Windows :
.\ledger\Scripts\Activate.ps1
# Install Ledgerblue (tool to load the app)
python3 -m pip install ledgerblue
# Load the app.
python3 -m ledgerblue.runScript --scp --fileName bin/app.apdu --elfFile bin/app.elf
The flow processed in GitHub Actions is the following:
- Code formatting with clang-format
- Compilation of the application for Ledger Nano S in ledger-app-builder