This is a plugin for the Ethereum application which helps parsing and displaying relevant information when signing an OUSD or OETH transaction on their respective dapps.
Plugins are lightweight applications that go hand-in-hand with the Ethereum Application on a Nano (S, S plus, X) and Stax devices.
They allow users to safely interact with smart contracts by parsing the transaction data and displaying its content in a human-readable way. This is done on a "per contract" basis, meaning a plugin is required for every DApp.
The code has been commented, and special "EDIT THIS" comments indicate where developers are expected to adapt the code to their own needs.
It is STRONGLY recommended to follow the plugin guide in order to better understand the flow and the context for plugins.
Clone the plugin to a new folder.
git clone https://github.com/OriginProtocol/origin-app-plugin.git
Then in the same folder clone two more repositories, which is the plugin-tools and app-ethereum.
git clone --recurse-submodules https://github.com/LedgerHQ/app-ethereum
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 "origin-app-plugin" folder and build the ".elf" files.
cd origin-app-plugin/tests # go to the tests folder in origin-app-plugin
./build_local_test_elfs.sh # run the script build_local_test_elfs.sh
To test the plugin go to the tests folder in a new console window from the "origin-app-plugin" and run the script "test"
cd origin-app-plugin/tests # go to the tests folder in origin-app-plugin
yarn install
yarn test # run the script test
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:
Contract | Address |
---|---|
OETH Zapper | 0x9858e47bcbbe6fbac040519b02d7cd4b2c470c66 |
OETH Vault | 0x39254033945aa2e4809cc2977e7087bee48bd7ab |
ETH/OETH Curve Pool | 0x94b17476a93b3262d87b9a326965d1e91f9c13e7 |
Curve Router | 0x99a58482bd75cbab83b27ec03ca68ff489b5788f |
OUSD Vault | 0xe75d77b1865ae93c7eaa3040b038d7aa7bc02f70 |
OUSD Flipper | 0xcecad69d7d4ed6d52efcfa028af8732f27e08f70 |
UniswapV3 Router | 0xe592427a0aece92de3edee1f18e0157c05861564 |
OUSD/3CRV Curve Pool | 0x87650d7bbfc3a9f10587d7778206671719d9910d |
ETH/OETH Curve Pool | 0x94b17476a93b3262d87b9a326965d1e91f9c13e7 |
Curve Router | 0x99a58482bd75cbab83b27ec03ca68ff489b5788f |
OUSD Vault | 0xe75d77b1865ae93c7eaa3040b038d7aa7bc02f70 |
OUSD Flipper | 0xcecad69d7d4ed6d52efcfa028af8732f27e08f70 |
WOETH | 0xdcee70654261af21c44c093c300ed3bb97b78192 |
WOUSD | 0xd2af830e8cbdfed6cc11bab697bb25496ed6fa62 |
Function | Selector | Displayed Parameters | |||||
---|---|---|---|---|---|---|---|
deposit | 0xd0e30db0 | ||||||
depositSFRXETH | 0xd443e97d |
|
|||||
mint | 0x156e29f6 |
|
|||||
redeem | 0x7cbc2373 |
|
|||||
exchange | 0x3df02124 |
|
|||||
exchange_underlying | 0xa6417ed6 |
|
|||||
exchange_multiple | 0x353ca424 |
|
|||||
exactInput | 0xc04b8d59 |
|
|||||
exactInputSingle | 0x414bf389 |
|
|||||
buyOusdWithUsdt | 0x35aa0b96 |
|
|||||
sellOusdForUsdt | 0xcb939053 |
|
|||||
buyOusdWithDai | 0x5981c746 |
|
|||||
sellOusdForDai | 0x8a095a0f |
|
|||||
buyOusdWithUsdc | 0xbfc11ffd |
|
|||||
sellOusdForUsdc | 0xc6b68169 |
|
|||||
redeem | 0xba087652 |
|
|||||
redeem | 0xba087652 |
|
Ethereum plugins need the Ethereum SDK.
You can use the ETHEREUM_PLUGIN_SDK
variable to point to the directory where you cloned
this repository. By default, the Makefile
expects it to be at the root directory of this
plugin repository by the ethereum-plugin-sdk
name.
You can see that this CI workflow
verifies that the SDK used is either on the latest master
or develop
references. This ensures
the code is compiled and tested on the latest version of the SDK.
The documentation about the plugin shall be added in PLUGIN_SPECIFICATON.md. It shall includes at least the smart contracts and functions supported by the plugin.
The C source code is expected to be formatted with clang-format
11.0.0 or higher.