Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-fast-forward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fi

- name: Fast forwarding
uses: sequoia-pgp/fast-forward@v1
uses: sequoia-pgp/fast-forward@ea7628bedcb0b0b96e94383ada458d812fca4979 # v1.0.0
with:
merge: false
comment: on-error # always | never | on-error
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- devel
- bepolia

permissions:
contents: read

jobs:
ci:
runs-on:
Expand All @@ -25,17 +28,21 @@ jobs:
command: forge coverage --fuzz-runs 256 --report lcov --report-file ./test-forge-cover.txt
summary: "## Coverage result"
name: ${{ matrix.job_name }}
env:
BERACHAIN_RPC_URL: ${{ secrets.BERACHAIN_RPC_URL }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0

- name: Install Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: "1.3.14"

- name: Install the Node.js dependencies
run: bun install
Expand All @@ -50,7 +57,7 @@ jobs:

- if: ${{ matrix.job_name == 'coverage' }}
name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test-forge-cover.txt
2 changes: 1 addition & 1 deletion .github/workflows/fast-forward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
exit 1
fi
- name: Fast forwarding
uses: sequoia-pgp/fast-forward@v1
uses: sequoia-pgp/fast-forward@ea7628bedcb0b0b96e94383ada458d812fca4979 # v1.0.0
with:
merge: true
comment: on-error # always | never | on-error
9 changes: 6 additions & 3 deletions .github/workflows/slither.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ name: Slither Analysis
on:
pull_request:

permissions:
contents: read

jobs:
analyze:
runs-on: ubuntu-latest
steps:
# Add Docker Hub authentication with rate limiting configuration
- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
registry: docker.io

- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: crytic/slither-action@v0.4.1
- uses: crytic/slither-action@4fd765aeef19915d04ddf0be90c2930036a774d8 # v0.4.1
with:
fail-on: none

Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/tests-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,29 @@ on:
- bepolia
- devel

permissions:
contents: read

jobs:
test:
runs-on:
labels: ubuntu-latest
timeout-minutes: 30
env:
BERACHAIN_RPC_URL: ${{ secrets.BERACHAIN_RPC_URL }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0

- name: Install Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: "1.3.14"

- name: Install the Node.js dependencies
run: bun install
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/tests-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,29 @@ name: Tests-PR
on:
pull_request:

permissions:
contents: read

jobs:
test:
runs-on:
labels: ubuntu-latest
timeout-minutes: 30
env:
BERACHAIN_RPC_URL: ${{ secrets.BERACHAIN_RPC_URL }}
steps:
- name: Check out the repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d # v1.8.0

- name: Install Bun
uses: oven-sh/setup-bun@v1
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: "1.3.14"

- name: Install the Node.js dependencies
run: bun install
Expand Down
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mainnet = "https://eth-mainnet.g.alchemy.com/v2/${API_KEY_ALCHEMY}"
optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}"
polygon = "https://polygon-mainnet.infura.io/v3/${API_KEY_INFURA}"
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"
berachain = "https://rpc.berachain.com"
berachain = "${BERACHAIN_RPC_URL}"
bepolia = "https://bepolia.rpc.berachain.com/"

[lint]
Expand Down
5 changes: 5 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>berachain/renovate-config"],
"baseBranches": ["devel"]
}
46 changes: 46 additions & 0 deletions script/base/BaseUpgrade.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import { console2 } from "forge-std/Script.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { UpgradeableBeacon } from "solady/src/utils/UpgradeableBeacon.sol";

import { BaseDeployScript } from "./BaseDeploy.s.sol";
import { AddressBook } from "./AddressBook.sol";

abstract contract BaseUpgradeScript is BaseDeployScript, AddressBook {
function run() public pure {
console2.log("Please run specific function.");
}

function deployNewImplementation() public broadcast {
address impl = _deployNewImplementation();
console2.log("New implementation address:", impl);
}

function _deployNewImplementation() internal virtual returns (address);
}

abstract contract BaseERC1967UpgradeScript is BaseUpgradeScript {
/// @dev Only for testnet or test purposes.
function upgradeToAndCallTestnet(bytes memory callSignature) public broadcast {
address newImpl = _deployNewImplementation();
console2.log("New implementation address:", newImpl);
UUPSUpgradeable(_proxyAddress()).upgradeToAndCall(newImpl, callSignature);
console2.log("Contract upgraded successfully");
}

function _proxyAddress() internal view virtual returns (address);
}

abstract contract BaseBeaconUpgradeScript is BaseUpgradeScript {
/// @dev Only for testnet or test purposes.
function upgradeToTestnet() public broadcast {
address newImpl = _deployNewImplementation();
console2.log("New implementation address:", newImpl);
UpgradeableBeacon(_beaconAddress()).upgradeTo(newImpl);
console2.log("Contract upgraded successfully");
}

function _beaconAddress() internal view virtual returns (address);
}
6 changes: 4 additions & 2 deletions script/base/Storage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ import { BeaconDeposit } from "src/pol/BeaconDeposit.sol";
import { BGTIncentiveDistributor } from "src/pol/rewards/BGTIncentiveDistributor.sol";
import { WBERAStakerVault } from "src/pol/WBERAStakerVault.sol";
import { WBERAStakerVaultWithdrawalRequest } from "src/pol/WBERAStakerVaultWithdrawalRequest.sol";
import { BGTIncentiveFeeCollector } from "src/pol/BGTIncentiveFeeCollector.sol";
import { IncentivesCollector } from "src/pol/IncentivesCollector.sol";
import { LSTStakerVaultFactory } from "src/pol/lst/LSTStakerVaultFactory.sol";
import { LSTStakerVault } from "src/pol/lst/LSTStakerVault.sol";
import { LSTStakerVaultWithdrawalRequest } from "src/pol/lst/LSTStakerVaultWithdrawalRequest.sol";
import { DedicatedEmissionStreamManager } from "src/pol/rewards/DedicatedEmissionStreamManager.sol";
import { RewardVaultHelper } from "src/pol/rewards/RewardVaultHelper.sol";

abstract contract Storage {
BGT internal bgt;
Expand All @@ -44,9 +45,10 @@ abstract contract Storage {
BGTIncentiveDistributor internal bgtIncentiveDistributor;
WBERAStakerVault internal wberaStakerVault;
WBERAStakerVaultWithdrawalRequest internal wberaStakerVaultWithdrawalRequest;
BGTIncentiveFeeCollector internal bgtIncentiveFeeCollector;
IncentivesCollector internal incentivesCollector;
LSTStakerVaultFactory internal lstStakerVaultFactory;
LSTStakerVault internal lstStakerVault;
LSTStakerVaultWithdrawalRequest internal lstStakerVaultWithdrawalRequest;
DedicatedEmissionStreamManager internal dedicatedEmissionStreamManager;
RewardVaultHelper internal rewardVaultHelper;
}
Loading
Loading