Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@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.
The npm package @railgun-community/cookbook receives a total of 37 weekly downloads. As such, @railgun-community/cookbook popularity was classified as not popular.
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.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.