
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@ganache/console.log
Advanced tools
A Solidity library and EVM hooks for using console.log from Solidity contracts
@ganache/console.log
A Solidity library and EVM hooks for using console.log
from Solidity
contracts.
@ganache/console.log
was designed to be used with the @ethereumjs/vm
npm
package.
Install @ganache/console.log
:
> npm install @ganache/console.log --save-exact
@ganache/console.log
has two parts, a console.sol
Solidity library file, and
a method to capture logs generated by the use of the console.sol
library.
console.sol
Solidity LibraryThe console.sol
library is available at @ganache/console.log/console.sol
.
There are various ways to make this file available to your contracts and
Solidity build pipelines, so this part is left up to the user.
Use it in Solidity just like any other library, e.g.,
// SPDX-License-Identifier: MIT
pragma solidity >= 0.4.22 <0.9.0;
import "console.sol";
contract MyContract {
constructor() {
console.log("got here");
}
}
console.log
parser (maybeGetLogs
):To use @ganache/console.log
directly within an instance of the
@ethereumjs/vm
VM:
import { ConsoleLogs, maybeGetLogs } from "@ganache/console.log";
// ... initialize vm ...
// vm should be an instance of @ethereumjs/vm
vm.evm.events.on("step", event => {
const logs: ConsoleLogs | null = maybeGetLogs(event); // (string | bigint | boolean)[] | null
// do something with `logs`
});
Note: Ganache CLI, as well as Ganache.server
and Ganache.provider
, already
implement the logger parser and will automatically log calls to console.sol
to
standard output just like JavaScript's console.log
.
FAQs
A Solidity library and EVM hooks for using console.log from Solidity contracts
The npm package @ganache/console.log receives a total of 1,140 weekly downloads. As such, @ganache/console.log popularity was classified as popular.
We found that @ganache/console.log demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.