@1inch/solidity-utils 6.9.5 → 6.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/contracts/interfaces/IRescuable.sol +18 -0
- package/contracts/mixins/Rescuable.sol +35 -0
- package/dist/typechain-types/contracts/interfaces/IRescuable.d.ts +35 -0
- package/dist/typechain-types/contracts/interfaces/IRescuable.js +3 -0
- package/dist/typechain-types/contracts/interfaces/IRescuable.js.map +1 -0
- package/dist/typechain-types/contracts/interfaces/index.d.ts +1 -0
- package/dist/typechain-types/contracts/mixins/Rescuable.d.ts +68 -0
- package/dist/typechain-types/contracts/mixins/Rescuable.js +3 -0
- package/dist/typechain-types/contracts/mixins/Rescuable.js.map +1 -0
- package/dist/typechain-types/contracts/mixins/index.d.ts +1 -0
- package/dist/typechain-types/contracts/tests/mocks/NoReceiveOwnerMock.d.ts +35 -0
- package/dist/typechain-types/contracts/tests/mocks/NoReceiveOwnerMock.js +3 -0
- package/dist/typechain-types/contracts/tests/mocks/NoReceiveOwnerMock.js.map +1 -0
- package/dist/typechain-types/contracts/tests/mocks/RescuableMock.d.ts +68 -0
- package/dist/typechain-types/contracts/tests/mocks/RescuableMock.js +3 -0
- package/dist/typechain-types/contracts/tests/mocks/RescuableMock.js.map +1 -0
- package/dist/typechain-types/contracts/tests/mocks/index.d.ts +2 -0
- package/dist/typechain-types/factories/contracts/interfaces/IRescuable__factory.d.ts +25 -0
- package/dist/typechain-types/factories/contracts/interfaces/IRescuable__factory.js +43 -0
- package/dist/typechain-types/factories/contracts/interfaces/IRescuable__factory.js.map +1 -0
- package/dist/typechain-types/factories/contracts/interfaces/index.d.ts +1 -0
- package/dist/typechain-types/factories/contracts/interfaces/index.js +3 -1
- package/dist/typechain-types/factories/contracts/interfaces/index.js.map +1 -1
- package/dist/typechain-types/factories/contracts/mixins/Rescuable__factory.d.ts +86 -0
- package/dist/typechain-types/factories/contracts/mixins/Rescuable__factory.js +122 -0
- package/dist/typechain-types/factories/contracts/mixins/Rescuable__factory.js.map +1 -0
- package/dist/typechain-types/factories/contracts/mixins/index.d.ts +1 -0
- package/dist/typechain-types/factories/contracts/mixins/index.js +3 -1
- package/dist/typechain-types/factories/contracts/mixins/index.js.map +1 -1
- package/dist/typechain-types/factories/contracts/tests/mocks/NoReceiveOwnerMock__factory.d.ts +44 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/NoReceiveOwnerMock__factory.js +69 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/NoReceiveOwnerMock__factory.js.map +1 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/RescuableMock__factory.d.ts +112 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/RescuableMock__factory.js +157 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/RescuableMock__factory.js.map +1 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/index.d.ts +2 -0
- package/dist/typechain-types/factories/contracts/tests/mocks/index.js +5 -1
- package/dist/typechain-types/factories/contracts/tests/mocks/index.js.map +1 -1
- package/dist/typechain-types/index.d.ts +8 -0
- package/dist/typechain-types/index.js +10 -2
- package/dist/typechain-types/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.30;
|
|
3
|
+
|
|
4
|
+
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title IRescuable
|
|
8
|
+
* @dev Interface for rescuing funds from the contract.
|
|
9
|
+
*/
|
|
10
|
+
interface IRescuable {
|
|
11
|
+
/// @dev Native ETH transfer failed during rescue
|
|
12
|
+
error ETHTransferFailed();
|
|
13
|
+
|
|
14
|
+
/// @dev Rescues funds from the contract.
|
|
15
|
+
/// @param token The token to rescue, use `IERC20(address(0))` for native ETH.
|
|
16
|
+
/// @param amount The amount to rescue.
|
|
17
|
+
function rescueFunds(IERC20 token, uint256 amount) external;
|
|
18
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.30;
|
|
3
|
+
|
|
4
|
+
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
|
|
5
|
+
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
6
|
+
import { SafeERC20 } from "../libraries/SafeERC20.sol";
|
|
7
|
+
import { IRescuable } from "../interfaces/IRescuable.sol";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @title Rescuable
|
|
11
|
+
* @dev Abstract contract for rescuing funds from the contract.
|
|
12
|
+
* Only the owner can rescue funds. Only native ETH and ERC20 tokens are supported.
|
|
13
|
+
* The token is transferred to the owner's address.
|
|
14
|
+
*/
|
|
15
|
+
abstract contract Rescuable is Ownable, IRescuable {
|
|
16
|
+
using SafeERC20 for IERC20;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @dev Sets the owner of the contract.
|
|
20
|
+
* @param owner Address of the owner.
|
|
21
|
+
*/
|
|
22
|
+
constructor(address owner) Ownable(owner) {}
|
|
23
|
+
|
|
24
|
+
/// @dev Rescues funds from the contract.
|
|
25
|
+
/// @param token The token to rescue, use `IERC20(address(0))` for native ETH.
|
|
26
|
+
/// @param amount The amount to rescue.
|
|
27
|
+
function rescueFunds(IERC20 token, uint256 amount) external virtual onlyOwner {
|
|
28
|
+
if(token == IERC20(address(0))) {
|
|
29
|
+
(bool success, ) = payable(owner()).call{ value: amount }("");
|
|
30
|
+
if (!success) revert ETHTransferFailed();
|
|
31
|
+
} else {
|
|
32
|
+
token.safeTransfer(owner(), amount);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedListener, TypedContractMethod } from "../../common";
|
|
3
|
+
export interface IRescuableInterface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: "rescueFunds"): FunctionFragment;
|
|
5
|
+
encodeFunctionData(functionFragment: "rescueFunds", values: [AddressLike, BigNumberish]): string;
|
|
6
|
+
decodeFunctionResult(functionFragment: "rescueFunds", data: BytesLike): Result;
|
|
7
|
+
}
|
|
8
|
+
export interface IRescuable extends BaseContract {
|
|
9
|
+
connect(runner?: ContractRunner | null): IRescuable;
|
|
10
|
+
waitForDeployment(): Promise<this>;
|
|
11
|
+
interface: IRescuableInterface;
|
|
12
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
13
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
14
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
15
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
16
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
17
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
18
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
19
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
20
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
21
|
+
rescueFunds: TypedContractMethod<[
|
|
22
|
+
token: AddressLike,
|
|
23
|
+
amount: BigNumberish
|
|
24
|
+
], [
|
|
25
|
+
void
|
|
26
|
+
], "nonpayable">;
|
|
27
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
28
|
+
getFunction(nameOrSignature: "rescueFunds"): TypedContractMethod<[
|
|
29
|
+
token: AddressLike,
|
|
30
|
+
amount: BigNumberish
|
|
31
|
+
], [
|
|
32
|
+
void
|
|
33
|
+
], "nonpayable">;
|
|
34
|
+
filters: {};
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRescuable.js","sourceRoot":"","sources":["../../../../typechain-types/contracts/interfaces/IRescuable.ts"],"names":[],"mappings":""}
|
|
@@ -3,4 +3,5 @@ export type { IDaiLikePermit } from "./IDaiLikePermit";
|
|
|
3
3
|
export type { IERC20MetadataUppercase } from "./IERC20MetadataUppercase";
|
|
4
4
|
export type { IERC7597Permit } from "./IERC7597Permit";
|
|
5
5
|
export type { IPermit2 } from "./IPermit2";
|
|
6
|
+
export type { IRescuable } from "./IRescuable";
|
|
6
7
|
export type { IWETH } from "./IWETH";
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "../../common";
|
|
3
|
+
export interface RescuableInterface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: "owner" | "renounceOwnership" | "rescueFunds" | "transferOwnership"): FunctionFragment;
|
|
5
|
+
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
|
|
6
|
+
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
|
7
|
+
encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string;
|
|
8
|
+
encodeFunctionData(functionFragment: "rescueFunds", values: [AddressLike, BigNumberish]): string;
|
|
9
|
+
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
|
|
10
|
+
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
|
11
|
+
decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result;
|
|
12
|
+
decodeFunctionResult(functionFragment: "rescueFunds", data: BytesLike): Result;
|
|
13
|
+
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace OwnershipTransferredEvent {
|
|
16
|
+
type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
|
|
17
|
+
type OutputTuple = [previousOwner: string, newOwner: string];
|
|
18
|
+
interface OutputObject {
|
|
19
|
+
previousOwner: string;
|
|
20
|
+
newOwner: string;
|
|
21
|
+
}
|
|
22
|
+
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
23
|
+
type Filter = TypedDeferredTopicFilter<Event>;
|
|
24
|
+
type Log = TypedEventLog<Event>;
|
|
25
|
+
type LogDescription = TypedLogDescription<Event>;
|
|
26
|
+
}
|
|
27
|
+
export interface Rescuable extends BaseContract {
|
|
28
|
+
connect(runner?: ContractRunner | null): Rescuable;
|
|
29
|
+
waitForDeployment(): Promise<this>;
|
|
30
|
+
interface: RescuableInterface;
|
|
31
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
32
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
33
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
34
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
35
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
36
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
37
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
38
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
39
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
40
|
+
owner: TypedContractMethod<[], [string], "view">;
|
|
41
|
+
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;
|
|
42
|
+
rescueFunds: TypedContractMethod<[
|
|
43
|
+
token: AddressLike,
|
|
44
|
+
amount: BigNumberish
|
|
45
|
+
], [
|
|
46
|
+
void
|
|
47
|
+
], "nonpayable">;
|
|
48
|
+
transferOwnership: TypedContractMethod<[
|
|
49
|
+
newOwner: AddressLike
|
|
50
|
+
], [
|
|
51
|
+
void
|
|
52
|
+
], "nonpayable">;
|
|
53
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
54
|
+
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
|
|
55
|
+
getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "nonpayable">;
|
|
56
|
+
getFunction(nameOrSignature: "rescueFunds"): TypedContractMethod<[
|
|
57
|
+
token: AddressLike,
|
|
58
|
+
amount: BigNumberish
|
|
59
|
+
], [
|
|
60
|
+
void
|
|
61
|
+
], "nonpayable">;
|
|
62
|
+
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;
|
|
63
|
+
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
|
|
64
|
+
filters: {
|
|
65
|
+
"OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
|
|
66
|
+
OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rescuable.js","sourceRoot":"","sources":["../../../../typechain-types/contracts/mixins/Rescuable.ts"],"names":[],"mappings":""}
|
|
@@ -4,5 +4,6 @@ export type { Multicall } from "./Multicall";
|
|
|
4
4
|
export type { OnlyWethReceiver } from "./OnlyWethReceiver";
|
|
5
5
|
export type { PermitAndCall } from "./PermitAndCall";
|
|
6
6
|
export type { ReentrancyGuard } from "./ReentrancyGuard";
|
|
7
|
+
export type { Rescuable } from "./Rescuable";
|
|
7
8
|
export type { SelfdestructEthSender } from "./SelfdestructEthSender";
|
|
8
9
|
export type { Simulator } from "./Simulator";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedListener, TypedContractMethod } from "../../../common";
|
|
3
|
+
export interface NoReceiveOwnerMockInterface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: "rescueFunds"): FunctionFragment;
|
|
5
|
+
encodeFunctionData(functionFragment: "rescueFunds", values: [AddressLike, BigNumberish]): string;
|
|
6
|
+
decodeFunctionResult(functionFragment: "rescueFunds", data: BytesLike): Result;
|
|
7
|
+
}
|
|
8
|
+
export interface NoReceiveOwnerMock extends BaseContract {
|
|
9
|
+
connect(runner?: ContractRunner | null): NoReceiveOwnerMock;
|
|
10
|
+
waitForDeployment(): Promise<this>;
|
|
11
|
+
interface: NoReceiveOwnerMockInterface;
|
|
12
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
13
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
14
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
15
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
16
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
17
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
18
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
19
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
20
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
21
|
+
rescueFunds: TypedContractMethod<[
|
|
22
|
+
token: AddressLike,
|
|
23
|
+
amount: BigNumberish
|
|
24
|
+
], [
|
|
25
|
+
void
|
|
26
|
+
], "nonpayable">;
|
|
27
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
28
|
+
getFunction(nameOrSignature: "rescueFunds"): TypedContractMethod<[
|
|
29
|
+
token: AddressLike,
|
|
30
|
+
amount: BigNumberish
|
|
31
|
+
], [
|
|
32
|
+
void
|
|
33
|
+
], "nonpayable">;
|
|
34
|
+
filters: {};
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoReceiveOwnerMock.js","sourceRoot":"","sources":["../../../../../typechain-types/contracts/tests/mocks/NoReceiveOwnerMock.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { BaseContract, BigNumberish, BytesLike, FunctionFragment, Result, Interface, EventFragment, AddressLike, ContractRunner, ContractMethod, Listener } from "ethers";
|
|
2
|
+
import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, TypedLogDescription, TypedListener, TypedContractMethod } from "../../../common";
|
|
3
|
+
export interface RescuableMockInterface extends Interface {
|
|
4
|
+
getFunction(nameOrSignature: "owner" | "renounceOwnership" | "rescueFunds" | "transferOwnership"): FunctionFragment;
|
|
5
|
+
getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment;
|
|
6
|
+
encodeFunctionData(functionFragment: "owner", values?: undefined): string;
|
|
7
|
+
encodeFunctionData(functionFragment: "renounceOwnership", values?: undefined): string;
|
|
8
|
+
encodeFunctionData(functionFragment: "rescueFunds", values: [AddressLike, BigNumberish]): string;
|
|
9
|
+
encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string;
|
|
10
|
+
decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result;
|
|
11
|
+
decodeFunctionResult(functionFragment: "renounceOwnership", data: BytesLike): Result;
|
|
12
|
+
decodeFunctionResult(functionFragment: "rescueFunds", data: BytesLike): Result;
|
|
13
|
+
decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result;
|
|
14
|
+
}
|
|
15
|
+
export declare namespace OwnershipTransferredEvent {
|
|
16
|
+
type InputTuple = [previousOwner: AddressLike, newOwner: AddressLike];
|
|
17
|
+
type OutputTuple = [previousOwner: string, newOwner: string];
|
|
18
|
+
interface OutputObject {
|
|
19
|
+
previousOwner: string;
|
|
20
|
+
newOwner: string;
|
|
21
|
+
}
|
|
22
|
+
type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
|
|
23
|
+
type Filter = TypedDeferredTopicFilter<Event>;
|
|
24
|
+
type Log = TypedEventLog<Event>;
|
|
25
|
+
type LogDescription = TypedLogDescription<Event>;
|
|
26
|
+
}
|
|
27
|
+
export interface RescuableMock extends BaseContract {
|
|
28
|
+
connect(runner?: ContractRunner | null): RescuableMock;
|
|
29
|
+
waitForDeployment(): Promise<this>;
|
|
30
|
+
interface: RescuableMockInterface;
|
|
31
|
+
queryFilter<TCEvent extends TypedContractEvent>(event: TCEvent, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
32
|
+
queryFilter<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise<Array<TypedEventLog<TCEvent>>>;
|
|
33
|
+
on<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
34
|
+
on<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
35
|
+
once<TCEvent extends TypedContractEvent>(event: TCEvent, listener: TypedListener<TCEvent>): Promise<this>;
|
|
36
|
+
once<TCEvent extends TypedContractEvent>(filter: TypedDeferredTopicFilter<TCEvent>, listener: TypedListener<TCEvent>): Promise<this>;
|
|
37
|
+
listeners<TCEvent extends TypedContractEvent>(event: TCEvent): Promise<Array<TypedListener<TCEvent>>>;
|
|
38
|
+
listeners(eventName?: string): Promise<Array<Listener>>;
|
|
39
|
+
removeAllListeners<TCEvent extends TypedContractEvent>(event?: TCEvent): Promise<this>;
|
|
40
|
+
owner: TypedContractMethod<[], [string], "view">;
|
|
41
|
+
renounceOwnership: TypedContractMethod<[], [void], "nonpayable">;
|
|
42
|
+
rescueFunds: TypedContractMethod<[
|
|
43
|
+
token: AddressLike,
|
|
44
|
+
amount: BigNumberish
|
|
45
|
+
], [
|
|
46
|
+
void
|
|
47
|
+
], "nonpayable">;
|
|
48
|
+
transferOwnership: TypedContractMethod<[
|
|
49
|
+
newOwner: AddressLike
|
|
50
|
+
], [
|
|
51
|
+
void
|
|
52
|
+
], "nonpayable">;
|
|
53
|
+
getFunction<T extends ContractMethod = ContractMethod>(key: string | FunctionFragment): T;
|
|
54
|
+
getFunction(nameOrSignature: "owner"): TypedContractMethod<[], [string], "view">;
|
|
55
|
+
getFunction(nameOrSignature: "renounceOwnership"): TypedContractMethod<[], [void], "nonpayable">;
|
|
56
|
+
getFunction(nameOrSignature: "rescueFunds"): TypedContractMethod<[
|
|
57
|
+
token: AddressLike,
|
|
58
|
+
amount: BigNumberish
|
|
59
|
+
], [
|
|
60
|
+
void
|
|
61
|
+
], "nonpayable">;
|
|
62
|
+
getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[newOwner: AddressLike], [void], "nonpayable">;
|
|
63
|
+
getEvent(key: "OwnershipTransferred"): TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
|
|
64
|
+
filters: {
|
|
65
|
+
"OwnershipTransferred(address,address)": TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
|
|
66
|
+
OwnershipTransferred: TypedContractEvent<OwnershipTransferredEvent.InputTuple, OwnershipTransferredEvent.OutputTuple, OwnershipTransferredEvent.OutputObject>;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RescuableMock.js","sourceRoot":"","sources":["../../../../../typechain-types/contracts/tests/mocks/RescuableMock.ts"],"names":[],"mappings":""}
|
|
@@ -22,8 +22,10 @@ export type { ERC1271WalletMock } from "./ERC1271WalletMock";
|
|
|
22
22
|
export type { EthReceiverMock } from "./EthReceiverMock";
|
|
23
23
|
export type { EthSenderMock } from "./EthSenderMock";
|
|
24
24
|
export type { MulticallMock } from "./MulticallMock";
|
|
25
|
+
export type { NoReceiveOwnerMock } from "./NoReceiveOwnerMock";
|
|
25
26
|
export type { PermitAndCallMock } from "./PermitAndCallMock";
|
|
26
27
|
export type { PermitableMock } from "./PermitableMock";
|
|
28
|
+
export type { RescuableMock } from "./RescuableMock";
|
|
27
29
|
export type { TokenWithBySig } from "./TokenWithBySig";
|
|
28
30
|
export type { TransientLockMock } from "./TransientLockMock";
|
|
29
31
|
export type { TransientMock } from "./TransientMock";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ContractRunner } from "ethers";
|
|
2
|
+
import type { IRescuable, IRescuableInterface } from "../../../contracts/interfaces/IRescuable";
|
|
3
|
+
export declare class IRescuable__factory {
|
|
4
|
+
static readonly abi: readonly [{
|
|
5
|
+
readonly inputs: readonly [];
|
|
6
|
+
readonly name: "ETHTransferFailed";
|
|
7
|
+
readonly type: "error";
|
|
8
|
+
}, {
|
|
9
|
+
readonly inputs: readonly [{
|
|
10
|
+
readonly internalType: "contract IERC20";
|
|
11
|
+
readonly name: "token";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}, {
|
|
14
|
+
readonly internalType: "uint256";
|
|
15
|
+
readonly name: "amount";
|
|
16
|
+
readonly type: "uint256";
|
|
17
|
+
}];
|
|
18
|
+
readonly name: "rescueFunds";
|
|
19
|
+
readonly outputs: readonly [];
|
|
20
|
+
readonly stateMutability: "nonpayable";
|
|
21
|
+
readonly type: "function";
|
|
22
|
+
}];
|
|
23
|
+
static createInterface(): IRescuableInterface;
|
|
24
|
+
static connect(address: string, runner?: ContractRunner | null): IRescuable;
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Autogenerated file. Do not edit manually. */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IRescuable__factory = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const _abi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [],
|
|
11
|
+
name: "ETHTransferFailed",
|
|
12
|
+
type: "error",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
internalType: "contract IERC20",
|
|
18
|
+
name: "token",
|
|
19
|
+
type: "address",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
internalType: "uint256",
|
|
23
|
+
name: "amount",
|
|
24
|
+
type: "uint256",
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
name: "rescueFunds",
|
|
28
|
+
outputs: [],
|
|
29
|
+
stateMutability: "nonpayable",
|
|
30
|
+
type: "function",
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
class IRescuable__factory {
|
|
34
|
+
static createInterface() {
|
|
35
|
+
return new ethers_1.Interface(_abi);
|
|
36
|
+
}
|
|
37
|
+
static connect(address, runner) {
|
|
38
|
+
return new ethers_1.Contract(address, _abi, runner);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.IRescuable__factory = IRescuable__factory;
|
|
42
|
+
IRescuable__factory.abi = _abi;
|
|
43
|
+
//# sourceMappingURL=IRescuable__factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRescuable__factory.js","sourceRoot":"","sources":["../../../../../typechain-types/factories/contracts/interfaces/IRescuable__factory.ts"],"names":[],"mappings":";AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;;;AAEpB,mCAAkE;AAMlE,MAAM,IAAI,GAAG;IACX;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,OAAO;KACd;IACD;QACE,MAAM,EAAE;YACN;gBACE,YAAY,EAAE,iBAAiB;gBAC/B,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,YAAY,EAAE,SAAS;gBACvB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;aAChB;SACF;QACD,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;KACjB;CACO,CAAC;AAEX,MAAa,mBAAmB;IAE9B,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,kBAAS,CAAC,IAAI,CAAwB,CAAC;IACpD,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,OAAe,EAAE,MAA8B;QAC5D,OAAO,IAAI,iBAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAA0B,CAAC;IACtE,CAAC;;AAPH,kDAQC;AAPiB,uBAAG,GAAG,IAAI,CAAC"}
|
|
@@ -3,4 +3,5 @@ export { IDaiLikePermit__factory } from "./IDaiLikePermit__factory";
|
|
|
3
3
|
export { IERC20MetadataUppercase__factory } from "./IERC20MetadataUppercase__factory";
|
|
4
4
|
export { IERC7597Permit__factory } from "./IERC7597Permit__factory";
|
|
5
5
|
export { IPermit2__factory } from "./IPermit2__factory";
|
|
6
|
+
export { IRescuable__factory } from "./IRescuable__factory";
|
|
6
7
|
export { IWETH__factory } from "./IWETH__factory";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IWETH__factory = exports.IPermit2__factory = exports.IERC7597Permit__factory = exports.IERC20MetadataUppercase__factory = exports.IDaiLikePermit__factory = exports.ICreate3Deployer__factory = void 0;
|
|
3
|
+
exports.IWETH__factory = exports.IRescuable__factory = exports.IPermit2__factory = exports.IERC7597Permit__factory = exports.IERC20MetadataUppercase__factory = exports.IDaiLikePermit__factory = exports.ICreate3Deployer__factory = void 0;
|
|
4
4
|
/* Autogenerated file. Do not edit manually. */
|
|
5
5
|
/* tslint:disable */
|
|
6
6
|
/* eslint-disable */
|
|
@@ -14,6 +14,8 @@ var IERC7597Permit__factory_1 = require("./IERC7597Permit__factory");
|
|
|
14
14
|
Object.defineProperty(exports, "IERC7597Permit__factory", { enumerable: true, get: function () { return IERC7597Permit__factory_1.IERC7597Permit__factory; } });
|
|
15
15
|
var IPermit2__factory_1 = require("./IPermit2__factory");
|
|
16
16
|
Object.defineProperty(exports, "IPermit2__factory", { enumerable: true, get: function () { return IPermit2__factory_1.IPermit2__factory; } });
|
|
17
|
+
var IRescuable__factory_1 = require("./IRescuable__factory");
|
|
18
|
+
Object.defineProperty(exports, "IRescuable__factory", { enumerable: true, get: function () { return IRescuable__factory_1.IRescuable__factory; } });
|
|
17
19
|
var IWETH__factory_1 = require("./IWETH__factory");
|
|
18
20
|
Object.defineProperty(exports, "IWETH__factory", { enumerable: true, get: function () { return IWETH__factory_1.IWETH__factory; } });
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../typechain-types/factories/contracts/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AACpB,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,uFAAsF;AAA7E,oJAAA,gCAAgC,OAAA;AACzC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../typechain-types/factories/contracts/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,oBAAoB;AACpB,oBAAoB;AACpB,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,uFAAsF;AAA7E,oJAAA,gCAAgC,OAAA;AACzC,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { type ContractRunner } from "ethers";
|
|
2
|
+
import type { Rescuable, RescuableInterface } from "../../../contracts/mixins/Rescuable";
|
|
3
|
+
export declare class Rescuable__factory {
|
|
4
|
+
static readonly abi: readonly [{
|
|
5
|
+
readonly inputs: readonly [];
|
|
6
|
+
readonly name: "ETHTransferFailed";
|
|
7
|
+
readonly type: "error";
|
|
8
|
+
}, {
|
|
9
|
+
readonly inputs: readonly [{
|
|
10
|
+
readonly internalType: "address";
|
|
11
|
+
readonly name: "owner";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
}];
|
|
14
|
+
readonly name: "OwnableInvalidOwner";
|
|
15
|
+
readonly type: "error";
|
|
16
|
+
}, {
|
|
17
|
+
readonly inputs: readonly [{
|
|
18
|
+
readonly internalType: "address";
|
|
19
|
+
readonly name: "account";
|
|
20
|
+
readonly type: "address";
|
|
21
|
+
}];
|
|
22
|
+
readonly name: "OwnableUnauthorizedAccount";
|
|
23
|
+
readonly type: "error";
|
|
24
|
+
}, {
|
|
25
|
+
readonly inputs: readonly [];
|
|
26
|
+
readonly name: "SafeTransferFailed";
|
|
27
|
+
readonly type: "error";
|
|
28
|
+
}, {
|
|
29
|
+
readonly anonymous: false;
|
|
30
|
+
readonly inputs: readonly [{
|
|
31
|
+
readonly indexed: true;
|
|
32
|
+
readonly internalType: "address";
|
|
33
|
+
readonly name: "previousOwner";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}, {
|
|
36
|
+
readonly indexed: true;
|
|
37
|
+
readonly internalType: "address";
|
|
38
|
+
readonly name: "newOwner";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
}];
|
|
41
|
+
readonly name: "OwnershipTransferred";
|
|
42
|
+
readonly type: "event";
|
|
43
|
+
}, {
|
|
44
|
+
readonly inputs: readonly [];
|
|
45
|
+
readonly name: "owner";
|
|
46
|
+
readonly outputs: readonly [{
|
|
47
|
+
readonly internalType: "address";
|
|
48
|
+
readonly name: "";
|
|
49
|
+
readonly type: "address";
|
|
50
|
+
}];
|
|
51
|
+
readonly stateMutability: "view";
|
|
52
|
+
readonly type: "function";
|
|
53
|
+
}, {
|
|
54
|
+
readonly inputs: readonly [];
|
|
55
|
+
readonly name: "renounceOwnership";
|
|
56
|
+
readonly outputs: readonly [];
|
|
57
|
+
readonly stateMutability: "nonpayable";
|
|
58
|
+
readonly type: "function";
|
|
59
|
+
}, {
|
|
60
|
+
readonly inputs: readonly [{
|
|
61
|
+
readonly internalType: "contract IERC20";
|
|
62
|
+
readonly name: "token";
|
|
63
|
+
readonly type: "address";
|
|
64
|
+
}, {
|
|
65
|
+
readonly internalType: "uint256";
|
|
66
|
+
readonly name: "amount";
|
|
67
|
+
readonly type: "uint256";
|
|
68
|
+
}];
|
|
69
|
+
readonly name: "rescueFunds";
|
|
70
|
+
readonly outputs: readonly [];
|
|
71
|
+
readonly stateMutability: "nonpayable";
|
|
72
|
+
readonly type: "function";
|
|
73
|
+
}, {
|
|
74
|
+
readonly inputs: readonly [{
|
|
75
|
+
readonly internalType: "address";
|
|
76
|
+
readonly name: "newOwner";
|
|
77
|
+
readonly type: "address";
|
|
78
|
+
}];
|
|
79
|
+
readonly name: "transferOwnership";
|
|
80
|
+
readonly outputs: readonly [];
|
|
81
|
+
readonly stateMutability: "nonpayable";
|
|
82
|
+
readonly type: "function";
|
|
83
|
+
}];
|
|
84
|
+
static createInterface(): RescuableInterface;
|
|
85
|
+
static connect(address: string, runner?: ContractRunner | null): Rescuable;
|
|
86
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Autogenerated file. Do not edit manually. */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Rescuable__factory = void 0;
|
|
7
|
+
const ethers_1 = require("ethers");
|
|
8
|
+
const _abi = [
|
|
9
|
+
{
|
|
10
|
+
inputs: [],
|
|
11
|
+
name: "ETHTransferFailed",
|
|
12
|
+
type: "error",
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
inputs: [
|
|
16
|
+
{
|
|
17
|
+
internalType: "address",
|
|
18
|
+
name: "owner",
|
|
19
|
+
type: "address",
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
name: "OwnableInvalidOwner",
|
|
23
|
+
type: "error",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
inputs: [
|
|
27
|
+
{
|
|
28
|
+
internalType: "address",
|
|
29
|
+
name: "account",
|
|
30
|
+
type: "address",
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
name: "OwnableUnauthorizedAccount",
|
|
34
|
+
type: "error",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
inputs: [],
|
|
38
|
+
name: "SafeTransferFailed",
|
|
39
|
+
type: "error",
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
anonymous: false,
|
|
43
|
+
inputs: [
|
|
44
|
+
{
|
|
45
|
+
indexed: true,
|
|
46
|
+
internalType: "address",
|
|
47
|
+
name: "previousOwner",
|
|
48
|
+
type: "address",
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
indexed: true,
|
|
52
|
+
internalType: "address",
|
|
53
|
+
name: "newOwner",
|
|
54
|
+
type: "address",
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
name: "OwnershipTransferred",
|
|
58
|
+
type: "event",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
inputs: [],
|
|
62
|
+
name: "owner",
|
|
63
|
+
outputs: [
|
|
64
|
+
{
|
|
65
|
+
internalType: "address",
|
|
66
|
+
name: "",
|
|
67
|
+
type: "address",
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
stateMutability: "view",
|
|
71
|
+
type: "function",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
inputs: [],
|
|
75
|
+
name: "renounceOwnership",
|
|
76
|
+
outputs: [],
|
|
77
|
+
stateMutability: "nonpayable",
|
|
78
|
+
type: "function",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
inputs: [
|
|
82
|
+
{
|
|
83
|
+
internalType: "contract IERC20",
|
|
84
|
+
name: "token",
|
|
85
|
+
type: "address",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
internalType: "uint256",
|
|
89
|
+
name: "amount",
|
|
90
|
+
type: "uint256",
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
name: "rescueFunds",
|
|
94
|
+
outputs: [],
|
|
95
|
+
stateMutability: "nonpayable",
|
|
96
|
+
type: "function",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
inputs: [
|
|
100
|
+
{
|
|
101
|
+
internalType: "address",
|
|
102
|
+
name: "newOwner",
|
|
103
|
+
type: "address",
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
name: "transferOwnership",
|
|
107
|
+
outputs: [],
|
|
108
|
+
stateMutability: "nonpayable",
|
|
109
|
+
type: "function",
|
|
110
|
+
},
|
|
111
|
+
];
|
|
112
|
+
class Rescuable__factory {
|
|
113
|
+
static createInterface() {
|
|
114
|
+
return new ethers_1.Interface(_abi);
|
|
115
|
+
}
|
|
116
|
+
static connect(address, runner) {
|
|
117
|
+
return new ethers_1.Contract(address, _abi, runner);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.Rescuable__factory = Rescuable__factory;
|
|
121
|
+
Rescuable__factory.abi = _abi;
|
|
122
|
+
//# sourceMappingURL=Rescuable__factory.js.map
|