Skip to content

Commit

Permalink
fix(js): bump version to v6.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
danijelTxFusion committed Feb 29, 2024
1 parent c0a9066 commit a958d63
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.idea
.idea
.vscode
7 changes: 5 additions & 2 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
"mocha": "^10.2.0",
"prettier": "3.0.3",
"ts-node": "^10.9.1",
"typescript": "^5.1.6",
"zksync-ethers": "6.3.0"
"typescript": "^5.1.6"
},
"dependencies": {
"zksync-ethers": "^6.4.0"
},

"peerDependencies": {
"ethers": "^6.7.1"
},
Expand Down
22 changes: 20 additions & 2 deletions js/src/12_deploy_create.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { Provider, types, Wallet, ContractFactory, Contract } from "zksync-ethers";
import { ethers, Typed } from "ethers";
import {Provider, types, Wallet, ContractFactory, Contract, utils} from "zksync-ethers";
import { Typed } from "ethers";

const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider);

const tokenAddress = "0x927488F48ffbc32112F1fF721759649A89721F8F"; // Crown token which can be minted for free
const paymasterAddress = "0x13D0D8550769f59aa241a41897D4859c87f7Dd46"; // Paymaster for Crown token


async function main() {
const conf = require("../../solidity/storage/build/combined.json");
const abi = conf.contracts["Storage.sol:Storage"].abi;
Expand All @@ -20,6 +24,20 @@ async function main() {
await tx.wait();

console.log(`Value: ${await storage.get()}`);

const paymasterTx = await storage.set(Typed.uint256(500), {
customData: {
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
paymasterParams: utils.getPaymasterParams(paymasterAddress, {
type: "ApprovalBased",
token: tokenAddress,
minimalAllowance: 1,
innerInput: new Uint8Array(),
}),
}
})
await paymasterTx.wait();
console.log(`Value: ${await storage.get()}`);
}

main()
Expand Down
19 changes: 18 additions & 1 deletion js/src/15_deploy_create2.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Provider, types, Wallet, ContractFactory, Contract } from "zksync-ethers";
import { Provider, types, Wallet, ContractFactory, Contract, utils } from "zksync-ethers";
import { ethers, Typed } from "ethers";

const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider);

const tokenAddress = "0x927488F48ffbc32112F1fF721759649A89721F8F"; // Crown token which can be minted for free
const paymasterAddress = "0x13D0D8550769f59aa241a41897D4859c87f7Dd46"; // Paymaster for Crown token

async function main() {
const conf = require("../../solidity/storage/build/combined.json");
const abi = conf.contracts["Storage.sol:Storage"].abi;
Expand All @@ -22,6 +25,20 @@ async function main() {
await tx.wait();

console.log(`Value: ${await storage.get()}`);

const paymasterTx = await storage.set(Typed.uint256(500), {
customData: {
gasPerPubdata: utils.DEFAULT_GAS_PER_PUBDATA_LIMIT,
paymasterParams: utils.getPaymasterParams(paymasterAddress, {
type: "ApprovalBased",
token: tokenAddress,
minimalAllowance: 1,
innerInput: new Uint8Array(),
}),
}
})
await paymasterTx.wait();
console.log(`Value: ${await storage.get()}`);
}

main()
Expand Down
8 changes: 4 additions & 4 deletions js/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

zksync-ethers@6.3.0:
version "6.3.0"
resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-6.3.0.tgz#604c57250974ccad121510a2c84c1dd8b990722f"
integrity sha512-ApQIJSFevxFNVQTO1MxkmXxmx9N0qZHNvMzjFvu5v40QPFGkpUt09pY/WHy3b5BlsXzybQ3q2YnHaz/c/TgilA==
zksync-ethers@^6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/zksync-ethers/-/zksync-ethers-6.4.0.tgz#2abb1000e15524dff4d7dbc3757bd470f8c611e2"
integrity sha512-/0JSJ9w71kGqkcnAg2eY3xD+WX4o9Pf5OwrM1cHvmy1QEzyHWAHBfhTLMJcTMoW0S9bkrF5YHACY/3LAZrkcig==

0 comments on commit a958d63

Please sign in to comment.