Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion types/DoubleTransferHelperFactory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Generated by ts-generator ver. 0.0.8 */
/* tslint:disable */
/* eslint-disable */ // Use modern ESLint disable comments

import { Contract, ContractFactory, Signer } from "ethers";
import { Provider } from "ethers/providers";
Expand All @@ -8,29 +8,66 @@ import { UnsignedTransaction } from "ethers/utils/transaction";
import { TransactionOverrides } from ".";
import { DoubleTransferHelper } from "./DoubleTransferHelper";

/**
* @notice Factory class for deploying and interacting with the DoubleTransferHelper contract.
* This contract is designed to execute two transfers of the same token (AAVE) in a single transaction.
*/
export class DoubleTransferHelperFactory extends ContractFactory {
// Use the generated ABI and Bytecode for deployment
constructor(signer?: Signer) {
super(_abi, _bytecode, signer);
}

/**
* @notice Deploys a new instance of the DoubleTransferHelper contract.
* @param aave The address of the AAVE ERC-20 token contract.
* @param overrides Optional transaction overrides.
* @returns A promise resolving to the deployed contract instance.
*/
deploy(
aave: string,
overrides?: TransactionOverrides
): Promise<DoubleTransferHelper> {
return super.deploy(aave, overrides) as Promise<DoubleTransferHelper>;
}

/**
* @notice Gets the unsigned transaction object for contract deployment.
* @param aave The address of the AAVE ERC-20 token contract.
* @param overrides Optional transaction overrides.
* @returns An unsigned transaction object.
*/
getDeployTransaction(
aave: string,
overrides?: TransactionOverrides
): UnsignedTransaction {
return super.getDeployTransaction(aave, overrides);
}

/**
* @notice Attaches to an existing contract instance at the specified address.
* @param address The address of the deployed contract.
* @returns The contract instance.
*/
attach(address: string): DoubleTransferHelper {
return super.attach(address) as DoubleTransferHelper;
}

/**
* @notice Connects the factory to a different Signer for deployment/interaction.
* @param signer The new signer.
* @returns A new factory instance connected to the signer.
*/
connect(signer: Signer): DoubleTransferHelperFactory {
return super.connect(signer) as DoubleTransferHelperFactory;
}

/**
* @notice Static method to connect to an existing contract instance.
* @param address The address of the deployed contract.
* @param signerOrProvider A Signer or Provider instance.
* @returns The contract instance.
*/
static connect(
address: string,
signerOrProvider: Signer | Provider
Expand All @@ -43,8 +80,10 @@ export class DoubleTransferHelperFactory extends ContractFactory {
}
}

// --- Contract ABI (Application Binary Interface) ---
const _abi = [
{
// Constructor: Initializes the AAVE token address upon deployment.
inputs: [
{
internalType: "contract IERC20",
Expand All @@ -56,6 +95,7 @@ const _abi = [
type: "constructor"
},
{
// Public view function to retrieve the stored AAVE token address.
inputs: [],
name: "AAVE",
outputs: [
Expand All @@ -69,6 +109,9 @@ const _abi = [
type: "function"
},
{
// Main logic function: Performs two transfers of the AAVE token from the
// Helper contract's balance to the 'to' address.
// NOTE: This function relies on AAVE tokens being pre-funded to this contract address.
inputs: [
{
internalType: "address",
Expand All @@ -93,5 +136,7 @@ const _abi = [
}
];

// --- Contract Bytecode ---
const _bytecode =
"0x60a060405234801561001057600080fd5b506040516102ad3803806102ad8339818101604052602081101561003357600080fd5b5051606081901b6001600160601b0319166080526001600160a01b031661023e61006f600039806095528060b9528061018c525061023e6000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806348ccda3c1461003b578063983ff7691461005f575b600080fd5b610043610093565b604080516001600160a01b039092168252519081900360200190f35b6100916004803603606081101561007557600080fd5b506001600160a01b0381351690602081013590604001356100b7565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561013757600080fd5b505af115801561014b573d6000803e3d6000fd5b505050506040513d602081101561016157600080fd5b50506040805163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905291517f00000000000000000000000000000000000000000000000000000000000000009092169163a9059cbb916044808201926020929091908290030181600087803b1580156101d757600080fd5b505af11580156101eb573d6000803e3d6000fd5b505050506040513d602081101561020157600080fd5b505050505056fea26469706673582212206b5de4a7898b6c4d86736a84f3fc2e5e9ae60034519329e57e14ce508cd7ca5864736f6c634300060a0033";
```