Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@latticexyz/gas-report
Advanced tools
Measure and report gas usage within forge tests
Add some reports to your forge tests
import { Test } from "forge-std/Test.sol";
import { GasReporter } from "@latticexyz/gas-report/src/GasReporter.sol";
contract ExampleTest is Test, GasReporter {
function testGas() public {
startGasReport("description of behavior to measure gas for");
// do something here
endGasReport();
}
}
Then use the cli command to run tests and save the report:
pnpm gas-report --save gas-report.json
Or, if you have your own test command, you can pipe the output to gas-report --stdin
:
GAS_REPORTER_ENABLED=true forge test -vvv --isolate | pnpm gas-report --stdin
Run pnpm gas-report --help
for more details.
Version 2.2.14
Release date: Thu Oct 24 2024
fix(cli): support public library methods in modules (#3308) (@latticexyz/cli)
Added support for deploying public libraries used within modules.
fix(cli): support public library methods in modules (#3308) (@latticexyz/world-module-erc20, @latticexyz/world-modules)
Changed ERC20 and ERC721 related modules to use public library methods instead of manual delegatecall
s.
feat(stash): add useStash and improve other helpers (#3320) (@latticexyz/stash)
Added useStash
React hook. It's heavily inspired by Zustand's useStore
and accepts a stash, a state selector, an an optional equality function to avoid unnecessary re-render cycles when returning unstable values.
Also updated getRecord
and getRecords
to each take either a stash
or state
object for more ergonomic use with useStash
.
import { useStash } from "@latticexyz/stash/react";
import { getRecord } from "@latticexyz/stash";
import config from "../mud.config";
const tables = config.namespaces.app.tables;
export function PlayerName({ playerId }) {
const record = useStash(stash, (state) => getRecord({ state, table: tables.Player, key: { playerId } }));
...
}
import isEqual from "fast-deep-equal";
import { useStash } from "@latticexyz/stash/react";
import { getRecords } from "@latticexyz/stash";
import config from "../mud.config";
export function PlayerNames() {
const record = useStash(stash, (state) => getRecords({ state, table: tables.Player }), { isEqual });
...
}
FAQs
Gas reporter for specific lines within forge tests
The npm package @latticexyz/gas-report receives a total of 392 weekly downloads. As such, @latticexyz/gas-report popularity was classified as not popular.
We found that @latticexyz/gas-report demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.