Skip to content

Commit

Permalink
test: fix before ether upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
pcheremu committed Jul 15, 2024
1 parent 3c4c5fc commit 6ad6b15
Show file tree
Hide file tree
Showing 8 changed files with 515 additions and 32 deletions.
14 changes: 9 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"supertest": "^6.3.3",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"zksync-web3": "^0.14.3"
"zksync-web3": "^0.17.1"
},
"dependencies": {
"ts-jest-resolver": "^2.0.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/integration-tests/src/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ export enum TransactionsStatus {
}

export enum Wallets {
mainWalletAddress = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", // "0x586607935E1462ab762F438E0A7b2968A4158975",
secondWalletAddress = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049", // "0x26A4c5Dfe2cA3c9E7E8C417B689F41b6b5745C37",
mainWalletAddress = "0x586607935E1462ab762F438E0A7b2968A4158975",
secondWalletAddress = "0x26A4c5Dfe2cA3c9E7E8C417B689F41b6b5745C37",
richWalletAddress = "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049",
mainWalletPrivateKey = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110", // "0x06ac1584dd1cf69f97a784b2b7812cd0c65a867ec997add028cdf56483c1c299",
secondWalletPrivateKey = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110", //"e14e6e0b3b610411cf15c3a5aa3252cac9e0a40a9bbe67ceb3b5d506f56576fd",
mainWalletPrivateKey = "0x06ac1584dd1cf69f97a784b2b7812cd0c65a867ec997add028cdf56483c1c299",
secondWalletPrivateKey = "e14e6e0b3b610411cf15c3a5aa3252cac9e0a40a9bbe67ceb3b5d506f56576fd",
richWalletPrivateKey = "0x7726827caac94a7f9e1b160f7ea819f172f7b6f9d2a97f992c38edeab82d4110",
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// File @openzeppelin/contracts/token/ERC20/[email protected]

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/Address.sol";

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.16;


contract TokenF2L2 {
// Declare the using directive on the contract scope
using SafeERC20 for IERC20;
using Address for address payable;

//Be able to receive any funds to the contract
receive() external payable {
pay();
}

function pay() public payable {
emit Paid(msg.sender, msg.value, block.timestamp);
}

function getBalance() public view returns (uint) {
return address(this).balance;
}

address public owner;

constructor(address _owner) {
owner = _owner;
}

event Paid(address indexed _from, uint _amount, uint _timestamp);

modifier onlyOwner() {
require(owner == msg.sender, "You are not the owner");
_; // continue
}

function multiTransfer(
address[] memory _recivers,
address[] memory _tokenAddresses,
uint256[] memory _tokenAmounts
) public payable onlyOwner {
// Check that the length of the tokenAddresses array is equal to the length of the tokenAmounts array
require(_tokenAddresses.length == _tokenAmounts.length, "Arrays must have the same length");
require(_tokenAddresses.length == _recivers.length, "Arrays must have the same length");

// Iterate over the arrays and transfer the specified amount of each token
for (uint i = 0; i < _tokenAddresses.length; i++) {
if (_tokenAddresses[i] == address(0)) {
payable(_recivers[i]).sendValue(_tokenAmounts[i]);
} else {
// Cast the token address to an IERC20 contract to access its safeTransfer function
IERC20 token = IERC20(_tokenAddresses[i]);

// Attempt to transfer the specified amount of the token
token.safeTransfer(_recivers[i], _tokenAmounts[i]);
}
}
}
}
Loading

0 comments on commit 6ad6b15

Please sign in to comment.