Skip to content

Commit

Permalink
Restake (stader-labs#31)
Browse files Browse the repository at this point in the history
* [auto] Add manifest

* update sdk

* change source code according to new boilerplate plugin code

* temporarily remove nanosp from testing

* wip: kelp lst deposit

* refactor

* deposit LST test

* kelp deposit eth

* fix minor issues

* Revert "temporarily remove nanosp from testing"

This reverts commit 4d6190f.

* Revert "Revert "temporarily remove nanosp from testing""

This reverts commit e527a79.

* rename and docs

* sdk update

* updates in src code for sdk changes

---------

Co-authored-by: Sarah GLINER <[email protected]>
  • Loading branch information
manoj9april and sgliner-ledger authored Apr 1, 2024
1 parent cbced1d commit 31145c5
Show file tree
Hide file tree
Showing 49 changed files with 1,051 additions and 919 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ SortIncludes: false
SpaceAfterCStyleCast: true
AllowShortCaseLabelsOnASingleLine: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
BinPackArguments: false
Expand Down
108 changes: 2 additions & 106 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ****************************************************************************
# Ledger App
# Ledger Ethereum Plugin Staderlabs
# (c) 2023 Ledger SAS.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -15,116 +15,12 @@
# limitations under the License.
# ****************************************************************************

ifeq ($(BOLOS_SDK),)
$(error Environment variable BOLOS_SDK is not set)
endif

include $(BOLOS_SDK)/Makefile.defines

########################################
# Mandatory configuration #
########################################
# Application name
APPNAME = "Staderlabs"

# Application version
APPVERSION_M = 1
APPVERSION_N = 1
APPVERSION_P = 2
APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)"

# Initialize plugin SDK submodule if needed
ifneq ($(shell git submodule status | grep '^[-+]'),)
$(info INFO: Need to reinitialize git submodules)
$(shell git submodule update --init)
endif

ifeq ($(ETHEREUM_PLUGIN_SDK),)
ETHEREUM_PLUGIN_SDK=ethereum-plugin-sdk
endif

# Application source files
APP_SOURCE_PATH += src $(ETHEREUM_PLUGIN_SDK)

# Application icons following guidelines:
# https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon
ICON_ID = $(shell echo -n "$(APPNAME)" | tr " " "_" | tr "[:upper:]" "[:lower:]")
ICON_NANOS = icons/nanos_app_$(ICON_ID).gif
ICON_NANOX = icons/nanox_app_$(ICON_ID).gif
ICON_NANOSP = $(ICON_NANOX)
ICON_STAX = icons/stax_app_$(ICON_ID).gif

ifeq ($(TARGET_NAME),TARGET_STAX)
DEFINES += ICONGLYPH=C_stax_$(ICON_ID)_64px
DEFINES += ICONBITMAP=C_stax_$(ICON_ID)_64px_bitmap
endif

# Application allowed derivation curves.
# Possibles curves are: secp256k1, secp256r1, ed25519 and bls12381g1
# If your app needs it, you can specify multiple curves by using:
# `CURVE_APP_LOAD_PARAMS = <curve1> <curve2>`
CURVE_APP_LOAD_PARAMS = secp256k1

# Application allowed derivation paths.
# You should request a specific path for your app.
# This serve as an isolation mechanism.
# Most application will have to request a path according to the BIP-0044
# and SLIP-0044 standards.
# If your app needs it, you can specify multiple path by using:
# `PATH_APP_LOAD_PARAMS = "44'/1'" "45'/1'"`
PATH_APP_LOAD_PARAMS = "44'/60'" # purpose=coin(44) / coin_type=Testnet(1)

# Setting to allow building variant applications
# - <VARIANT_PARAM> is the name of the parameter which should be set
# to specify the variant that should be build.
# - <VARIANT_VALUES> a list of variant that can be build using this app code.
# * It must at least contains one value.
# * Values can be the app ticker or anything else but should be unique.
VARIANT_PARAM = COIN
VARIANT_VALUES = staderlabs

# Enabling DEBUG flag will enable PRINTF and disable optimizations
#DEBUG = 1

########################################
# Application custom permissions #
########################################
# See SDK `include/appflags.h` for the purpose of each permission
#HAVE_APPLICATION_FLAG_DERIVE_MASTER = 1
#HAVE_APPLICATION_FLAG_GLOBAL_PIN = 1
#HAVE_APPLICATION_FLAG_BOLOS_SETTINGS = 1
HAVE_APPLICATION_FLAG_LIBRARY = 1

########################################
# Application communication interfaces #
########################################
#ENABLE_BLUETOOTH = 1
#ENABLE_NFC = 1

########################################
# NBGL custom features #
########################################
#ENABLE_NBGL_QRCODE = 1
#ENABLE_NBGL_KEYBOARD = 1
#ENABLE_NBGL_KEYPAD = 1

########################################
# Features disablers #
########################################
# These advanced settings allow to disable some feature that are by
# default enabled in the SDK `Makefile.standard_app`.

DISABLE_STANDARD_APP_FILES = 1

# To allow custom size declaration
#DISABLE_DEFAULT_IO_SEPROXY_BUFFER_SIZE = 1

# Will set all the following disablers
#DISABLE_STANDARD_APP_DEFINES = 1

DISABLE_STANDARD_SNPRINTF = 1
#DISABLE_STANDARD_USB = 1
DISABLE_STANDARD_WEBUSB = 1
DISABLE_STANDARD_BAGL_UX_FLOW = 1

include $(BOLOS_SDK)/Makefile.standard_app
include ethereum-plugin-sdk/standard_plugin.mk
12 changes: 12 additions & 0 deletions PLUGIN_SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,15 @@ Functions covered by above contract/s :
|UserWithdrawalManager | claim(uint256 \_requestId) | `0x379607f5`| |
|StaderStakePoolsManager | deposit(address \_receiver) | `0xf340fa01`| `_receiver`, native_token_amount (eth) |
|UserWithdrawalManager | requestWithdraw(uint256 \_ethXAmount, address \_owner) | `0xccc143b8`| `_ethXAmount`, `_owner` |

#### KELP

| Network | Contract Name | Smart Contract |
| ------- | ------------- | -------------------------------------------- |
| Ethereum | LRTDepositPool | `0x036676389e48133B63a802f8635AD39E752D375D` |

Functions covered by above contract/s :
|Contract | Function | Selector | Displayed Parameters |
| --- | --- | --- | --- |
|LRTDepositPool | depositETH(uint256 minRSETHAmountExpected, string calldata referralId) | `0x72c51c0b`| native_token_amount (eth) |
|LRTDepositPool | depositAsset(address asset, uint256 depositAmount, uint256 minRSETHAmountExpected, string calldata referralId) | `0xc3ae1766`| `asset`, `depositAmount` |
4 changes: 4 additions & 0 deletions ledger_app.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[app]
build_directory = "./"
sdk = "C"
devices = ["nanos", "nanox", "nanos+", "stax"]
147 changes: 0 additions & 147 deletions src/contract.c

This file was deleted.

5 changes: 0 additions & 5 deletions src/dbg/debug.h

This file was deleted.

Loading

0 comments on commit 31145c5

Please sign in to comment.