diff --git a/arb.db b/arb.db index e0b2bfe9a..83f63f9a3 100644 Binary files a/arb.db and b/arb.db differ diff --git a/avax.db b/avax.db index 60449b0bb..d44f109f3 100644 Binary files a/avax.db and b/avax.db differ diff --git a/base.db b/base.db index ea62f4b61..9d6e72529 100644 Binary files a/base.db and b/base.db differ diff --git a/ethereum.db b/ethereum.db index baa0be7d9..7da54a825 100644 Binary files a/ethereum.db and b/ethereum.db differ diff --git a/matic.db b/matic.db index 878de52f8..d2186bf7e 100644 Binary files a/matic.db and b/matic.db differ diff --git a/op.db b/op.db index 4666fb05c..9226d31ba 100644 Binary files a/op.db and b/op.db differ diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/BalMinter.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/BalMinter.ts new file mode 100644 index 000000000..fd659693d --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/BalMinter.ts @@ -0,0 +1,473 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface BalMinterInterface extends Interface { + getFunction( + nameOrSignature: + | "allowed_to_mint_for" + | "getBalancerToken" + | "getBalancerTokenAdmin" + | "getDomainSeparator" + | "getGaugeController" + | "getMinterApproval" + | "getNextNonce" + | "mint" + | "mintFor" + | "mintMany" + | "mintManyFor" + | "mint_for" + | "mint_many" + | "minted" + | "setMinterApproval" + | "setMinterApprovalWithSignature" + | "toggle_approve_mint" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: "Minted" | "MinterApprovalSet" + ): EventFragment; + + encodeFunctionData( + functionFragment: "allowed_to_mint_for", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getBalancerToken", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getBalancerTokenAdmin", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getDomainSeparator", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getGaugeController", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getMinterApproval", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getNextNonce", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "mint", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "mintFor", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "mintMany", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "mintManyFor", + values: [AddressLike[], AddressLike] + ): string; + encodeFunctionData( + functionFragment: "mint_for", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "mint_many", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "minted", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "setMinterApproval", + values: [AddressLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "setMinterApprovalWithSignature", + values: [ + AddressLike, + boolean, + AddressLike, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "toggle_approve_mint", + values: [AddressLike] + ): string; + + decodeFunctionResult( + functionFragment: "allowed_to_mint_for", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getBalancerToken", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getBalancerTokenAdmin", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDomainSeparator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getGaugeController", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMinterApproval", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getNextNonce", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "mintFor", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "mintMany", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "mintManyFor", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint_for", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "mint_many", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "minted", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMinterApproval", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMinterApprovalWithSignature", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "toggle_approve_mint", + data: BytesLike + ): Result; +} + +export namespace MintedEvent { + export type InputTuple = [ + recipient: AddressLike, + gauge: AddressLike, + minted: BigNumberish + ]; + export type OutputTuple = [recipient: string, gauge: string, minted: bigint]; + export interface OutputObject { + recipient: string; + gauge: string; + minted: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace MinterApprovalSetEvent { + export type InputTuple = [ + user: AddressLike, + minter: AddressLike, + approval: boolean + ]; + export type OutputTuple = [user: string, minter: string, approval: boolean]; + export interface OutputObject { + user: string; + minter: string; + approval: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface BalMinter extends BaseContract { + connect(runner?: ContractRunner | null): BalMinter; + waitForDeployment(): Promise; + + interface: BalMinterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + allowed_to_mint_for: TypedContractMethod< + [minter: AddressLike, user: AddressLike], + [boolean], + "view" + >; + + getBalancerToken: TypedContractMethod<[], [string], "view">; + + getBalancerTokenAdmin: TypedContractMethod<[], [string], "view">; + + getDomainSeparator: TypedContractMethod<[], [string], "view">; + + getGaugeController: TypedContractMethod<[], [string], "view">; + + getMinterApproval: TypedContractMethod< + [minter: AddressLike, user: AddressLike], + [boolean], + "view" + >; + + getNextNonce: TypedContractMethod<[user: AddressLike], [bigint], "view">; + + mint: TypedContractMethod<[gauge: AddressLike], [bigint], "nonpayable">; + + mintFor: TypedContractMethod< + [gauge: AddressLike, user: AddressLike], + [bigint], + "nonpayable" + >; + + mintMany: TypedContractMethod< + [gauges: AddressLike[]], + [bigint], + "nonpayable" + >; + + mintManyFor: TypedContractMethod< + [gauges: AddressLike[], user: AddressLike], + [bigint], + "nonpayable" + >; + + mint_for: TypedContractMethod< + [gauge: AddressLike, user: AddressLike], + [void], + "nonpayable" + >; + + mint_many: TypedContractMethod<[gauges: AddressLike[]], [void], "nonpayable">; + + minted: TypedContractMethod< + [user: AddressLike, gauge: AddressLike], + [bigint], + "view" + >; + + setMinterApproval: TypedContractMethod< + [minter: AddressLike, approval: boolean], + [void], + "nonpayable" + >; + + setMinterApprovalWithSignature: TypedContractMethod< + [ + minter: AddressLike, + approval: boolean, + user: AddressLike, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + + toggle_approve_mint: TypedContractMethod< + [minter: AddressLike], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "allowed_to_mint_for" + ): TypedContractMethod< + [minter: AddressLike, user: AddressLike], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "getBalancerToken" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getBalancerTokenAdmin" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getDomainSeparator" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getGaugeController" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getMinterApproval" + ): TypedContractMethod< + [minter: AddressLike, user: AddressLike], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "getNextNonce" + ): TypedContractMethod<[user: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "mint" + ): TypedContractMethod<[gauge: AddressLike], [bigint], "nonpayable">; + getFunction( + nameOrSignature: "mintFor" + ): TypedContractMethod< + [gauge: AddressLike, user: AddressLike], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "mintMany" + ): TypedContractMethod<[gauges: AddressLike[]], [bigint], "nonpayable">; + getFunction( + nameOrSignature: "mintManyFor" + ): TypedContractMethod< + [gauges: AddressLike[], user: AddressLike], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "mint_for" + ): TypedContractMethod< + [gauge: AddressLike, user: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "mint_many" + ): TypedContractMethod<[gauges: AddressLike[]], [void], "nonpayable">; + getFunction( + nameOrSignature: "minted" + ): TypedContractMethod< + [user: AddressLike, gauge: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "setMinterApproval" + ): TypedContractMethod< + [minter: AddressLike, approval: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setMinterApprovalWithSignature" + ): TypedContractMethod< + [ + minter: AddressLike, + approval: boolean, + user: AddressLike, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "toggle_approve_mint" + ): TypedContractMethod<[minter: AddressLike], [void], "nonpayable">; + + getEvent( + key: "Minted" + ): TypedContractEvent< + MintedEvent.InputTuple, + MintedEvent.OutputTuple, + MintedEvent.OutputObject + >; + getEvent( + key: "MinterApprovalSet" + ): TypedContractEvent< + MinterApprovalSetEvent.InputTuple, + MinterApprovalSetEvent.OutputTuple, + MinterApprovalSetEvent.OutputObject + >; + + filters: { + "Minted(address,address,uint256)": TypedContractEvent< + MintedEvent.InputTuple, + MintedEvent.OutputTuple, + MintedEvent.OutputObject + >; + Minted: TypedContractEvent< + MintedEvent.InputTuple, + MintedEvent.OutputTuple, + MintedEvent.OutputObject + >; + + "MinterApprovalSet(address,address,bool)": TypedContractEvent< + MinterApprovalSetEvent.InputTuple, + MinterApprovalSetEvent.OutputTuple, + MinterApprovalSetEvent.OutputObject + >; + MinterApprovalSet: TypedContractEvent< + MinterApprovalSetEvent.InputTuple, + MinterApprovalSetEvent.OutputTuple, + MinterApprovalSetEvent.OutputObject + >; + }; +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/Farming.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/Farming.ts new file mode 100644 index 000000000..bfb1be150 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/Farming.ts @@ -0,0 +1,924 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface FarmingInterface extends Interface { + getFunction( + nameOrSignature: + | "token" + | "voting_escrow" + | "admin" + | "gauge_exists" + | "gauge_types" + | "add_gauge(address,int128)" + | "add_gauge(address,int128,uint256)" + | "checkpoint" + | "checkpoint_gauge" + | "gauge_relative_weight(address)" + | "gauge_relative_weight(address,uint256)" + | "gauge_relative_weight_write(address)" + | "gauge_relative_weight_write(address,uint256)" + | "add_type(string)" + | "add_type(string,uint256)" + | "change_type_weight" + | "change_gauge_weight" + | "vote_for_many_gauge_weights" + | "vote_for_gauge_weights" + | "get_gauge_weight" + | "get_type_weight" + | "get_total_weight" + | "get_weights_sum_per_type" + | "n_gauge_types" + | "n_gauges" + | "gauge_type_names" + | "gauges" + | "vote_user_slopes" + | "vote_user_power" + | "last_user_vote" + | "points_weight" + | "time_weight" + | "points_sum" + | "time_sum" + | "points_total" + | "time_total" + | "points_type_weight" + | "time_type_weight" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "AddType" + | "NewTypeWeight" + | "NewGaugeWeight" + | "VoteForGauge" + | "NewGauge" + ): EventFragment; + + encodeFunctionData(functionFragment: "token", values?: undefined): string; + encodeFunctionData( + functionFragment: "voting_escrow", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "admin", values?: undefined): string; + encodeFunctionData( + functionFragment: "gauge_exists", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "gauge_types", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "add_gauge(address,int128)", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "add_gauge(address,int128,uint256)", + values: [AddressLike, BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "checkpoint", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "checkpoint_gauge", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "gauge_relative_weight(address)", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "gauge_relative_weight(address,uint256)", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "gauge_relative_weight_write(address)", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "gauge_relative_weight_write(address,uint256)", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "add_type(string)", + values: [string] + ): string; + encodeFunctionData( + functionFragment: "add_type(string,uint256)", + values: [string, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "change_type_weight", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "change_gauge_weight", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "vote_for_many_gauge_weights", + values: [AddressLike[], BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "vote_for_gauge_weights", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "get_gauge_weight", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "get_type_weight", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "get_total_weight", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "get_weights_sum_per_type", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "n_gauge_types", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "n_gauges", values?: undefined): string; + encodeFunctionData( + functionFragment: "gauge_type_names", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "gauges", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "vote_user_slopes", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "vote_user_power", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "last_user_vote", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "points_weight", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "time_weight", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "points_sum", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "time_sum", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "points_total", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "time_total", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "points_type_weight", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "time_type_weight", + values: [BigNumberish] + ): string; + + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "voting_escrow", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "admin", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "gauge_exists", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gauge_types", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "add_gauge(address,int128)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "add_gauge(address,int128,uint256)", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "checkpoint", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "checkpoint_gauge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gauge_relative_weight(address)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gauge_relative_weight(address,uint256)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gauge_relative_weight_write(address)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gauge_relative_weight_write(address,uint256)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "add_type(string)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "add_type(string,uint256)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "change_type_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "change_gauge_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "vote_for_many_gauge_weights", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "vote_for_gauge_weights", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "get_gauge_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "get_type_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "get_total_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "get_weights_sum_per_type", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "n_gauge_types", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "n_gauges", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "gauge_type_names", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "gauges", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "vote_user_slopes", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "vote_user_power", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "last_user_vote", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "points_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "time_weight", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "points_sum", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "time_sum", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "points_total", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "time_total", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "points_type_weight", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "time_type_weight", + data: BytesLike + ): Result; +} + +export namespace AddTypeEvent { + export type InputTuple = [name: string, type_id: BigNumberish]; + export type OutputTuple = [name: string, type_id: bigint]; + export interface OutputObject { + name: string; + type_id: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace NewTypeWeightEvent { + export type InputTuple = [ + type_id: BigNumberish, + time: BigNumberish, + weight: BigNumberish, + total_weight: BigNumberish + ]; + export type OutputTuple = [ + type_id: bigint, + time: bigint, + weight: bigint, + total_weight: bigint + ]; + export interface OutputObject { + type_id: bigint; + time: bigint; + weight: bigint; + total_weight: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace NewGaugeWeightEvent { + export type InputTuple = [ + gauge_address: AddressLike, + time: BigNumberish, + weight: BigNumberish, + total_weight: BigNumberish + ]; + export type OutputTuple = [ + gauge_address: string, + time: bigint, + weight: bigint, + total_weight: bigint + ]; + export interface OutputObject { + gauge_address: string; + time: bigint; + weight: bigint; + total_weight: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace VoteForGaugeEvent { + export type InputTuple = [ + time: BigNumberish, + user: AddressLike, + gauge_addr: AddressLike, + weight: BigNumberish + ]; + export type OutputTuple = [ + time: bigint, + user: string, + gauge_addr: string, + weight: bigint + ]; + export interface OutputObject { + time: bigint; + user: string; + gauge_addr: string; + weight: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace NewGaugeEvent { + export type InputTuple = [ + addr: AddressLike, + gauge_type: BigNumberish, + weight: BigNumberish + ]; + export type OutputTuple = [addr: string, gauge_type: bigint, weight: bigint]; + export interface OutputObject { + addr: string; + gauge_type: bigint; + weight: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface Farming extends BaseContract { + connect(runner?: ContractRunner | null): Farming; + waitForDeployment(): Promise; + + interface: FarmingInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + token: TypedContractMethod<[], [string], "view">; + + voting_escrow: TypedContractMethod<[], [string], "view">; + + admin: TypedContractMethod<[], [string], "view">; + + gauge_exists: TypedContractMethod<[_addr: AddressLike], [boolean], "view">; + + gauge_types: TypedContractMethod<[_addr: AddressLike], [bigint], "view">; + + "add_gauge(address,int128)": TypedContractMethod< + [addr: AddressLike, gauge_type: BigNumberish], + [void], + "nonpayable" + >; + + "add_gauge(address,int128,uint256)": TypedContractMethod< + [addr: AddressLike, gauge_type: BigNumberish, weight: BigNumberish], + [void], + "nonpayable" + >; + + checkpoint: TypedContractMethod<[], [void], "nonpayable">; + + checkpoint_gauge: TypedContractMethod< + [addr: AddressLike], + [void], + "nonpayable" + >; + + "gauge_relative_weight(address)": TypedContractMethod< + [addr: AddressLike], + [bigint], + "view" + >; + + "gauge_relative_weight(address,uint256)": TypedContractMethod< + [addr: AddressLike, time: BigNumberish], + [bigint], + "view" + >; + + "gauge_relative_weight_write(address)": TypedContractMethod< + [addr: AddressLike], + [bigint], + "nonpayable" + >; + + "gauge_relative_weight_write(address,uint256)": TypedContractMethod< + [addr: AddressLike, time: BigNumberish], + [bigint], + "nonpayable" + >; + + "add_type(string)": TypedContractMethod< + [_name: string], + [void], + "nonpayable" + >; + + "add_type(string,uint256)": TypedContractMethod< + [_name: string, weight: BigNumberish], + [void], + "nonpayable" + >; + + change_type_weight: TypedContractMethod< + [type_id: BigNumberish, weight: BigNumberish], + [void], + "nonpayable" + >; + + change_gauge_weight: TypedContractMethod< + [addr: AddressLike, weight: BigNumberish], + [void], + "nonpayable" + >; + + vote_for_many_gauge_weights: TypedContractMethod< + [_gauge_addrs: AddressLike[], _user_weight: BigNumberish[]], + [void], + "nonpayable" + >; + + vote_for_gauge_weights: TypedContractMethod< + [_gauge_addr: AddressLike, _user_weight: BigNumberish], + [void], + "nonpayable" + >; + + get_gauge_weight: TypedContractMethod<[addr: AddressLike], [bigint], "view">; + + get_type_weight: TypedContractMethod< + [type_id: BigNumberish], + [bigint], + "view" + >; + + get_total_weight: TypedContractMethod<[], [bigint], "view">; + + get_weights_sum_per_type: TypedContractMethod< + [type_id: BigNumberish], + [bigint], + "view" + >; + + n_gauge_types: TypedContractMethod<[], [bigint], "view">; + + n_gauges: TypedContractMethod<[], [bigint], "view">; + + gauge_type_names: TypedContractMethod<[arg0: BigNumberish], [string], "view">; + + gauges: TypedContractMethod<[arg0: BigNumberish], [string], "view">; + + vote_user_slopes: TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [[bigint, bigint, bigint] & { slope: bigint; power: bigint; end: bigint }], + "view" + >; + + vote_user_power: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + last_user_vote: TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + + points_weight: TypedContractMethod< + [arg0: AddressLike, arg1: BigNumberish], + [[bigint, bigint] & { bias: bigint; slope: bigint }], + "view" + >; + + time_weight: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + points_sum: TypedContractMethod< + [arg0: BigNumberish, arg1: BigNumberish], + [[bigint, bigint] & { bias: bigint; slope: bigint }], + "view" + >; + + time_sum: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + points_total: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + time_total: TypedContractMethod<[], [bigint], "view">; + + points_type_weight: TypedContractMethod< + [arg0: BigNumberish, arg1: BigNumberish], + [bigint], + "view" + >; + + time_type_weight: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "token" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "voting_escrow" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "admin" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "gauge_exists" + ): TypedContractMethod<[_addr: AddressLike], [boolean], "view">; + getFunction( + nameOrSignature: "gauge_types" + ): TypedContractMethod<[_addr: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "add_gauge(address,int128)" + ): TypedContractMethod< + [addr: AddressLike, gauge_type: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "add_gauge(address,int128,uint256)" + ): TypedContractMethod< + [addr: AddressLike, gauge_type: BigNumberish, weight: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "checkpoint" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "checkpoint_gauge" + ): TypedContractMethod<[addr: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "gauge_relative_weight(address)" + ): TypedContractMethod<[addr: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "gauge_relative_weight(address,uint256)" + ): TypedContractMethod< + [addr: AddressLike, time: BigNumberish], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "gauge_relative_weight_write(address)" + ): TypedContractMethod<[addr: AddressLike], [bigint], "nonpayable">; + getFunction( + nameOrSignature: "gauge_relative_weight_write(address,uint256)" + ): TypedContractMethod< + [addr: AddressLike, time: BigNumberish], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "add_type(string)" + ): TypedContractMethod<[_name: string], [void], "nonpayable">; + getFunction( + nameOrSignature: "add_type(string,uint256)" + ): TypedContractMethod< + [_name: string, weight: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "change_type_weight" + ): TypedContractMethod< + [type_id: BigNumberish, weight: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "change_gauge_weight" + ): TypedContractMethod< + [addr: AddressLike, weight: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "vote_for_many_gauge_weights" + ): TypedContractMethod< + [_gauge_addrs: AddressLike[], _user_weight: BigNumberish[]], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "vote_for_gauge_weights" + ): TypedContractMethod< + [_gauge_addr: AddressLike, _user_weight: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "get_gauge_weight" + ): TypedContractMethod<[addr: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "get_type_weight" + ): TypedContractMethod<[type_id: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "get_total_weight" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "get_weights_sum_per_type" + ): TypedContractMethod<[type_id: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "n_gauge_types" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "n_gauges" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "gauge_type_names" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "gauges" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "vote_user_slopes" + ): TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [[bigint, bigint, bigint] & { slope: bigint; power: bigint; end: bigint }], + "view" + >; + getFunction( + nameOrSignature: "vote_user_power" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "last_user_vote" + ): TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "points_weight" + ): TypedContractMethod< + [arg0: AddressLike, arg1: BigNumberish], + [[bigint, bigint] & { bias: bigint; slope: bigint }], + "view" + >; + getFunction( + nameOrSignature: "time_weight" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "points_sum" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: BigNumberish], + [[bigint, bigint] & { bias: bigint; slope: bigint }], + "view" + >; + getFunction( + nameOrSignature: "time_sum" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "points_total" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "time_total" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "points_type_weight" + ): TypedContractMethod< + [arg0: BigNumberish, arg1: BigNumberish], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "time_type_weight" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + getEvent( + key: "AddType" + ): TypedContractEvent< + AddTypeEvent.InputTuple, + AddTypeEvent.OutputTuple, + AddTypeEvent.OutputObject + >; + getEvent( + key: "NewTypeWeight" + ): TypedContractEvent< + NewTypeWeightEvent.InputTuple, + NewTypeWeightEvent.OutputTuple, + NewTypeWeightEvent.OutputObject + >; + getEvent( + key: "NewGaugeWeight" + ): TypedContractEvent< + NewGaugeWeightEvent.InputTuple, + NewGaugeWeightEvent.OutputTuple, + NewGaugeWeightEvent.OutputObject + >; + getEvent( + key: "VoteForGauge" + ): TypedContractEvent< + VoteForGaugeEvent.InputTuple, + VoteForGaugeEvent.OutputTuple, + VoteForGaugeEvent.OutputObject + >; + getEvent( + key: "NewGauge" + ): TypedContractEvent< + NewGaugeEvent.InputTuple, + NewGaugeEvent.OutputTuple, + NewGaugeEvent.OutputObject + >; + + filters: { + "AddType(string,int128)": TypedContractEvent< + AddTypeEvent.InputTuple, + AddTypeEvent.OutputTuple, + AddTypeEvent.OutputObject + >; + AddType: TypedContractEvent< + AddTypeEvent.InputTuple, + AddTypeEvent.OutputTuple, + AddTypeEvent.OutputObject + >; + + "NewTypeWeight(int128,uint256,uint256,uint256)": TypedContractEvent< + NewTypeWeightEvent.InputTuple, + NewTypeWeightEvent.OutputTuple, + NewTypeWeightEvent.OutputObject + >; + NewTypeWeight: TypedContractEvent< + NewTypeWeightEvent.InputTuple, + NewTypeWeightEvent.OutputTuple, + NewTypeWeightEvent.OutputObject + >; + + "NewGaugeWeight(address,uint256,uint256,uint256)": TypedContractEvent< + NewGaugeWeightEvent.InputTuple, + NewGaugeWeightEvent.OutputTuple, + NewGaugeWeightEvent.OutputObject + >; + NewGaugeWeight: TypedContractEvent< + NewGaugeWeightEvent.InputTuple, + NewGaugeWeightEvent.OutputTuple, + NewGaugeWeightEvent.OutputObject + >; + + "VoteForGauge(uint256,address,address,uint256)": TypedContractEvent< + VoteForGaugeEvent.InputTuple, + VoteForGaugeEvent.OutputTuple, + VoteForGaugeEvent.OutputObject + >; + VoteForGauge: TypedContractEvent< + VoteForGaugeEvent.InputTuple, + VoteForGaugeEvent.OutputTuple, + VoteForGaugeEvent.OutputObject + >; + + "NewGauge(address,int128,uint256)": TypedContractEvent< + NewGaugeEvent.InputTuple, + NewGaugeEvent.OutputTuple, + NewGaugeEvent.OutputObject + >; + NewGauge: TypedContractEvent< + NewGaugeEvent.InputTuple, + NewGaugeEvent.OutputTuple, + NewGaugeEvent.OutputObject + >; + }; +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/FarmingToken.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/FarmingToken.ts new file mode 100644 index 000000000..e88097e28 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/FarmingToken.ts @@ -0,0 +1,1199 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface FarmingTokenInterface extends Interface { + getFunction( + nameOrSignature: + | "deposit(uint256)" + | "deposit(uint256,address)" + | "deposit(uint256,address,bool)" + | "withdraw(uint256)" + | "withdraw(uint256,bool)" + | "claim_rewards()" + | "claim_rewards(address)" + | "claim_rewards(address,address)" + | "transferFrom" + | "transfer" + | "approve" + | "permit" + | "increaseAllowance" + | "decreaseAllowance" + | "user_checkpoint" + | "set_rewards_receiver" + | "kick" + | "deposit_reward_token" + | "add_reward" + | "set_reward_distributor" + | "killGauge" + | "unkillGauge" + | "claimed_reward" + | "claimable_reward" + | "claimable_tokens" + | "integrate_checkpoint" + | "future_epoch_time" + | "inflation_rate" + | "decimals" + | "version" + | "allowance" + | "initialize" + | "balanceOf" + | "totalSupply" + | "name" + | "symbol" + | "DOMAIN_SEPARATOR" + | "nonces" + | "lp_token" + | "is_killed" + | "reward_count" + | "reward_data" + | "rewards_receiver" + | "reward_integral_for" + | "working_balances" + | "working_supply" + | "integrate_inv_supply_of" + | "integrate_checkpoint_of" + | "integrate_fraction" + | "period" + | "reward_tokens" + | "period_timestamp" + | "integrate_inv_supply" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "Deposit" + | "Withdraw" + | "UpdateLiquidityLimit" + | "Transfer" + | "Approval" + | "RewardDistributorUpdated" + ): EventFragment; + + encodeFunctionData( + functionFragment: "deposit(uint256)", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "deposit(uint256,address)", + values: [BigNumberish, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "deposit(uint256,address,bool)", + values: [BigNumberish, AddressLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "withdraw(uint256)", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "withdraw(uint256,bool)", + values: [BigNumberish, boolean] + ): string; + encodeFunctionData( + functionFragment: "claim_rewards()", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "claim_rewards(address)", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "claim_rewards(address,address)", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "permit", + values: [ + AddressLike, + AddressLike, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "user_checkpoint", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "set_rewards_receiver", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "kick", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "deposit_reward_token", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "add_reward", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "set_reward_distributor", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData(functionFragment: "killGauge", values?: undefined): string; + encodeFunctionData( + functionFragment: "unkillGauge", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "claimed_reward", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "claimable_reward", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "claimable_tokens", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "integrate_checkpoint", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "future_epoch_time", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "inflation_rate", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData(functionFragment: "version", values?: undefined): string; + encodeFunctionData( + functionFragment: "allowance", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "lp_token", values?: undefined): string; + encodeFunctionData(functionFragment: "is_killed", values?: undefined): string; + encodeFunctionData( + functionFragment: "reward_count", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "reward_data", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "rewards_receiver", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "reward_integral_for", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "working_balances", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "working_supply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "integrate_inv_supply_of", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "integrate_checkpoint_of", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "integrate_fraction", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "period", values?: undefined): string; + encodeFunctionData( + functionFragment: "reward_tokens", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "period_timestamp", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "integrate_inv_supply", + values: [BigNumberish] + ): string; + + decodeFunctionResult( + functionFragment: "deposit(uint256)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "deposit(uint256,address)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "deposit(uint256,address,bool)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "withdraw(uint256)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "withdraw(uint256,bool)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "claim_rewards()", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "claim_rewards(address)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "claim_rewards(address,address)", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "user_checkpoint", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "set_rewards_receiver", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "kick", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "deposit_reward_token", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "add_reward", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "set_reward_distributor", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "killGauge", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "unkillGauge", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "claimed_reward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "claimable_reward", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "claimable_tokens", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "integrate_checkpoint", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "future_epoch_time", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "inflation_rate", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "lp_token", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "is_killed", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "reward_count", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "reward_data", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "rewards_receiver", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "reward_integral_for", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "working_balances", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "working_supply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "integrate_inv_supply_of", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "integrate_checkpoint_of", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "integrate_fraction", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "period", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "reward_tokens", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "period_timestamp", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "integrate_inv_supply", + data: BytesLike + ): Result; +} + +export namespace DepositEvent { + export type InputTuple = [provider: AddressLike, value: BigNumberish]; + export type OutputTuple = [provider: string, value: bigint]; + export interface OutputObject { + provider: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace WithdrawEvent { + export type InputTuple = [provider: AddressLike, value: BigNumberish]; + export type OutputTuple = [provider: string, value: bigint]; + export interface OutputObject { + provider: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace UpdateLiquidityLimitEvent { + export type InputTuple = [ + user: AddressLike, + original_balance: BigNumberish, + original_supply: BigNumberish, + working_balance: BigNumberish, + working_supply: BigNumberish + ]; + export type OutputTuple = [ + user: string, + original_balance: bigint, + original_supply: bigint, + working_balance: bigint, + working_supply: bigint + ]; + export interface OutputObject { + user: string; + original_balance: bigint; + original_supply: bigint; + working_balance: bigint; + working_supply: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TransferEvent { + export type InputTuple = [ + _from: AddressLike, + _to: AddressLike, + _value: BigNumberish + ]; + export type OutputTuple = [_from: string, _to: string, _value: bigint]; + export interface OutputObject { + _from: string; + _to: string; + _value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ApprovalEvent { + export type InputTuple = [ + _owner: AddressLike, + _spender: AddressLike, + _value: BigNumberish + ]; + export type OutputTuple = [_owner: string, _spender: string, _value: bigint]; + export interface OutputObject { + _owner: string; + _spender: string; + _value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RewardDistributorUpdatedEvent { + export type InputTuple = [ + reward_token: AddressLike, + distributor: AddressLike + ]; + export type OutputTuple = [reward_token: string, distributor: string]; + export interface OutputObject { + reward_token: string; + distributor: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface FarmingToken extends BaseContract { + connect(runner?: ContractRunner | null): FarmingToken; + waitForDeployment(): Promise; + + interface: FarmingTokenInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + "deposit(uint256)": TypedContractMethod< + [_value: BigNumberish], + [void], + "nonpayable" + >; + + "deposit(uint256,address)": TypedContractMethod< + [_value: BigNumberish, _addr: AddressLike], + [void], + "nonpayable" + >; + + "deposit(uint256,address,bool)": TypedContractMethod< + [_value: BigNumberish, _addr: AddressLike, _claim_rewards: boolean], + [void], + "nonpayable" + >; + + "withdraw(uint256)": TypedContractMethod< + [_value: BigNumberish], + [void], + "nonpayable" + >; + + "withdraw(uint256,bool)": TypedContractMethod< + [_value: BigNumberish, _claim_rewards: boolean], + [void], + "nonpayable" + >; + + "claim_rewards()": TypedContractMethod<[], [void], "nonpayable">; + + "claim_rewards(address)": TypedContractMethod< + [_addr: AddressLike], + [void], + "nonpayable" + >; + + "claim_rewards(address,address)": TypedContractMethod< + [_addr: AddressLike, _receiver: AddressLike], + [void], + "nonpayable" + >; + + transferFrom: TypedContractMethod< + [_from: AddressLike, _to: AddressLike, _value: BigNumberish], + [boolean], + "nonpayable" + >; + + transfer: TypedContractMethod< + [_to: AddressLike, _value: BigNumberish], + [boolean], + "nonpayable" + >; + + approve: TypedContractMethod< + [_spender: AddressLike, _value: BigNumberish], + [boolean], + "nonpayable" + >; + + permit: TypedContractMethod< + [ + _owner: AddressLike, + _spender: AddressLike, + _value: BigNumberish, + _deadline: BigNumberish, + _v: BigNumberish, + _r: BytesLike, + _s: BytesLike + ], + [boolean], + "nonpayable" + >; + + increaseAllowance: TypedContractMethod< + [_spender: AddressLike, _added_value: BigNumberish], + [boolean], + "nonpayable" + >; + + decreaseAllowance: TypedContractMethod< + [_spender: AddressLike, _subtracted_value: BigNumberish], + [boolean], + "nonpayable" + >; + + user_checkpoint: TypedContractMethod< + [addr: AddressLike], + [boolean], + "nonpayable" + >; + + set_rewards_receiver: TypedContractMethod< + [_receiver: AddressLike], + [void], + "nonpayable" + >; + + kick: TypedContractMethod<[addr: AddressLike], [void], "nonpayable">; + + deposit_reward_token: TypedContractMethod< + [_reward_token: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + + add_reward: TypedContractMethod< + [_reward_token: AddressLike, _distributor: AddressLike], + [void], + "nonpayable" + >; + + set_reward_distributor: TypedContractMethod< + [_reward_token: AddressLike, _distributor: AddressLike], + [void], + "nonpayable" + >; + + killGauge: TypedContractMethod<[], [void], "nonpayable">; + + unkillGauge: TypedContractMethod<[], [void], "nonpayable">; + + claimed_reward: TypedContractMethod< + [_addr: AddressLike, _token: AddressLike], + [bigint], + "view" + >; + + claimable_reward: TypedContractMethod< + [_user: AddressLike, _reward_token: AddressLike], + [bigint], + "view" + >; + + claimable_tokens: TypedContractMethod< + [addr: AddressLike], + [bigint], + "nonpayable" + >; + + integrate_checkpoint: TypedContractMethod<[], [bigint], "view">; + + future_epoch_time: TypedContractMethod<[], [bigint], "view">; + + inflation_rate: TypedContractMethod<[], [bigint], "view">; + + decimals: TypedContractMethod<[], [bigint], "view">; + + version: TypedContractMethod<[], [string], "view">; + + allowance: TypedContractMethod< + [owner: AddressLike, spender: AddressLike], + [bigint], + "view" + >; + + initialize: TypedContractMethod< + [_lp_token: AddressLike], + [void], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + name: TypedContractMethod<[], [string], "view">; + + symbol: TypedContractMethod<[], [string], "view">; + + DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; + + nonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + lp_token: TypedContractMethod<[], [string], "view">; + + is_killed: TypedContractMethod<[], [boolean], "view">; + + reward_count: TypedContractMethod<[], [bigint], "view">; + + reward_data: TypedContractMethod< + [arg0: AddressLike], + [ + [string, string, bigint, bigint, bigint, bigint] & { + token: string; + distributor: string; + period_finish: bigint; + rate: bigint; + last_update: bigint; + integral: bigint; + } + ], + "view" + >; + + rewards_receiver: TypedContractMethod<[arg0: AddressLike], [string], "view">; + + reward_integral_for: TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + + working_balances: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + working_supply: TypedContractMethod<[], [bigint], "view">; + + integrate_inv_supply_of: TypedContractMethod< + [arg0: AddressLike], + [bigint], + "view" + >; + + integrate_checkpoint_of: TypedContractMethod< + [arg0: AddressLike], + [bigint], + "view" + >; + + integrate_fraction: TypedContractMethod< + [arg0: AddressLike], + [bigint], + "view" + >; + + period: TypedContractMethod<[], [bigint], "view">; + + reward_tokens: TypedContractMethod<[arg0: BigNumberish], [string], "view">; + + period_timestamp: TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + integrate_inv_supply: TypedContractMethod< + [arg0: BigNumberish], + [bigint], + "view" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "deposit(uint256)" + ): TypedContractMethod<[_value: BigNumberish], [void], "nonpayable">; + getFunction( + nameOrSignature: "deposit(uint256,address)" + ): TypedContractMethod< + [_value: BigNumberish, _addr: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "deposit(uint256,address,bool)" + ): TypedContractMethod< + [_value: BigNumberish, _addr: AddressLike, _claim_rewards: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "withdraw(uint256)" + ): TypedContractMethod<[_value: BigNumberish], [void], "nonpayable">; + getFunction( + nameOrSignature: "withdraw(uint256,bool)" + ): TypedContractMethod< + [_value: BigNumberish, _claim_rewards: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "claim_rewards()" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "claim_rewards(address)" + ): TypedContractMethod<[_addr: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "claim_rewards(address,address)" + ): TypedContractMethod< + [_addr: AddressLike, _receiver: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferFrom" + ): TypedContractMethod< + [_from: AddressLike, _to: AddressLike, _value: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transfer" + ): TypedContractMethod< + [_to: AddressLike, _value: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "approve" + ): TypedContractMethod< + [_spender: AddressLike, _value: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "permit" + ): TypedContractMethod< + [ + _owner: AddressLike, + _spender: AddressLike, + _value: BigNumberish, + _deadline: BigNumberish, + _v: BigNumberish, + _r: BytesLike, + _s: BytesLike + ], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "increaseAllowance" + ): TypedContractMethod< + [_spender: AddressLike, _added_value: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "decreaseAllowance" + ): TypedContractMethod< + [_spender: AddressLike, _subtracted_value: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "user_checkpoint" + ): TypedContractMethod<[addr: AddressLike], [boolean], "nonpayable">; + getFunction( + nameOrSignature: "set_rewards_receiver" + ): TypedContractMethod<[_receiver: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "kick" + ): TypedContractMethod<[addr: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "deposit_reward_token" + ): TypedContractMethod< + [_reward_token: AddressLike, _amount: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "add_reward" + ): TypedContractMethod< + [_reward_token: AddressLike, _distributor: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "set_reward_distributor" + ): TypedContractMethod< + [_reward_token: AddressLike, _distributor: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "killGauge" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "unkillGauge" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "claimed_reward" + ): TypedContractMethod< + [_addr: AddressLike, _token: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "claimable_reward" + ): TypedContractMethod< + [_user: AddressLike, _reward_token: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "claimable_tokens" + ): TypedContractMethod<[addr: AddressLike], [bigint], "nonpayable">; + getFunction( + nameOrSignature: "integrate_checkpoint" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "future_epoch_time" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "inflation_rate" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "decimals" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "version" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "allowance" + ): TypedContractMethod< + [owner: AddressLike, spender: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod<[_lp_token: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "balanceOf" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "totalSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "name" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "symbol" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "DOMAIN_SEPARATOR" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "nonces" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "lp_token" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "is_killed" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "reward_count" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "reward_data" + ): TypedContractMethod< + [arg0: AddressLike], + [ + [string, string, bigint, bigint, bigint, bigint] & { + token: string; + distributor: string; + period_finish: bigint; + rate: bigint; + last_update: bigint; + integral: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "rewards_receiver" + ): TypedContractMethod<[arg0: AddressLike], [string], "view">; + getFunction( + nameOrSignature: "reward_integral_for" + ): TypedContractMethod< + [arg0: AddressLike, arg1: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "working_balances" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "working_supply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "integrate_inv_supply_of" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "integrate_checkpoint_of" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "integrate_fraction" + ): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "period" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "reward_tokens" + ): TypedContractMethod<[arg0: BigNumberish], [string], "view">; + getFunction( + nameOrSignature: "period_timestamp" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "integrate_inv_supply" + ): TypedContractMethod<[arg0: BigNumberish], [bigint], "view">; + + getEvent( + key: "Deposit" + ): TypedContractEvent< + DepositEvent.InputTuple, + DepositEvent.OutputTuple, + DepositEvent.OutputObject + >; + getEvent( + key: "Withdraw" + ): TypedContractEvent< + WithdrawEvent.InputTuple, + WithdrawEvent.OutputTuple, + WithdrawEvent.OutputObject + >; + getEvent( + key: "UpdateLiquidityLimit" + ): TypedContractEvent< + UpdateLiquidityLimitEvent.InputTuple, + UpdateLiquidityLimitEvent.OutputTuple, + UpdateLiquidityLimitEvent.OutputObject + >; + getEvent( + key: "Transfer" + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + getEvent( + key: "Approval" + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "RewardDistributorUpdated" + ): TypedContractEvent< + RewardDistributorUpdatedEvent.InputTuple, + RewardDistributorUpdatedEvent.OutputTuple, + RewardDistributorUpdatedEvent.OutputObject + >; + + filters: { + "Deposit(address,uint256)": TypedContractEvent< + DepositEvent.InputTuple, + DepositEvent.OutputTuple, + DepositEvent.OutputObject + >; + Deposit: TypedContractEvent< + DepositEvent.InputTuple, + DepositEvent.OutputTuple, + DepositEvent.OutputObject + >; + + "Withdraw(address,uint256)": TypedContractEvent< + WithdrawEvent.InputTuple, + WithdrawEvent.OutputTuple, + WithdrawEvent.OutputObject + >; + Withdraw: TypedContractEvent< + WithdrawEvent.InputTuple, + WithdrawEvent.OutputTuple, + WithdrawEvent.OutputObject + >; + + "UpdateLiquidityLimit(address,uint256,uint256,uint256,uint256)": TypedContractEvent< + UpdateLiquidityLimitEvent.InputTuple, + UpdateLiquidityLimitEvent.OutputTuple, + UpdateLiquidityLimitEvent.OutputObject + >; + UpdateLiquidityLimit: TypedContractEvent< + UpdateLiquidityLimitEvent.InputTuple, + UpdateLiquidityLimitEvent.OutputTuple, + UpdateLiquidityLimitEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "RewardDistributorUpdated(address,address)": TypedContractEvent< + RewardDistributorUpdatedEvent.InputTuple, + RewardDistributorUpdatedEvent.OutputTuple, + RewardDistributorUpdatedEvent.OutputObject + >; + RewardDistributorUpdated: TypedContractEvent< + RewardDistributorUpdatedEvent.InputTuple, + RewardDistributorUpdatedEvent.OutputTuple, + RewardDistributorUpdatedEvent.OutputObject + >; + }; +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/bal-minter.json b/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/bal-minter.json new file mode 100644 index 000000000..3b75e6d82 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/bal-minter.json @@ -0,0 +1 @@ +[{"inputs":[{"internalType":"contract IBalancerTokenAdmin","name":"tokenAdmin","type":"address"},{"internalType":"contract IGaugeController","name":"gaugeController","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"address","name":"gauge","type":"address"},{"indexed":false,"internalType":"uint256","name":"minted","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"bool","name":"approval","type":"bool"}],"name":"MinterApprovalSet","type":"event"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"allowed_to_mint_for","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalancerToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBalancerTokenAdmin","outputs":[{"internalType":"contract IBalancerTokenAdmin","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getGaugeController","outputs":[{"internalType":"contract IGaugeController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"getMinterApproval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getNextNonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"mintFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"gauges","type":"address[]"}],"name":"mintMany","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"gauges","type":"address[]"},{"internalType":"address","name":"user","type":"address"}],"name":"mintManyFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"mint_for","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[8]","name":"gauges","type":"address[8]"}],"name":"mint_many","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"address","name":"gauge","type":"address"}],"name":"minted","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"approval","type":"bool"}],"name":"setMinterApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"},{"internalType":"bool","name":"approval","type":"bool"},{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"setMinterApprovalWithSignature","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"toggle_approve_mint","outputs":[],"stateMutability":"nonpayable","type":"function"}] \ No newline at end of file diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/farming-token.json b/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/farming-token.json new file mode 100644 index 000000000..8bf2b0391 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/farming-token.json @@ -0,0 +1 @@ +[{"name":"Deposit","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Withdraw","inputs":[{"name":"provider","type":"address","indexed":true},{"name":"value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"UpdateLiquidityLimit","inputs":[{"name":"user","type":"address","indexed":true},{"name":"original_balance","type":"uint256","indexed":false},{"name":"original_supply","type":"uint256","indexed":false},{"name":"working_balance","type":"uint256","indexed":false},{"name":"working_supply","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Transfer","inputs":[{"name":"_from","type":"address","indexed":true},{"name":"_to","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"Approval","inputs":[{"name":"_owner","type":"address","indexed":true},{"name":"_spender","type":"address","indexed":true},{"name":"_value","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"RewardDistributorUpdated","inputs":[{"name":"reward_token","type":"address","indexed":true},{"name":"distributor","type":"address","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"minter","type":"address"},{"name":"veBoostProxy","type":"address"},{"name":"authorizerAdaptor","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"},{"name":"_addr","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit","inputs":[{"name":"_value","type":"uint256"},{"name":"_addr","type":"address"},{"name":"_claim_rewards","type":"bool"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"withdraw","inputs":[{"name":"_value","type":"uint256"},{"name":"_claim_rewards","type":"bool"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[{"name":"_addr","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"claim_rewards","inputs":[{"name":"_addr","type":"address"},{"name":"_receiver","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"transferFrom","inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"transfer","inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"approve","inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"permit","inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_deadline","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"increaseAllowance","inputs":[{"name":"_spender","type":"address"},{"name":"_added_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"decreaseAllowance","inputs":[{"name":"_spender","type":"address"},{"name":"_subtracted_value","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"user_checkpoint","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"set_rewards_receiver","inputs":[{"name":"_receiver","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"kick","inputs":[{"name":"addr","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"deposit_reward_token","inputs":[{"name":"_reward_token","type":"address"},{"name":"_amount","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"add_reward","inputs":[{"name":"_reward_token","type":"address"},{"name":"_distributor","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"set_reward_distributor","inputs":[{"name":"_reward_token","type":"address"},{"name":"_distributor","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"killGauge","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"unkillGauge","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"claimed_reward","inputs":[{"name":"_addr","type":"address"},{"name":"_token","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"claimable_reward","inputs":[{"name":"_user","type":"address"},{"name":"_reward_token","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"claimable_tokens","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_checkpoint","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"future_epoch_time","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"inflation_rate","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"decimals","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"version","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"allowance","inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"initialize","inputs":[{"name":"_lp_token","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"balanceOf","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"totalSupply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"name","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"symbol","inputs":[],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"DOMAIN_SEPARATOR","inputs":[],"outputs":[{"name":"","type":"bytes32"}]},{"stateMutability":"view","type":"function","name":"nonces","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"lp_token","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"is_killed","inputs":[],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"view","type":"function","name":"reward_count","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"reward_data","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"token","type":"address"},{"name":"distributor","type":"address"},{"name":"period_finish","type":"uint256"},{"name":"rate","type":"uint256"},{"name":"last_update","type":"uint256"},{"name":"integral","type":"uint256"}]}]},{"stateMutability":"view","type":"function","name":"rewards_receiver","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"reward_integral_for","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"working_balances","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"working_supply","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_inv_supply_of","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_checkpoint_of","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_fraction","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"period","inputs":[],"outputs":[{"name":"","type":"int128"}]},{"stateMutability":"view","type":"function","name":"reward_tokens","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"period_timestamp","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"integrate_inv_supply","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]}] \ No newline at end of file diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/farming.json b/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/farming.json new file mode 100644 index 000000000..bf6f79c8b --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/abis/farming.json @@ -0,0 +1 @@ +[{"name":"AddType","inputs":[{"name":"name","type":"string","indexed":false},{"name":"type_id","type":"int128","indexed":false}],"anonymous":false,"type":"event"},{"name":"NewTypeWeight","inputs":[{"name":"type_id","type":"int128","indexed":false},{"name":"time","type":"uint256","indexed":false},{"name":"weight","type":"uint256","indexed":false},{"name":"total_weight","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"NewGaugeWeight","inputs":[{"name":"gauge_address","type":"address","indexed":false},{"name":"time","type":"uint256","indexed":false},{"name":"weight","type":"uint256","indexed":false},{"name":"total_weight","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"VoteForGauge","inputs":[{"name":"time","type":"uint256","indexed":false},{"name":"user","type":"address","indexed":false},{"name":"gauge_addr","type":"address","indexed":false},{"name":"weight","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"NewGauge","inputs":[{"name":"addr","type":"address","indexed":false},{"name":"gauge_type","type":"int128","indexed":false},{"name":"weight","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[{"name":"_voting_escrow","type":"address"},{"name":"_authorizer_adaptor","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"token","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"voting_escrow","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"gauge_exists","inputs":[{"name":"_addr","type":"address"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"view","type":"function","name":"gauge_types","inputs":[{"name":"_addr","type":"address"}],"outputs":[{"name":"","type":"int128"}]},{"stateMutability":"nonpayable","type":"function","name":"add_gauge","inputs":[{"name":"addr","type":"address"},{"name":"gauge_type","type":"int128"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"add_gauge","inputs":[{"name":"addr","type":"address"},{"name":"gauge_type","type":"int128"},{"name":"weight","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"checkpoint","inputs":[],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"checkpoint_gauge","inputs":[{"name":"addr","type":"address"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"gauge_relative_weight","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"gauge_relative_weight","inputs":[{"name":"addr","type":"address"},{"name":"time","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"gauge_relative_weight_write","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"gauge_relative_weight_write","inputs":[{"name":"addr","type":"address"},{"name":"time","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"nonpayable","type":"function","name":"add_type","inputs":[{"name":"_name","type":"string"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"add_type","inputs":[{"name":"_name","type":"string"},{"name":"weight","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"change_type_weight","inputs":[{"name":"type_id","type":"int128"},{"name":"weight","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"change_gauge_weight","inputs":[{"name":"addr","type":"address"},{"name":"weight","type":"uint256"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"vote_for_many_gauge_weights","inputs":[{"name":"_gauge_addrs","type":"address[8]"},{"name":"_user_weight","type":"uint256[8]"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"vote_for_gauge_weights","inputs":[{"name":"_gauge_addr","type":"address"},{"name":"_user_weight","type":"uint256"}],"outputs":[]},{"stateMutability":"view","type":"function","name":"get_gauge_weight","inputs":[{"name":"addr","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_type_weight","inputs":[{"name":"type_id","type":"int128"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_total_weight","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"get_weights_sum_per_type","inputs":[{"name":"type_id","type":"int128"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"n_gauge_types","inputs":[],"outputs":[{"name":"","type":"int128"}]},{"stateMutability":"view","type":"function","name":"n_gauges","inputs":[],"outputs":[{"name":"","type":"int128"}]},{"stateMutability":"view","type":"function","name":"gauge_type_names","inputs":[{"name":"arg0","type":"int128"}],"outputs":[{"name":"","type":"string"}]},{"stateMutability":"view","type":"function","name":"gauges","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"vote_user_slopes","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"slope","type":"uint256"},{"name":"power","type":"uint256"},{"name":"end","type":"uint256"}]}]},{"stateMutability":"view","type":"function","name":"vote_user_power","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"last_user_vote","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"points_weight","inputs":[{"name":"arg0","type":"address"},{"name":"arg1","type":"uint256"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"bias","type":"uint256"},{"name":"slope","type":"uint256"}]}]},{"stateMutability":"view","type":"function","name":"time_weight","inputs":[{"name":"arg0","type":"address"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"points_sum","inputs":[{"name":"arg0","type":"int128"},{"name":"arg1","type":"uint256"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"bias","type":"uint256"},{"name":"slope","type":"uint256"}]}]},{"stateMutability":"view","type":"function","name":"time_sum","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"points_total","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"time_total","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"points_type_weight","inputs":[{"name":"arg0","type":"int128"},{"name":"arg1","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"time_type_weight","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"uint256"}]}] \ No newline at end of file diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/BalMinter__factory.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/BalMinter__factory.ts new file mode 100644 index 000000000..5fd222f73 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/BalMinter__factory.ts @@ -0,0 +1,419 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { BalMinter, BalMinterInterface } from "../BalMinter"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract IBalancerTokenAdmin", + name: "tokenAdmin", + type: "address", + }, + { + internalType: "contract IGaugeController", + name: "gaugeController", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "gauge", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "minted", + type: "uint256", + }, + ], + name: "Minted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "minter", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approval", + type: "bool", + }, + ], + name: "MinterApprovalSet", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "minter", + type: "address", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "allowed_to_mint_for", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBalancerToken", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBalancerTokenAdmin", + outputs: [ + { + internalType: "contract IBalancerTokenAdmin", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getDomainSeparator", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getGaugeController", + outputs: [ + { + internalType: "contract IGaugeController", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "minter", + type: "address", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "getMinterApproval", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "getNextNonce", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "gauge", + type: "address", + }, + ], + name: "mint", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "gauge", + type: "address", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "mintFor", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "gauges", + type: "address[]", + }, + ], + name: "mintMany", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "gauges", + type: "address[]", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "mintManyFor", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "gauge", + type: "address", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "mint_for", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address[8]", + name: "gauges", + type: "address[8]", + }, + ], + name: "mint_many", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "address", + name: "gauge", + type: "address", + }, + ], + name: "minted", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "minter", + type: "address", + }, + { + internalType: "bool", + name: "approval", + type: "bool", + }, + ], + name: "setMinterApproval", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "minter", + type: "address", + }, + { + internalType: "bool", + name: "approval", + type: "bool", + }, + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + ], + name: "setMinterApprovalWithSignature", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "minter", + type: "address", + }, + ], + name: "toggle_approve_mint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class BalMinter__factory { + static readonly abi = _abi; + static createInterface(): BalMinterInterface { + return new Interface(_abi) as BalMinterInterface; + } + static connect(address: string, runner?: ContractRunner | null): BalMinter { + return new Contract(address, _abi, runner) as unknown as BalMinter; + } +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/FarmingToken__factory.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/FarmingToken__factory.ts new file mode 100644 index 000000000..a004d4f92 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/FarmingToken__factory.ts @@ -0,0 +1,1026 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { FarmingToken, FarmingTokenInterface } from "../FarmingToken"; + +const _abi = [ + { + name: "Deposit", + inputs: [ + { + name: "provider", + type: "address", + indexed: true, + }, + { + name: "value", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "Withdraw", + inputs: [ + { + name: "provider", + type: "address", + indexed: true, + }, + { + name: "value", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "UpdateLiquidityLimit", + inputs: [ + { + name: "user", + type: "address", + indexed: true, + }, + { + name: "original_balance", + type: "uint256", + indexed: false, + }, + { + name: "original_supply", + type: "uint256", + indexed: false, + }, + { + name: "working_balance", + type: "uint256", + indexed: false, + }, + { + name: "working_supply", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "Transfer", + inputs: [ + { + name: "_from", + type: "address", + indexed: true, + }, + { + name: "_to", + type: "address", + indexed: true, + }, + { + name: "_value", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "Approval", + inputs: [ + { + name: "_owner", + type: "address", + indexed: true, + }, + { + name: "_spender", + type: "address", + indexed: true, + }, + { + name: "_value", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "RewardDistributorUpdated", + inputs: [ + { + name: "reward_token", + type: "address", + indexed: true, + }, + { + name: "distributor", + type: "address", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { + name: "minter", + type: "address", + }, + { + name: "veBoostProxy", + type: "address", + }, + { + name: "authorizerAdaptor", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "deposit", + inputs: [ + { + name: "_value", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "deposit", + inputs: [ + { + name: "_value", + type: "uint256", + }, + { + name: "_addr", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "deposit", + inputs: [ + { + name: "_value", + type: "uint256", + }, + { + name: "_addr", + type: "address", + }, + { + name: "_claim_rewards", + type: "bool", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "withdraw", + inputs: [ + { + name: "_value", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "withdraw", + inputs: [ + { + name: "_value", + type: "uint256", + }, + { + name: "_claim_rewards", + type: "bool", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "claim_rewards", + inputs: [], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "claim_rewards", + inputs: [ + { + name: "_addr", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "claim_rewards", + inputs: [ + { + name: "_addr", + type: "address", + }, + { + name: "_receiver", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "transferFrom", + inputs: [ + { + name: "_from", + type: "address", + }, + { + name: "_to", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "transfer", + inputs: [ + { + name: "_to", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "approve", + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "permit", + inputs: [ + { + name: "_owner", + type: "address", + }, + { + name: "_spender", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + { + name: "_deadline", + type: "uint256", + }, + { + name: "_v", + type: "uint8", + }, + { + name: "_r", + type: "bytes32", + }, + { + name: "_s", + type: "bytes32", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "increaseAllowance", + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_added_value", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "decreaseAllowance", + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_subtracted_value", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "user_checkpoint", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "set_rewards_receiver", + inputs: [ + { + name: "_receiver", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "kick", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "deposit_reward_token", + inputs: [ + { + name: "_reward_token", + type: "address", + }, + { + name: "_amount", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "add_reward", + inputs: [ + { + name: "_reward_token", + type: "address", + }, + { + name: "_distributor", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "set_reward_distributor", + inputs: [ + { + name: "_reward_token", + type: "address", + }, + { + name: "_distributor", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "killGauge", + inputs: [], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "unkillGauge", + inputs: [], + outputs: [], + }, + { + stateMutability: "view", + type: "function", + name: "claimed_reward", + inputs: [ + { + name: "_addr", + type: "address", + }, + { + name: "_token", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "claimable_reward", + inputs: [ + { + name: "_user", + type: "address", + }, + { + name: "_reward_token", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "claimable_tokens", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "integrate_checkpoint", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "future_epoch_time", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "inflation_rate", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "decimals", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "version", + inputs: [], + outputs: [ + { + name: "", + type: "string", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "allowance", + inputs: [ + { + name: "owner", + type: "address", + }, + { + name: "spender", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "initialize", + inputs: [ + { + name: "_lp_token", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "view", + type: "function", + name: "balanceOf", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "totalSupply", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "name", + inputs: [], + outputs: [ + { + name: "", + type: "string", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "symbol", + inputs: [], + outputs: [ + { + name: "", + type: "string", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "DOMAIN_SEPARATOR", + inputs: [], + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "nonces", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "lp_token", + inputs: [], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "is_killed", + inputs: [], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "reward_count", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "reward_data", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "tuple", + components: [ + { + name: "token", + type: "address", + }, + { + name: "distributor", + type: "address", + }, + { + name: "period_finish", + type: "uint256", + }, + { + name: "rate", + type: "uint256", + }, + { + name: "last_update", + type: "uint256", + }, + { + name: "integral", + type: "uint256", + }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "rewards_receiver", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "reward_integral_for", + inputs: [ + { + name: "arg0", + type: "address", + }, + { + name: "arg1", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "working_balances", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "working_supply", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "integrate_inv_supply_of", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "integrate_checkpoint_of", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "integrate_fraction", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "period", + inputs: [], + outputs: [ + { + name: "", + type: "int128", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "reward_tokens", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "period_timestamp", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "integrate_inv_supply", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, +] as const; + +export class FarmingToken__factory { + static readonly abi = _abi; + static createInterface(): FarmingTokenInterface { + return new Interface(_abi) as FarmingTokenInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): FarmingToken { + return new Contract(address, _abi, runner) as unknown as FarmingToken; + } +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/Farming__factory.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/Farming__factory.ts new file mode 100644 index 000000000..dddbaf1f5 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/Farming__factory.ts @@ -0,0 +1,804 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { Farming, FarmingInterface } from "../Farming"; + +const _abi = [ + { + name: "AddType", + inputs: [ + { + name: "name", + type: "string", + indexed: false, + }, + { + name: "type_id", + type: "int128", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "NewTypeWeight", + inputs: [ + { + name: "type_id", + type: "int128", + indexed: false, + }, + { + name: "time", + type: "uint256", + indexed: false, + }, + { + name: "weight", + type: "uint256", + indexed: false, + }, + { + name: "total_weight", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "NewGaugeWeight", + inputs: [ + { + name: "gauge_address", + type: "address", + indexed: false, + }, + { + name: "time", + type: "uint256", + indexed: false, + }, + { + name: "weight", + type: "uint256", + indexed: false, + }, + { + name: "total_weight", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "VoteForGauge", + inputs: [ + { + name: "time", + type: "uint256", + indexed: false, + }, + { + name: "user", + type: "address", + indexed: false, + }, + { + name: "gauge_addr", + type: "address", + indexed: false, + }, + { + name: "weight", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + name: "NewGauge", + inputs: [ + { + name: "addr", + type: "address", + indexed: false, + }, + { + name: "gauge_type", + type: "int128", + indexed: false, + }, + { + name: "weight", + type: "uint256", + indexed: false, + }, + ], + anonymous: false, + type: "event", + }, + { + stateMutability: "nonpayable", + type: "constructor", + inputs: [ + { + name: "_voting_escrow", + type: "address", + }, + { + name: "_authorizer_adaptor", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "view", + type: "function", + name: "token", + inputs: [], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "voting_escrow", + inputs: [], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "admin", + inputs: [], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "gauge_exists", + inputs: [ + { + name: "_addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "bool", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "gauge_types", + inputs: [ + { + name: "_addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "int128", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "add_gauge", + inputs: [ + { + name: "addr", + type: "address", + }, + { + name: "gauge_type", + type: "int128", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "add_gauge", + inputs: [ + { + name: "addr", + type: "address", + }, + { + name: "gauge_type", + type: "int128", + }, + { + name: "weight", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "checkpoint", + inputs: [], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "checkpoint_gauge", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [], + }, + { + stateMutability: "view", + type: "function", + name: "gauge_relative_weight", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "gauge_relative_weight", + inputs: [ + { + name: "addr", + type: "address", + }, + { + name: "time", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "gauge_relative_weight_write", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "gauge_relative_weight_write", + inputs: [ + { + name: "addr", + type: "address", + }, + { + name: "time", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "add_type", + inputs: [ + { + name: "_name", + type: "string", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "add_type", + inputs: [ + { + name: "_name", + type: "string", + }, + { + name: "weight", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "change_type_weight", + inputs: [ + { + name: "type_id", + type: "int128", + }, + { + name: "weight", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "change_gauge_weight", + inputs: [ + { + name: "addr", + type: "address", + }, + { + name: "weight", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "vote_for_many_gauge_weights", + inputs: [ + { + name: "_gauge_addrs", + type: "address[8]", + }, + { + name: "_user_weight", + type: "uint256[8]", + }, + ], + outputs: [], + }, + { + stateMutability: "nonpayable", + type: "function", + name: "vote_for_gauge_weights", + inputs: [ + { + name: "_gauge_addr", + type: "address", + }, + { + name: "_user_weight", + type: "uint256", + }, + ], + outputs: [], + }, + { + stateMutability: "view", + type: "function", + name: "get_gauge_weight", + inputs: [ + { + name: "addr", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "get_type_weight", + inputs: [ + { + name: "type_id", + type: "int128", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "get_total_weight", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "get_weights_sum_per_type", + inputs: [ + { + name: "type_id", + type: "int128", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "n_gauge_types", + inputs: [], + outputs: [ + { + name: "", + type: "int128", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "n_gauges", + inputs: [], + outputs: [ + { + name: "", + type: "int128", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "gauge_type_names", + inputs: [ + { + name: "arg0", + type: "int128", + }, + ], + outputs: [ + { + name: "", + type: "string", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "gauges", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "address", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "vote_user_slopes", + inputs: [ + { + name: "arg0", + type: "address", + }, + { + name: "arg1", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "tuple", + components: [ + { + name: "slope", + type: "uint256", + }, + { + name: "power", + type: "uint256", + }, + { + name: "end", + type: "uint256", + }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "vote_user_power", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "last_user_vote", + inputs: [ + { + name: "arg0", + type: "address", + }, + { + name: "arg1", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "points_weight", + inputs: [ + { + name: "arg0", + type: "address", + }, + { + name: "arg1", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "tuple", + components: [ + { + name: "bias", + type: "uint256", + }, + { + name: "slope", + type: "uint256", + }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "time_weight", + inputs: [ + { + name: "arg0", + type: "address", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "points_sum", + inputs: [ + { + name: "arg0", + type: "int128", + }, + { + name: "arg1", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "tuple", + components: [ + { + name: "bias", + type: "uint256", + }, + { + name: "slope", + type: "uint256", + }, + ], + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "time_sum", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "points_total", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "time_total", + inputs: [], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "points_type_weight", + inputs: [ + { + name: "arg0", + type: "int128", + }, + { + name: "arg1", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, + { + stateMutability: "view", + type: "function", + name: "time_type_weight", + inputs: [ + { + name: "arg0", + type: "uint256", + }, + ], + outputs: [ + { + name: "", + type: "uint256", + }, + ], + }, +] as const; + +export class Farming__factory { + static readonly abi = _abi; + static createInterface(): FarmingInterface { + return new Interface(_abi) as FarmingInterface; + } + static connect(address: string, runner?: ContractRunner | null): Farming { + return new Contract(address, _abi, runner) as unknown as Farming; + } +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/index.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/index.ts index 0053d3d5d..d7e0e2b9c 100644 --- a/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/index.ts +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/factories/index.ts @@ -1,4 +1,7 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export { BalMinter__factory } from "./BalMinter__factory"; +export { Farming__factory } from "./Farming__factory"; +export { FarmingToken__factory } from "./FarmingToken__factory"; export { Vault__factory } from "./Vault__factory"; diff --git a/packages/adapters-library/src/adapters/balancer-v2/contracts/index.ts b/packages/adapters-library/src/adapters/balancer-v2/contracts/index.ts index 886761b65..d1cadd06b 100644 --- a/packages/adapters-library/src/adapters/balancer-v2/contracts/index.ts +++ b/packages/adapters-library/src/adapters/balancer-v2/contracts/index.ts @@ -1,6 +1,12 @@ /* Autogenerated file. Do not edit manually. */ /* tslint:disable */ /* eslint-disable */ +export type { BalMinter } from "./BalMinter"; +export type { Farming } from "./Farming"; +export type { FarmingToken } from "./FarmingToken"; export type { Vault } from "./Vault"; export * as factories from "./factories"; +export { BalMinter__factory } from "./factories/BalMinter__factory"; +export { FarmingToken__factory } from "./factories/FarmingToken__factory"; +export { Farming__factory } from "./factories/Farming__factory"; export { Vault__factory } from "./factories/Vault__factory"; diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/farming/balancerV2FarmingAdapter.ts b/packages/adapters-library/src/adapters/balancer-v2/products/farming/balancerV2FarmingAdapter.ts new file mode 100644 index 000000000..dd00e6fa7 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/products/farming/balancerV2FarmingAdapter.ts @@ -0,0 +1,232 @@ +import { getAddress } from 'ethers' +import { AdaptersController } from '../../../../core/adaptersController' +import { Chain } from '../../../../core/constants/chains' +import { CacheToDb } from '../../../../core/decorators/cacheToDb' +import { NotImplementedError } from '../../../../core/errors/errors' +import { CustomJsonRpcProvider } from '../../../../core/provider/CustomJsonRpcProvider' +import { logger } from '../../../../core/utils/logger' +import { Helpers } from '../../../../scripts/helpers' +import { + IProtocolAdapter, + ProtocolToken, +} from '../../../../types/IProtocolAdapter' +import { + AssetType, + GetEventsInput, + GetPositionsInput, + GetRewardPositionsInput, + GetTotalValueLockedInput, + MovementsByBlock, + MovementsByBlockReward, + PositionType, + ProtocolAdapterParams, + ProtocolDetails, + ProtocolPosition, + ProtocolTokenTvl, + TokenType, + Underlying, + UnderlyingReward, + UnwrapExchangeRate, + UnwrapInput, +} from '../../../../types/adapter' +import { Erc20Metadata } from '../../../../types/erc20Metadata' +import { Protocol } from '../../../protocols' +import { + BalMinter__factory, + FarmingToken__factory, + Farming__factory, +} from '../../contracts' + +type AdditionalMetadata = { + rewardTokens: Erc20Metadata[] +} + +export class BalancerV2FarmingAdapter implements IProtocolAdapter { + productId = 'farming' + protocolId: Protocol + chainId: Chain + helpers: Helpers + + adapterSettings = { + enablePositionDetectionByProtocolTokenTransfer: true, + includeInUnwrap: true, + } + + private provider: CustomJsonRpcProvider + + adaptersController: AdaptersController + + constructor({ + provider, + chainId, + protocolId, + adaptersController, + helpers, + }: ProtocolAdapterParams) { + this.provider = provider + this.chainId = chainId + this.protocolId = protocolId + this.adaptersController = adaptersController + this.helpers = helpers + } + + /** + * Update me. + * Add your protocol details + */ + getProtocolDetails(): ProtocolDetails { + return { + protocolId: this.protocolId, + name: 'BalancerV2', + description: 'BalancerV2 defi adapter', + siteUrl: 'https:', + iconUrl: 'https://', + positionType: PositionType.Supply, + chainId: this.chainId, + productId: this.productId, + } + } + + @CacheToDb + async getProtocolTokens(): Promise[]> { + const farmingAddress = '0xC128468b7Ce63eA702C1f104D55A2566b13D3ABD' + const balancerToken = await this.helpers.getTokenMetadata( + '0xba100000625a3754423978a60c9317c58a424e3d', + ) + + const farmingContract = Farming__factory.connect( + farmingAddress, + this.provider, + ) + + const count = await farmingContract.n_gauges() + + const protocolTokens: ProtocolToken[] = [] + + await Promise.all( + Array.from({ length: Number(count) }, async (_, i) => { + try { + const gaugeAddress = await farmingContract.gauges(i) + const gaugeContract = FarmingToken__factory.connect( + gaugeAddress, + this.provider, + ) + + const protocolToken = + await this.helpers.getTokenMetadata(gaugeAddress) + const underlyingTokenAddress = await gaugeContract.lp_token() + const underlyingToken = await this.helpers.getTokenMetadata( + underlyingTokenAddress, + ) + protocolTokens.push({ + ...protocolToken, + underlyingTokens: [underlyingToken], + rewardTokens: [balancerToken], + }) + } catch (error) { + logger.debug( + `Failed to process gauge at index ${i}: ${ + (error as Error).message + }`, + ) + } + }), + ) + + console.log(protocolTokens) + + return protocolTokens + } + + private async getProtocolTokenByAddress(protocolTokenAddress: string) { + return this.helpers.getProtocolTokenByAddress({ + protocolTokens: await this.getProtocolTokens(), + protocolTokenAddress, + }) + } + + async getPositions(input: GetPositionsInput): Promise { + return this.helpers.getBalanceOfTokens({ + ...input, + protocolTokens: await this.getProtocolTokens(), + }) + } + + async getWithdrawals({ + protocolTokenAddress, + fromBlock, + toBlock, + userAddress, + }: GetEventsInput): Promise { + return this.helpers.withdrawals({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + filter: { fromBlock, toBlock, userAddress }, + }) + } + + async getDeposits({ + protocolTokenAddress, + fromBlock, + toBlock, + userAddress, + }: GetEventsInput): Promise { + return this.helpers.deposits({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + filter: { fromBlock, toBlock, userAddress }, + }) + } + + async getTotalValueLocked({ + protocolTokenAddresses, + blockNumber, + }: GetTotalValueLockedInput): Promise { + const protocolTokens = await this.getProtocolTokens() + + return await this.helpers.tvl({ + protocolTokens, + filterProtocolTokenAddresses: protocolTokenAddresses, + blockNumber, + }) + } + + async unwrap({ + protocolTokenAddress, + tokenId, + blockNumber, + }: UnwrapInput): Promise { + return this.helpers.unwrapOneToOne({ + protocolToken: await this.getProtocolTokenByAddress(protocolTokenAddress), + underlyingTokens: ( + await this.getProtocolTokenByAddress(protocolTokenAddress) + ).underlyingTokens, + }) + } + + async getRewardPositions({ + userAddress, + protocolTokenAddress, + blockNumber, + tokenId, + }: GetRewardPositionsInput): Promise { + const balancerMinter = BalMinter__factory.connect( + '0x239e55F427D44C3cc793f49bFB507ebe76638a2b', + this.provider, + ) + + const { rewardTokens } = + await this.getProtocolTokenByAddress(protocolTokenAddress) + + if (!rewardTokens || rewardTokens.length === 0) { + return [] + } + + const balanceRaw = await balancerMinter.mint.staticCall( + protocolTokenAddress, + { blockTag: blockNumber, from: userAddress }, + ) + + return [ + { ...rewardTokens[0]!, balanceRaw, type: TokenType.UnderlyingClaimable }, + ] + } +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/farming/tests/snapshots/ethereum.positions.farming.json b/packages/adapters-library/src/adapters/balancer-v2/products/farming/tests/snapshots/ethereum.positions.farming.json new file mode 100644 index 000000000..f9393ddc5 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/products/farming/tests/snapshots/ethereum.positions.farming.json @@ -0,0 +1,101 @@ +{ + "blockNumber": 21271033, + "latency": "Latency: 0 seconds", + "aggregatedValues": ["USD6,052.64"], + "snapshot": [ + { + "protocolId": "balancer-v2", + "name": "BalancerV2", + "description": "BalancerV2 defi adapter", + "siteUrl": "https:", + "iconUrl": "https://", + "positionType": "supply", + "chainId": 1, + "productId": "farming", + "chainName": "ethereum", + "success": true, + "tokens": [ + { + "address": "0x275dF57d2B23d53e20322b4bb71Bf1dCb21D0A00", + "name": "Balancer 50WETH-50AURA Gauge Deposit", + "symbol": "50WETH-50AURA-gauge", + "decimals": 18, + "balanceRaw": "170391182246230452284n", + "type": "protocol", + "tokens": [ + { + "address": "0xba100000625a3754423978a60c9317c58a424e3D", + "name": "Balancer", + "symbol": "BAL", + "decimals": 18, + "balanceRaw": "29788762905686532196n", + "type": "underlying-claimable", + "balance": 29.788762905686532, + "price": 2.5798840674916845, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xba100000625a3754423978a60c9317c58a424e3D/logo.png" + }, + { + "address": "0xCfCA23cA9CA720B6E98E3Eb9B6aa0fFC4a5C08B9", + "name": "50WETH-50AURA", + "symbol": "50WETH-50AURA", + "decimals": 18, + "type": "underlying", + "balanceRaw": "170391182246230452284n", + "tokens": [ + { + "address": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", + "name": "Wrapped Ether", + "symbol": "WETH", + "decimals": 18, + "type": "underlying", + "balanceRaw": "939867335472840601n", + "balance": 0.9398673354728406, + "price": 3380.7701, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png" + }, + { + "address": "0xC0c293ce456fF0ED870ADd98a0828Dd4d2903DBF", + "name": "Aura", + "symbol": "AURA", + "decimals": 18, + "type": "underlying", + "balanceRaw": "9333765961857726899106n", + "balance": 9333.765961857727, + "price": 0.2998053258820348, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC0c293ce456fF0ED870ADd98a0828Dd4d2903DBF/logo.png" + } + ], + "balance": 170.39118224623044, + "price": 35.070994008358376, + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xCfCA23cA9CA720B6E98E3Eb9B6aa0fFC4a5C08B9/logo.png" + } + ], + "balance": 170.39118224623044 + } + ] + } + ], + "rpcResponses": { + "ed331133a76a6ca503449fe0ada6f413": { + "result": "0x0000000000000000000000000000000000000000000000093ca7157b5569683c" + }, + "b78c48807cadbc5932042b4389d5c0e3": { + "result": "0x0000000000000000000000000000000000000000000000019d66f208fbc76064" + }, + "0cc6e4e0a57f49307ffdbe6ef1e3d36d": { + "result": "0x0000000000000000000000000000000000000000000000070000000000000b540000000000000000000000000000000000000000000000000000004eb6f5c8500000000000000000000000000000000000000000000000000000000067458f260000000000000000000000000000000000000000000000000000000067458f3b0000000000000000000000000000000000000000000000070000000000000b54" + }, + "406de85044aa6e1963df504a7ea46b46": { + "result": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000014491e40000000000000000000000000000000000000000000000000000000000000002000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000c0c293ce456ff0ed870add98a0828dd4d2903dbf0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000017cee2d8eb53876fb8000000000000000000000000000000000000000000039b954b62b2dab3d86dc8" + }, + "a566d830ca28eb1bbf1eecb2ffcddd1f": { + "result": "0x0000000000000000000000000000000000000000000000000002b60a54e724ae" + }, + "470fa70a21cbbe35d6db0bba8d331d8f": { + "result": "0x0000000000000000000000000000000000000000000010dc3efacd8770eb22ed" + }, + "52e2c3c7267df53713965ef464917c60": { + "result": "0x000000000000000000000000000000000000000000000000000050a753ce1ad4" + } + } +} diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/farming/tests/testCases.ts b/packages/adapters-library/src/adapters/balancer-v2/products/farming/tests/testCases.ts new file mode 100644 index 000000000..a544d51b2 --- /dev/null +++ b/packages/adapters-library/src/adapters/balancer-v2/products/farming/tests/testCases.ts @@ -0,0 +1,17 @@ +import { Chain } from '../../../../../core/constants/chains' +import { TimePeriod } from '../../../../../core/constants/timePeriod' +import type { TestCase } from '../../../../../types/testCase' + +export const testCases: TestCase[] = [ + { + chainId: Chain.Ethereum, + method: 'positions', + key: 'farming', + input: { + userAddress: '0x9e3F12527831E59760D79E17a36CE695998F2afB', + filterProtocolTokens: ['0x275dF57d2B23d53e20322b4bb71Bf1dCb21D0A00'], + }, + + blockNumber: 21271033, + }, +] diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/pool/balancerV2PoolAdapter.ts b/packages/adapters-library/src/adapters/balancer-v2/products/pool/balancerV2PoolAdapter.ts index 85da251d0..6624b7448 100644 --- a/packages/adapters-library/src/adapters/balancer-v2/products/pool/balancerV2PoolAdapter.ts +++ b/packages/adapters-library/src/adapters/balancer-v2/products/pool/balancerV2PoolAdapter.ts @@ -32,7 +32,7 @@ import { filterMapAsync } from '../../../../core/utils/filters' import { Erc20Metadata } from '../../../../types/erc20Metadata' import { Vault__factory } from '../../contracts' -const vaultAAddress = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' +const vaultAddress = '0xBA12222222228d8Ba445958a75a0704d566BF2C8' type AdditionalMetadata = { poolId: string } @@ -84,7 +84,7 @@ export class BalancerV2PoolAdapter implements IProtocolAdapter { @CacheToDb async getProtocolTokens(): Promise[]> { - const vault = Vault__factory.connect(vaultAAddress, this.provider) + const vault = Vault__factory.connect(vaultAddress, this.provider) const filter = await vault.filters.PoolRegistered() @@ -191,7 +191,7 @@ export class BalancerV2PoolAdapter implements IProtocolAdapter { await this.getProtocolTokenByAddress(protocolTokenAddress) // Connect to Vault contract - const vault = Vault__factory.connect(vaultAAddress, this.provider) + const vault = Vault__factory.connect(vaultAddress, this.provider) // Fetch underlying token balances from the pool const tokenData = await vault.getPoolTokens(poolId, { diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.3.json b/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.3.json index 8594ea941..dc33fd14b 100644 --- a/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.3.json +++ b/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.3.json @@ -102,9 +102,6 @@ } ], "rpcResponses": { - "0c43f9d0b645e67747b811d8ee94cfc6": { - "result": "0x144913e" - }, "abaa1cb183efcbff52d9b4a9c311a109": { "result": "0x00000000000000000000000000000000000000000000000089f1008d9d44c031" }, diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.json b/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.json index c5e91633d..9cd73d08c 100644 --- a/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.json +++ b/packages/adapters-library/src/adapters/balancer-v2/products/pool/tests/snapshots/ethereum.positions.json @@ -98,18 +98,18 @@ "dd053d50c2ad8f7f8619aef234271e01": { "result": "0x000000000000000000000000000000000000000000000001edbda4ba47e311f1" }, - "0c42b53469ed066749d2ed56773696b8": { - "result": "0x0000000000000000000000000000000000000000000000070000000000000a710000000000000000000000000000000000000000000000000000004e1e798e440000000000000000000000000000000000000000000000000000000067404f6e0000000000000000000000000000000000000000000000000000000067404f830000000000000000000000000000000000000000000000070000000000000a71" - }, - "160ecf3b98fdcd9674702fefa6773a6a": { - "result": "0x0000000000000000000000000000000000000000000000000000001c2714ce9f" - }, "c186a1e53978ca00fbf94453139643f6": { "result": "0x000000000000000000000000000000000000000000000000000000000746d2c1" }, + "0c42b53469ed066749d2ed56773696b8": { + "result": "0x0000000000000000000000000000000000000000000000070000000000000a710000000000000000000000000000000000000000000000000000004e1e798e440000000000000000000000000000000000000000000000000000000067404f6e0000000000000000000000000000000000000000000000000000000067404f830000000000000000000000000000000000000000000000070000000000000a71" + }, "a74d239b15735a4622bee6d6f304c79f": { "result": "0x0000000000000000000000000000000000000000000000000000000000000000" }, + "160ecf3b98fdcd9674702fefa6773a6a": { + "result": "0x0000000000000000000000000000000000000000000000000000001c2714ce9f" + }, "5c404d8a8d7ec85853b925339c98ec4c": { "result": "0x00000000000000000000000000000000000000000000000928f6f0368ec9f07a" }, diff --git a/packages/adapters-library/src/adapters/balancer-v2/products/vesting/tests/snapshots/ethereum.positions.2.json b/packages/adapters-library/src/adapters/balancer-v2/products/vesting/tests/snapshots/ethereum.positions.2.json index 713c53d51..39ea69847 100644 --- a/packages/adapters-library/src/adapters/balancer-v2/products/vesting/tests/snapshots/ethereum.positions.2.json +++ b/packages/adapters-library/src/adapters/balancer-v2/products/vesting/tests/snapshots/ethereum.positions.2.json @@ -179,14 +179,20 @@ "c6443e715cde299579704a591e917756": { "result": "0x000000000000000000000000000000000000000000000007000000000000091b000000000000000000000000000000000000000000000000000000468eb5f48000000000000000000000000000000000000000000000000000000000673766e100000000000000000000000000000000000000000000000000000000673766f3000000000000000000000000000000000000000000000007000000000000091b" }, - "5e41d8306257bacd879bb10edc27625e": { - "result": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000129f25900000000000000000000000000000000000000000000000000000000000000030000000000000000000000002f4eb100552ef93840d5adc30560e5513dfffacb000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000f8fd466f12e236f4c96f7cce6c79eadb819abf580000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000fffffffed91de12dc1e09196d1380000000000000000000000000000000000000000000000000000000001fd15d20000000000000000000000000000000000000000000000000000000000000001" + "1ab3f4b8cb83198de71ad236d9fecc91": { + "result": "0x0000000000000000000000000000000000000000000000000002550063766b07" + }, + "4407192925b018b26ad5e70c748eeca2": { + "result": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000129f253000000000000000000000000000000000000000000000000000000000000000300000000000000000000000082698aecc9e28e9bb27608bd52cf57f704bd1b83000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000d093fa4fb80d09bb30817fdcd442d4d02ed3e5de0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000fffffffd94fae72039445e1de3cb00000000000000000000000000000000000000000000000000000000018c3a3d0000000000000000000000000000000000000000000000000000000000000000" }, "9d2356243d2c5505071069eb1d34f317": { "result": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000001302543000000000000000000000000000000000000000000000000000000000000000300000000000000000000000002d60b84491589974263d922d9cc7a3152618ef60000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000ae37d54ae477268b9997d4161b96b8200755935c0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000011501becd2f9fb7af00000000000000000000000000000000000000000000000082d0f9edbe79b020c000000000000000000000000000000000000ffffffff7f21eac65caffbeb0746" }, - "4407192925b018b26ad5e70c748eeca2": { - "result": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000129f253000000000000000000000000000000000000000000000000000000000000000300000000000000000000000082698aecc9e28e9bb27608bd52cf57f704bd1b83000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000d093fa4fb80d09bb30817fdcd442d4d02ed3e5de0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000fffffffd94fae72039445e1de3cb00000000000000000000000000000000000000000000000000000000018c3a3d0000000000000000000000000000000000000000000000000000000000000000" + "5e41d8306257bacd879bb10edc27625e": { + "result": "0x000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000129f25900000000000000000000000000000000000000000000000000000000000000030000000000000000000000002f4eb100552ef93840d5adc30560e5513dfffacb000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000f8fd466f12e236f4c96f7cce6c79eadb819abf580000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000fffffffed91de12dc1e09196d1380000000000000000000000000000000000000000000000000000000001fd15d20000000000000000000000000000000000000000000000000000000000000001" + }, + "033bb2e6a6bf6a2eeab042ff37ce8e5a": { + "result": "0x000000000000000000000000000000000000ffffffff7f530235e799206feb42" }, "389cf0b39a800c194a558a0058ad9202": { "result": "0x000000000000000000000000000000000000fffffffed953d9d44330871e147c" @@ -194,23 +200,17 @@ "41f526774015f3f2913fc0a82c62850f": { "result": "0x000000000000000000000000000000000000fffffffd95fb0bce8530b2e6658d" }, - "033bb2e6a6bf6a2eeab042ff37ce8e5a": { - "result": "0x000000000000000000000000000000000000ffffffff7f530235e799206feb42" - }, - "1ab3f4b8cb83198de71ad236d9fecc91": { - "result": "0x0000000000000000000000000000000000000000000000000002550063766b07" - }, "9467b33f4797a01ca227761c60465bee": { "result": "0x0000000000000000000000000000000000000000000000000000000000000000" }, "5e398386ac6704d741e9ed398f89fa1c": { "result": "0x00000000000000000000000000000000000000000000000000012cab3ec95e3b" }, - "c13137e44f1b0bcb25f0648c86b0fca6": { - "result": "0x00000000000000000000000000000000000000000111312b5e15454c2981df1c" - }, "3182ca43df14aa9748799332af11b483": { "result": "0x000000000000000000000000000000000000000001106b756889c9941c794b46" + }, + "c13137e44f1b0bcb25f0648c86b0fca6": { + "result": "0x00000000000000000000000000000000000000000111312b5e15454c2981df1c" } } } diff --git a/packages/adapters-library/src/adapters/integration.test.ts b/packages/adapters-library/src/adapters/integration.test.ts index 56bc5eaca..6897e9d91 100644 --- a/packages/adapters-library/src/adapters/integration.test.ts +++ b/packages/adapters-library/src/adapters/integration.test.ts @@ -24,6 +24,7 @@ import { testCases as aaveV3StableDebtTokenTestCases } from './aave-v3/products/ import { testCases as aaveV3StakingTestCases } from './aave-v3/products/staking/tests/testCases' import { testCases as aaveV3VariableDebtTokenTestCases } from './aave-v3/products/variable-debt-token/tests/testCases' import { testCases as angleProtocolSavingsTestCases } from './angle-protocol/products/savings/tests/testCases' +import { testCases as balancerV2FarmingTestCases } from './balancer-v2/products/farming/tests/testCases' import { testCases as balancerV2PoolTestCases } from './balancer-v2/products/pool/tests/testCases' import { testCases as balancerV2VestingTestCases } from './balancer-v2/products/vesting/tests/testCases' import { testCases as beefyCowTokenTestCases } from './beefy/products/cow-token/tests/testCases' @@ -162,6 +163,7 @@ const allTestCases: Record> = { [Protocol.BalancerV2]: { ['pool']: balancerV2PoolTestCases, + ['farming']: balancerV2FarmingTestCases, ['vesting']: balancerV2VestingTestCases, }, diff --git a/packages/adapters-library/src/adapters/supportedProtocols.ts b/packages/adapters-library/src/adapters/supportedProtocols.ts index 2e9c67439..d63559252 100644 --- a/packages/adapters-library/src/adapters/supportedProtocols.ts +++ b/packages/adapters-library/src/adapters/supportedProtocols.ts @@ -149,6 +149,8 @@ import { DineroPxEthAdapter } from './dinero/products/px-eth/dineroPxEthAdapter' import { BalancerV2PoolAdapter } from './balancer-v2/products/pool/balancerV2PoolAdapter' import { DineroApxEthAdapter } from './dinero/products/apx-eth/dineroApxEthAdapter' +import { BalancerV2FarmingAdapter } from './balancer-v2/products/farming/balancerV2FarmingAdapter' + export const supportedProtocols: Record< Protocol, Partial< @@ -231,7 +233,11 @@ export const supportedProtocols: Record< }, [Protocol.BalancerV2]: { - [Chain.Ethereum]: [BalancerV2VestingAdapter, BalancerV2PoolAdapter], + [Chain.Ethereum]: [ + BalancerV2VestingAdapter, + BalancerV2PoolAdapter, + BalancerV2FarmingAdapter, + ], [Chain.Optimism]: [BalancerV2PoolAdapter], [Chain.Avalanche]: [BalancerV2PoolAdapter], [Chain.Polygon]: [BalancerV2PoolAdapter],