Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into fix/bridger-wusdm
Browse files Browse the repository at this point in the history
  • Loading branch information
ylv-io committed Feb 1, 2025
2 parents 76ed83b + 10fa0e5 commit ba48f42
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 17 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,6 @@ jobs:
# due to non-deterministic fuzzing (but still use pseudo-random fuzzing seeds)
FOUNDRY_FUZZ_SEED: 0x${{ github.event.pull_request.base.sha || github.sha }}

- name: Compare gas reports
uses: Rubilmax/foundry-gas-diff@v3.16
with:
summaryQuantile: 0.9 # only display the 10% most significant gas diffs in the summary (defaults to 20%)
sortCriteria: avg,max # sort diff rows by criteria
sortOrders: desc,asc # and directions
ignore: test-foundry/**/* # filter out gas reports from specific paths (test/ is included by default)
id: gas_diff

- name: Add gas diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact gas costs
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}

test-fork:
needs: test-local

Expand Down
57 changes: 57 additions & 0 deletions script/actions/fund-bridger.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import {KintoWalletFactory} from "@kinto-core/wallet/KintoWalletFactory.sol";
import {SponsorPaymaster} from "@kinto-core/paymasters/SponsorPaymaster.sol";
import {MigrationHelper} from "@kinto-core-script/utils/MigrationHelper.sol";
import {ArrayHelpers} from "@kinto-core-test/helpers/ArrayHelpers.sol";
import "forge-std/console2.sol";

contract FundBridgerScript is MigrationHelper {
using ArrayHelpers for *;

address public constant ETHEREUM_BRIDGER = 0x0f1b7bd7762662B23486320AA91F30312184f70C;
address public constant ARB_BRIDGER = 0xb7DfE09Cf3950141DFb7DB8ABca90dDef8d06Ec0;
address public constant BASE_BRIDGER = 0x361C9A99Cf874ec0B0A0A89e217Bf0264ee17a5B;

function run() public override {
super.run();

console2.log("Hot Wallet Balance: %e", deployer.balance);
if (deployer.balance < 0.25 ether) {
console2.log("Hot Wallet Balance too low. Refill.");
return;
}

address[3] memory bridgers = [ETHEREUM_BRIDGER, ARB_BRIDGER, BASE_BRIDGER];

if (block.chainid == ETHEREUM_CHAINID) {
fund(ETHEREUM_BRIDGER, "ETHEREUM_BRIDGER", 0.25 ether, 0.25 ether);
}

if (block.chainid == ARBITRUM_CHAINID) {
fund(ARB_BRIDGER, "ARB_BRIDGER", 0.25 ether, 0.25 ether);
}

if (block.chainid == BASE_CHAINID) {
fund(BASE_BRIDGER, "BASE_BRIDGER", 0.25 ether, 0.25 ether);
}

for (uint256 index = 0; index < bridgers.length; index++) {}
}

function fund(address bridger, string memory name, uint256 limit, uint256 amount) internal {
uint256 balance = bridger.balance;
console2.log("Bridger:", name);
console2.log("Address:", bridger);
console2.log("Balance: %e", balance);

if (balance < limit) {
console2.log("Needs funding. Adding: %e", amount);

vm.broadcast(deployerPrivateKey);
(bool success,) = address(bridger).call{value: amount}("");
require(success, "Failed to send ETH");
}
}
}

0 comments on commit ba48f42

Please sign in to comment.