Skip to content

Commit

Permalink
init: renamed boilerplate variable to berachain
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven2505 committed Jan 13, 2025
1 parent 5923f85 commit d2572d7
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 21 deletions.
6 changes: 3 additions & 3 deletions .clusterfuzzlite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ FROM ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest AS LITE_
FROM gcr.io/oss-fuzz-base/base-builder:v1

# Copy the project's source code.
COPY . $SRC/app-plugin-boilerplate
COPY --from=LITE_BUILDER /opt/nanox-secure-sdk $SRC/app-plugin-boilerplate/BOLOS_SDK
COPY . $SRC/app-plugin-berachain
COPY --from=LITE_BUILDER /opt/nanox-secure-sdk $SRC/app-plugin-berachain/BOLOS_SDK

# Working directory for build.sh
WORKDIR $SRC/app-plugin-boilerplate
WORKDIR $SRC/app-plugin-berachain

# Copy build.sh into $SRC dir.
COPY ./.clusterfuzzlite/build.sh $SRC/
2 changes: 1 addition & 1 deletion .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# CI with Github workflows

[//]: # (Comment)
[//]: # (This file when in the plugin-boilerplate repository is included in the Ethereum Plugin SDK Github page, keep that in mind when editing it.)
[//]: # (This file when in the plugin-berachain repository is included in the Ethereum Plugin SDK Github page, keep that in mind when editing it.)

The following Github workflows are provided for your application:

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ****************************************************************************
# Ledger Ethereum Plugin Boilerplate
# Ledger Ethereum Plugin Berachain
# (c) 2023 Ledger SAS.
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,7 +16,7 @@
# ****************************************************************************

# EDIT THIS: Application name
APPNAME = "PluginBoilerplate"
APPNAME = "Berachain"

# Application version
APPVERSION_M = 1
Expand Down
2 changes: 1 addition & 1 deletion PLUGIN_SPECIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This documentation is a template and shall be updated.

## About

This documentation describes the smart contracts and functions supported by the boilerplate plugin.
This documentation describes the smart contracts and functions supported by the Berachain plugin.

## Smart Contracts

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[![Ensure compliance with Ledger guidelines](https://github.com/LedgerHQ/app-plugin-boilerplate/actions/workflows/guidelines_enforcer.yml/badge.svg?branch=develop)](https://github.com/LedgerHQ/app-plugin-boilerplate/actions/workflows/guidelines_enforcer.yml)
[![Compilation & tests](https://github.com/LedgerHQ/app-plugin-boilerplate/actions/workflows/build_and_functional_tests.yml/badge.svg?branch=develop)](https://github.com/LedgerHQ/app-plugin-boilerplate/actions/workflows/build_and_functional_tests.yml)
[![Ensure compliance with Ledger guidelines](https://github.com/LedgerHQ/app-plugin-berachain/actions/workflows/guidelines_enforcer.yml/badge.svg?branch=develop)](https://github.com/LedgerHQ/app-plugin-berachain/actions/workflows/guidelines_enforcer.yml)
[![Compilation & tests](https://github.com/LedgerHQ/app-plugin-berachain/actions/workflows/build_and_functional_tests.yml/badge.svg?branch=develop)](https://github.com/LedgerHQ/app-plugin-berachain/actions/workflows/build_and_functional_tests.yml)


# app-plugin-boilerplate
# app-plugin-berachain

This repo is meant to be a forkable example of a plugin.

Expand All @@ -27,13 +27,13 @@ You can use the `ETHEREUM_PLUGIN_SDK` variable to point to the directory where y
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](https://github.com/LedgerHQ/app-plugin-boilerplate/blob/develop/.github/workflows/check_sdk.yml) workflow
You can see that this [CI](https://github.com/LedgerHQ/app-plugin-berachain/blob/develop/.github/workflows/check_sdk.yml) 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.

## Documentation

The documentation about the plugin shall be added in [PLUGIN_SPECIFICATON.md](https://github.com/LedgerHQ/app-plugin-boilerplate/blob/develop/PLUGIN_SPECIFICATION.md). It shall includes at least the smart contracts and functions supported by the plugin.
The documentation about the plugin shall be added in [PLUGIN_SPECIFICATON.md](https://github.com/LedgerHQ/app-plugin-berachain/blob/develop/PLUGIN_SPECIFICATION.md). It shall includes at least the smart contracts and functions supported by the plugin.

## Formatting

Expand Down
4 changes: 2 additions & 2 deletions fuzzing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ endif()
# project information
project(Fuzzer
VERSION 1.0
DESCRIPTION "Contract parser of Boilerplate plugin app"
DESCRIPTION "Contract parser of Berachain plugin app"
LANGUAGES C)

# guard against bad build-type strings
Expand Down Expand Up @@ -51,7 +51,7 @@ set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src")
set(ETH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../ethereum-plugin-sdk")

add_compile_definitions(
APPNAME="PluginBoilerplate"
APPNAME="PluginBerachain"
)

add_compile_definitions(
Expand Down
8 changes: 4 additions & 4 deletions fuzzing/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Fuzzing on transaction parser

[//]: # (Comment)
[//]: # (This file when in the plugin-boilerplate repository is included in the Ethereum Plugin SDK Github page, keep that in mind when editing it.)
[//]: # (This file when in the plugin-berachain repository is included in the Ethereum Plugin SDK Github page, keep that in mind when editing it.)

Fuzzing allows us to test how a program behaves when provided with invalid, unexpected, or random data as input.

In the case of `app-plugin-boilerplate` we want to test the code that is responsible for handling the contract data.
In the case of `app-plugin-berachain` we want to test the code that is responsible for handling the contract data.
The fuzzer needs to implement `int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)`, which provides an array of random bytes that can be used to simulate a serialized transaction.
If the application crashes, or a [sanitizer](https://github.com/google/sanitizers) detects any kind of access violation, the fuzzing process is stopped, a report regarding the vulnerability is shown, and the input that triggered the bug is written to disk under the name `crash-*`. The vulnerable input file created can be passed as an argument to the fuzzer to triage the issue.

Expand Down Expand Up @@ -71,13 +71,13 @@ The principle is to build the container, and run it to perform the fuzzing.
# Prepare directory tree
mkdir fuzzing/{corpus,out}
# Container generation
docker build -t app-plugin-boilerplate --file .clusterfuzzlite/Dockerfile .
docker build -t app-plugin-berachain --file .clusterfuzzlite/Dockerfile .
```

### Compilation

```shell
docker run --rm --privileged -e FUZZING_LANGUAGE=c -v "$(realpath .)/fuzzing/out:/out" -ti app-plugin-boilerplate
docker run --rm --privileged -e FUZZING_LANGUAGE=c -v "$(realpath .)/fuzzing/out:/out" -ti app-plugin-berachain
```

### Run
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Plugin Boilerplate
* Plugin Berachain
* (c) 2023 Ledger
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Plugin Boilerplate
* Plugin Berachain
* (c) 2023 Ledger
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Several methods are available:
- Clone the [Ethereum application](https://github.com/LedgerHQ/app-ethereum) in the `.test_dependencies/` directory and compile it.
- You will need to set the compilation flags manually to compile for tests.
- Open the [Ethereum application manifest](https://github.com/LedgerHQ/app-ethereum/blob/develop/ledger_app.toml) and use the flags from `use_test_keys`
- Re-use the Ethereum build produced by a test CI, and available as artifact. Example here with the [plugin-boilerplate CI](https://github.com/LedgerHQ/app-plugin-boilerplate/actions/workflows/build_and_functional_tests.yml).
- Re-use the Ethereum build produced by a test CI, and available as artifact. Example here with the [plugin-berachain CI](https://github.com/LedgerHQ/app-plugin-berachain/actions/workflows/build_and_functional_tests.yml).


## Launching the tests
Expand Down

0 comments on commit d2572d7

Please sign in to comment.