Skip to content

Commit

Permalink
fix: use latest zksync-contracts version
Browse files Browse the repository at this point in the history
  • Loading branch information
Romsters committed Sep 12, 2024
1 parent a832ee0 commit df16c33
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions content/tutorials/cross-chain-governance/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Select the option **Create a Typescript project** and accept the defaults for ev

::callout{icon="i-heroicons-exclamation-circle"}
To interact with the ZKsync bridge contract using Solidity, you need
the ZKsync contract interface. There are two ways to get it:
the IZkSyncHyperchain interface. There are two ways to get it:

- Import it from the `@matterlabs/zksync-contracts` npm package (preferred).
- Download it from the [contracts repo](https://github.com/matter-labs/era-contracts).
Expand Down Expand Up @@ -104,7 +104,7 @@ The `callZkSync` function calls a transaction on L2 which can only be called by
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.13;
import "@matterlabs/zksync-contracts/l1/contracts/zksync/interfaces/IZkSync.sol";
import "@matterlabs/zksync-contracts/contracts/l1-contracts/state-transition/chain-interfaces/IZkSyncHyperchain.sol";
contract Governance {
address public governor;
Expand All @@ -122,7 +122,7 @@ contract Governance {
) external payable {
require(msg.sender == governor, "Only governor is allowed");
IZkSync zksync = IZkSync(zkSyncAddress);
IZkSyncHyperchain zksync = IZkSyncHyperchain(zkSyncAddress);
zksync.requestL2Transaction{value: msg.value}(contractAddr, 0,
data, gasLimit, gasPerPubdataByteLimit, new bytes[](0), msg.sender);
}
Expand Down
12 changes: 6 additions & 6 deletions content/tutorials/daily-spend-limit-account/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -540,15 +540,15 @@ with the owner of the account.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IAccount.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IAccount.sol"
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/TransactionHelper.sol";
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
// Used for signature validation
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// Access ZKsync system contracts for nonce validation via NONCE_HOLDER_SYSTEM_CONTRACT
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
// to call non-view function of system contracts
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/SystemContractsCaller.sol";
import "./SpendLimit.sol";
contract Account is IAccount, IERC1271, SpendLimit {
Expand Down Expand Up @@ -807,8 +807,8 @@ The `AAFactory.sol` contract is responsible for deploying instances of the `Acco
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/SystemContractsCaller.sol";
contract AAFactory {
bytes32 public aaBytecodeHash;
Expand Down
8 changes: 4 additions & 4 deletions content/tutorials/dapp-nft-paymaster/20.smart-contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
import {IPaymaster, ExecutionResult, PAYMASTER_VALIDATION_SUCCESS_MAGIC} from "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymaster.sol";
import {IPaymasterFlow} from "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymasterFlow.sol";
import {TransactionHelper, Transaction} from "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";
import {IPaymaster, ExecutionResult, PAYMASTER_VALIDATION_SUCCESS_MAGIC} from "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IPaymaster.sol";
import {IPaymasterFlow} from "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IPaymasterFlow.sol";
import {TransactionHelper, Transaction} from "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/TransactionHelper.sol";
/// @author Matter Labs
/// @notice This smart contract pays the gas fees on behalf of users that are the owner of a specific NFT asset
Expand Down
16 changes: 8 additions & 8 deletions content/tutorials/erc20-paymaster/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IPaymaster, ExecutionResult, PAYMASTER_VALIDATION_SUCCESS_MAGIC} from "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymaster.sol";
import {IPaymasterFlow} from "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymasterFlow.sol";
import {TransactionHelper, Transaction} from "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";
import {IPaymaster, ExecutionResult, PAYMASTER_VALIDATION_SUCCESS_MAGIC} from "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IPaymaster.sol";
import {IPaymasterFlow} from "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IPaymasterFlow.sol";
import {TransactionHelper, Transaction} from "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/TransactionHelper.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
contract MyPaymaster is IPaymaster {
uint256 constant PRICE_FOR_PAYING_FEES = 1;
Expand Down Expand Up @@ -236,11 +236,11 @@ pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IPaymaster, ExecutionResult, PAYMASTER_VALIDATION_SUCCESS_MAGIC} from "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymaster.sol";
import {IPaymasterFlow} from "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IPaymasterFlow.sol";
import {TransactionHelper, Transaction} from "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";
import {IPaymaster, ExecutionResult, PAYMASTER_VALIDATION_SUCCESS_MAGIC} from "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IPaymaster.sol";
import {IPaymasterFlow} from "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IPaymasterFlow.sol";
import {TransactionHelper, Transaction} from "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/TransactionHelper.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
contract MyPaymaster is IPaymaster {
uint256 constant PRICE_FOR_PAYING_FEES = 1;
Expand Down
20 changes: 10 additions & 10 deletions content/tutorials/native-aa-multisig/10.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ Use it to perform next steps, or you can skip and use completed code from the [F
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IAccount.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IAccount.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/TransactionHelper.sol";
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
Expand Down Expand Up @@ -379,7 +379,7 @@ To call the `NONCE_HOLDER_SYSTEM_CONTRACT`, we add the following import:
```solidity
// Access ZKsync system contracts for nonce validation via NONCE_HOLDER_SYSTEM_CONTRACT
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
```
::callout{icon="i-heroicons-exclamation-circle"}
Expand All @@ -391,7 +391,7 @@ function of the `SystemContractsCaller` library.
Import this library also:
`solidity
// to call non-view function of system contracts
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/SystemContractsCaller.sol";
`
::
Expand Down Expand Up @@ -542,18 +542,18 @@ Therefore, it is highly recommended to put `require(success)` for the transactio
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@matterlabs/zksync-contracts/l2/system-contracts/interfaces/IAccount.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/TransactionHelper.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/interfaces/IAccount.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/TransactionHelper.sol";
import "@openzeppelin/contracts/interfaces/IERC1271.sol";
// Used for signature validation
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
// Access ZKsync system contracts for nonce validation via NONCE_HOLDER_SYSTEM_CONTRACT
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
// to call non-view function of system contracts
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/SystemContractsCaller.sol";
contract TwoUserMultisig is IAccount, IERC1271 {
// to get transaction hash
Expand Down Expand Up @@ -813,8 +813,8 @@ contract TwoUserMultisig is IAccount, IERC1271 {
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@matterlabs/zksync-contracts/l2/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/l2/system-contracts/libraries/SystemContractsCaller.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/Constants.sol";
import "@matterlabs/zksync-contracts/contracts/system-contracts/libraries/SystemContractsCaller.sol";
contract AAFactory {
bytes32 public aaBytecodeHash;
Expand Down

0 comments on commit df16c33

Please sign in to comment.