Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
feat: update testnetPaymaster and Crown token addresses (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters authored Dec 6, 2023
1 parent 10bea94 commit 3264eaf
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/api/go/accounts.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ AllowanceL1(opts *CallOpts, token common.Address, bridgeAddress common.Address)
```go
ZkSyncEraProvider := "https://testnet.era.zksync.dev"
// The Crown token on testnet
TokenAddress := common.HexToAddress("0x09B0196641D91eDEC4042e4bb8C605bb35a02546")
TokenAddress := common.HexToAddress("0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B")

client, err := clients.Dial(ZkSyncEraProvider)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ head:
# Deploy paymaster

Deploy the paymaster account, which will receive the token deployed in the [previous](deploy-token.md) step and pay the fee in ETH for the account that
sends the token. The token address on testnet that is deployed in previous step is `0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B`
sends the token. The token address on testnet that is deployed in previous step is `0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150`

## Deploy paymaster with CREATE opcode

Expand All @@ -19,7 +19,7 @@ const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider);

const tokenAddress = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B";
const tokenAddress = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150";

async function main() {
const conf = require("../../solidity/custom_paymaster/paymaster/build/Paymaster.json");
Expand Down Expand Up @@ -48,7 +48,7 @@ const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider);

const tokenAddress = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B";
const tokenAddress = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150";

async function main() {
const conf = require("../../solidity/custom_paymaster/paymaster/build/Paymaster.json");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ This example demonstrates how to use a paymaster to facilitate fee payment with
The user initiates a mint transaction that is configured to be paid with an ERC20 token through the paymaster.
During transaction execution, the paymaster receives the ERC20 token from the user and covers the transaction fee using ETH.

The token address used in this example is already deployed at: `0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B`.
The paymaster address used in this example is already deployed at: `0xd660c2F92d3d0634e5A20f26821C43F1b09298fe`.
The token address used in this example is already deployed at: `0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150`.
The paymaster address used in this example is already deployed at: `0x3cb2b87d10ac01736a65688f3e0fb1b070b3eea3`.

```ts
import { Provider, types, utils, Wallet } from "zksync2-js";
Expand All @@ -23,8 +23,8 @@ const ethProvider = ethers.getDefaultProvider("sepolia");
const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider, ethProvider);

const tokenAddress = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B"; // Crown token which can be minted for free
const paymasterAddress = "0xd660c2F92d3d0634e5A20f26821C43F1b09298fe"; // Paymaster for Crown token
const tokenAddress = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150"; // Crown token which can be minted for free
const paymasterAddress = "0x3cb2b87d10ac01736a65688f3e0fb1b070b3eea3"; // Paymaster for Crown token
const token = new ethers.Interface(require("../../solidity/custom_paymaster/token/build/Token.json").abi);

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion docs/api/js/zksync2-js/examples/transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider, ethProvider);

