Skip to content

Commit

Permalink
deps
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Sep 13, 2024
1 parent 696aba9 commit a12b88b
Show file tree
Hide file tree
Showing 24 changed files with 518 additions and 699 deletions.
2 changes: 1 addition & 1 deletion contracts/EthZetaMock.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.7;
pragma solidity 0.8.26;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
Expand Down
28 changes: 15 additions & 13 deletions contracts/shared/libraries/SafeMath.sol
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;

import "@openzeppelin/contracts/utils/math/SafeMath.sol";

library Math {
using SafeMath for uint256;

error AdditionsOverflow();
error SubtractionsUnderflow();
error MultiplicationsOverflow();

function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
bool success;
(success, z) = x.tryAdd(y);
if (!success) revert AdditionsOverflow();
unchecked {
z = x + y;
if (z < x) revert AdditionsOverflow();
}
}

function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
bool success;
(success, z) = x.trySub(y);
if (!success) revert SubtractionsUnderflow();
unchecked {
if (y > x) revert SubtractionsUnderflow();
z = x - y;
}
}

function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
bool success;
(success, z) = x.tryMul(y);
if (!success) revert MultiplicationsOverflow();
unchecked {
if (x == 0 || (z = x * y) / x == y) {
return z;
} else {
revert MultiplicationsOverflow();
}
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"@inquirer/prompts": "^2.1.1",
"@inquirer/select": "1.1.3",
"@nomiclabs/hardhat-ethers": "^2.2.3",
"@openzeppelin/contracts": "^4.9.6",
"@openzeppelin/contracts": "^5.0.2",
"@openzeppelin/contracts-upgradeable": "^5.0.2",
"@solana/web3.js": "^1.95.3",
"@uniswap/v2-periphery": "^1.1.0-beta.0",
"@zetachain/faucet-cli": "^4.1.1",
Expand Down
2 changes: 2 additions & 0 deletions typechain-types/@openzeppelin/contracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import type * as interfaces from "./interfaces";
export type { interfaces };
import type * as token from "./token";
export type { token };
110 changes: 15 additions & 95 deletions typechain-types/@openzeppelin/contracts/token/ERC20/ERC20.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export interface ERC20Interface extends utils.Interface {
"approve(address,uint256)": FunctionFragment;
"balanceOf(address)": FunctionFragment;
"decimals()": FunctionFragment;
"decreaseAllowance(address,uint256)": FunctionFragment;
"increaseAllowance(address,uint256)": FunctionFragment;
"name()": FunctionFragment;
"symbol()": FunctionFragment;
"totalSupply()": FunctionFragment;
Expand All @@ -48,8 +46,6 @@ export interface ERC20Interface extends utils.Interface {
| "approve"
| "balanceOf"
| "decimals"
| "decreaseAllowance"
| "increaseAllowance"
| "name"
| "symbol"
| "totalSupply"
Expand All @@ -70,14 +66,6 @@ export interface ERC20Interface extends utils.Interface {
values: [PromiseOrValue<string>]
): string;
encodeFunctionData(functionFragment: "decimals", values?: undefined): string;
encodeFunctionData(
functionFragment: "decreaseAllowance",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(
functionFragment: "increaseAllowance",
values: [PromiseOrValue<string>, PromiseOrValue<BigNumberish>]
): string;
encodeFunctionData(functionFragment: "name", values?: undefined): string;
encodeFunctionData(functionFragment: "symbol", values?: undefined): string;
encodeFunctionData(
Expand All @@ -101,14 +89,6 @@ export interface ERC20Interface extends utils.Interface {
decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result;
decodeFunctionResult(
functionFragment: "decreaseAllowance",
data: BytesLike
): Result;
decodeFunctionResult(
functionFragment: "increaseAllowance",
data: BytesLike
): Result;
decodeFunctionResult(functionFragment: "name", data: BytesLike): Result;
decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result;
decodeFunctionResult(
Expand Down Expand Up @@ -189,7 +169,7 @@ export interface ERC20 extends BaseContract {

approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

Expand All @@ -200,18 +180,6 @@ export interface ERC20 extends BaseContract {

decimals(overrides?: CallOverrides): Promise<[number]>;

decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

name(overrides?: CallOverrides): Promise<[string]>;

symbol(overrides?: CallOverrides): Promise<[string]>;
Expand All @@ -220,14 +188,14 @@ export interface ERC20 extends BaseContract {

transfer(
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;
};
Expand All @@ -240,7 +208,7 @@ export interface ERC20 extends BaseContract {

approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

Expand All @@ -251,18 +219,6 @@ export interface ERC20 extends BaseContract {

decimals(overrides?: CallOverrides): Promise<number>;

decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

name(overrides?: CallOverrides): Promise<string>;

symbol(overrides?: CallOverrides): Promise<string>;
Expand All @@ -271,14 +227,14 @@ export interface ERC20 extends BaseContract {

transfer(
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<ContractTransaction>;

Expand All @@ -291,7 +247,7 @@ export interface ERC20 extends BaseContract {

approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;

Expand All @@ -302,18 +258,6 @@ export interface ERC20 extends BaseContract {

decimals(overrides?: CallOverrides): Promise<number>;

decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;

increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;

name(overrides?: CallOverrides): Promise<string>;

symbol(overrides?: CallOverrides): Promise<string>;
Expand All @@ -322,14 +266,14 @@ export interface ERC20 extends BaseContract {

transfer(
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;

transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: CallOverrides
): Promise<boolean>;
};
Expand Down Expand Up @@ -367,7 +311,7 @@ export interface ERC20 extends BaseContract {

approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

Expand All @@ -378,18 +322,6 @@ export interface ERC20 extends BaseContract {

decimals(overrides?: CallOverrides): Promise<BigNumber>;

decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

name(overrides?: CallOverrides): Promise<BigNumber>;

symbol(overrides?: CallOverrides): Promise<BigNumber>;
Expand All @@ -398,14 +330,14 @@ export interface ERC20 extends BaseContract {

transfer(
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;

transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<BigNumber>;
};
Expand All @@ -419,7 +351,7 @@ export interface ERC20 extends BaseContract {

approve(
spender: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

Expand All @@ -430,18 +362,6 @@ export interface ERC20 extends BaseContract {

decimals(overrides?: CallOverrides): Promise<PopulatedTransaction>;

decreaseAllowance(
spender: PromiseOrValue<string>,
subtractedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

increaseAllowance(
spender: PromiseOrValue<string>,
addedValue: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

name(overrides?: CallOverrides): Promise<PopulatedTransaction>;

symbol(overrides?: CallOverrides): Promise<PopulatedTransaction>;
Expand All @@ -450,14 +370,14 @@ export interface ERC20 extends BaseContract {

transfer(
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;

transferFrom(
from: PromiseOrValue<string>,
to: PromiseOrValue<string>,
amount: PromiseOrValue<BigNumberish>,
value: PromiseOrValue<BigNumberish>,
overrides?: Overrides & { from?: PromiseOrValue<string> }
): Promise<PopulatedTransaction>;
};
Expand Down
Loading

0 comments on commit a12b88b

Please sign in to comment.