
Research
TeamPCP Compromises Telnyx Python SDK to Deliver Credential-Stealing Malware
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.
@openzeppelin/test-helpers
Advanced tools
JavaScript testing helpers for Ethereum smart contract development.
Assertion library for Ethereum smart contract testing. Make sure your contracts behave as expected.
Test Helpers integrates seamlessly with OpenZeppelin Test Environment, but it also supports Truffle tests and regular web3 workflows.
npm install --save-dev @openzeppelin/test-helpers
Install web3 and the hardhat-web3 plugin.
npm install --save-dev @nomiclabs/hardhat-web3 web3
Remember to include the plugin in your configuration as explained in the installation instructions.
Import @openzeppelin/test-helpers in your test files to access the different assertions and utilities.
Note: The following snippet uses OpenZeppelin Test Environment: a Truffle-based setup would work the same way.
const { accounts, contract } = require('@openzeppelin/test-environment');
const {
BN, // Big Number support
constants, // Common constants, like the zero address and largest integers
expectEvent, // Assertions for emitted events
expectRevert, // Assertions for transactions that should fail
} = require('@openzeppelin/test-helpers');
const ERC20 = contract.fromArtifacts('ERC20');
describe('ERC20', function () {
const [sender, receiver] = accounts;
beforeEach(async function () {
// The bundled BN library is the same one web3 uses under the hood
this.value = new BN(1);
this.erc20 = await ERC20.new();
});
it('reverts when transferring tokens to the zero address', async function () {
// Conditions that trigger a require statement can be precisely tested
await expectRevert(
this.erc20.transfer(constants.ZERO_ADDRESS, this.value, { from: sender }),
'ERC20: transfer to the zero address',
);
});
it('emits a Transfer event on successful transfers', async function () {
const receipt = await this.erc20.transfer(
receiver, this.value, { from: sender }
);
// Event assertions can verify that the arguments are the expected ones
expectEvent(receipt, 'Transfer', {
from: sender,
to: receiver,
value: this.value,
});
});
it('updates balances on successful transfers', async function () {
this.erc20.transfer(receiver, this.value, { from: sender });
// BN assertions are automatically available via chai-bn (if using Chai)
expect(await this.erc20.balanceOf(receiver))
.to.be.bignumber.equal(this.value);
});
});
FAQs
JavaScript testing helpers for Ethereum smart contract development.
The npm package @openzeppelin/test-helpers receives a total of 10,032 weekly downloads. As such, @openzeppelin/test-helpers popularity was classified as popular.
We found that @openzeppelin/test-helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.

Security News
/Research
Widespread GitHub phishing campaign uses fake Visual Studio Code security alerts in Discussions to trick developers into visiting malicious website.