@layerzerolabs/devtools-evm
v1.0.2
Published
Utilities for LayerZero EVM projects
Downloads
3,405
Readme
Utilities for working with LayerZero EVM contracts.
Installation
yarn add @layerzerolabs/devtools-evm
pnpm add @layerzerolabs/devtools-evm
npm install @layerzerolabs/devtools-evm
Address utilities
ignoreZero(address: Address | null | undefined)
Turns EVM zero addresses to undefined
import { ignoreZero } from "@layerzerolabs/devtools-evm";
ignoreZero("0xEe6cF2E1Bc7645F8439d241ce37820305F2BB3F8"); // Returns '0xEe6cF2E1Bc7645F8439d241ce37820305F2BB3F8'
ignoreZero("0x0000000000000000000000000000000000000000"); // Returns undefined
ignoreZero(undefined); // Returns undefined
ignoreZero(null); // Returns undefined
makeZeroAddress(address)
Turns null
and undefined
into EVM zero address
import { makeZeroAddress } from "@layerzerolabs/devtools-evm";
makeZeroAddress("0xEe6cF2E1Bc7645F8439d241ce37820305F2BB3F8"); // Returns '0xEe6cF2E1Bc7645F8439d241ce37820305F2BB3F8'
makeZeroAddress("0x0000000000000000000000000000000000000000"); // Returns '0x0000000000000000000000000000000000000000'
makeZeroAddress(undefined); // Returns '0x0000000000000000000000000000000000000000'
makeZeroAddress(null); // Returns '0x0000000000000000000000000000000000000000'