Skip to main content

ForgeHelper

Git Source

🛠 Helper Methods for Forge Std

Functions

loadPrivateKey


🔧 Env File

function loadPrivateKey(string memory envKey) internal view returns (uint256);

loadAddressFromEnv

function loadAddressFromEnv(string memory envKey) internal view returns (address);

getAddress


📍 Address

function getAddress(address target, bytes32 slot) internal view returns (address);

getDictionaryAddress

function getDictionaryAddress(address proxy) internal view returns (address);

injectCode

function injectCode(address target, bytes memory runtimeBytecode) internal;

injectAddressToStorage

function injectAddressToStorage(address target, bytes32 slot, address addr) internal;

injectDictionary

function injectDictionary(address proxy, address dictionary) internal;

assumeAddressIsNotReserved

function assumeAddressIsNotReserved(address addr) internal pure;

msgSender


📓 Context

function msgSender() internal returns (address);

assignLabel


🏷️ Label

function assignLabel(address addr, string memory name) internal returns (address);

getLabel

function getLabel(address addr) internal view returns (string memory);

readBoolOr


📂 TOML

function readBoolOr(string memory toml, string memory key, bool or) internal view returns (bool);

readStringOr

function readStringOr(string memory toml, string memory key, string memory or) internal view returns (string memory);

readUintOr

function readUintOr(string memory toml, string memory key, uint256 or) internal view returns (uint256);

readLogLevelOr

function readLogLevelOr(string memory toml, string memory key, Logger.Level or) internal view returns (Logger.Level);

pauseBroadcast


📡 Broadcast

function pauseBroadcast() internal returns (bool isBroadcasting, address);

resumeBroadcast

function resumeBroadcast(bool isBroadcasting, address currentSender) internal;