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.
lopt
is a utility package that can generate mock Solidity contracts in the form of fakes
and mocks
.
lopt
is based in @eth-optimism/smock, sinon and sinon-chai.
Some benefits of using lopt
:
sinon-chai
expect
and should
syntaxtypechain
(highly recommended)fakes
mock
and start asserting calls or changing behaviourDocumentation is available here.
You can easily install lopt
via npm:
npm install --save-dev @defi-wonderland/lopt
Or via yarn:
yarn add --dev @defi-wonderland/lopt
...
import { FakeContract, lopt } from '@defi-wonderland/lopt';
chai.should(); // if you like should syntax
chai.use(lopt.matchers);
describe('MyContract', () => {
let myContractFake: FakeContract<MyContract>;
beforeEach(async () => {
...
myContractFake = await lopt.fake<MyContract>('MyContract');
});
it('some test', () => {
...
myContractFake.bark.atCall(0).should.be.calledWith('Hello World');
});
});
lopt
?Loki's alternative name is Lopt, and Loki was obviously taken.
Loki is the God of Mischief, a trickster, and the purpose of mocking libraries is basically to trick the tests.
FAQs
Mocking framework for Solidity contracts
The npm package lopt-test receives a total of 1 weekly downloads. As such, lopt-test popularity was classified as not popular.
We found that lopt-test demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.