
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.
@railgun-community/cookbook
Advanced tools
Write a recipe in minutes to convert your dApp to a zkApp.
yarn add @railgun-community/cookbook
// Set up initial parameters.
const sellToken = {tokenAddress: 'DAI'};
const buyToken = {tokenAddress: 'WETH'};
const slippagePercentage = 0.01;
// Use RAILGUN Cookbook to generate auto-validated multi-call transactions from a recipe.
const swap = new ZeroXSwapRecipe(sellToken, buyToken, slippagePercentage);
// Pass inputs that will be unshielded from private balance.
const amount = BigNumber.from(10).pow(18).mul(3000); // 3000 DAI
const unshieldERC20Amounts = [{ tokenAddress: 'DAI', amount }];
const recipeInput = {networkName, unshieldERC20Amounts};
const {populatedTransactions, shieldERC20Addresses} = await swap.getRecipeOutput(recipeInput);
// Use RAILGUN Quickstart to generate a private [unshield -> call -> re-shield] enclosing the recipe.
const crossContractCallsSerialized = populatedTransactions.map(
serializeUnsignedTransaction,
)
const {gasEstimateString} = await gasEstimateForUnprovenCrossContractCalls(
...
crossContractCallsSerialized,
...
)
const {error} = await generateCrossContractCallsProof(
...
crossContractCallsSerialized,
...
)
const {serializedTransaction} = await populateProvedCrossContractCalls(
...
crossContractCallsSerialized,
...
);
// Submit transaction to RPC.
// Note: use @railgun-community/waku-relayer-client to submit through Relayer.
const transaction = deserializeTransaction(serializedTransaction);
await wallet.sendTransaction(transaction);
TODO
yarn test
to run tests without Ganache Fork.
yarn test-fork
to run all tests, including Ganache Fork tests.
These tests are currently in beta - there are a number of minor issues with test setup scripts. Note that the Ganache fork and setup scripts take about 40 sec to complete.
If you see one of the following error messages during the setup scripts, please run the test suite again:
FAQs
Write a Recipe in minutes to convert your dApp to a zkApp.
We found that @railgun-community/cookbook 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
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.