Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@defi-wonderland/foundry-mock-generator
Advanced tools
A mock contract generator for Foundry
Foundry Mock Generator is the solidity mocking library. It's a plugin for foundry that can be used to create mock Solidity contracts able to mock variables and external calls.
You can install the tool via yarn:
yarn add foundry-mock-generator@<latest-canary>
To generate the mock contracts all you have to do is run:
yarn foundry-mock-generator --contracts <path/to/contracts> --out <path/to/foundry/out> --genDir <path/to/generate/contracts>
Note: --contracts required by the user, tha path to the solidity contracts to mock
Note: --genDir default path is solidity/test/mock-contracts
, the path to generate the mock contracts
Note: --out default path is out
, the path that has foundry's compiled artifacts
import { MockMyContractName } from '/path/to/mock-contracts/MockMyContractName.sol'
/// Deploy mock contract
mock_myContract = new MockMyContractname(...);
/// Allow mocks for the contract
vm.allowCheatcodes(address(mock_myContract));
/// Mock myFuncName function, when called with `arg1`, `arg2` to return `return1`
mock_myContract.mock_call_myFuncName(arg1, arg2, return1);
/// Mock myVarName variable, to return `return1`
mock_myContract.mock_call_myVarName(return1);
private
)/// Change value of a variable
mock_myContract.set_myVarName(value);
internal
functions, you must make them virtual
. The tool will not generate mocks for internal functions that are not virtual.We use changesets to mark packages for new releases. When merging commits to the dev branch you MUST include a changeset file if your change would require that a new version of a package be released.
To add a changeset, run the command yarn changeset
in the root of this repo. You will be presented with a small prompt to select the packages to be released, the scope of the release (major, minor, or patch), and the reason for the release. Comments within changeset files will be automatically included in the changelog of the package.
Maintained with love by Wonderland. Made possible by viewers like you.
FAQs
A mock contract generator for Foundry
The npm package @defi-wonderland/foundry-mock-generator receives a total of 0 weekly downloads. As such, @defi-wonderland/foundry-mock-generator popularity was classified as not popular.
We found that @defi-wonderland/foundry-mock-generator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.