async function main() {
const token = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B";
const token = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150";
const receiver = "0x81E9D85b65E9CC8618D85A1110e4b1DF63fA30d9";

console.log(`Account1 balance before transfer: ${await wallet.getBalance()}`);
Expand Down
2 changes: 1 addition & 1 deletion docs/api/js/zksync2-js/examples/withdraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const PRIVATE_KEY = process.env.PRIVATE_KEY;
const wallet = new Wallet(PRIVATE_KEY, provider, ethProvider);

async function main() {
const token = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B";
const token = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150";

console.log(`L2 balance before withdrawal: ${await wallet.getBalance()}`);
console.log(`L1 balance before withdrawal: ${await wallet.getBalanceL1()}`);
Expand Down
10 changes: 5 additions & 5 deletions docs/api/js/zksync2-js/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ import { Provider, types } from "zksync2-js";
const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const gasTokenApprove = await provider.estimateGas({
from: "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
to: "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B",
to: "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150",
data: utils.IERC20.encodeFunctionData("approve", [RECEIVER, 1]),
});
console.log(`Gas for token approval tx: ${gasTokenApprove}`);
Expand All @@ -147,8 +147,8 @@ console.log(`Gas for token approval tx: ${gasTokenApprove}`);
import { Provider, types } from "zksync2-js";

const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const tokenAddress = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B"; // Crown token which can be minted for free
const paymasterAddress = "0xd660c2F92d3d0634e5A20f26821C43F1b09298fe"; // Paymaster for Crown token
const tokenAddress = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150"; // Crown token which can be minted for free
const paymasterAddress = "0x3cb2b87d10ac01736a65688f3e0fb1b070b3eea3"; // Paymaster for Crown token

const paymasterParams = utils.getPaymasterParams(paymasterAddress, {
type: "ApprovalBased",
Expand Down Expand Up @@ -382,7 +382,7 @@ import { Provider, types } from "zksync2-js";

const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const account = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049";
const tokenAddress = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B"; // Crown token which can be minted for free
const tokenAddress = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150"; // Crown token which can be minted for free
console.log(`ETH balance: ${await provider.getBalance(account)}`);
console.log(`Token balance: ${await provider.getBalance(account, "latest", tokenAddres)}`);
```
Expand Down Expand Up @@ -522,7 +522,7 @@ Helper function: [toJSON](#tojson).
import { Provider, types } from "zksync2-js";

const provider = Provider.getDefaultProvider(types.Network.Sepolia);
const tokenAddress = "0xCd9BDa1d0FC539043D4C80103bdF4f9cb108931B"; // Crown token which can be minted for free
const tokenAddress = "0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150"; // Crown token which can be minted for free
console.log(`Contract account info: ${toJSON(await provider.getContractAccountInfo(tokenAddress))}`);
```

Expand Down
10 changes: 5 additions & 5 deletions docs/api/python/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ if __name__ == "__main__":
account1: LocalAccount = Account.from_key(PRIVATE_KEY)
account2_address = zk_web3.to_checksum_address("0x81E9D85b65E9CC8618D85A1110e4b1DF63fA30d9")

token_address = zk_web3.to_checksum_address("0x09B0196641D91eDEC4042e4bb8C605bb35a02546")
token_address = zk_web3.to_checksum_address("0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150")
token_contract = zk_web3.zksync.contract(token_address, abi=get_erc20_abi())

# Show balance before token transfer
Expand Down Expand Up @@ -1505,7 +1505,7 @@ if __name__ == "__main__":
contract_path = Path("solidity/custom-paymaster/build/Paymaster.json")

# Crown token than can be minted for free
token_address = zk_web3.to_checksum_address("0x09B0196641D91eDEC4042e4bb8C605bb35a02546")
token_address = zk_web3.to_checksum_address("0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150")
constructor_arguments = {"_erc20": token_address}

# Perform contract deployment
Expand Down Expand Up @@ -1653,7 +1653,7 @@ if __name__ == "__main__":
contract_path = Path("solidity/custom-paymaster/build/Paymaster.json")

# Crown token than can be minted for free
token_address = zk_web3.to_checksum_address("0x09B0196641D91eDEC4042e4bb8C605bb35a02546")
token_address = zk_web3.to_checksum_address("0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150")
constructor_arguments = {"_erc20": token_address}

# Perform contract deployment
Expand Down Expand Up @@ -1707,9 +1707,9 @@ if __name__ == "__main__":
account: LocalAccount = Account.from_key(PRIVATE_KEY)

# Crown token than can be minted for free
token_address = zk_web3.to_checksum_address("0x09B0196641D91eDEC4042e4bb8C605bb35a02546")
token_address = zk_web3.to_checksum_address("0x765F5AF819D818a8e8ee6ff63D8d0e8056DBE150")
# Paymaster for Crown token
paymaster_address = zk_web3.to_checksum_address("0xd660c2F92d3d0634e5A20f26821C43F1b09298fe")
paymaster_address = zk_web3.to_checksum_address("0x3cb2b87d10ac01736a65688f3e0fb1b070b3eea3")

# Provide a compiled JSON source contract
token_path = Path("solidity/custom-paymaster/build/Token.json")
Expand Down

0 comments on commit 3264eaf

Please sign in to comment.