diff --git a/src/adapters/chimp-exchange/contracts/BalancerPoolDataQueries.ts b/src/adapters/chimp-exchange/contracts/BalancerPoolDataQueries.ts new file mode 100644 index 000000000..a34d255ff --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/BalancerPoolDataQueries.ts @@ -0,0 +1,469 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type PoolDataQueryConfigStruct = { + loadTokenBalanceUpdatesAfterBlock: boolean; + loadTotalSupply: boolean; + loadSwapFees: boolean; + loadLinearWrappedTokenRates: boolean; + loadLinearTargets: boolean; + loadNormalizedWeights: boolean; + loadScalingFactors: boolean; + loadAmps: boolean; + loadRates: boolean; + blockNumber: BigNumberish; + totalSupplyTypes: BigNumberish[]; + swapFeeTypes: BigNumberish[]; + linearPoolIdxs: BigNumberish[]; + weightedPoolIdxs: BigNumberish[]; + scalingFactorPoolIdxs: BigNumberish[]; + ampPoolIdxs: BigNumberish[]; + ratePoolIdxs: BigNumberish[]; +}; + +export type PoolDataQueryConfigStructOutput = [ + loadTokenBalanceUpdatesAfterBlock: boolean, + loadTotalSupply: boolean, + loadSwapFees: boolean, + loadLinearWrappedTokenRates: boolean, + loadLinearTargets: boolean, + loadNormalizedWeights: boolean, + loadScalingFactors: boolean, + loadAmps: boolean, + loadRates: boolean, + blockNumber: bigint, + totalSupplyTypes: bigint[], + swapFeeTypes: bigint[], + linearPoolIdxs: bigint[], + weightedPoolIdxs: bigint[], + scalingFactorPoolIdxs: bigint[], + ampPoolIdxs: bigint[], + ratePoolIdxs: bigint[] +] & { + loadTokenBalanceUpdatesAfterBlock: boolean; + loadTotalSupply: boolean; + loadSwapFees: boolean; + loadLinearWrappedTokenRates: boolean; + loadLinearTargets: boolean; + loadNormalizedWeights: boolean; + loadScalingFactors: boolean; + loadAmps: boolean; + loadRates: boolean; + blockNumber: bigint; + totalSupplyTypes: bigint[]; + swapFeeTypes: bigint[]; + linearPoolIdxs: bigint[]; + weightedPoolIdxs: bigint[]; + scalingFactorPoolIdxs: bigint[]; + ampPoolIdxs: bigint[]; + ratePoolIdxs: bigint[]; +}; + +export type PoolStatusQueryConfigStruct = { + loadInRecoveryMode: boolean; + loadIsPaused: boolean; +}; + +export type PoolStatusQueryConfigStructOutput = [ + loadInRecoveryMode: boolean, + loadIsPaused: boolean +] & { loadInRecoveryMode: boolean; loadIsPaused: boolean }; + +export interface BalancerPoolDataQueriesInterface extends Interface { + getFunction( + nameOrSignature: + | "getAmpForPools" + | "getInRecoveryModeForPools" + | "getIsPausedForPools" + | "getLinearTargetsForPools" + | "getNormalizedWeightsForPools" + | "getPoolData" + | "getPoolStatus" + | "getPoolTokenBalancesWithUpdatesAfterBlock" + | "getRateForPools" + | "getScalingFactorsForPools" + | "getSwapFeePercentageForPools" + | "getTotalSupplyForPools" + | "getWrappedTokenRateForLinearPools" + | "vault" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "getAmpForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getInRecoveryModeForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getIsPausedForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getLinearTargetsForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getNormalizedWeightsForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getPoolData", + values: [BytesLike[], PoolDataQueryConfigStruct] + ): string; + encodeFunctionData( + functionFragment: "getPoolStatus", + values: [BytesLike[], PoolStatusQueryConfigStruct] + ): string; + encodeFunctionData( + functionFragment: "getPoolTokenBalancesWithUpdatesAfterBlock", + values: [BytesLike[], BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getRateForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getScalingFactorsForPools", + values: [AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getSwapFeePercentageForPools", + values: [AddressLike[], BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "getTotalSupplyForPools", + values: [AddressLike[], BigNumberish[]] + ): string; + encodeFunctionData( + functionFragment: "getWrappedTokenRateForLinearPools", + values: [AddressLike[]] + ): string; + encodeFunctionData(functionFragment: "vault", values?: undefined): string; + + decodeFunctionResult( + functionFragment: "getAmpForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getInRecoveryModeForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getIsPausedForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLinearTargetsForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getNormalizedWeightsForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPoolData", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPoolStatus", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPoolTokenBalancesWithUpdatesAfterBlock", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRateForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getScalingFactorsForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSwapFeePercentageForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getTotalSupplyForPools", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getWrappedTokenRateForLinearPools", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "vault", data: BytesLike): Result; +} + +export interface BalancerPoolDataQueries extends BaseContract { + connect(runner?: ContractRunner | null): BalancerPoolDataQueries; + waitForDeployment(): Promise; + + interface: BalancerPoolDataQueriesInterface; + + 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; + + getAmpForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [bigint[]], + "view" + >; + + getInRecoveryModeForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [boolean[]], + "view" + >; + + getIsPausedForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [boolean[]], + "view" + >; + + getLinearTargetsForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [bigint[][]], + "view" + >; + + getNormalizedWeightsForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [bigint[][]], + "view" + >; + + getPoolData: TypedContractMethod< + [poolIds: BytesLike[], config: PoolDataQueryConfigStruct], + [ + [ + bigint[][], + bigint[], + bigint[], + bigint[], + bigint[][], + bigint[][], + bigint[][], + bigint[], + bigint[], + bigint[] + ] & { + balances: bigint[][]; + totalSupplies: bigint[]; + swapFees: bigint[]; + linearWrappedTokenRates: bigint[]; + linearTargets: bigint[][]; + weights: bigint[][]; + scalingFactors: bigint[][]; + amps: bigint[]; + rates: bigint[]; + ignoreIdxs: bigint[]; + } + ], + "view" + >; + + getPoolStatus: TypedContractMethod< + [poolIds: BytesLike[], config: PoolStatusQueryConfigStruct], + [ + [boolean[], boolean[]] & { + isPaused: boolean[]; + inRecoveryMode: boolean[]; + } + ], + "view" + >; + + getPoolTokenBalancesWithUpdatesAfterBlock: TypedContractMethod< + [poolIds: BytesLike[], blockNumber: BigNumberish], + [bigint[][]], + "view" + >; + + getRateForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [bigint[]], + "view" + >; + + getScalingFactorsForPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [bigint[][]], + "view" + >; + + getSwapFeePercentageForPools: TypedContractMethod< + [poolAddresses: AddressLike[], swapFeeTypes: BigNumberish[]], + [bigint[]], + "view" + >; + + getTotalSupplyForPools: TypedContractMethod< + [poolAddresses: AddressLike[], totalSupplyTypes: BigNumberish[]], + [bigint[]], + "view" + >; + + getWrappedTokenRateForLinearPools: TypedContractMethod< + [poolAddresses: AddressLike[]], + [bigint[]], + "view" + >; + + vault: TypedContractMethod<[], [string], "view">; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "getAmpForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [bigint[]], "view">; + getFunction( + nameOrSignature: "getInRecoveryModeForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [boolean[]], "view">; + getFunction( + nameOrSignature: "getIsPausedForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [boolean[]], "view">; + getFunction( + nameOrSignature: "getLinearTargetsForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [bigint[][]], "view">; + getFunction( + nameOrSignature: "getNormalizedWeightsForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [bigint[][]], "view">; + getFunction( + nameOrSignature: "getPoolData" + ): TypedContractMethod< + [poolIds: BytesLike[], config: PoolDataQueryConfigStruct], + [ + [ + bigint[][], + bigint[], + bigint[], + bigint[], + bigint[][], + bigint[][], + bigint[][], + bigint[], + bigint[], + bigint[] + ] & { + balances: bigint[][]; + totalSupplies: bigint[]; + swapFees: bigint[]; + linearWrappedTokenRates: bigint[]; + linearTargets: bigint[][]; + weights: bigint[][]; + scalingFactors: bigint[][]; + amps: bigint[]; + rates: bigint[]; + ignoreIdxs: bigint[]; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getPoolStatus" + ): TypedContractMethod< + [poolIds: BytesLike[], config: PoolStatusQueryConfigStruct], + [ + [boolean[], boolean[]] & { + isPaused: boolean[]; + inRecoveryMode: boolean[]; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getPoolTokenBalancesWithUpdatesAfterBlock" + ): TypedContractMethod< + [poolIds: BytesLike[], blockNumber: BigNumberish], + [bigint[][]], + "view" + >; + getFunction( + nameOrSignature: "getRateForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [bigint[]], "view">; + getFunction( + nameOrSignature: "getScalingFactorsForPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [bigint[][]], "view">; + getFunction( + nameOrSignature: "getSwapFeePercentageForPools" + ): TypedContractMethod< + [poolAddresses: AddressLike[], swapFeeTypes: BigNumberish[]], + [bigint[]], + "view" + >; + getFunction( + nameOrSignature: "getTotalSupplyForPools" + ): TypedContractMethod< + [poolAddresses: AddressLike[], totalSupplyTypes: BigNumberish[]], + [bigint[]], + "view" + >; + getFunction( + nameOrSignature: "getWrappedTokenRateForLinearPools" + ): TypedContractMethod<[poolAddresses: AddressLike[]], [bigint[]], "view">; + getFunction( + nameOrSignature: "vault" + ): TypedContractMethod<[], [string], "view">; + + filters: {}; +} diff --git a/src/adapters/chimp-exchange/contracts/Pool.ts b/src/adapters/chimp-exchange/contracts/Pool.ts new file mode 100644 index 000000000..5362ca2f3 --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/Pool.ts @@ -0,0 +1,1200 @@ +/* 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 declare namespace WeightedPool { + export type NewPoolParamsStruct = { + name: string; + symbol: string; + tokens: AddressLike[]; + normalizedWeights: BigNumberish[]; + rateProviders: AddressLike[]; + assetManagers: AddressLike[]; + swapFeePercentage: BigNumberish; + }; + + export type NewPoolParamsStructOutput = [ + name: string, + symbol: string, + tokens: string[], + normalizedWeights: bigint[], + rateProviders: string[], + assetManagers: string[], + swapFeePercentage: bigint + ] & { + name: string; + symbol: string; + tokens: string[]; + normalizedWeights: bigint[]; + rateProviders: string[]; + assetManagers: string[]; + swapFeePercentage: bigint; + }; +} + +export declare namespace IPoolSwapStructs { + export type SwapRequestStruct = { + kind: BigNumberish; + tokenIn: AddressLike; + tokenOut: AddressLike; + amount: BigNumberish; + poolId: BytesLike; + lastChangeBlock: BigNumberish; + from: AddressLike; + to: AddressLike; + userData: BytesLike; + }; + + export type SwapRequestStructOutput = [ + kind: bigint, + tokenIn: string, + tokenOut: string, + amount: bigint, + poolId: string, + lastChangeBlock: bigint, + from: string, + to: string, + userData: string + ] & { + kind: bigint; + tokenIn: string; + tokenOut: string; + amount: bigint; + poolId: string; + lastChangeBlock: bigint; + from: string; + to: string; + userData: string; + }; +} + +export interface PoolInterface extends Interface { + getFunction( + nameOrSignature: + | "DOMAIN_SEPARATOR" + | "allowance" + | "approve" + | "balanceOf" + | "decimals" + | "decreaseAllowance" + | "disableRecoveryMode" + | "enableRecoveryMode" + | "getATHRateProduct" + | "getActionId" + | "getActualSupply" + | "getAuthorizer" + | "getDomainSeparator" + | "getInvariant" + | "getLastPostJoinExitInvariant" + | "getNextNonce" + | "getNormalizedWeights" + | "getOwner" + | "getPausedState" + | "getPoolId" + | "getProtocolFeePercentageCache" + | "getProtocolFeesCollector" + | "getProviderFeeId" + | "getRateProviders" + | "getScalingFactors" + | "getSwapFeePercentage" + | "getVault" + | "inRecoveryMode" + | "increaseAllowance" + | "name" + | "nonces" + | "onExitPool" + | "onJoinPool" + | "onSwap" + | "pause" + | "permit" + | "queryExit" + | "queryJoin" + | "setSwapFeePercentage" + | "symbol" + | "totalSupply" + | "transfer" + | "transferFrom" + | "unpause" + | "updateProtocolFeePercentageCache" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "ATHRateProductUpdated" + | "Approval" + | "PausedStateChanged" + | "ProtocolFeePercentageCacheUpdated" + | "RecoveryModeStateChanged" + | "SwapFeePercentageChanged" + | "Transfer" + ): EventFragment; + + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "disableRecoveryMode", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "enableRecoveryMode", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getATHRateProduct", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getActionId", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getActualSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getAuthorizer", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getDomainSeparator", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getInvariant", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getLastPostJoinExitInvariant", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getNextNonce", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getNormalizedWeights", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "getOwner", values?: undefined): string; + encodeFunctionData( + functionFragment: "getPausedState", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "getPoolId", values?: undefined): string; + encodeFunctionData( + functionFragment: "getProtocolFeePercentageCache", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getProtocolFeesCollector", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getProviderFeeId", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getRateProviders", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getScalingFactors", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getSwapFeePercentage", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "getVault", values?: undefined): string; + encodeFunctionData( + functionFragment: "inRecoveryMode", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "onExitPool", + values: [ + BytesLike, + AddressLike, + AddressLike, + BigNumberish[], + BigNumberish, + BigNumberish, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "onJoinPool", + values: [ + BytesLike, + AddressLike, + AddressLike, + BigNumberish[], + BigNumberish, + BigNumberish, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "onSwap", + values: [IPoolSwapStructs.SwapRequestStruct, BigNumberish, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "pause", values?: undefined): string; + encodeFunctionData( + functionFragment: "permit", + values: [ + AddressLike, + AddressLike, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "queryExit", + values: [ + BytesLike, + AddressLike, + AddressLike, + BigNumberish[], + BigNumberish, + BigNumberish, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "queryJoin", + values: [ + BytesLike, + AddressLike, + AddressLike, + BigNumberish[], + BigNumberish, + BigNumberish, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "setSwapFeePercentage", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "unpause", values?: undefined): string; + encodeFunctionData( + functionFragment: "updateProtocolFeePercentageCache", + values?: undefined + ): string; + + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "disableRecoveryMode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "enableRecoveryMode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getATHRateProduct", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getActionId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getActualSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAuthorizer", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDomainSeparator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getInvariant", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLastPostJoinExitInvariant", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getNextNonce", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getNormalizedWeights", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getOwner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getPausedState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getPoolId", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getProtocolFeePercentageCache", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProtocolFeesCollector", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProviderFeeId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getRateProviders", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getScalingFactors", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSwapFeePercentage", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getVault", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "inRecoveryMode", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "onExitPool", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "onJoinPool", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "onSwap", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "pause", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "queryExit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "queryJoin", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setSwapFeePercentage", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "unpause", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "updateProtocolFeePercentageCache", + data: BytesLike + ): Result; +} + +export namespace ATHRateProductUpdatedEvent { + export type InputTuple = [ + oldATHRateProduct: BigNumberish, + newATHRateProduct: BigNumberish + ]; + export type OutputTuple = [ + oldATHRateProduct: bigint, + newATHRateProduct: bigint + ]; + export interface OutputObject { + oldATHRateProduct: bigint; + newATHRateProduct: 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 PausedStateChangedEvent { + export type InputTuple = [paused: boolean]; + export type OutputTuple = [paused: boolean]; + export interface OutputObject { + paused: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ProtocolFeePercentageCacheUpdatedEvent { + export type InputTuple = [feeCache: BytesLike]; + export type OutputTuple = [feeCache: string]; + export interface OutputObject { + feeCache: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RecoveryModeStateChangedEvent { + export type InputTuple = [enabled: boolean]; + export type OutputTuple = [enabled: boolean]; + export interface OutputObject { + enabled: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SwapFeePercentageChangedEvent { + export type InputTuple = [swapFeePercentage: BigNumberish]; + export type OutputTuple = [swapFeePercentage: bigint]; + export interface OutputObject { + swapFeePercentage: 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 interface Pool extends BaseContract { + connect(runner?: ContractRunner | null): Pool; + waitForDeployment(): Promise; + + interface: PoolInterface; + + 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; + + DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; + + allowance: TypedContractMethod< + [owner: AddressLike, spender: AddressLike], + [bigint], + "view" + >; + + approve: TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[account: AddressLike], [bigint], "view">; + + decimals: TypedContractMethod<[], [bigint], "view">; + + decreaseAllowance: TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + disableRecoveryMode: TypedContractMethod<[], [void], "nonpayable">; + + enableRecoveryMode: TypedContractMethod<[], [void], "nonpayable">; + + getATHRateProduct: TypedContractMethod<[], [bigint], "view">; + + getActionId: TypedContractMethod<[selector: BytesLike], [string], "view">; + + getActualSupply: TypedContractMethod<[], [bigint], "view">; + + getAuthorizer: TypedContractMethod<[], [string], "view">; + + getDomainSeparator: TypedContractMethod<[], [string], "view">; + + getInvariant: TypedContractMethod<[], [bigint], "view">; + + getLastPostJoinExitInvariant: TypedContractMethod<[], [bigint], "view">; + + getNextNonce: TypedContractMethod<[account: AddressLike], [bigint], "view">; + + getNormalizedWeights: TypedContractMethod<[], [bigint[]], "view">; + + getOwner: TypedContractMethod<[], [string], "view">; + + getPausedState: TypedContractMethod< + [], + [ + [boolean, bigint, bigint] & { + paused: boolean; + pauseWindowEndTime: bigint; + bufferPeriodEndTime: bigint; + } + ], + "view" + >; + + getPoolId: TypedContractMethod<[], [string], "view">; + + getProtocolFeePercentageCache: TypedContractMethod< + [feeType: BigNumberish], + [bigint], + "view" + >; + + getProtocolFeesCollector: TypedContractMethod<[], [string], "view">; + + getProviderFeeId: TypedContractMethod< + [feeType: BigNumberish], + [bigint], + "view" + >; + + getRateProviders: TypedContractMethod<[], [string[]], "view">; + + getScalingFactors: TypedContractMethod<[], [bigint[]], "view">; + + getSwapFeePercentage: TypedContractMethod<[], [bigint], "view">; + + getVault: TypedContractMethod<[], [string], "view">; + + inRecoveryMode: TypedContractMethod<[], [boolean], "view">; + + increaseAllowance: TypedContractMethod< + [spender: AddressLike, addedValue: BigNumberish], + [boolean], + "nonpayable" + >; + + name: TypedContractMethod<[], [string], "view">; + + nonces: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + onExitPool: TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint[], bigint[]]], + "nonpayable" + >; + + onJoinPool: TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint[], bigint[]]], + "nonpayable" + >; + + onSwap: TypedContractMethod< + [ + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish + ], + [bigint], + "nonpayable" + >; + + pause: TypedContractMethod<[], [void], "nonpayable">; + + permit: TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + + queryExit: TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint, bigint[]] & { bptIn: bigint; amountsOut: bigint[] }], + "view" + >; + + queryJoin: TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint, bigint[]] & { bptOut: bigint; amountsIn: bigint[] }], + "view" + >; + + setSwapFeePercentage: TypedContractMethod< + [swapFeePercentage: BigNumberish], + [void], + "nonpayable" + >; + + symbol: TypedContractMethod<[], [string], "view">; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + transfer: TypedContractMethod< + [recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + transferFrom: TypedContractMethod< + [sender: AddressLike, recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + unpause: TypedContractMethod<[], [void], "nonpayable">; + + updateProtocolFeePercentageCache: TypedContractMethod< + [], + [void], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "DOMAIN_SEPARATOR" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "allowance" + ): TypedContractMethod< + [owner: AddressLike, spender: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "approve" + ): TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "balanceOf" + ): TypedContractMethod<[account: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "decimals" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "decreaseAllowance" + ): TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "disableRecoveryMode" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "enableRecoveryMode" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "getATHRateProduct" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getActionId" + ): TypedContractMethod<[selector: BytesLike], [string], "view">; + getFunction( + nameOrSignature: "getActualSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getAuthorizer" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getDomainSeparator" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getInvariant" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getLastPostJoinExitInvariant" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getNextNonce" + ): TypedContractMethod<[account: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "getNormalizedWeights" + ): TypedContractMethod<[], [bigint[]], "view">; + getFunction( + nameOrSignature: "getOwner" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getPausedState" + ): TypedContractMethod< + [], + [ + [boolean, bigint, bigint] & { + paused: boolean; + pauseWindowEndTime: bigint; + bufferPeriodEndTime: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getPoolId" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getProtocolFeePercentageCache" + ): TypedContractMethod<[feeType: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getProtocolFeesCollector" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getProviderFeeId" + ): TypedContractMethod<[feeType: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getRateProviders" + ): TypedContractMethod<[], [string[]], "view">; + getFunction( + nameOrSignature: "getScalingFactors" + ): TypedContractMethod<[], [bigint[]], "view">; + getFunction( + nameOrSignature: "getSwapFeePercentage" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getVault" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "inRecoveryMode" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "increaseAllowance" + ): TypedContractMethod< + [spender: AddressLike, addedValue: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "name" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "nonces" + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "onExitPool" + ): TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint[], bigint[]]], + "nonpayable" + >; + getFunction( + nameOrSignature: "onJoinPool" + ): TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint[], bigint[]]], + "nonpayable" + >; + getFunction( + nameOrSignature: "onSwap" + ): TypedContractMethod< + [ + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish + ], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "pause" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "permit" + ): TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "queryExit" + ): TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint, bigint[]] & { bptIn: bigint; amountsOut: bigint[] }], + "view" + >; + getFunction( + nameOrSignature: "queryJoin" + ): TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike + ], + [[bigint, bigint[]] & { bptOut: bigint; amountsIn: bigint[] }], + "view" + >; + getFunction( + nameOrSignature: "setSwapFeePercentage" + ): TypedContractMethod< + [swapFeePercentage: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "symbol" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "totalSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transfer" + ): TypedContractMethod< + [recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferFrom" + ): TypedContractMethod< + [sender: AddressLike, recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "unpause" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "updateProtocolFeePercentageCache" + ): TypedContractMethod<[], [void], "nonpayable">; + + getEvent( + key: "ATHRateProductUpdated" + ): TypedContractEvent< + ATHRateProductUpdatedEvent.InputTuple, + ATHRateProductUpdatedEvent.OutputTuple, + ATHRateProductUpdatedEvent.OutputObject + >; + getEvent( + key: "Approval" + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "PausedStateChanged" + ): TypedContractEvent< + PausedStateChangedEvent.InputTuple, + PausedStateChangedEvent.OutputTuple, + PausedStateChangedEvent.OutputObject + >; + getEvent( + key: "ProtocolFeePercentageCacheUpdated" + ): TypedContractEvent< + ProtocolFeePercentageCacheUpdatedEvent.InputTuple, + ProtocolFeePercentageCacheUpdatedEvent.OutputTuple, + ProtocolFeePercentageCacheUpdatedEvent.OutputObject + >; + getEvent( + key: "RecoveryModeStateChanged" + ): TypedContractEvent< + RecoveryModeStateChangedEvent.InputTuple, + RecoveryModeStateChangedEvent.OutputTuple, + RecoveryModeStateChangedEvent.OutputObject + >; + getEvent( + key: "SwapFeePercentageChanged" + ): TypedContractEvent< + SwapFeePercentageChangedEvent.InputTuple, + SwapFeePercentageChangedEvent.OutputTuple, + SwapFeePercentageChangedEvent.OutputObject + >; + getEvent( + key: "Transfer" + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + filters: { + "ATHRateProductUpdated(uint256,uint256)": TypedContractEvent< + ATHRateProductUpdatedEvent.InputTuple, + ATHRateProductUpdatedEvent.OutputTuple, + ATHRateProductUpdatedEvent.OutputObject + >; + ATHRateProductUpdated: TypedContractEvent< + ATHRateProductUpdatedEvent.InputTuple, + ATHRateProductUpdatedEvent.OutputTuple, + ATHRateProductUpdatedEvent.OutputObject + >; + + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "PausedStateChanged(bool)": TypedContractEvent< + PausedStateChangedEvent.InputTuple, + PausedStateChangedEvent.OutputTuple, + PausedStateChangedEvent.OutputObject + >; + PausedStateChanged: TypedContractEvent< + PausedStateChangedEvent.InputTuple, + PausedStateChangedEvent.OutputTuple, + PausedStateChangedEvent.OutputObject + >; + + "ProtocolFeePercentageCacheUpdated(bytes32)": TypedContractEvent< + ProtocolFeePercentageCacheUpdatedEvent.InputTuple, + ProtocolFeePercentageCacheUpdatedEvent.OutputTuple, + ProtocolFeePercentageCacheUpdatedEvent.OutputObject + >; + ProtocolFeePercentageCacheUpdated: TypedContractEvent< + ProtocolFeePercentageCacheUpdatedEvent.InputTuple, + ProtocolFeePercentageCacheUpdatedEvent.OutputTuple, + ProtocolFeePercentageCacheUpdatedEvent.OutputObject + >; + + "RecoveryModeStateChanged(bool)": TypedContractEvent< + RecoveryModeStateChangedEvent.InputTuple, + RecoveryModeStateChangedEvent.OutputTuple, + RecoveryModeStateChangedEvent.OutputObject + >; + RecoveryModeStateChanged: TypedContractEvent< + RecoveryModeStateChangedEvent.InputTuple, + RecoveryModeStateChangedEvent.OutputTuple, + RecoveryModeStateChangedEvent.OutputObject + >; + + "SwapFeePercentageChanged(uint256)": TypedContractEvent< + SwapFeePercentageChangedEvent.InputTuple, + SwapFeePercentageChangedEvent.OutputTuple, + SwapFeePercentageChangedEvent.OutputObject + >; + SwapFeePercentageChanged: TypedContractEvent< + SwapFeePercentageChangedEvent.InputTuple, + SwapFeePercentageChangedEvent.OutputTuple, + SwapFeePercentageChangedEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + }; +} diff --git a/src/adapters/chimp-exchange/contracts/Vault.ts b/src/adapters/chimp-exchange/contracts/Vault.ts new file mode 100755 index 000000000..d31a5393e --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/Vault.ts @@ -0,0 +1,1303 @@ +/* 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 declare namespace IVault { + export type BatchSwapStepStruct = { + poolId: BytesLike; + assetInIndex: BigNumberish; + assetOutIndex: BigNumberish; + amount: BigNumberish; + userData: BytesLike; + }; + + export type BatchSwapStepStructOutput = [ + poolId: string, + assetInIndex: bigint, + assetOutIndex: bigint, + amount: bigint, + userData: string + ] & { + poolId: string; + assetInIndex: bigint; + assetOutIndex: bigint; + amount: bigint; + userData: string; + }; + + export type FundManagementStruct = { + sender: AddressLike; + fromInternalBalance: boolean; + recipient: AddressLike; + toInternalBalance: boolean; + }; + + export type FundManagementStructOutput = [ + sender: string, + fromInternalBalance: boolean, + recipient: string, + toInternalBalance: boolean + ] & { + sender: string; + fromInternalBalance: boolean; + recipient: string; + toInternalBalance: boolean; + }; + + export type ExitPoolRequestStruct = { + assets: AddressLike[]; + minAmountsOut: BigNumberish[]; + userData: BytesLike; + toInternalBalance: boolean; + }; + + export type ExitPoolRequestStructOutput = [ + assets: string[], + minAmountsOut: bigint[], + userData: string, + toInternalBalance: boolean + ] & { + assets: string[]; + minAmountsOut: bigint[]; + userData: string; + toInternalBalance: boolean; + }; + + export type JoinPoolRequestStruct = { + assets: AddressLike[]; + maxAmountsIn: BigNumberish[]; + userData: BytesLike; + fromInternalBalance: boolean; + }; + + export type JoinPoolRequestStructOutput = [ + assets: string[], + maxAmountsIn: bigint[], + userData: string, + fromInternalBalance: boolean + ] & { + assets: string[]; + maxAmountsIn: bigint[]; + userData: string; + fromInternalBalance: boolean; + }; + + export type PoolBalanceOpStruct = { + kind: BigNumberish; + poolId: BytesLike; + token: AddressLike; + amount: BigNumberish; + }; + + export type PoolBalanceOpStructOutput = [ + kind: bigint, + poolId: string, + token: string, + amount: bigint + ] & { kind: bigint; poolId: string; token: string; amount: bigint }; + + export type UserBalanceOpStruct = { + kind: BigNumberish; + asset: AddressLike; + amount: BigNumberish; + sender: AddressLike; + recipient: AddressLike; + }; + + export type UserBalanceOpStructOutput = [ + kind: bigint, + asset: string, + amount: bigint, + sender: string, + recipient: string + ] & { + kind: bigint; + asset: string; + amount: bigint; + sender: string; + recipient: string; + }; + + export type SingleSwapStruct = { + poolId: BytesLike; + kind: BigNumberish; + assetIn: AddressLike; + assetOut: AddressLike; + amount: BigNumberish; + userData: BytesLike; + }; + + export type SingleSwapStructOutput = [ + poolId: string, + kind: bigint, + assetIn: string, + assetOut: string, + amount: bigint, + userData: string + ] & { + poolId: string; + kind: bigint; + assetIn: string; + assetOut: string; + amount: bigint; + userData: string; + }; +} + +export interface VaultInterface extends Interface { + getFunction( + nameOrSignature: + | "WETH" + | "batchSwap" + | "deregisterTokens" + | "exitPool" + | "flashLoan" + | "getActionId" + | "getAuthorizer" + | "getDomainSeparator" + | "getInternalBalance" + | "getNextNonce" + | "getPausedState" + | "getPool" + | "getPoolTokenInfo" + | "getPoolTokens" + | "getProtocolFeesCollector" + | "hasApprovedRelayer" + | "joinPool" + | "managePoolBalance" + | "manageUserBalance" + | "queryBatchSwap" + | "registerPool" + | "registerTokens" + | "setAuthorizer" + | "setPaused" + | "setRelayerApproval" + | "swap" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "AuthorizerChanged" + | "ExternalBalanceTransfer" + | "FlashLoan" + | "InternalBalanceChanged" + | "PausedStateChanged" + | "PoolBalanceChanged" + | "PoolBalanceManaged" + | "PoolRegistered" + | "RelayerApprovalChanged" + | "Swap" + | "TokensDeregistered" + | "TokensRegistered" + ): EventFragment; + + encodeFunctionData(functionFragment: "WETH", values?: undefined): string; + encodeFunctionData( + functionFragment: "batchSwap", + values: [ + BigNumberish, + IVault.BatchSwapStepStruct[], + AddressLike[], + IVault.FundManagementStruct, + BigNumberish[], + BigNumberish + ] + ): string; + encodeFunctionData( + functionFragment: "deregisterTokens", + values: [BytesLike, AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "exitPool", + values: [BytesLike, AddressLike, AddressLike, IVault.ExitPoolRequestStruct] + ): string; + encodeFunctionData( + functionFragment: "flashLoan", + values: [AddressLike, AddressLike[], BigNumberish[], BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getActionId", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getAuthorizer", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getDomainSeparator", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getInternalBalance", + values: [AddressLike, AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "getNextNonce", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getPausedState", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "getPool", values: [BytesLike]): string; + encodeFunctionData( + functionFragment: "getPoolTokenInfo", + values: [BytesLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "getPoolTokens", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "getProtocolFeesCollector", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "hasApprovedRelayer", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "joinPool", + values: [BytesLike, AddressLike, AddressLike, IVault.JoinPoolRequestStruct] + ): string; + encodeFunctionData( + functionFragment: "managePoolBalance", + values: [IVault.PoolBalanceOpStruct[]] + ): string; + encodeFunctionData( + functionFragment: "manageUserBalance", + values: [IVault.UserBalanceOpStruct[]] + ): string; + encodeFunctionData( + functionFragment: "queryBatchSwap", + values: [ + BigNumberish, + IVault.BatchSwapStepStruct[], + AddressLike[], + IVault.FundManagementStruct + ] + ): string; + encodeFunctionData( + functionFragment: "registerPool", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "registerTokens", + values: [BytesLike, AddressLike[], AddressLike[]] + ): string; + encodeFunctionData( + functionFragment: "setAuthorizer", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "setPaused", values: [boolean]): string; + encodeFunctionData( + functionFragment: "setRelayerApproval", + values: [AddressLike, AddressLike, boolean] + ): string; + encodeFunctionData( + functionFragment: "swap", + values: [ + IVault.SingleSwapStruct, + IVault.FundManagementStruct, + BigNumberish, + BigNumberish + ] + ): string; + + decodeFunctionResult(functionFragment: "WETH", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "batchSwap", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "deregisterTokens", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "exitPool", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "flashLoan", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getActionId", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getAuthorizer", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDomainSeparator", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getInternalBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getNextNonce", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPausedState", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getPool", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getPoolTokenInfo", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPoolTokens", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getProtocolFeesCollector", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "hasApprovedRelayer", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "joinPool", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "managePoolBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "manageUserBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "queryBatchSwap", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "registerPool", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "registerTokens", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setAuthorizer", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "setPaused", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setRelayerApproval", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "swap", data: BytesLike): Result; +} + +export namespace AuthorizerChangedEvent { + export type InputTuple = [newAuthorizer: AddressLike]; + export type OutputTuple = [newAuthorizer: string]; + export interface OutputObject { + newAuthorizer: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ExternalBalanceTransferEvent { + export type InputTuple = [ + token: AddressLike, + sender: AddressLike, + recipient: AddressLike, + amount: BigNumberish + ]; + export type OutputTuple = [ + token: string, + sender: string, + recipient: string, + amount: bigint + ]; + export interface OutputObject { + token: string; + sender: string; + recipient: string; + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace FlashLoanEvent { + export type InputTuple = [ + recipient: AddressLike, + token: AddressLike, + amount: BigNumberish, + feeAmount: BigNumberish + ]; + export type OutputTuple = [ + recipient: string, + token: string, + amount: bigint, + feeAmount: bigint + ]; + export interface OutputObject { + recipient: string; + token: string; + amount: bigint; + feeAmount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace InternalBalanceChangedEvent { + export type InputTuple = [ + user: AddressLike, + token: AddressLike, + delta: BigNumberish + ]; + export type OutputTuple = [user: string, token: string, delta: bigint]; + export interface OutputObject { + user: string; + token: string; + delta: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PausedStateChangedEvent { + export type InputTuple = [paused: boolean]; + export type OutputTuple = [paused: boolean]; + export interface OutputObject { + paused: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PoolBalanceChangedEvent { + export type InputTuple = [ + poolId: BytesLike, + liquidityProvider: AddressLike, + tokens: AddressLike[], + deltas: BigNumberish[], + protocolFeeAmounts: BigNumberish[] + ]; + export type OutputTuple = [ + poolId: string, + liquidityProvider: string, + tokens: string[], + deltas: bigint[], + protocolFeeAmounts: bigint[] + ]; + export interface OutputObject { + poolId: string; + liquidityProvider: string; + tokens: string[]; + deltas: bigint[]; + protocolFeeAmounts: bigint[]; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PoolBalanceManagedEvent { + export type InputTuple = [ + poolId: BytesLike, + assetManager: AddressLike, + token: AddressLike, + cashDelta: BigNumberish, + managedDelta: BigNumberish + ]; + export type OutputTuple = [ + poolId: string, + assetManager: string, + token: string, + cashDelta: bigint, + managedDelta: bigint + ]; + export interface OutputObject { + poolId: string; + assetManager: string; + token: string; + cashDelta: bigint; + managedDelta: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace PoolRegisteredEvent { + export type InputTuple = [ + poolId: BytesLike, + poolAddress: AddressLike, + specialization: BigNumberish + ]; + export type OutputTuple = [ + poolId: string, + poolAddress: string, + specialization: bigint + ]; + export interface OutputObject { + poolId: string; + poolAddress: string; + specialization: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RelayerApprovalChangedEvent { + export type InputTuple = [ + relayer: AddressLike, + sender: AddressLike, + approved: boolean + ]; + export type OutputTuple = [ + relayer: string, + sender: string, + approved: boolean + ]; + export interface OutputObject { + relayer: string; + sender: string; + approved: boolean; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SwapEvent { + export type InputTuple = [ + poolId: BytesLike, + tokenIn: AddressLike, + tokenOut: AddressLike, + amountIn: BigNumberish, + amountOut: BigNumberish + ]; + export type OutputTuple = [ + poolId: string, + tokenIn: string, + tokenOut: string, + amountIn: bigint, + amountOut: bigint + ]; + export interface OutputObject { + poolId: string; + tokenIn: string; + tokenOut: string; + amountIn: bigint; + amountOut: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TokensDeregisteredEvent { + export type InputTuple = [poolId: BytesLike, tokens: AddressLike[]]; + export type OutputTuple = [poolId: string, tokens: string[]]; + export interface OutputObject { + poolId: string; + tokens: string[]; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TokensRegisteredEvent { + export type InputTuple = [ + poolId: BytesLike, + tokens: AddressLike[], + assetManagers: AddressLike[] + ]; + export type OutputTuple = [ + poolId: string, + tokens: string[], + assetManagers: string[] + ]; + export interface OutputObject { + poolId: string; + tokens: string[]; + assetManagers: string[]; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface Vault extends BaseContract { + connect(runner?: ContractRunner | null): Vault; + waitForDeployment(): Promise; + + interface: VaultInterface; + + 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; + + WETH: TypedContractMethod<[], [string], "view">; + + batchSwap: TypedContractMethod< + [ + kind: BigNumberish, + swaps: IVault.BatchSwapStepStruct[], + assets: AddressLike[], + funds: IVault.FundManagementStruct, + limits: BigNumberish[], + deadline: BigNumberish + ], + [bigint[]], + "payable" + >; + + deregisterTokens: TypedContractMethod< + [poolId: BytesLike, tokens: AddressLike[]], + [void], + "nonpayable" + >; + + exitPool: TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + request: IVault.ExitPoolRequestStruct + ], + [void], + "nonpayable" + >; + + flashLoan: TypedContractMethod< + [ + recipient: AddressLike, + tokens: AddressLike[], + amounts: BigNumberish[], + userData: BytesLike + ], + [void], + "nonpayable" + >; + + getActionId: TypedContractMethod<[selector: BytesLike], [string], "view">; + + getAuthorizer: TypedContractMethod<[], [string], "view">; + + getDomainSeparator: TypedContractMethod<[], [string], "view">; + + getInternalBalance: TypedContractMethod< + [user: AddressLike, tokens: AddressLike[]], + [bigint[]], + "view" + >; + + getNextNonce: TypedContractMethod<[user: AddressLike], [bigint], "view">; + + getPausedState: TypedContractMethod< + [], + [ + [boolean, bigint, bigint] & { + paused: boolean; + pauseWindowEndTime: bigint; + bufferPeriodEndTime: bigint; + } + ], + "view" + >; + + getPool: TypedContractMethod<[poolId: BytesLike], [[string, bigint]], "view">; + + getPoolTokenInfo: TypedContractMethod< + [poolId: BytesLike, token: AddressLike], + [ + [bigint, bigint, bigint, string] & { + cash: bigint; + managed: bigint; + lastChangeBlock: bigint; + assetManager: string; + } + ], + "view" + >; + + getPoolTokens: TypedContractMethod< + [poolId: BytesLike], + [ + [string[], bigint[], bigint] & { + tokens: string[]; + balances: bigint[]; + lastChangeBlock: bigint; + } + ], + "view" + >; + + getProtocolFeesCollector: TypedContractMethod<[], [string], "view">; + + hasApprovedRelayer: TypedContractMethod< + [user: AddressLike, relayer: AddressLike], + [boolean], + "view" + >; + + joinPool: TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + request: IVault.JoinPoolRequestStruct + ], + [void], + "payable" + >; + + managePoolBalance: TypedContractMethod< + [ops: IVault.PoolBalanceOpStruct[]], + [void], + "nonpayable" + >; + + manageUserBalance: TypedContractMethod< + [ops: IVault.UserBalanceOpStruct[]], + [void], + "payable" + >; + + queryBatchSwap: TypedContractMethod< + [ + kind: BigNumberish, + swaps: IVault.BatchSwapStepStruct[], + assets: AddressLike[], + funds: IVault.FundManagementStruct + ], + [bigint[]], + "nonpayable" + >; + + registerPool: TypedContractMethod< + [specialization: BigNumberish], + [string], + "nonpayable" + >; + + registerTokens: TypedContractMethod< + [poolId: BytesLike, tokens: AddressLike[], assetManagers: AddressLike[]], + [void], + "nonpayable" + >; + + setAuthorizer: TypedContractMethod< + [newAuthorizer: AddressLike], + [void], + "nonpayable" + >; + + setPaused: TypedContractMethod<[paused: boolean], [void], "nonpayable">; + + setRelayerApproval: TypedContractMethod< + [sender: AddressLike, relayer: AddressLike, approved: boolean], + [void], + "nonpayable" + >; + + swap: TypedContractMethod< + [ + singleSwap: IVault.SingleSwapStruct, + funds: IVault.FundManagementStruct, + limit: BigNumberish, + deadline: BigNumberish + ], + [bigint], + "payable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "WETH" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "batchSwap" + ): TypedContractMethod< + [ + kind: BigNumberish, + swaps: IVault.BatchSwapStepStruct[], + assets: AddressLike[], + funds: IVault.FundManagementStruct, + limits: BigNumberish[], + deadline: BigNumberish + ], + [bigint[]], + "payable" + >; + getFunction( + nameOrSignature: "deregisterTokens" + ): TypedContractMethod< + [poolId: BytesLike, tokens: AddressLike[]], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "exitPool" + ): TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + request: IVault.ExitPoolRequestStruct + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "flashLoan" + ): TypedContractMethod< + [ + recipient: AddressLike, + tokens: AddressLike[], + amounts: BigNumberish[], + userData: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "getActionId" + ): TypedContractMethod<[selector: BytesLike], [string], "view">; + getFunction( + nameOrSignature: "getAuthorizer" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getDomainSeparator" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getInternalBalance" + ): TypedContractMethod< + [user: AddressLike, tokens: AddressLike[]], + [bigint[]], + "view" + >; + getFunction( + nameOrSignature: "getNextNonce" + ): TypedContractMethod<[user: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "getPausedState" + ): TypedContractMethod< + [], + [ + [boolean, bigint, bigint] & { + paused: boolean; + pauseWindowEndTime: bigint; + bufferPeriodEndTime: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getPool" + ): TypedContractMethod<[poolId: BytesLike], [[string, bigint]], "view">; + getFunction( + nameOrSignature: "getPoolTokenInfo" + ): TypedContractMethod< + [poolId: BytesLike, token: AddressLike], + [ + [bigint, bigint, bigint, string] & { + cash: bigint; + managed: bigint; + lastChangeBlock: bigint; + assetManager: string; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getPoolTokens" + ): TypedContractMethod< + [poolId: BytesLike], + [ + [string[], bigint[], bigint] & { + tokens: string[]; + balances: bigint[]; + lastChangeBlock: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getProtocolFeesCollector" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "hasApprovedRelayer" + ): TypedContractMethod< + [user: AddressLike, relayer: AddressLike], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "joinPool" + ): TypedContractMethod< + [ + poolId: BytesLike, + sender: AddressLike, + recipient: AddressLike, + request: IVault.JoinPoolRequestStruct + ], + [void], + "payable" + >; + getFunction( + nameOrSignature: "managePoolBalance" + ): TypedContractMethod< + [ops: IVault.PoolBalanceOpStruct[]], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "manageUserBalance" + ): TypedContractMethod< + [ops: IVault.UserBalanceOpStruct[]], + [void], + "payable" + >; + getFunction( + nameOrSignature: "queryBatchSwap" + ): TypedContractMethod< + [ + kind: BigNumberish, + swaps: IVault.BatchSwapStepStruct[], + assets: AddressLike[], + funds: IVault.FundManagementStruct + ], + [bigint[]], + "nonpayable" + >; + getFunction( + nameOrSignature: "registerPool" + ): TypedContractMethod< + [specialization: BigNumberish], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "registerTokens" + ): TypedContractMethod< + [poolId: BytesLike, tokens: AddressLike[], assetManagers: AddressLike[]], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "setAuthorizer" + ): TypedContractMethod<[newAuthorizer: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "setPaused" + ): TypedContractMethod<[paused: boolean], [void], "nonpayable">; + getFunction( + nameOrSignature: "setRelayerApproval" + ): TypedContractMethod< + [sender: AddressLike, relayer: AddressLike, approved: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "swap" + ): TypedContractMethod< + [ + singleSwap: IVault.SingleSwapStruct, + funds: IVault.FundManagementStruct, + limit: BigNumberish, + deadline: BigNumberish + ], + [bigint], + "payable" + >; + + getEvent( + key: "AuthorizerChanged" + ): TypedContractEvent< + AuthorizerChangedEvent.InputTuple, + AuthorizerChangedEvent.OutputTuple, + AuthorizerChangedEvent.OutputObject + >; + getEvent( + key: "ExternalBalanceTransfer" + ): TypedContractEvent< + ExternalBalanceTransferEvent.InputTuple, + ExternalBalanceTransferEvent.OutputTuple, + ExternalBalanceTransferEvent.OutputObject + >; + getEvent( + key: "FlashLoan" + ): TypedContractEvent< + FlashLoanEvent.InputTuple, + FlashLoanEvent.OutputTuple, + FlashLoanEvent.OutputObject + >; + getEvent( + key: "InternalBalanceChanged" + ): TypedContractEvent< + InternalBalanceChangedEvent.InputTuple, + InternalBalanceChangedEvent.OutputTuple, + InternalBalanceChangedEvent.OutputObject + >; + getEvent( + key: "PausedStateChanged" + ): TypedContractEvent< + PausedStateChangedEvent.InputTuple, + PausedStateChangedEvent.OutputTuple, + PausedStateChangedEvent.OutputObject + >; + getEvent( + key: "PoolBalanceChanged" + ): TypedContractEvent< + PoolBalanceChangedEvent.InputTuple, + PoolBalanceChangedEvent.OutputTuple, + PoolBalanceChangedEvent.OutputObject + >; + getEvent( + key: "PoolBalanceManaged" + ): TypedContractEvent< + PoolBalanceManagedEvent.InputTuple, + PoolBalanceManagedEvent.OutputTuple, + PoolBalanceManagedEvent.OutputObject + >; + getEvent( + key: "PoolRegistered" + ): TypedContractEvent< + PoolRegisteredEvent.InputTuple, + PoolRegisteredEvent.OutputTuple, + PoolRegisteredEvent.OutputObject + >; + getEvent( + key: "RelayerApprovalChanged" + ): TypedContractEvent< + RelayerApprovalChangedEvent.InputTuple, + RelayerApprovalChangedEvent.OutputTuple, + RelayerApprovalChangedEvent.OutputObject + >; + getEvent( + key: "Swap" + ): TypedContractEvent< + SwapEvent.InputTuple, + SwapEvent.OutputTuple, + SwapEvent.OutputObject + >; + getEvent( + key: "TokensDeregistered" + ): TypedContractEvent< + TokensDeregisteredEvent.InputTuple, + TokensDeregisteredEvent.OutputTuple, + TokensDeregisteredEvent.OutputObject + >; + getEvent( + key: "TokensRegistered" + ): TypedContractEvent< + TokensRegisteredEvent.InputTuple, + TokensRegisteredEvent.OutputTuple, + TokensRegisteredEvent.OutputObject + >; + + filters: { + "AuthorizerChanged(address)": TypedContractEvent< + AuthorizerChangedEvent.InputTuple, + AuthorizerChangedEvent.OutputTuple, + AuthorizerChangedEvent.OutputObject + >; + AuthorizerChanged: TypedContractEvent< + AuthorizerChangedEvent.InputTuple, + AuthorizerChangedEvent.OutputTuple, + AuthorizerChangedEvent.OutputObject + >; + + "ExternalBalanceTransfer(address,address,address,uint256)": TypedContractEvent< + ExternalBalanceTransferEvent.InputTuple, + ExternalBalanceTransferEvent.OutputTuple, + ExternalBalanceTransferEvent.OutputObject + >; + ExternalBalanceTransfer: TypedContractEvent< + ExternalBalanceTransferEvent.InputTuple, + ExternalBalanceTransferEvent.OutputTuple, + ExternalBalanceTransferEvent.OutputObject + >; + + "FlashLoan(address,address,uint256,uint256)": TypedContractEvent< + FlashLoanEvent.InputTuple, + FlashLoanEvent.OutputTuple, + FlashLoanEvent.OutputObject + >; + FlashLoan: TypedContractEvent< + FlashLoanEvent.InputTuple, + FlashLoanEvent.OutputTuple, + FlashLoanEvent.OutputObject + >; + + "InternalBalanceChanged(address,address,int256)": TypedContractEvent< + InternalBalanceChangedEvent.InputTuple, + InternalBalanceChangedEvent.OutputTuple, + InternalBalanceChangedEvent.OutputObject + >; + InternalBalanceChanged: TypedContractEvent< + InternalBalanceChangedEvent.InputTuple, + InternalBalanceChangedEvent.OutputTuple, + InternalBalanceChangedEvent.OutputObject + >; + + "PausedStateChanged(bool)": TypedContractEvent< + PausedStateChangedEvent.InputTuple, + PausedStateChangedEvent.OutputTuple, + PausedStateChangedEvent.OutputObject + >; + PausedStateChanged: TypedContractEvent< + PausedStateChangedEvent.InputTuple, + PausedStateChangedEvent.OutputTuple, + PausedStateChangedEvent.OutputObject + >; + + "PoolBalanceChanged(bytes32,address,address[],int256[],uint256[])": TypedContractEvent< + PoolBalanceChangedEvent.InputTuple, + PoolBalanceChangedEvent.OutputTuple, + PoolBalanceChangedEvent.OutputObject + >; + PoolBalanceChanged: TypedContractEvent< + PoolBalanceChangedEvent.InputTuple, + PoolBalanceChangedEvent.OutputTuple, + PoolBalanceChangedEvent.OutputObject + >; + + "PoolBalanceManaged(bytes32,address,address,int256,int256)": TypedContractEvent< + PoolBalanceManagedEvent.InputTuple, + PoolBalanceManagedEvent.OutputTuple, + PoolBalanceManagedEvent.OutputObject + >; + PoolBalanceManaged: TypedContractEvent< + PoolBalanceManagedEvent.InputTuple, + PoolBalanceManagedEvent.OutputTuple, + PoolBalanceManagedEvent.OutputObject + >; + + "PoolRegistered(bytes32,address,uint8)": TypedContractEvent< + PoolRegisteredEvent.InputTuple, + PoolRegisteredEvent.OutputTuple, + PoolRegisteredEvent.OutputObject + >; + PoolRegistered: TypedContractEvent< + PoolRegisteredEvent.InputTuple, + PoolRegisteredEvent.OutputTuple, + PoolRegisteredEvent.OutputObject + >; + + "RelayerApprovalChanged(address,address,bool)": TypedContractEvent< + RelayerApprovalChangedEvent.InputTuple, + RelayerApprovalChangedEvent.OutputTuple, + RelayerApprovalChangedEvent.OutputObject + >; + RelayerApprovalChanged: TypedContractEvent< + RelayerApprovalChangedEvent.InputTuple, + RelayerApprovalChangedEvent.OutputTuple, + RelayerApprovalChangedEvent.OutputObject + >; + + "Swap(bytes32,address,address,uint256,uint256)": TypedContractEvent< + SwapEvent.InputTuple, + SwapEvent.OutputTuple, + SwapEvent.OutputObject + >; + Swap: TypedContractEvent< + SwapEvent.InputTuple, + SwapEvent.OutputTuple, + SwapEvent.OutputObject + >; + + "TokensDeregistered(bytes32,address[])": TypedContractEvent< + TokensDeregisteredEvent.InputTuple, + TokensDeregisteredEvent.OutputTuple, + TokensDeregisteredEvent.OutputObject + >; + TokensDeregistered: TypedContractEvent< + TokensDeregisteredEvent.InputTuple, + TokensDeregisteredEvent.OutputTuple, + TokensDeregisteredEvent.OutputObject + >; + + "TokensRegistered(bytes32,address[],address[])": TypedContractEvent< + TokensRegisteredEvent.InputTuple, + TokensRegisteredEvent.OutputTuple, + TokensRegisteredEvent.OutputObject + >; + TokensRegistered: TypedContractEvent< + TokensRegisteredEvent.InputTuple, + TokensRegisteredEvent.OutputTuple, + TokensRegisteredEvent.OutputObject + >; + }; +} diff --git a/src/adapters/chimp-exchange/contracts/abis/BalancerPoolDataQueries.json b/src/adapters/chimp-exchange/contracts/abis/BalancerPoolDataQueries.json new file mode 100644 index 000000000..36cfc176f --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/abis/BalancerPoolDataQueries.json @@ -0,0 +1,447 @@ +[ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "_vault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getAmpForPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getInRecoveryModeForPools", + "outputs": [ + { + "internalType": "bool[]", + "name": "", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getIsPausedForPools", + "outputs": [ + { + "internalType": "bool[]", + "name": "", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getLinearTargetsForPools", + "outputs": [ + { + "internalType": "uint256[][]", + "name": "", + "type": "uint256[][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getNormalizedWeightsForPools", + "outputs": [ + { + "internalType": "uint256[][]", + "name": "", + "type": "uint256[][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "components": [ + { + "internalType": "bool", + "name": "loadTokenBalanceUpdatesAfterBlock", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadTotalSupply", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadSwapFees", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadLinearWrappedTokenRates", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadLinearTargets", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadNormalizedWeights", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadScalingFactors", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadAmps", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadRates", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "enum TotalSupplyType[]", + "name": "totalSupplyTypes", + "type": "uint8[]" + }, + { + "internalType": "enum SwapFeeType[]", + "name": "swapFeeTypes", + "type": "uint8[]" + }, + { + "internalType": "uint256[]", + "name": "linearPoolIdxs", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "weightedPoolIdxs", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "scalingFactorPoolIdxs", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "ampPoolIdxs", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "ratePoolIdxs", + "type": "uint256[]" + } + ], + "internalType": "struct PoolDataQueryConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "getPoolData", + "outputs": [ + { + "internalType": "uint256[][]", + "name": "balances", + "type": "uint256[][]" + }, + { + "internalType": "uint256[]", + "name": "totalSupplies", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "swapFees", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "linearWrappedTokenRates", + "type": "uint256[]" + }, + { + "internalType": "uint256[][]", + "name": "linearTargets", + "type": "uint256[][]" + }, + { + "internalType": "uint256[][]", + "name": "weights", + "type": "uint256[][]" + }, + { + "internalType": "uint256[][]", + "name": "scalingFactors", + "type": "uint256[][]" + }, + { + "internalType": "uint256[]", + "name": "amps", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "rates", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "ignoreIdxs", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "components": [ + { + "internalType": "bool", + "name": "loadInRecoveryMode", + "type": "bool" + }, + { + "internalType": "bool", + "name": "loadIsPaused", + "type": "bool" + } + ], + "internalType": "struct PoolStatusQueryConfig", + "name": "config", + "type": "tuple" + } + ], + "name": "getPoolStatus", + "outputs": [ + { + "internalType": "bool[]", + "name": "isPaused", + "type": "bool[]" + }, + { + "internalType": "bool[]", + "name": "inRecoveryMode", + "type": "bool[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32[]", + "name": "poolIds", + "type": "bytes32[]" + }, + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getPoolTokenBalancesWithUpdatesAfterBlock", + "outputs": [ + { + "internalType": "uint256[][]", + "name": "", + "type": "uint256[][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getRateForPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getScalingFactorsForPools", + "outputs": [ + { + "internalType": "uint256[][]", + "name": "", + "type": "uint256[][]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + }, + { + "internalType": "enum SwapFeeType[]", + "name": "swapFeeTypes", + "type": "uint8[]" + } + ], + "name": "getSwapFeePercentageForPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + }, + { + "internalType": "enum TotalSupplyType[]", + "name": "totalSupplyTypes", + "type": "uint8[]" + } + ], + "name": "getTotalSupplyForPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "poolAddresses", + "type": "address[]" + } + ], + "name": "getWrappedTokenRateForLinearPools", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "vault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] \ No newline at end of file diff --git a/src/adapters/chimp-exchange/contracts/abis/pool.json b/src/adapters/chimp-exchange/contracts/abis/pool.json new file mode 100644 index 000000000..3c18de1e3 --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/abis/pool.json @@ -0,0 +1,1134 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "WeightedPool", + "sourceName": "contracts/WeightedPool.sol", + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "normalizedWeights", + "type": "uint256[]" + }, + { + "internalType": "contract IRateProvider[]", + "name": "rateProviders", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "assetManagers", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "internalType": "struct WeightedPool.NewPoolParams", + "name": "params", + "type": "tuple" + }, + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "contract IProtocolFeePercentagesProvider", + "name": "protocolFeeProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldATHRateProduct", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newATHRateProduct", + "type": "uint256" + } + ], + "name": "ATHRateProductUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "feeCache", + "type": "bytes32" + } + ], + "name": "ProtocolFeePercentageCacheUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "enabled", + "type": "bool" + } + ], + "name": "RecoveryModeStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "SwapFeePercentageChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "disableRecoveryMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "enableRecoveryMode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getATHRateProduct", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getActualSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastPostJoinExitInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "getNextNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNormalizedWeights", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeType", + "type": "uint256" + } + ], + "name": "getProtocolFeePercentageCache", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeesCollector", + "outputs": [ + { + "internalType": "contract IProtocolFeesCollector", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeType", + "type": "uint256" + } + ], + "name": "getProviderFeeId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRateProviders", + "outputs": [ + { + "internalType": "contract IRateProvider[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getScalingFactors", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "inRecoveryMode", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onExitPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onJoinPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "request", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "balanceTokenIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceTokenOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "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": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "setSwapFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "updateProtocolFeePercentageCache", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x6106606040523480156200001257600080fd5b50604051620078e6380380620078e6833981016040819052620000359162001598565b856040015151866080015185604051806060016040528060008152602001600281526020016003815250888a600001518b602001518c604001518d60a001518e60c001518c8c8c600089875160021480156200008f575081155b6200009c5760016200009f565b60025b8a8a8a8a8a8a8a8a8983838a8a8e86336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000f192919062001262565b5080516200010790600490602084019062001262565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b166101205250620001869050630163f50083111561019462000ac3565b6200019a6276a70082111561019562000ac3565b4291909101610140819052016101605260601b6001600160601b031916610180528551620001ce906002111560c862000ac3565b620001e8620001dc62000ad8565b8751111560c962000ac3565b620001f38462000add565b60006200020e8b8b898962000b7160201b620014341760201c565b9050806101a081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200025357600080fd5b505afa15801562000268573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200028e919062001579565b6001600160a01b03166101c0816001600160a01b031660601b81525050505050505050505050505050505050505050505050816001600160a01b03166101e0816001600160a01b031660601b81525050600062000303826040015160088060000101600862000ba060201b620014541760201c565b6200032483602001516008600001600862000ba060201b620014541760201c565b6200034284600001516000600862000ba060201b620014541760201c565b1717610200819052905062000358838262000bb5565b506200036d915050600883111560c962000ac3565b6200038582825162000e3b60201b620014671760201c565b620003908162000e4a565b151560f81b6103205280518190600090620003a757fe5b60200260200101516001600160a01b0316610220816001600160a01b031660601b8152505080600181518110620003da57fe5b60200260200101516001600160a01b0316610240816001600160a01b031660601b81525050600282116200041057600062000427565b806002815181106200041e57fe5b60200260200101515b60601b6001600160601b03191661026052600382116200044957600062000460565b806003815181106200045757fe5b60200260200101515b60601b6001600160601b03191661028052600482116200048257600062000499565b806004815181106200049057fe5b60200260200101515b60601b6001600160601b0319166102a05260058211620004bb576000620004d2565b80600581518110620004c957fe5b60200260200101515b60601b6001600160601b0319166102c05260068211620004f45760006200050b565b806006815181106200050257fe5b60200260200101515b60601b6001600160601b0319166102e052600782116200052d57600062000544565b806007815181106200053b57fe5b60200260200101515b6001600160a01b0316610300816001600160a01b031660601b81525050505060008660400151519050620005898188606001515162000e3b60201b620014671760201c565b6103408190526000805b828160ff1610156200060357600089606001518260ff1681518110620005b557fe5b60200260200101519050620005dd662386f26fc1000082101561012e62000ac360201b60201c565b620005f7818462000ea660201b620014781790919060201c565b92505060010162000593565b506200061c670de0b6b3a7640000821461013462000ac3565b87604001516000815181106200062e57fe5b60200260200101516001600160a01b0316610360816001600160a01b031660601b8152505087604001516001815181106200066557fe5b60200260200101516001600160a01b0316610380816001600160a01b031660601b81525050600282116200069b576000620006b6565b8760400151600281518110620006ad57fe5b60200260200101515b60601b6001600160601b0319166103a05260038211620006d8576000620006f3565b8760400151600381518110620006ea57fe5b60200260200101515b60601b6001600160601b0319166103c052600482116200071557600062000730565b87604001516004815181106200072757fe5b60200260200101515b60601b6001600160601b0319166103e05260058211620007525760006200076d565b87604001516005815181106200076457fe5b60200260200101515b60601b6001600160601b03191661040052600682116200078f576000620007aa565b8760400151600681518110620007a157fe5b60200260200101515b60601b6001600160601b0319166104205260078211620007cc576000620007e7565b8760400151600781518110620007de57fe5b60200260200101515b6001600160a01b0316610440816001600160a01b031660601b815250506200082e88604001516000815181106200081a57fe5b602002602001015162000ec360201b60201c565b61046052604088015180516200084b919060019081106200081a57fe5b61048052600282116200086057600062000876565b6200087688604001516002815181106200081a57fe5b6104a052600382116200088b576000620008a1565b620008a188604001516003815181106200081a57fe5b6104c05260048211620008b6576000620008cc565b620008cc88604001516004815181106200081a57fe5b6104e05260058211620008e1576000620008f7565b620008f788604001516005815181106200081a57fe5b61050052600682116200090c57600062000922565b6200092288604001516006815181106200081a57fe5b6105205260078211620009375760006200094d565b6200094d88604001516007815181106200081a57fe5b61054052606088015180516000906200096257fe5b6020026020010151610560818152505087606001516001815181106200098457fe5b6020026020010151610580818152505060028211620009a5576000620009c0565b8760600151600281518110620009b757fe5b60200260200101515b6105a05260038211620009d5576000620009f0565b8760600151600381518110620009e757fe5b60200260200101515b6105c0526004821162000a0557600062000a20565b876060015160048151811062000a1757fe5b60200260200101515b6105e0526005821162000a3557600062000a50565b876060015160058151811062000a4757fe5b60200260200101515b610600526006821162000a6557600062000a80565b876060015160068151811062000a7757fe5b60200260200101515b610620526007821162000a9557600062000ab0565b876060015160078151811062000aa757fe5b60200260200101515b6106405250620018599650505050505050565b8162000ad45762000ad48162000f92565b5050565b600890565b62000af662000aeb62000fa7565b82101560cb62000ac3565b62000b0f62000b0462000fb0565b82111560ca62000ac3565b62000b318160c0603f60085462000fbc60201b6200148a17909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc9062000b6690839062001744565b60405180910390a150565b600062000b898362000fe160201b620014ad1760201c565b62000b978585858562000fed565b95945050505050565b600062000baf848484620010e7565b50501b90565b6000826001600160a01b0316631a7c326362000be460006008866200114760201b620014b7179092919060201c565b6040518263ffffffff1660e01b815260040162000c02919062001744565b60206040518083038186803b15801562000c1b57600080fd5b505afa15801562000c30573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c56919062001560565b905060006001600160a01b038416631a7c326362000c838560088062001147602090811b620014b717901c565b6040518263ffffffff1660e01b815260040162000ca1919062001744565b60206040518083038186803b15801562000cba57600080fd5b505afa15801562000ccf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cf5919062001560565b905060006001600160a01b038516631a7c326362000d23866010600862001147602090811b620014b717901c565b6040518263ffffffff1660e01b815260040162000d41919062001744565b60206040518083038186803b15801562000d5a57600080fd5b505afa15801562000d6f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d95919062001560565b9050600062000db88260408060000101604062000ba060201b620014541760201c565b62000dd5846040600001604062000ba060201b620014541760201c565b62000def866000604062000ba060201b620014541760201c565b17179050806009819055507fc3f0acc358200d8e08ac6ce20bc2f9f27893a344f813bf682b7859b3e521502e8160405162000e2b919062001744565b60405180910390a1505050505050565b62000ad4828214606762000ac3565b6000805b825181101562000e9b5760006001600160a01b031683828151811062000e7057fe5b60200260200101516001600160a01b03161462000e9257600091505062000ea1565b60010162000e4e565b50600190505b919050565b600082820162000eba848210158362000ac3565b90505b92915050565b60006001600160a01b03821630141562000ee75750670de0b6b3a764000062000ea1565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f2357600080fd5b505afa15801562000f38573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f5e919062001721565b60ff169050600062000f7d6012836200115660201b620014c61760201c565b600a0a670de0b6b3a764000002949350505050565b62000fa4816210905360ea1b6200116e565b50565b64e8d4a5100090565b67016345785d8a000090565b600062000fcb848484620010e7565b506001901b60001901811b1992909216911b1790565b8062000ad481620011cf565b600080856001600160a01b03166309b2760f866040518263ffffffff1660e01b81526004016200101e9190620017db565b602060405180830381600087803b1580156200103957600080fd5b505af11580156200104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001074919062001560565b604051633354e3e960e11b81529091506001600160a01b038716906366a9c7d290620010a9908490889088906004016200174d565b600060405180830381600087803b158015620010c457600080fd5b505af1158015620010d9573d6000803e3d6000fd5b509298975050505050505050565b620010f86101008310606462000ac3565b62001131600182101580156200112957506200112560ff84610100036200125660201b620014dc1760201c565b8211155b606462000ac3565b6200114283821c156101b462000ac3565b505050565b6001901b6000190191901c1690565b60006200116883831115600162000ac3565b50900390565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600281511015620011e05762000fa4565b600081600081518110620011f057fe5b602002602001015190506000600190505b8251811015620011425760008382815181106200121a57fe5b602002602001015190506200124b816001600160a01b0316846001600160a01b031610606562000ac360201b60201c565b915060010162001201565b80820390821102900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620012a557805160ff1916838001178555620012d5565b82800160010185558215620012d5579182015b82811115620012d5578251825591602001919060010190620012b8565b50620012e3929150620012e7565b5090565b5b80821115620012e35760008155600101620012e8565b805162000ebd8162001843565b600082601f8301126200131c578081fd5b8151620013336200132d8262001817565b620017f0565b8181529150602080830190848101818402860182018710156200135557600080fd5b60005b84811015620013815781516200136e8162001843565b8452928201929082019060010162001358565b505050505092915050565b600082601f8301126200139d578081fd5b8151620013ae6200132d8262001817565b818152915060208083019084810181840286018201871015620013d057600080fd5b60005b8481101562001381578151620013e98162001843565b84529282019290820190600101620013d3565b600082601f8301126200140d578081fd5b81516200141e6200132d8262001817565b8181529150602080830190848101818402860182018710156200144057600080fd5b60005b8481101562001381578151620014598162001843565b8452928201929082019060010162001443565b600082601f8301126200147d578081fd5b81516200148e6200132d8262001817565b818152915060208083019084810181840286018201871015620014b057600080fd5b60005b848110156200138157815184529282019290820190600101620014b3565b600082601f830112620014e2578081fd5b81516001600160401b03811115620014f8578182fd5b60206200150e601f8301601f19168201620017f0565b925081835284818386010111156200152557600080fd5b60005b828110156200154557848101820151848201830152810162001528565b82811115620015575760008284860101525b50505092915050565b60006020828403121562001572578081fd5b5051919050565b6000602082840312156200158b578081fd5b815162000eba8162001843565b60008060008060008060c08789031215620015b1578182fd5b86516001600160401b0380821115620015c8578384fd5b9088019060e0828b031215620015dc578384fd5b620015e860e0620017f0565b825182811115620015f7578586fd5b620016058c828601620014d1565b8252506020830151828111156200161a578586fd5b620016288c828601620014d1565b60208301525060408301518281111562001640578586fd5b6200164e8c8286016200138c565b60408301525060608301518281111562001666578586fd5b620016748c8286016200146c565b6060830152506080830151828111156200168c578586fd5b6200169a8c828601620013fc565b60808301525060a083015182811115620016b2578586fd5b620016c08c8286016200130b565b60a08301525060c083015160c0820152809850505050620016e58860208901620012fe565b9450620016f68860408901620012fe565b93506060870151925060808701519150620017158860a08901620012fe565b90509295509295509295565b60006020828403121562001733578081fd5b815160ff8116811462000eba578182fd5b90815260200190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015620017995762001786855162001837565b8352938301939183019160010162001771565b505084810360408601528551808252908201925081860190845b81811015620010d957620017c8835162001837565b85529383019391830191600101620017b3565b6020810160038310620017ea57fe5b91905290565b6040518181016001600160401b03811182821017156200180f57600080fd5b604052919050565b60006001600160401b038211156200182d578081fd5b5060209081020190565b6001600160a01b031690565b6001600160a01b038116811462000fa457600080fd5b60805160a05160c05160e0516101005160601c6101205160601c61014051610160516101805160601c6101a0516101c05160601c6101e05160601c610200516102205160601c6102405160601c6102605160601c6102805160601c6102a05160601c6102c05160601c6102e05160601c6103005160601c6103205160f81c610340516103605160601c6103805160601c6103a05160601c6103c05160601c6103e05160601c6104005160601c6104205160601c6104405160601c61046051610480516104a0516104c0516104e05161050051610520516105405161056051610580516105a0516105c0516105e051610600516106205161064051615dea62001afc6000398061226752806135da52508061222452806135795250806121e1528061351852508061219e52806134b752508061215b528061345652508061211852806133f55250806120d5528061339452508061209b5280613333525080612c24525080612c00525080612bdc525080612bb8525080612b94525080612b70525080612b4c525080612b28525080612561528061359f52508061251f528061353e5250806124dd52806134dd52508061249b528061347c525080612459528061341b52508061241752806133ba5250806123d5528061335952508061238c52806132f8525080611ab152508061387f5250806109da5280613ae05250806109835280613a9452508061092c5280613a485250806108d552806139fc52508061087e52806139b0525080610819528061394f5250806107c252806138fe52508061077452806138c05250806106ba5280610b8b525080610699525080611213525080610ada5250806115525250806118f65250806118d2525080610ef5525080610ed1525080610e1f52508061287d5250806128bf52508061289e5250615dea6000f3fe608060405234801561001057600080fd5b50600436106102ff5760003560e01c80637ecebe001161019c578063a9059cbb116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105ab578063ed24911d146105be578063f89f27ed146105c6576102ff565b8063d2946c2b1461057d578063d505accf14610585578063d5c096c414610598576102ff565b8063b35056b8116100c8578063b35056b814610565578063b7b814fc1461056d578063c0ff1a1514610575576102ff565b8063a9059cbb14610542578063aaabadc514610555578063b10962781461055d576102ff565b8063893d20e81161015057806395d89b411161012a57806395d89b41146105145780639d2c110c1461051c578063a457c2d71461052f576102ff565b8063893d20e8146104e45780638d928af8146104f957806390193b7c14610501576102ff565b8063851c1bb311610181578063851c1bb3146104b6578063876f303b146104c957806387ec6817146104d1576102ff565b80637ecebe001461049b5780638456cb59146104ae576102ff565b806338e9922e1161025557806354a844ba1161020957806370464016116101e3578063704640161461045457806370a082311461046757806374f3b0091461047a576102ff565b806354a844ba1461042357806355c676281461042b5780636028bfd414610433576102ff565b8063395093511161023a57806339509351146103f55780633f4ba83a146104085780634df77ce014610410576102ff565b806338e9922e146103da57806338fff2d0146103ed576102ff565b80631dd746ea116102b757806323ef89ed1161029157806323ef89ed146103b5578063313ce567146103bd5780633644e515146103d2576102ff565b80631dd746ea14610378578063238a2d591461038d57806323b872dd146103a2576102ff565b80630da0669c116102e85780630da0669c1461034257806318160ddd1461034c5780631c0de05114610361576102ff565b806306fdde0314610304578063095ea7b314610322575b600080fd5b61030c6105ce565b6040516103199190615cb7565b60405180910390f35b6103356103303660046154c6565b610665565b6040516103199190615b46565b61034a61067c565b005b6103546106e0565b6040516103199190615b69565b6103696106e6565b60405161031993929190615b51565b61038061070f565b6040516103199190615b0e565b61039561071e565b6040516103199190615ac1565b6103356103b0366004615416565b610a2d565b610354610aa3565b6103c5610aa9565b6040516103199190615ca9565b610354610ab2565b61034a6103e83660046159b3565b610abc565b610354610ad8565b6103356104033660046154c6565b610afc565b61034a610b37565b61035461041e3660046159b3565b610b49565b61034a610bbb565b610354610c0f565b6104466104413660046155f5565b610c22565b604051610319929190615cea565b6103546104623660046159b3565b610c59565b6103546104753660046153c2565b610cbb565b61048d6104883660046155f5565b610cd6565b604051610319929190615b21565b6103546104a93660046153c2565b610dfe565b61034a610e09565b6103546104c43660046156f2565b610e1b565b610354610e6d565b6104466104df3660046155f5565b610ea9565b6104ec610ecf565b6040516103199190615aad565b6104ec610ef3565b61035461050f3660046153c2565b610f17565b61030c610f32565b61035461052a3660046158b7565b610f93565b61033561053d3660046154c6565b61108c565b6103356105503660046154c6565b6110ca565b6104ec6110d7565b6103546110e1565b6103356110f9565b61034a61110a565b610354611154565b6104ec611211565b61034a610593366004615456565b611235565b61048d6105a63660046155f5565b6112c0565b6103546105b93660046153de565b6113e3565b610354611420565b61038061142a565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561065a5780601f1061062f5761010080835404028352916020019161065a565b820191906000526020600020905b81548152906001019060200180831161063d57829003601f168201915b505050505090505b90565b60006106723384846114e8565b5060015b92915050565b61068c610687611550565b611574565b610694611645565b6106de7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061169f565b565b60025490565b60008060006106f36118b3565b1592506106fe6118d0565b91506107086118f4565b9050909192565b6060610719611918565b905090565b6060600061072a611aaf565b905060608167ffffffffffffffff8111801561074557600080fd5b5060405190808252806020026020018201604052801561076f578160200160208202803683370190505b5090507f0000000000000000000000000000000000000000000000000000000000000000816000815181106107a057fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000816001815181106107ee57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600282111561086a577f00000000000000000000000000000000000000000000000000000000000000008160028151811061084557fe5b60200260200101906001600160a01b031690816001600160a01b031681525050610873565b91506106629050565b600382111561086a577f0000000000000000000000000000000000000000000000000000000000000000816003815181106108aa57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600482111561086a577f00000000000000000000000000000000000000000000000000000000000000008160048151811061090157fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600582111561086a577f00000000000000000000000000000000000000000000000000000000000000008160058151811061095857fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600682111561086a577f0000000000000000000000000000000000000000000000000000000000000000816006815181106109af57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600782111561086a577f000000000000000000000000000000000000000000000000000000000000000081600781518110610a0657fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b91505090565b600080610a3a85336113e3565b9050610a5e336001600160a01b0387161480610a565750838210155b61019e611ad3565b610a69858585611ae1565b336001600160a01b03861614801590610a8457506000198114155b15610a9657610a9685338584036114e8565b60019150505b9392505050565b600a5490565b60055460ff1690565b6000610719611420565b610ac4611bc1565b610acc611bef565b610ad581611c02565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610672918590610b329086611478565b6114e8565b610b3f611bc1565b6106de6000611c7b565b60008082610b5957506000610b86565b6002831415610b6a57506008610b86565b6003831415610b7b57506010610b86565b610b866101bb611cee565b610bb27f00000000000000000000000000000000000000000000000000000000000000008260086114b7565b9150505b919050565b610bc3611bc1565b610bcb611cfe565b610bd56001611d12565b7feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c86001604051610c059190615b46565b60405180910390a1565b6008546000906107199060c0603f6114b7565b60006060610c388651610c33611aaf565b611467565b610c4d89898989898989611d69611dcb611e3a565b97509795505050505050565b6000610c636110f9565b15610c7057506000610bb6565b600082610c7f57506000610cac565b6002831415610c9057506040610cac565b6003831415610ca157506080610cac565b610cac6101bb611cee565b600954610bb2908260406114b7565b6001600160a01b031660009081526020819052604090205490565b60608088610d00610ce5610ef3565b6001600160a01b0316336001600160a01b03161460cd611ad3565b610d15610d0b610ad8565b82146101f4611ad3565b60606000610d2286611f64565b15610d4a57610d2f611f93565b610d4189610d3b6106e0565b88611fa6565b92509050610d9c565b610d52611fca565b6060610d5c611918565b9050610d688a82611fd2565b610d8c8d8d8d8d8d610d786110f9565b610d82578d610d85565b60005b878e611d69565b93509150610d9a8382611dcb565b505b610da68b8261203b565b81895167ffffffffffffffff81118015610dbf57600080fd5b50604051908082528060200260200182016040528015610de9578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061067682610f17565b610e11611bc1565b6106de6001611c7b565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610e50929190615a4e565b604051602081830303815290604052805190602001209050919050565b600080610e786106e0565b90506000610e95610e87611154565b610e8f612045565b84612293565b509050610ea28282611478565b9250505090565b60006060610eba8651610c33611aaf565b610c4d898989898989896122d661231f611e3a565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561065a5780601f1061062f5761010080835404028352916020019161065a565b60008360800151610fa5610ce5610ef3565b610fb0610d0b610ad8565b610fb8611fca565b6000610fc78660200151612388565b90506000610fd88760400151612388565b9050610fe486836125ac565b9550610ff085826125ac565b945060008751600181111561100157fe5b141561104d5761101487606001516125b8565b6060880181905261102590836125ac565b606088015260006110378888886125d9565b9050611043818361260c565b9450505050611084565b61105b8760600151826125ac565b6060880152600061106d888888612618565b90506110798184612643565b90506110438161264f565b509392505050565b60008061109933856113e3565b90508083106110b3576110ae338560006114e8565b6110c0565b6110c033858584036114e8565b5060019392505050565b6000610672338484611ae1565b600061071961266b565b6000610719600060c06110f26126e5565b91906114b7565b6008546000906107199060ff6126eb565b611112611bc1565b61111a611f93565b6111246000611d12565b7feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c86000604051610c059190615b46565b60006060611160610ef3565b6001600160a01b031663f94d4668611176610ad8565b6040518263ffffffff1660e01b81526004016111929190615b69565b60006040518083038186803b1580156111aa57600080fd5b505afa1580156111be573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111e691908101906154f1565b509150506111fb816111f6611918565b611fd2565b6060611205612045565b9050610ea281836126f2565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886112648c610f17565b8960405160200161127a96959493929190615b91565b6040516020818303038152906040528051906020012090506112ab88826112a2878787612764565b886101f86127a3565b6112b68888886114e8565b5050505050505050565b606080886112cf610ce5610ef3565b6112da610d0b610ad8565b6112e2611fca565b60606112ec611918565b90506112f66106e0565b6113a3576000606061130b8d8d8d868b6127fa565b9150915061132461131a61283d565b83101560cc611ad3565b611336600061133161283d565b612844565b6113498b61134261283d565b8403612844565b611353818461231f565b808a5167ffffffffffffffff8111801561136c57600080fd5b50604051908082528060200260200182016040528015611396578160200160208202803683370190505b5095509550505050610df1565b6113ad8882611fd2565b600060606113d58d8d8d8d8d6113c16110f9565b6113cb578d6113ce565b60005b898e6122d6565b915091506113498b83612844565b60006113ed610ef3565b6001600160a01b0316826001600160a01b0316141561140f5750600019610676565b611419838361284e565b9050610676565b6000610719612879565b6060610719612045565b600061143f836114ad565b61144b85858585612916565b95945050505050565b6000611461848484612a06565b50501b90565b6114748183146067611ad3565b5050565b6000828201610a9c8482101583611ad3565b6000611497848484612a06565b506001901b60001901811b1992909216911b1790565b8061147481612a4d565b6001901b6000190191901c1690565b60006114d6838311156001611ad3565b50900390565b80820390821102900390565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611543908590615b69565b60405180910390a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6060816001600160a01b0316612710630e8e3e8460e01b600060405160240161159d9190615ca9565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516115f09190615a76565b6000604051808303818686fa925050503d806000811461162c576040519150601f19603f3d011682016040523d82523d6000602084013e611631565b606091505b509150506114748151600014610190611ad3565b61164d611bef565b6000611657611154565b905060008061167583611668612045565b6116706106e0565b612293565b9150915061168282612ac6565b61168b83612add565b801561169a5761169a81612ae6565b505050565b60006001600160a01b038316631a7c32636116bc848460086114b7565b6040518263ffffffff1660e01b81526004016116d89190615b69565b60206040518083038186803b1580156116f057600080fd5b505afa158015611704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172891906155dd565b905060006001600160a01b038416631a7c3263611747856008806114b7565b6040518263ffffffff1660e01b81526004016117639190615b69565b60206040518083038186803b15801561177b57600080fd5b505afa15801561178f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b391906155dd565b905060006001600160a01b038516631a7c32636117d386601060086114b7565b6040518263ffffffff1660e01b81526004016117ef9190615b69565b60206040518083038186803b15801561180757600080fd5b505afa15801561181b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183f91906155dd565b905060006118508260806040611454565b61185c84604080611454565b6118698660006040611454565b17179050806009819055507fc3f0acc358200d8e08ac6ce20bc2f9f27893a344f813bf682b7859b3e521502e816040516118a39190615b69565b60405180910390a1505050505050565b60006118bd6118f4565b42118061071957505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60606000611924611aaf565b905060608167ffffffffffffffff8111801561193f57600080fd5b50604051908082528060200260200182016040528015611969578160200160208202803683370190505b509050611974612b26565b8160008151811061198157fe5b602002602001018181525050611995612b4a565b816001815181106119a257fe5b602002602001018181525050600282111561086a576119bf612b6e565b816002815181106119cc57fe5b602002602001018181525050600382111561086a576119e9612b92565b816003815181106119f657fe5b602002602001018181525050600482111561086a57611a13612bb6565b81600481518110611a2057fe5b602002602001018181525050600582111561086a57611a3d612bda565b81600581518110611a4a57fe5b602002602001018181525050600682111561086a57611a67612bfe565b81600681518110611a7457fe5b602002602001018181525050600782111561086a57611a91612c22565b81600781518110611a9e57fe5b602002602001018181525050610a27565b7f000000000000000000000000000000000000000000000000000000000000000090565b816114745761147481611cee565b611af86001600160a01b0384161515610198611ad3565b611b0f6001600160a01b0383161515610199611ad3565b611b1a83838361169a565b6001600160a01b038316600090815260208190526040902054611b4090826101a0612c46565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b6f9082611478565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611543908590615b69565b6000611bd86000356001600160e01b031916610e1b565b9050610ad5611be78233612c5c565b610191611ad3565b6106de611bfa6118b3565b610192611ad3565b611c17611c0d612d45565b82101560cb611ad3565b611c2c611c22612d4e565b82111560ca611ad3565b600854611c3d908260c0603f61148a565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611c70908390615b69565b60405180910390a150565b8015611c9b57611c96611c8c6118d0565b4210610193611ad3565b611cb0565b611cb0611ca66118f4565b42106101a9611ad3565b6007805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611c70908390615b46565b610ad5816210905360ea1b612d5a565b6106de611d096110f9565b156101b5611ad3565b600854611d21908260ff612dbb565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611d54908390615b46565b60405180910390a180610ad557610ad5612dca565b6000606080611d76612045565b9050600080611d858a84612e12565b9150915060006060611d9b8e8d878c888d612e72565b9092509050611db7838d838888611db281896114c6565b612f05565b909e909d509b505050505050505050505050565b81518151611dda908290611467565b60005b81811015611e3457611e15848281518110611df457fe5b6020026020010151848381518110611e0857fe5b6020026020010151612f29565b848281518110611e2157fe5b6020908102919091010152600101611ddd565b50505050565b333014611ef8576000306001600160a01b0316600036604051611e5e929190615a66565b6000604051808303816000865af19150503d8060008114611e9b576040519150601f19603f3d011682016040523d82523d6000602084013e611ea0565b606091505b505090508060008114611eaf57fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b8114611eda573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611f00611fca565b6060611f0a611918565b9050611f168782611fd2565b60006060611f2e8c8c8c8c8c8c898d8d63ffffffff16565b91509150611f4081848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b6000808251118015610676575060ff801682806020019051810190611f8991906159cb565b60ff161492915050565b6106de611f9e6110f9565b6101b6611ad3565b60006060611fb383612f7c565b9150611fc0858584612f92565b9050935093915050565b6106de611bef565b81518151611fe1908290611467565b60005b81811015611e345761201c848281518110611ffb57fe5b602002602001015184838151811061200f57fe5b6020026020010151613041565b84828151811061202857fe5b6020908102919091010152600101611fe4565b6114748282613074565b60606000612051611aaf565b905060608167ffffffffffffffff8111801561206c57600080fd5b50604051908082528060200260200182016040528015612096578160200160208202803683370190505b5090507f0000000000000000000000000000000000000000000000000000000000000000816000815181106120c757fe5b6020026020010181815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061210157fe5b602002602001018181525050600282111561086a577f00000000000000000000000000000000000000000000000000000000000000008160028151811061214457fe5b602002602001018181525050600382111561086a577f00000000000000000000000000000000000000000000000000000000000000008160038151811061218757fe5b602002602001018181525050600482111561086a577f0000000000000000000000000000000000000000000000000000000000000000816004815181106121ca57fe5b602002602001018181525050600582111561086a577f00000000000000000000000000000000000000000000000000000000000000008160058151811061220d57fe5b602002602001018181525050600682111561086a577f00000000000000000000000000000000000000000000000000000000000000008160068151811061225057fe5b602002602001018181525050600782111561086a577f000000000000000000000000000000000000000000000000000000000000000081600781518110611a9e57fe5b60008060006122ab866122a66000610c59565b613140565b90506000806122b987613166565b915091506122c9868385016131d6565b9890975095505050505050565b60006060806122e3612045565b90506000806122f28a84612e12565b91509150600060606123088e8d878c888d6131f3565b9092509050611db7838d838888611db28189611478565b8151815161232e908290611467565b60005b81811015611e345761236984828151811061234857fe5b602002602001015184838151811061235c57fe5b602002602001015161326f565b84828151811061237557fe5b6020908102919091010152600101612331565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156123d3576123cc612b26565b9050610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612415576123cc612b4a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612457576123cc612b6e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612499576123cc612b92565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156124db576123cc612bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561251d576123cc612bda565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561255f576123cc612bfe565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125a1576123cc612c22565b610bb6610135611cee565b6000610a9c8383613041565b6000806125cd6125c6610c0f565b84906132bc565b9050610bb283826114c6565b6000612604836125ec86602001516132f4565b846125fa88604001516132f4565b88606001516135fe565b949350505050565b6000610a9c8383612f29565b60006126048361262b86602001516132f4565b8461263988604001516132f4565b8860600151613679565b6000610a9c838361326f565b600061067661266461265f610c0f565b6136ef565b839061326f565b6000612675610ef3565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156126ad57600080fd5b505afa1580156126c1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610719919061571a565b60085490565b1c60011690565b670de0b6b3a764000060005b83518110156127545761274a61274385838151811061271957fe5b602002602001015185848151811061272d57fe5b602002602001015161370190919063ffffffff16565b8390613041565b91506001016126fe565b5061067660008211610137611ad3565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b60006127ae856137b2565b90506127c46127be8783876137ce565b83611ad3565b6127d3428410156101b8611ad3565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b6000606061280661387d565b6128225761282261281d612818612045565b6138a1565b612ae6565b61282f8787878787613b04565b915091509550959350505050565b620f424090565b6114748282613b94565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006128e6613c27565b306040516020016128fb959493929190615c4b565b60405160208183030381529060405280519060200120905090565b600080856001600160a01b03166309b2760f866040518263ffffffff1660e01b81526004016129459190615c95565b602060405180830381600087803b15801561295f57600080fd5b505af1158015612973573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299791906155dd565b604051633354e3e960e11b81529091506001600160a01b038716906366a9c7d2906129ca90849088908890600401615bc5565b600060405180830381600087803b1580156129e457600080fd5b505af11580156129f8573d6000803e3d6000fd5b509298975050505050505050565b612a1561010083106064611ad3565b612a3e60018210158015612a375750612a3360ff84610100036114dc565b8211155b6064611ad3565b61169a83821c156101b4611ad3565b600281511015612a5c57610ad5565b600081600081518110612a6b57fe5b602002602001015190506000600190505b825181101561169a576000838281518110612a9357fe5b60200260200101519050612abc816001600160a01b0316846001600160a01b0316106065611ad3565b9150600101612a7c565b8015610ad557610ad5612ad7611211565b82612844565b610ad581613c2b565b7f836ff8964123d8b264c228d02eae300e3c2112664d4622b62c883b1128f66df5600a5482604051612b19929190615d03565b60405180910390a1600a55565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000612c558484111583611ad3565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612c7b610ecf565b6001600160a01b031614158015612c965750612c9683613c4b565b15612cbe57612ca3610ecf565b6001600160a01b0316336001600160a01b0316149050610676565b612cc661266b565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612cf593929190615b72565b60206040518083038186803b158015612d0d57600080fd5b505afa158015612d21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141991906155bd565b64e8d4a5100090565b67016345785d8a000090565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b6001811b1992909216911b1790565b612dda612dd5611154565b612add565b612de261387d565b6106de576000612df0610aa3565b90506000612dff612818612045565b9050818111156114745761147481612ae6565b6000806000612e1f6106e0565b90506000612e2d85876126f2565b9050600080612e3d838886612293565b90925090508015612e5157612e5181612ae6565b612e5a82612ac6565b612e648483611478565b989297509195505050505050565b600060606000612e8184613c56565b90506000816002811115612e9157fe5b1415612ead57612ea388888787613c6c565b9250925050612efa565b6001816002811115612ebb57fe5b1415612ecc57612ea3888686613d3b565b6002816002811115612eda57fe5b1415612eed57612ea38888888888613d67565b612ef8610150611cee565b505b965096945050505050565b6000612f15878787878787613dc6565b9050612f2081612ac6565b50505050505050565b6000612f388215156004611ad3565b670de0b6b3a76400008302612f6a841580612f635750670de0b6b3a7640000858381612f6057fe5b04145b6005611ad3565b828181612f7357fe5b04949350505050565b600081806020019051810190610a9c91906159e7565b60606000612fa08385612f29565b9050845167ffffffffffffffff81118015612fba57600080fd5b50604051908082528060200260200182016040528015612fe4578160200160208202803683370190505b50915060005b8551811015613038576130198287838151811061300357fe5b602002602001015161304190919063ffffffff16565b83828151811061302557fe5b6020908102919091010152600101612fea565b50509392505050565b600082820261306584158061305e57508385838161305b57fe5b04145b6003611ad3565b670de0b6b3a764000081612f73565b61308b6001600160a01b038316151561019b611ad3565b6130978260008361169a565b6001600160a01b0382166000908152602081905260409020546130bd90826101b2612c46565b6001600160a01b0383166000908152602081905260409020556130f06130eb826130e56106e0565b90613ebf565b613ecd565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516131349190615b69565b60405180910390a35050565b6000610a9c6131576131506110e1565b8590612f29565b670de0b6b3a764000084613ed2565b60008061317161387d565b15613181575060009050806131d1565b600a54600061318f856138a1565b90508181116131a6576000809350935050506131d1565b6131cb6131b38284612f29565b670de0b6b3a76400006131c66002610c59565b613ed2565b93509150505b915091565b6000610a9c6131e58484613f10565b6131ee846136ef565b613f2a565b60006060600061320284613f4a565b9050600181600381111561321257fe5b141561322557612ea38888888888613f60565b600281600381111561323357fe5b141561324557612ea388888787613fb0565b600381600381111561325357fe5b141561326457612ea388868661400e565b612ef8610136611cee565b600061327e8215156004611ad3565b670de0b6b3a764000083026132a6841580612f635750670de0b6b3a7640000858381612f6057fe5b6001836001830304018115150291505092915050565b60008282026132d684158061305e57508385838161305b57fe5b6001670de0b6b3a76400006001830304018115150291505092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561335757507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156133b857507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561341957507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561347a57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156134db57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561353c57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561359d57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125a157507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b600061362061361587670429d069189e0000613041565b831115610130611ad3565b600061362c8784611478565b9050600061363a888361326f565b905060006136488887612f29565b90506000613656838361402c565b905061366b613664826136ef565b8990613041565b9a9950505050505050505050565b600061369b61369085670429d069189e0000613041565b831115610131611ad3565b60006136b16136aa86856114c6565b869061326f565b905060006136bf858861326f565b905060006136cd838361402c565b905060006136e382670de0b6b3a76400006114c6565b905061366b8a826132bc565b670de0b6b3a764000081810391100290565b6000670de0b6b3a764000082141561371a575081610676565b671bc16d674ec80000821415613734576114198384613041565b673782dace9d9000008214156137645760006137508485613041565b905061375c8182613041565b915050610676565b600061377084846140b2565b9050600061378a613783836127106132bc565b6001611478565b90508082101561379f57600092505050610676565b6137a982826114c6565b92505050610676565b60006137bc612879565b82604051602001610e50929190615a92565b60006137e082516041146101b9611ad3565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613819908990859088908890615c77565b6020604051602081039080840390855afa15801561383b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906138715750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8051600090816139276138e48583856138b657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b613922866001815181106138f457fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b613041565b905060028211156139815761397a6139738560028151811061394557fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b8290613041565b905061398a565b9150610bb69050565b6003821115613981576139d4613973856003815181106139a657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600482111561398157613a20613973856004815181106139f257fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600582111561398157613a6c61397385600581518110613a3e57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600682111561398157613ab861397385600681518110613a8a57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b90506007821115610bb25761260461397385600781518110613ad657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b600060606000613b1384613f4a565b9050613b2e6000826003811115613b2657fe5b1460ce611ad3565b6060613b3985614253565b9050613b4781518751611467565b613b518187611fd2565b6060613b5b612045565b90506000613b6982846126f2565b90506000613b78828551613f10565b9050613b8382612add565b9b929a509198505050505050505050565b613ba06000838361169a565b613bb56130eb82613baf6106e0565b90611478565b6001600160a01b038216600090815260208190526040902054613bd89082611478565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613134908590615b69565b4690565b610ad5613c4682600060c0613c3e6126e5565b92919061148a565b614269565b60006106768261427e565b6000818060200190518101906106769190615736565b60006060600080613c7c85614289565b91509150613c8e885182106064611ad3565b6000613cca898381518110613c9f57fe5b6020026020010151898481518110613cb357fe5b6020026020010151858a613cc5610c0f565b6142ab565b90506060895167ffffffffffffffff81118015613ce657600080fd5b50604051908082528060200260200182016040528015613d10578160200160208202803683370190505b50905081818481518110613d2057fe5b60209081029190910101529299929850919650505050505050565b600060606000613d4a84614361565b90506060613d59878784612f92565b919791965090945050505050565b60006060806000613d7785614377565b91509150613d8782518a51611467565b613d918288611fd2565b6000613da78a8a858a613da2610c0f565b61438f565b9050613db78282111560cf611ad3565b99919850909650505050505050565b600082821015815b8751811015613e605781613e1157613e0c888281518110613deb57fe5b6020026020010151888381518110613dff57fe5b6020026020010151613ebf565b613e41565b613e41888281518110613e2057fe5b6020026020010151888381518110613e3457fe5b6020026020010151611478565b888281518110613e4d57fe5b6020908102919091010152600101613dce565b506000613e6d86896126f2565b90506000613e7b6000610c59565b9050613e8682612add565b80613e975760009350505050613eb5565b6000613eae613ea6848d612f29565b8888856144cd565b9450505050505b9695505050505050565b6000610a9c83836001612c46565b600255565b60008383101580613ee1575081155b15613eee57506000610a9c565b6000613efa8486612f29565b670de0b6b3a764000003905061144b8184613041565b6000828202610a9c84158061305e57508385838161305b57fe5b6000613f398215156004611ad3565b818381613f4257fe5b049392505050565b60008180602001905181019061067691906157f7565b60006060806000613f70856144f0565b91509150613f8089518351611467565b613f8a8288611fd2565b6000613fa08a8a858a613f9b610c0f565b614508565b9050613db78282101560d0611ad3565b60006060600080613fc08561463c565b91509150613fd2885182106064611ad3565b6000613cca898381518110613fe357fe5b6020026020010151898481518110613ff757fe5b6020026020010151858a614009610c0f565b614653565b60006060600061401d846146e9565b90506060613d598787846146ff565b6000670de0b6b3a7640000821415614045575081610676565b671bc16d674ec8000082141561405f5761141983846132bc565b673782dace9d90000082141561408757600061407b84856132bc565b905061375c81826132bc565b600061409384846140b2565b905060006140a6613783836127106132bc565b90506137a98282611478565b6000816140c85750670de0b6b3a7640000610676565b826140d557506000610676565b6140e560ff84901c156006611ad3565b8261410b770bce5086492111aea88f4bb1ca6bcf584181ea8059f7653284106007611ad3565b826000670c7d713b49da00008313801561412c5750670f43fc2c04ee000083125b1561416357600061413c8461478f565b9050670de0b6b3a764000080820784020583670de0b6b3a764000083050201915050614171565b8161416d846148b6565b0290505b670de0b6b3a764000090056141a9680238fd42c5cf03ffff1982128015906141a2575068070c1cc73b00c800008213155b6008611ad3565b613eb581614c56565b60006001600160a01b038216156142435761423e83836001600160a01b031663679aefce6040518163ffffffff1660e01b815260040160206040518083038186803b15801561420057600080fd5b505afa158015614214573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061423891906155dd565b90613701565b610a9c565b50670de0b6b3a764000092915050565b606081806020019051810190610a9c9190615812565b60085461427890826000615034565b60085550565b600061067682615060565b600080828060200190518101906142a091906157c2565b909590945092505050565b6000806142c2846142bc81886114c6565b9061326f565b90506142db6709b6e64a8ec60000821015610132611ad3565b60006142f96142f2670de0b6b3a764000089612f29565b839061402c565b90506000614310614309836136ef565b8a90613041565b905060006143276143208a6136ef565b83906132bc565b9050600061433583836114c6565b905060006143456125c6896136ef565b90506143518282611478565b9c9b505050505050505050505050565b600081806020019051810190610a9c9190615796565b60606000828060200190518101906142a09190615751565b60006060845167ffffffffffffffff811180156143ab57600080fd5b506040519080825280602002602001820160405280156143d5578160200160208202803683370190505b5090506000805b885181101561449a576144358982815181106143f457fe5b60200260200101516142bc89848151811061440b57fe5b60200260200101518c858151811061441f57fe5b60200260200101516114c690919063ffffffff16565b83828151811061444157fe5b60200260200101818152505061449061448989838151811061445f57fe5b602002602001015185848151811061447357fe5b60200260200101516132bc90919063ffffffff16565b8390611478565b91506001016143dc565b5060006144ab89898986868a615083565b90506144c06144b9826136ef565b87906132bc565b9998505050505050505050565b6000806144e4866144de8688612f29565b85613ed2565b9050613eb584826131d6565b60606000828060200190518101906142a0919061585f565b60006060845167ffffffffffffffff8111801561452457600080fd5b5060405190808252806020026020018201604052801561454e578160200160208202803683370190505b5090506000805b88518110156145fc576145b489828151811061456d57fe5b60200260200101516145ae89848151811061458457fe5b60200260200101518c858151811061459857fe5b602002602001015161147890919063ffffffff16565b90612f29565b8382815181106145c057fe5b6020026020010181815250506145f26144898983815181106145de57fe5b602002602001015185848151811061300357fe5b9150600101614555565b50600061460d89898986868a6151a1565b90506000670de0b6b3a7640000821161462757600061366b565b61366b87670de0b6b3a763ffff198401613041565b600080828060200190518101906142a09190615899565b600080614664846142bc8188611478565b905061467d6729a2241af62c0000821115610133611ad3565b60006146946142f2670de0b6b3a76400008961326f565b905060006146b46146ad83670de0b6b3a76400006114c6565b8a906132bc565b905060006146c46143208a6136ef565b905060006146d283836114c6565b905060006143456146e2896136ef565b849061326f565b600081806020019051810190610a9c919061587d565b6060600061470d838561326f565b9050845167ffffffffffffffff8111801561472757600080fd5b50604051908082528060200260200182016040528015614751578160200160208202803683370190505b50915060005b8551811015613038576147708287838151811061447357fe5b83828151811061477c57fe5b6020908102919091010152600101614757565b670de0b6b3a7640000026000806ec097ce7bc90715b34b9f1000000000808401906ec097ce7bc90715b34b9f0fffffffff19850102816147cb57fe5b05905060006ec097ce7bc90715b34b9f100000000082800205905081806ec097ce7bc90715b34b9f100000000081840205915060038205016ec097ce7bc90715b34b9f100000000082840205915060058205016ec097ce7bc90715b34b9f100000000082840205915060078205016ec097ce7bc90715b34b9f100000000082840205915060098205016ec097ce7bc90715b34b9f1000000000828402059150600b8205016ec097ce7bc90715b34b9f1000000000828402059150600d8205016ec097ce7bc90715b34b9f1000000000828402059150600f826002919005919091010295945050505050565b6000670de0b6b3a76400008212156148f3576148e9826ec097ce7bc90715b34b9f1000000000816148e357fe5b056148b6565b6000039050610bb6565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c0000000000000831261494457770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e000000831261497c576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff008400083126149c4576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a70083126149ff576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf8508312614a3657693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e28312614a6d57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d038312614aa25768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb417461211108312614acd57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d8312614b02576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312614b37576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b2866038312614b6b576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac8312614b9f576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d631000008086030281614bc257fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000614c85680238fd42c5cf03ffff198312158015614c7e575068070c1cc73b00c800008313155b6009611ad3565b6000821215614cb957614c9a82600003614c56565b6ec097ce7bc90715b34b9f100000000081614cb157fe5b059050610bb6565b60006806f05b59d3b20000008312614cf957506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec630262827000000000614d2f565b6803782dace9d90000008312614d2b57506803782dace9d8ffffff19909101906b1425982cf597cd205cef7380614d2f565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac620000008412614d7f5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412614dbb576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412614df557682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412614e2f576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412614e6857680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412614ea15768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412614eda576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412614f135768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b77ffffffffffffffffffffffffffffffffffffffffffffffff828116821b90821b198416179392505050565b6000615072631c74c91760e11b610e1b565b8214806106765750610676826152ad565b670de0b6b3a764000060005b87518110156151965760008582815181106150a657fe5b60200260200101518511156151095760006150cf6150c3876136ef565b8b858151811061300357fe5b905060006150e3828a868151811061441f57fe5b905060006150f3612664886136ef565b90506150ff8382611478565b935050505061512e565b86828151811061511557fe5b60200260200101519050806000141561512e575061518e565b60006151578a848151811061513f57fe5b60200260200101516145ae848d878151811061441f57fe5b90506151896151828a858151811061516b57fe5b60200260200101518361370190919063ffffffff16565b8590613041565b935050505b60010161508f565b509695505050505050565b670de0b6b3a764000060005b8751811015615196576000848683815181106151c557fe5b6020026020010151111561523e576000670de0b6b3a764000086116151eb576000615205565b615205670de0b6b3a764000087038b858151811061300357fe5b905060006152238661521d848c888151811061441f57fe5b906132bc565b9050615235818a868151811061441f57fe5b92505050615263565b86828151811061524a57fe5b60200260200101519050806000141561526357506152a5565b600061528c8a848151811061527457fe5b60200260200101516145ae848d878151811061459857fe5b90506152a06151828a858151811061516b57fe5b935050505b6001016151ad565b50600090565b803561067681615d90565b600082601f8301126152ce578081fd5b81516152e16152dc82615d38565b615d11565b81815291506020808301908481018184028601820187101561530257600080fd5b60005b8481101561532157815184529282019290820190600101615305565b505050505092915050565b600082601f83011261533c578081fd5b813567ffffffffffffffff811115615352578182fd5b615365601f8201601f1916602001615d11565b915080825283602082850101111561537c57600080fd5b8060208401602084013760009082016020015292915050565b80516003811061067657600080fd5b80516004811061067657600080fd5b80356002811061067657600080fd5b6000602082840312156153d3578081fd5b8135610a9c81615d90565b600080604083850312156153f0578081fd5b82356153fb81615d90565b9150602083013561540b81615d90565b809150509250929050565b60008060006060848603121561542a578081fd5b833561543581615d90565b9250602084013561544581615d90565b929592945050506040919091013590565b600080600080600080600060e0888a031215615470578283fd5b873561547b81615d90565b9650602088013561548b81615d90565b9550604088013594506060880135935060808801356154a981615da5565b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156154d8578182fd5b82356154e381615d90565b946020939093013593505050565b600080600060608486031215615505578081fd5b835167ffffffffffffffff8082111561551c578283fd5b818601915086601f83011261552f578283fd5b815161553d6152dc82615d38565b80828252602080830192508086018b82838702890101111561555d578788fd5b8796505b8487101561558857805161557481615d90565b845260019690960195928101928101615561565b50890151909750935050508082111561559f578283fd5b506155ac868287016152be565b925050604084015190509250925092565b6000602082840312156155ce578081fd5b81518015158114610a9c578182fd5b6000602082840312156155ee578081fd5b5051919050565b600080600080600080600060e0888a03121561560f578081fd5b8735965060208089013561562281615d90565b9650604089013561563281615d90565b9550606089013567ffffffffffffffff8082111561564e578384fd5b818b0191508b601f830112615661578384fd5b813561566f6152dc82615d38565b8082825285820191508585018f87888602880101111561568d578788fd5b8795505b838610156156af578035835260019590950194918601918601615691565b509850505060808b0135955060a08b0135945060c08b01359250808311156156d5578384fd5b50506156e38a828b0161532c565b91505092959891949750929550565b600060208284031215615703578081fd5b81356001600160e01b031981168114610a9c578182fd5b60006020828403121561572b578081fd5b8151610a9c81615d90565b600060208284031215615747578081fd5b610a9c8383615395565b600080600060608486031215615765578081fd5b61576f8585615395565b9250602084015167ffffffffffffffff81111561578a578182fd5b6155ac868287016152be565b600080604083850312156157a8578182fd5b6157b28484615395565b9150602083015190509250929050565b6000806000606084860312156157d6578081fd5b6157e08585615395565b925060208401519150604084015190509250925092565b600060208284031215615808578081fd5b610a9c83836153a4565b60008060408385031215615824578182fd5b61582e84846153a4565b9150602083015167ffffffffffffffff811115615849578182fd5b615855858286016152be565b9150509250929050565b600080600060608486031215615873578081fd5b61576f85856153a4565b6000806040838503121561588f578182fd5b6157b284846153a4565b6000806000606084860312156158ad578081fd5b6157e085856153a4565b6000806000606084860312156158cb578081fd5b833567ffffffffffffffff808211156158e2578283fd5b81860191506101208083890312156158f8578384fd5b61590181615d11565b905061590d88846153b3565b815261591c88602085016152b3565b602082015261592e88604085016152b3565b6040820152606083013560608201526080830135608082015260a083013560a082015261595e8860c085016152b3565b60c08201526159708860e085016152b3565b60e08201526101008084013583811115615988578586fd5b6159948a82870161532c565b9183019190915250976020870135975060409096013595945050505050565b6000602082840312156159c4578081fd5b5035919050565b6000602082840312156159dc578081fd5b8151610a9c81615da5565b600080604083850312156159f9578182fd5b8251615a0481615da5565b6020939093015192949293505050565b6000815180845260208085019450808401835b83811015615a4357815187529582019590820190600101615a27565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b60008251615a88818460208701615d64565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015615b025783516001600160a01b031683529284019291840191600101615add565b50909695505050505050565b600060208252610a9c6020830184615a14565b600060408252615b346040830185615a14565b828103602084015261144b8185615a14565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015615c0d57615bfb8551615d58565b83529383019391830191600101615be9565b505084810360408601528551808252908201925081860190845b818110156129f857615c398351615d58565b85529383019391830191600101615c27565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6020810160038310615ca357fe5b91905290565b60ff91909116815260200190565b6000602082528251806020840152615cd6816040850160208701615d64565b601f01601f19169190910160400192915050565b6000838252604060208301526126046040830184615a14565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715615d3057600080fd5b604052919050565b600067ffffffffffffffff821115615d4e578081fd5b5060209081020190565b6001600160a01b031690565b60005b83811015615d7f578181015183820152602001615d67565b83811115611e345750506000910152565b6001600160a01b0381168114610ad557600080fd5b60ff81168114610ad557600080fdfea2646970667358221220facd8832bd4db2cb689388ccb2716010e39c4c1f878e51c3c245b9f4a967e0bf64736f6c63430007010033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102ff5760003560e01c80637ecebe001161019c578063a9059cbb116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105ab578063ed24911d146105be578063f89f27ed146105c6576102ff565b8063d2946c2b1461057d578063d505accf14610585578063d5c096c414610598576102ff565b8063b35056b8116100c8578063b35056b814610565578063b7b814fc1461056d578063c0ff1a1514610575576102ff565b8063a9059cbb14610542578063aaabadc514610555578063b10962781461055d576102ff565b8063893d20e81161015057806395d89b411161012a57806395d89b41146105145780639d2c110c1461051c578063a457c2d71461052f576102ff565b8063893d20e8146104e45780638d928af8146104f957806390193b7c14610501576102ff565b8063851c1bb311610181578063851c1bb3146104b6578063876f303b146104c957806387ec6817146104d1576102ff565b80637ecebe001461049b5780638456cb59146104ae576102ff565b806338e9922e1161025557806354a844ba1161020957806370464016116101e3578063704640161461045457806370a082311461046757806374f3b0091461047a576102ff565b806354a844ba1461042357806355c676281461042b5780636028bfd414610433576102ff565b8063395093511161023a57806339509351146103f55780633f4ba83a146104085780634df77ce014610410576102ff565b806338e9922e146103da57806338fff2d0146103ed576102ff565b80631dd746ea116102b757806323ef89ed1161029157806323ef89ed146103b5578063313ce567146103bd5780633644e515146103d2576102ff565b80631dd746ea14610378578063238a2d591461038d57806323b872dd146103a2576102ff565b80630da0669c116102e85780630da0669c1461034257806318160ddd1461034c5780631c0de05114610361576102ff565b806306fdde0314610304578063095ea7b314610322575b600080fd5b61030c6105ce565b6040516103199190615cb7565b60405180910390f35b6103356103303660046154c6565b610665565b6040516103199190615b46565b61034a61067c565b005b6103546106e0565b6040516103199190615b69565b6103696106e6565b60405161031993929190615b51565b61038061070f565b6040516103199190615b0e565b61039561071e565b6040516103199190615ac1565b6103356103b0366004615416565b610a2d565b610354610aa3565b6103c5610aa9565b6040516103199190615ca9565b610354610ab2565b61034a6103e83660046159b3565b610abc565b610354610ad8565b6103356104033660046154c6565b610afc565b61034a610b37565b61035461041e3660046159b3565b610b49565b61034a610bbb565b610354610c0f565b6104466104413660046155f5565b610c22565b604051610319929190615cea565b6103546104623660046159b3565b610c59565b6103546104753660046153c2565b610cbb565b61048d6104883660046155f5565b610cd6565b604051610319929190615b21565b6103546104a93660046153c2565b610dfe565b61034a610e09565b6103546104c43660046156f2565b610e1b565b610354610e6d565b6104466104df3660046155f5565b610ea9565b6104ec610ecf565b6040516103199190615aad565b6104ec610ef3565b61035461050f3660046153c2565b610f17565b61030c610f32565b61035461052a3660046158b7565b610f93565b61033561053d3660046154c6565b61108c565b6103356105503660046154c6565b6110ca565b6104ec6110d7565b6103546110e1565b6103356110f9565b61034a61110a565b610354611154565b6104ec611211565b61034a610593366004615456565b611235565b61048d6105a63660046155f5565b6112c0565b6103546105b93660046153de565b6113e3565b610354611420565b61038061142a565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561065a5780601f1061062f5761010080835404028352916020019161065a565b820191906000526020600020905b81548152906001019060200180831161063d57829003601f168201915b505050505090505b90565b60006106723384846114e8565b5060015b92915050565b61068c610687611550565b611574565b610694611645565b6106de7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061169f565b565b60025490565b60008060006106f36118b3565b1592506106fe6118d0565b91506107086118f4565b9050909192565b6060610719611918565b905090565b6060600061072a611aaf565b905060608167ffffffffffffffff8111801561074557600080fd5b5060405190808252806020026020018201604052801561076f578160200160208202803683370190505b5090507f0000000000000000000000000000000000000000000000000000000000000000816000815181106107a057fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000816001815181106107ee57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600282111561086a577f00000000000000000000000000000000000000000000000000000000000000008160028151811061084557fe5b60200260200101906001600160a01b031690816001600160a01b031681525050610873565b91506106629050565b600382111561086a577f0000000000000000000000000000000000000000000000000000000000000000816003815181106108aa57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600482111561086a577f00000000000000000000000000000000000000000000000000000000000000008160048151811061090157fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600582111561086a577f00000000000000000000000000000000000000000000000000000000000000008160058151811061095857fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600682111561086a577f0000000000000000000000000000000000000000000000000000000000000000816006815181106109af57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600782111561086a577f000000000000000000000000000000000000000000000000000000000000000081600781518110610a0657fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b91505090565b600080610a3a85336113e3565b9050610a5e336001600160a01b0387161480610a565750838210155b61019e611ad3565b610a69858585611ae1565b336001600160a01b03861614801590610a8457506000198114155b15610a9657610a9685338584036114e8565b60019150505b9392505050565b600a5490565b60055460ff1690565b6000610719611420565b610ac4611bc1565b610acc611bef565b610ad581611c02565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610672918590610b329086611478565b6114e8565b610b3f611bc1565b6106de6000611c7b565b60008082610b5957506000610b86565b6002831415610b6a57506008610b86565b6003831415610b7b57506010610b86565b610b866101bb611cee565b610bb27f00000000000000000000000000000000000000000000000000000000000000008260086114b7565b9150505b919050565b610bc3611bc1565b610bcb611cfe565b610bd56001611d12565b7feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c86001604051610c059190615b46565b60405180910390a1565b6008546000906107199060c0603f6114b7565b60006060610c388651610c33611aaf565b611467565b610c4d89898989898989611d69611dcb611e3a565b97509795505050505050565b6000610c636110f9565b15610c7057506000610bb6565b600082610c7f57506000610cac565b6002831415610c9057506040610cac565b6003831415610ca157506080610cac565b610cac6101bb611cee565b600954610bb2908260406114b7565b6001600160a01b031660009081526020819052604090205490565b60608088610d00610ce5610ef3565b6001600160a01b0316336001600160a01b03161460cd611ad3565b610d15610d0b610ad8565b82146101f4611ad3565b60606000610d2286611f64565b15610d4a57610d2f611f93565b610d4189610d3b6106e0565b88611fa6565b92509050610d9c565b610d52611fca565b6060610d5c611918565b9050610d688a82611fd2565b610d8c8d8d8d8d8d610d786110f9565b610d82578d610d85565b60005b878e611d69565b93509150610d9a8382611dcb565b505b610da68b8261203b565b81895167ffffffffffffffff81118015610dbf57600080fd5b50604051908082528060200260200182016040528015610de9578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061067682610f17565b610e11611bc1565b6106de6001611c7b565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610e50929190615a4e565b604051602081830303815290604052805190602001209050919050565b600080610e786106e0565b90506000610e95610e87611154565b610e8f612045565b84612293565b509050610ea28282611478565b9250505090565b60006060610eba8651610c33611aaf565b610c4d898989898989896122d661231f611e3a565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561065a5780601f1061062f5761010080835404028352916020019161065a565b60008360800151610fa5610ce5610ef3565b610fb0610d0b610ad8565b610fb8611fca565b6000610fc78660200151612388565b90506000610fd88760400151612388565b9050610fe486836125ac565b9550610ff085826125ac565b945060008751600181111561100157fe5b141561104d5761101487606001516125b8565b6060880181905261102590836125ac565b606088015260006110378888886125d9565b9050611043818361260c565b9450505050611084565b61105b8760600151826125ac565b6060880152600061106d888888612618565b90506110798184612643565b90506110438161264f565b509392505050565b60008061109933856113e3565b90508083106110b3576110ae338560006114e8565b6110c0565b6110c033858584036114e8565b5060019392505050565b6000610672338484611ae1565b600061071961266b565b6000610719600060c06110f26126e5565b91906114b7565b6008546000906107199060ff6126eb565b611112611bc1565b61111a611f93565b6111246000611d12565b7feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c86000604051610c059190615b46565b60006060611160610ef3565b6001600160a01b031663f94d4668611176610ad8565b6040518263ffffffff1660e01b81526004016111929190615b69565b60006040518083038186803b1580156111aa57600080fd5b505afa1580156111be573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111e691908101906154f1565b509150506111fb816111f6611918565b611fd2565b6060611205612045565b9050610ea281836126f2565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886112648c610f17565b8960405160200161127a96959493929190615b91565b6040516020818303038152906040528051906020012090506112ab88826112a2878787612764565b886101f86127a3565b6112b68888886114e8565b5050505050505050565b606080886112cf610ce5610ef3565b6112da610d0b610ad8565b6112e2611fca565b60606112ec611918565b90506112f66106e0565b6113a3576000606061130b8d8d8d868b6127fa565b9150915061132461131a61283d565b83101560cc611ad3565b611336600061133161283d565b612844565b6113498b61134261283d565b8403612844565b611353818461231f565b808a5167ffffffffffffffff8111801561136c57600080fd5b50604051908082528060200260200182016040528015611396578160200160208202803683370190505b5095509550505050610df1565b6113ad8882611fd2565b600060606113d58d8d8d8d8d6113c16110f9565b6113cb578d6113ce565b60005b898e6122d6565b915091506113498b83612844565b60006113ed610ef3565b6001600160a01b0316826001600160a01b0316141561140f5750600019610676565b611419838361284e565b9050610676565b6000610719612879565b6060610719612045565b600061143f836114ad565b61144b85858585612916565b95945050505050565b6000611461848484612a06565b50501b90565b6114748183146067611ad3565b5050565b6000828201610a9c8482101583611ad3565b6000611497848484612a06565b506001901b60001901811b1992909216911b1790565b8061147481612a4d565b6001901b6000190191901c1690565b60006114d6838311156001611ad3565b50900390565b80820390821102900390565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611543908590615b69565b60405180910390a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6060816001600160a01b0316612710630e8e3e8460e01b600060405160240161159d9190615ca9565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516115f09190615a76565b6000604051808303818686fa925050503d806000811461162c576040519150601f19603f3d011682016040523d82523d6000602084013e611631565b606091505b509150506114748151600014610190611ad3565b61164d611bef565b6000611657611154565b905060008061167583611668612045565b6116706106e0565b612293565b9150915061168282612ac6565b61168b83612add565b801561169a5761169a81612ae6565b505050565b60006001600160a01b038316631a7c32636116bc848460086114b7565b6040518263ffffffff1660e01b81526004016116d89190615b69565b60206040518083038186803b1580156116f057600080fd5b505afa158015611704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172891906155dd565b905060006001600160a01b038416631a7c3263611747856008806114b7565b6040518263ffffffff1660e01b81526004016117639190615b69565b60206040518083038186803b15801561177b57600080fd5b505afa15801561178f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b391906155dd565b905060006001600160a01b038516631a7c32636117d386601060086114b7565b6040518263ffffffff1660e01b81526004016117ef9190615b69565b60206040518083038186803b15801561180757600080fd5b505afa15801561181b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183f91906155dd565b905060006118508260806040611454565b61185c84604080611454565b6118698660006040611454565b17179050806009819055507fc3f0acc358200d8e08ac6ce20bc2f9f27893a344f813bf682b7859b3e521502e816040516118a39190615b69565b60405180910390a1505050505050565b60006118bd6118f4565b42118061071957505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60606000611924611aaf565b905060608167ffffffffffffffff8111801561193f57600080fd5b50604051908082528060200260200182016040528015611969578160200160208202803683370190505b509050611974612b26565b8160008151811061198157fe5b602002602001018181525050611995612b4a565b816001815181106119a257fe5b602002602001018181525050600282111561086a576119bf612b6e565b816002815181106119cc57fe5b602002602001018181525050600382111561086a576119e9612b92565b816003815181106119f657fe5b602002602001018181525050600482111561086a57611a13612bb6565b81600481518110611a2057fe5b602002602001018181525050600582111561086a57611a3d612bda565b81600581518110611a4a57fe5b602002602001018181525050600682111561086a57611a67612bfe565b81600681518110611a7457fe5b602002602001018181525050600782111561086a57611a91612c22565b81600781518110611a9e57fe5b602002602001018181525050610a27565b7f000000000000000000000000000000000000000000000000000000000000000090565b816114745761147481611cee565b611af86001600160a01b0384161515610198611ad3565b611b0f6001600160a01b0383161515610199611ad3565b611b1a83838361169a565b6001600160a01b038316600090815260208190526040902054611b4090826101a0612c46565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b6f9082611478565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611543908590615b69565b6000611bd86000356001600160e01b031916610e1b565b9050610ad5611be78233612c5c565b610191611ad3565b6106de611bfa6118b3565b610192611ad3565b611c17611c0d612d45565b82101560cb611ad3565b611c2c611c22612d4e565b82111560ca611ad3565b600854611c3d908260c0603f61148a565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611c70908390615b69565b60405180910390a150565b8015611c9b57611c96611c8c6118d0565b4210610193611ad3565b611cb0565b611cb0611ca66118f4565b42106101a9611ad3565b6007805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611c70908390615b46565b610ad5816210905360ea1b612d5a565b6106de611d096110f9565b156101b5611ad3565b600854611d21908260ff612dbb565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611d54908390615b46565b60405180910390a180610ad557610ad5612dca565b6000606080611d76612045565b9050600080611d858a84612e12565b9150915060006060611d9b8e8d878c888d612e72565b9092509050611db7838d838888611db281896114c6565b612f05565b909e909d509b505050505050505050505050565b81518151611dda908290611467565b60005b81811015611e3457611e15848281518110611df457fe5b6020026020010151848381518110611e0857fe5b6020026020010151612f29565b848281518110611e2157fe5b6020908102919091010152600101611ddd565b50505050565b333014611ef8576000306001600160a01b0316600036604051611e5e929190615a66565b6000604051808303816000865af19150503d8060008114611e9b576040519150601f19603f3d011682016040523d82523d6000602084013e611ea0565b606091505b505090508060008114611eaf57fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b8114611eda573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611f00611fca565b6060611f0a611918565b9050611f168782611fd2565b60006060611f2e8c8c8c8c8c8c898d8d63ffffffff16565b91509150611f4081848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b6000808251118015610676575060ff801682806020019051810190611f8991906159cb565b60ff161492915050565b6106de611f9e6110f9565b6101b6611ad3565b60006060611fb383612f7c565b9150611fc0858584612f92565b9050935093915050565b6106de611bef565b81518151611fe1908290611467565b60005b81811015611e345761201c848281518110611ffb57fe5b602002602001015184838151811061200f57fe5b6020026020010151613041565b84828151811061202857fe5b6020908102919091010152600101611fe4565b6114748282613074565b60606000612051611aaf565b905060608167ffffffffffffffff8111801561206c57600080fd5b50604051908082528060200260200182016040528015612096578160200160208202803683370190505b5090507f0000000000000000000000000000000000000000000000000000000000000000816000815181106120c757fe5b6020026020010181815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061210157fe5b602002602001018181525050600282111561086a577f00000000000000000000000000000000000000000000000000000000000000008160028151811061214457fe5b602002602001018181525050600382111561086a577f00000000000000000000000000000000000000000000000000000000000000008160038151811061218757fe5b602002602001018181525050600482111561086a577f0000000000000000000000000000000000000000000000000000000000000000816004815181106121ca57fe5b602002602001018181525050600582111561086a577f00000000000000000000000000000000000000000000000000000000000000008160058151811061220d57fe5b602002602001018181525050600682111561086a577f00000000000000000000000000000000000000000000000000000000000000008160068151811061225057fe5b602002602001018181525050600782111561086a577f000000000000000000000000000000000000000000000000000000000000000081600781518110611a9e57fe5b60008060006122ab866122a66000610c59565b613140565b90506000806122b987613166565b915091506122c9868385016131d6565b9890975095505050505050565b60006060806122e3612045565b90506000806122f28a84612e12565b91509150600060606123088e8d878c888d6131f3565b9092509050611db7838d838888611db28189611478565b8151815161232e908290611467565b60005b81811015611e345761236984828151811061234857fe5b602002602001015184838151811061235c57fe5b602002602001015161326f565b84828151811061237557fe5b6020908102919091010152600101612331565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156123d3576123cc612b26565b9050610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612415576123cc612b4a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612457576123cc612b6e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612499576123cc612b92565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156124db576123cc612bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561251d576123cc612bda565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561255f576123cc612bfe565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125a1576123cc612c22565b610bb6610135611cee565b6000610a9c8383613041565b6000806125cd6125c6610c0f565b84906132bc565b9050610bb283826114c6565b6000612604836125ec86602001516132f4565b846125fa88604001516132f4565b88606001516135fe565b949350505050565b6000610a9c8383612f29565b60006126048361262b86602001516132f4565b8461263988604001516132f4565b8860600151613679565b6000610a9c838361326f565b600061067661266461265f610c0f565b6136ef565b839061326f565b6000612675610ef3565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156126ad57600080fd5b505afa1580156126c1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610719919061571a565b60085490565b1c60011690565b670de0b6b3a764000060005b83518110156127545761274a61274385838151811061271957fe5b602002602001015185848151811061272d57fe5b602002602001015161370190919063ffffffff16565b8390613041565b91506001016126fe565b5061067660008211610137611ad3565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b60006127ae856137b2565b90506127c46127be8783876137ce565b83611ad3565b6127d3428410156101b8611ad3565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b6000606061280661387d565b6128225761282261281d612818612045565b6138a1565b612ae6565b61282f8787878787613b04565b915091509550959350505050565b620f424090565b6114748282613b94565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006128e6613c27565b306040516020016128fb959493929190615c4b565b60405160208183030381529060405280519060200120905090565b600080856001600160a01b03166309b2760f866040518263ffffffff1660e01b81526004016129459190615c95565b602060405180830381600087803b15801561295f57600080fd5b505af1158015612973573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299791906155dd565b604051633354e3e960e11b81529091506001600160a01b038716906366a9c7d2906129ca90849088908890600401615bc5565b600060405180830381600087803b1580156129e457600080fd5b505af11580156129f8573d6000803e3d6000fd5b509298975050505050505050565b612a1561010083106064611ad3565b612a3e60018210158015612a375750612a3360ff84610100036114dc565b8211155b6064611ad3565b61169a83821c156101b4611ad3565b600281511015612a5c57610ad5565b600081600081518110612a6b57fe5b602002602001015190506000600190505b825181101561169a576000838281518110612a9357fe5b60200260200101519050612abc816001600160a01b0316846001600160a01b0316106065611ad3565b9150600101612a7c565b8015610ad557610ad5612ad7611211565b82612844565b610ad581613c2b565b7f836ff8964123d8b264c228d02eae300e3c2112664d4622b62c883b1128f66df5600a5482604051612b19929190615d03565b60405180910390a1600a55565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000612c558484111583611ad3565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612c7b610ecf565b6001600160a01b031614158015612c965750612c9683613c4b565b15612cbe57612ca3610ecf565b6001600160a01b0316336001600160a01b0316149050610676565b612cc661266b565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612cf593929190615b72565b60206040518083038186803b158015612d0d57600080fd5b505afa158015612d21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141991906155bd565b64e8d4a5100090565b67016345785d8a000090565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b6001811b1992909216911b1790565b612dda612dd5611154565b612add565b612de261387d565b6106de576000612df0610aa3565b90506000612dff612818612045565b9050818111156114745761147481612ae6565b6000806000612e1f6106e0565b90506000612e2d85876126f2565b9050600080612e3d838886612293565b90925090508015612e5157612e5181612ae6565b612e5a82612ac6565b612e648483611478565b989297509195505050505050565b600060606000612e8184613c56565b90506000816002811115612e9157fe5b1415612ead57612ea388888787613c6c565b9250925050612efa565b6001816002811115612ebb57fe5b1415612ecc57612ea3888686613d3b565b6002816002811115612eda57fe5b1415612eed57612ea38888888888613d67565b612ef8610150611cee565b505b965096945050505050565b6000612f15878787878787613dc6565b9050612f2081612ac6565b50505050505050565b6000612f388215156004611ad3565b670de0b6b3a76400008302612f6a841580612f635750670de0b6b3a7640000858381612f6057fe5b04145b6005611ad3565b828181612f7357fe5b04949350505050565b600081806020019051810190610a9c91906159e7565b60606000612fa08385612f29565b9050845167ffffffffffffffff81118015612fba57600080fd5b50604051908082528060200260200182016040528015612fe4578160200160208202803683370190505b50915060005b8551811015613038576130198287838151811061300357fe5b602002602001015161304190919063ffffffff16565b83828151811061302557fe5b6020908102919091010152600101612fea565b50509392505050565b600082820261306584158061305e57508385838161305b57fe5b04145b6003611ad3565b670de0b6b3a764000081612f73565b61308b6001600160a01b038316151561019b611ad3565b6130978260008361169a565b6001600160a01b0382166000908152602081905260409020546130bd90826101b2612c46565b6001600160a01b0383166000908152602081905260409020556130f06130eb826130e56106e0565b90613ebf565b613ecd565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516131349190615b69565b60405180910390a35050565b6000610a9c6131576131506110e1565b8590612f29565b670de0b6b3a764000084613ed2565b60008061317161387d565b15613181575060009050806131d1565b600a54600061318f856138a1565b90508181116131a6576000809350935050506131d1565b6131cb6131b38284612f29565b670de0b6b3a76400006131c66002610c59565b613ed2565b93509150505b915091565b6000610a9c6131e58484613f10565b6131ee846136ef565b613f2a565b60006060600061320284613f4a565b9050600181600381111561321257fe5b141561322557612ea38888888888613f60565b600281600381111561323357fe5b141561324557612ea388888787613fb0565b600381600381111561325357fe5b141561326457612ea388868661400e565b612ef8610136611cee565b600061327e8215156004611ad3565b670de0b6b3a764000083026132a6841580612f635750670de0b6b3a7640000858381612f6057fe5b6001836001830304018115150291505092915050565b60008282026132d684158061305e57508385838161305b57fe5b6001670de0b6b3a76400006001830304018115150291505092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561335757507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156133b857507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561341957507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561347a57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156134db57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561353c57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561359d57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125a157507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b600061362061361587670429d069189e0000613041565b831115610130611ad3565b600061362c8784611478565b9050600061363a888361326f565b905060006136488887612f29565b90506000613656838361402c565b905061366b613664826136ef565b8990613041565b9a9950505050505050505050565b600061369b61369085670429d069189e0000613041565b831115610131611ad3565b60006136b16136aa86856114c6565b869061326f565b905060006136bf858861326f565b905060006136cd838361402c565b905060006136e382670de0b6b3a76400006114c6565b905061366b8a826132bc565b670de0b6b3a764000081810391100290565b6000670de0b6b3a764000082141561371a575081610676565b671bc16d674ec80000821415613734576114198384613041565b673782dace9d9000008214156137645760006137508485613041565b905061375c8182613041565b915050610676565b600061377084846140b2565b9050600061378a613783836127106132bc565b6001611478565b90508082101561379f57600092505050610676565b6137a982826114c6565b92505050610676565b60006137bc612879565b82604051602001610e50929190615a92565b60006137e082516041146101b9611ad3565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613819908990859088908890615c77565b6020604051602081039080840390855afa15801561383b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906138715750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8051600090816139276138e48583856138b657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b613922866001815181106138f457fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b613041565b905060028211156139815761397a6139738560028151811061394557fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b8290613041565b905061398a565b9150610bb69050565b6003821115613981576139d4613973856003815181106139a657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600482111561398157613a20613973856004815181106139f257fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600582111561398157613a6c61397385600581518110613a3e57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600682111561398157613ab861397385600681518110613a8a57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b90506007821115610bb25761260461397385600781518110613ad657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b600060606000613b1384613f4a565b9050613b2e6000826003811115613b2657fe5b1460ce611ad3565b6060613b3985614253565b9050613b4781518751611467565b613b518187611fd2565b6060613b5b612045565b90506000613b6982846126f2565b90506000613b78828551613f10565b9050613b8382612add565b9b929a509198505050505050505050565b613ba06000838361169a565b613bb56130eb82613baf6106e0565b90611478565b6001600160a01b038216600090815260208190526040902054613bd89082611478565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613134908590615b69565b4690565b610ad5613c4682600060c0613c3e6126e5565b92919061148a565b614269565b60006106768261427e565b6000818060200190518101906106769190615736565b60006060600080613c7c85614289565b91509150613c8e885182106064611ad3565b6000613cca898381518110613c9f57fe5b6020026020010151898481518110613cb357fe5b6020026020010151858a613cc5610c0f565b6142ab565b90506060895167ffffffffffffffff81118015613ce657600080fd5b50604051908082528060200260200182016040528015613d10578160200160208202803683370190505b50905081818481518110613d2057fe5b60209081029190910101529299929850919650505050505050565b600060606000613d4a84614361565b90506060613d59878784612f92565b919791965090945050505050565b60006060806000613d7785614377565b91509150613d8782518a51611467565b613d918288611fd2565b6000613da78a8a858a613da2610c0f565b61438f565b9050613db78282111560cf611ad3565b99919850909650505050505050565b600082821015815b8751811015613e605781613e1157613e0c888281518110613deb57fe5b6020026020010151888381518110613dff57fe5b6020026020010151613ebf565b613e41565b613e41888281518110613e2057fe5b6020026020010151888381518110613e3457fe5b6020026020010151611478565b888281518110613e4d57fe5b6020908102919091010152600101613dce565b506000613e6d86896126f2565b90506000613e7b6000610c59565b9050613e8682612add565b80613e975760009350505050613eb5565b6000613eae613ea6848d612f29565b8888856144cd565b9450505050505b9695505050505050565b6000610a9c83836001612c46565b600255565b60008383101580613ee1575081155b15613eee57506000610a9c565b6000613efa8486612f29565b670de0b6b3a764000003905061144b8184613041565b6000828202610a9c84158061305e57508385838161305b57fe5b6000613f398215156004611ad3565b818381613f4257fe5b049392505050565b60008180602001905181019061067691906157f7565b60006060806000613f70856144f0565b91509150613f8089518351611467565b613f8a8288611fd2565b6000613fa08a8a858a613f9b610c0f565b614508565b9050613db78282101560d0611ad3565b60006060600080613fc08561463c565b91509150613fd2885182106064611ad3565b6000613cca898381518110613fe357fe5b6020026020010151898481518110613ff757fe5b6020026020010151858a614009610c0f565b614653565b60006060600061401d846146e9565b90506060613d598787846146ff565b6000670de0b6b3a7640000821415614045575081610676565b671bc16d674ec8000082141561405f5761141983846132bc565b673782dace9d90000082141561408757600061407b84856132bc565b905061375c81826132bc565b600061409384846140b2565b905060006140a6613783836127106132bc565b90506137a98282611478565b6000816140c85750670de0b6b3a7640000610676565b826140d557506000610676565b6140e560ff84901c156006611ad3565b8261410b770bce5086492111aea88f4bb1ca6bcf584181ea8059f7653284106007611ad3565b826000670c7d713b49da00008313801561412c5750670f43fc2c04ee000083125b1561416357600061413c8461478f565b9050670de0b6b3a764000080820784020583670de0b6b3a764000083050201915050614171565b8161416d846148b6565b0290505b670de0b6b3a764000090056141a9680238fd42c5cf03ffff1982128015906141a2575068070c1cc73b00c800008213155b6008611ad3565b613eb581614c56565b60006001600160a01b038216156142435761423e83836001600160a01b031663679aefce6040518163ffffffff1660e01b815260040160206040518083038186803b15801561420057600080fd5b505afa158015614214573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061423891906155dd565b90613701565b610a9c565b50670de0b6b3a764000092915050565b606081806020019051810190610a9c9190615812565b60085461427890826000615034565b60085550565b600061067682615060565b600080828060200190518101906142a091906157c2565b909590945092505050565b6000806142c2846142bc81886114c6565b9061326f565b90506142db6709b6e64a8ec60000821015610132611ad3565b60006142f96142f2670de0b6b3a764000089612f29565b839061402c565b90506000614310614309836136ef565b8a90613041565b905060006143276143208a6136ef565b83906132bc565b9050600061433583836114c6565b905060006143456125c6896136ef565b90506143518282611478565b9c9b505050505050505050505050565b600081806020019051810190610a9c9190615796565b60606000828060200190518101906142a09190615751565b60006060845167ffffffffffffffff811180156143ab57600080fd5b506040519080825280602002602001820160405280156143d5578160200160208202803683370190505b5090506000805b885181101561449a576144358982815181106143f457fe5b60200260200101516142bc89848151811061440b57fe5b60200260200101518c858151811061441f57fe5b60200260200101516114c690919063ffffffff16565b83828151811061444157fe5b60200260200101818152505061449061448989838151811061445f57fe5b602002602001015185848151811061447357fe5b60200260200101516132bc90919063ffffffff16565b8390611478565b91506001016143dc565b5060006144ab89898986868a615083565b90506144c06144b9826136ef565b87906132bc565b9998505050505050505050565b6000806144e4866144de8688612f29565b85613ed2565b9050613eb584826131d6565b60606000828060200190518101906142a0919061585f565b60006060845167ffffffffffffffff8111801561452457600080fd5b5060405190808252806020026020018201604052801561454e578160200160208202803683370190505b5090506000805b88518110156145fc576145b489828151811061456d57fe5b60200260200101516145ae89848151811061458457fe5b60200260200101518c858151811061459857fe5b602002602001015161147890919063ffffffff16565b90612f29565b8382815181106145c057fe5b6020026020010181815250506145f26144898983815181106145de57fe5b602002602001015185848151811061300357fe5b9150600101614555565b50600061460d89898986868a6151a1565b90506000670de0b6b3a7640000821161462757600061366b565b61366b87670de0b6b3a763ffff198401613041565b600080828060200190518101906142a09190615899565b600080614664846142bc8188611478565b905061467d6729a2241af62c0000821115610133611ad3565b60006146946142f2670de0b6b3a76400008961326f565b905060006146b46146ad83670de0b6b3a76400006114c6565b8a906132bc565b905060006146c46143208a6136ef565b905060006146d283836114c6565b905060006143456146e2896136ef565b849061326f565b600081806020019051810190610a9c919061587d565b6060600061470d838561326f565b9050845167ffffffffffffffff8111801561472757600080fd5b50604051908082528060200260200182016040528015614751578160200160208202803683370190505b50915060005b8551811015613038576147708287838151811061447357fe5b83828151811061477c57fe5b6020908102919091010152600101614757565b670de0b6b3a7640000026000806ec097ce7bc90715b34b9f1000000000808401906ec097ce7bc90715b34b9f0fffffffff19850102816147cb57fe5b05905060006ec097ce7bc90715b34b9f100000000082800205905081806ec097ce7bc90715b34b9f100000000081840205915060038205016ec097ce7bc90715b34b9f100000000082840205915060058205016ec097ce7bc90715b34b9f100000000082840205915060078205016ec097ce7bc90715b34b9f100000000082840205915060098205016ec097ce7bc90715b34b9f1000000000828402059150600b8205016ec097ce7bc90715b34b9f1000000000828402059150600d8205016ec097ce7bc90715b34b9f1000000000828402059150600f826002919005919091010295945050505050565b6000670de0b6b3a76400008212156148f3576148e9826ec097ce7bc90715b34b9f1000000000816148e357fe5b056148b6565b6000039050610bb6565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c0000000000000831261494457770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e000000831261497c576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff008400083126149c4576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a70083126149ff576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf8508312614a3657693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e28312614a6d57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d038312614aa25768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb417461211108312614acd57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d8312614b02576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312614b37576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b2866038312614b6b576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac8312614b9f576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d631000008086030281614bc257fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000614c85680238fd42c5cf03ffff198312158015614c7e575068070c1cc73b00c800008313155b6009611ad3565b6000821215614cb957614c9a82600003614c56565b6ec097ce7bc90715b34b9f100000000081614cb157fe5b059050610bb6565b60006806f05b59d3b20000008312614cf957506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec630262827000000000614d2f565b6803782dace9d90000008312614d2b57506803782dace9d8ffffff19909101906b1425982cf597cd205cef7380614d2f565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac620000008412614d7f5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412614dbb576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412614df557682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412614e2f576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412614e6857680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412614ea15768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412614eda576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412614f135768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b77ffffffffffffffffffffffffffffffffffffffffffffffff828116821b90821b198416179392505050565b6000615072631c74c91760e11b610e1b565b8214806106765750610676826152ad565b670de0b6b3a764000060005b87518110156151965760008582815181106150a657fe5b60200260200101518511156151095760006150cf6150c3876136ef565b8b858151811061300357fe5b905060006150e3828a868151811061441f57fe5b905060006150f3612664886136ef565b90506150ff8382611478565b935050505061512e565b86828151811061511557fe5b60200260200101519050806000141561512e575061518e565b60006151578a848151811061513f57fe5b60200260200101516145ae848d878151811061441f57fe5b90506151896151828a858151811061516b57fe5b60200260200101518361370190919063ffffffff16565b8590613041565b935050505b60010161508f565b509695505050505050565b670de0b6b3a764000060005b8751811015615196576000848683815181106151c557fe5b6020026020010151111561523e576000670de0b6b3a764000086116151eb576000615205565b615205670de0b6b3a764000087038b858151811061300357fe5b905060006152238661521d848c888151811061441f57fe5b906132bc565b9050615235818a868151811061441f57fe5b92505050615263565b86828151811061524a57fe5b60200260200101519050806000141561526357506152a5565b600061528c8a848151811061527457fe5b60200260200101516145ae848d878151811061459857fe5b90506152a06151828a858151811061516b57fe5b935050505b6001016151ad565b50600090565b803561067681615d90565b600082601f8301126152ce578081fd5b81516152e16152dc82615d38565b615d11565b81815291506020808301908481018184028601820187101561530257600080fd5b60005b8481101561532157815184529282019290820190600101615305565b505050505092915050565b600082601f83011261533c578081fd5b813567ffffffffffffffff811115615352578182fd5b615365601f8201601f1916602001615d11565b915080825283602082850101111561537c57600080fd5b8060208401602084013760009082016020015292915050565b80516003811061067657600080fd5b80516004811061067657600080fd5b80356002811061067657600080fd5b6000602082840312156153d3578081fd5b8135610a9c81615d90565b600080604083850312156153f0578081fd5b82356153fb81615d90565b9150602083013561540b81615d90565b809150509250929050565b60008060006060848603121561542a578081fd5b833561543581615d90565b9250602084013561544581615d90565b929592945050506040919091013590565b600080600080600080600060e0888a031215615470578283fd5b873561547b81615d90565b9650602088013561548b81615d90565b9550604088013594506060880135935060808801356154a981615da5565b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156154d8578182fd5b82356154e381615d90565b946020939093013593505050565b600080600060608486031215615505578081fd5b835167ffffffffffffffff8082111561551c578283fd5b818601915086601f83011261552f578283fd5b815161553d6152dc82615d38565b80828252602080830192508086018b82838702890101111561555d578788fd5b8796505b8487101561558857805161557481615d90565b845260019690960195928101928101615561565b50890151909750935050508082111561559f578283fd5b506155ac868287016152be565b925050604084015190509250925092565b6000602082840312156155ce578081fd5b81518015158114610a9c578182fd5b6000602082840312156155ee578081fd5b5051919050565b600080600080600080600060e0888a03121561560f578081fd5b8735965060208089013561562281615d90565b9650604089013561563281615d90565b9550606089013567ffffffffffffffff8082111561564e578384fd5b818b0191508b601f830112615661578384fd5b813561566f6152dc82615d38565b8082825285820191508585018f87888602880101111561568d578788fd5b8795505b838610156156af578035835260019590950194918601918601615691565b509850505060808b0135955060a08b0135945060c08b01359250808311156156d5578384fd5b50506156e38a828b0161532c565b91505092959891949750929550565b600060208284031215615703578081fd5b81356001600160e01b031981168114610a9c578182fd5b60006020828403121561572b578081fd5b8151610a9c81615d90565b600060208284031215615747578081fd5b610a9c8383615395565b600080600060608486031215615765578081fd5b61576f8585615395565b9250602084015167ffffffffffffffff81111561578a578182fd5b6155ac868287016152be565b600080604083850312156157a8578182fd5b6157b28484615395565b9150602083015190509250929050565b6000806000606084860312156157d6578081fd5b6157e08585615395565b925060208401519150604084015190509250925092565b600060208284031215615808578081fd5b610a9c83836153a4565b60008060408385031215615824578182fd5b61582e84846153a4565b9150602083015167ffffffffffffffff811115615849578182fd5b615855858286016152be565b9150509250929050565b600080600060608486031215615873578081fd5b61576f85856153a4565b6000806040838503121561588f578182fd5b6157b284846153a4565b6000806000606084860312156158ad578081fd5b6157e085856153a4565b6000806000606084860312156158cb578081fd5b833567ffffffffffffffff808211156158e2578283fd5b81860191506101208083890312156158f8578384fd5b61590181615d11565b905061590d88846153b3565b815261591c88602085016152b3565b602082015261592e88604085016152b3565b6040820152606083013560608201526080830135608082015260a083013560a082015261595e8860c085016152b3565b60c08201526159708860e085016152b3565b60e08201526101008084013583811115615988578586fd5b6159948a82870161532c565b9183019190915250976020870135975060409096013595945050505050565b6000602082840312156159c4578081fd5b5035919050565b6000602082840312156159dc578081fd5b8151610a9c81615da5565b600080604083850312156159f9578182fd5b8251615a0481615da5565b6020939093015192949293505050565b6000815180845260208085019450808401835b83811015615a4357815187529582019590820190600101615a27565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b60008251615a88818460208701615d64565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015615b025783516001600160a01b031683529284019291840191600101615add565b50909695505050505050565b600060208252610a9c6020830184615a14565b600060408252615b346040830185615a14565b828103602084015261144b8185615a14565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015615c0d57615bfb8551615d58565b83529383019391830191600101615be9565b505084810360408601528551808252908201925081860190845b818110156129f857615c398351615d58565b85529383019391830191600101615c27565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6020810160038310615ca357fe5b91905290565b60ff91909116815260200190565b6000602082528251806020840152615cd6816040850160208701615d64565b601f01601f19169190910160400192915050565b6000838252604060208301526126046040830184615a14565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715615d3057600080fd5b604052919050565b600067ffffffffffffffff821115615d4e578081fd5b5060209081020190565b6001600160a01b031690565b60005b83811015615d7f578181015183820152602001615d67565b83811115611e345750506000910152565b6001600160a01b0381168114610ad557600080fd5b60ff81168114610ad557600080fdfea2646970667358221220facd8832bd4db2cb689388ccb2716010e39c4c1f878e51c3c245b9f4a967e0bf64736f6c63430007010033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/contracts/abis/vault.json b/src/adapters/chimp-exchange/contracts/abis/vault.json new file mode 100755 index 000000000..ccaba5181 --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/abis/vault.json @@ -0,0 +1,1179 @@ +[ + { + "inputs": [ + { + "internalType": "contract IAuthorizer", + "name": "authorizer", + "type": "address" + }, + { + "internalType": "contract IWETH", + "name": "weth", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IAuthorizer", + "name": "newAuthorizer", + "type": "address" + } + ], + "name": "AuthorizerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "ExternalBalanceTransfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "contract IFlashLoanRecipient", + "name": "recipient", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + } + ], + "name": "FlashLoan", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "delta", + "type": "int256" + } + ], + "name": "InternalBalanceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "liquidityProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "int256[]", + "name": "deltas", + "type": "int256[]" + }, + { + "indexed": false, + "internalType": "uint256[]", + "name": "protocolFeeAmounts", + "type": "uint256[]" + } + ], + "name": "PoolBalanceChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "assetManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "indexed": false, + "internalType": "int256", + "name": "cashDelta", + "type": "int256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "managedDelta", + "type": "int256" + } + ], + "name": "PoolBalanceManaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "poolAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "enum IVault.PoolSpecialization", + "name": "specialization", + "type": "uint8" + } + ], + "name": "PoolRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "RelayerApprovalChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amountOut", + "type": "uint256" + } + ], + "name": "Swap", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "TokensDeregistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "assetManagers", + "type": "address[]" + } + ], + "name": "TokensRegistered", + "type": "event" + }, + { + "inputs": [], + "name": "WETH", + "outputs": [ + { + "internalType": "contract IWETH", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "assetInIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetOutIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.BatchSwapStep[]", + "name": "swaps", + "type": "tuple[]" + }, + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + }, + { + "internalType": "int256[]", + "name": "limits", + "type": "int256[]" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "batchSwap", + "outputs": [ + { + "internalType": "int256[]", + "name": "assetDeltas", + "type": "int256[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "deregisterTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "minAmountsOut", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.ExitPoolRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "exitPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IFlashLoanRecipient", + "name": "recipient", + "type": "address" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "flashLoan", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDomainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + } + ], + "name": "getInternalBalance", + "outputs": [ + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + } + ], + "name": "getNextNonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + } + ], + "name": "getPool", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "enum IVault.PoolSpecialization", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + } + ], + "name": "getPoolTokenInfo", + "outputs": [ + { + "internalType": "uint256", + "name": "cash", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "managed", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "assetManager", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + } + ], + "name": "getPoolTokens", + "outputs": [ + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProtocolFeesCollector", + "outputs": [ + { + "internalType": "contract ProtocolFeesCollector", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + } + ], + "name": "hasApprovedRelayer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "components": [ + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "maxAmountsIn", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.JoinPoolRequest", + "name": "request", + "type": "tuple" + } + ], + "name": "joinPool", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.PoolBalanceOpKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "internalType": "struct IVault.PoolBalanceOp[]", + "name": "ops", + "type": "tuple[]" + } + ], + "name": "managePoolBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.UserBalanceOpKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IAsset", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + } + ], + "internalType": "struct IVault.UserBalanceOp[]", + "name": "ops", + "type": "tuple[]" + } + ], + "name": "manageUserBalance", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "assetInIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "assetOutIndex", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.BatchSwapStep[]", + "name": "swaps", + "type": "tuple[]" + }, + { + "internalType": "contract IAsset[]", + "name": "assets", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + } + ], + "name": "queryBatchSwap", + "outputs": [ + { + "internalType": "int256[]", + "name": "", + "type": "int256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IVault.PoolSpecialization", + "name": "specialization", + "type": "uint8" + } + ], + "name": "registerPool", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "contract IERC20[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "assetManagers", + "type": "address[]" + } + ], + "name": "registerTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IAuthorizer", + "name": "newAuthorizer", + "type": "address" + } + ], + "name": "setAuthorizer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "relayer", + "type": "address" + }, + { + "internalType": "bool", + "name": "approved", + "type": "bool" + } + ], + "name": "setRelayerApproval", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IAsset", + "name": "assetIn", + "type": "address" + }, + { + "internalType": "contract IAsset", + "name": "assetOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IVault.SingleSwap", + "name": "singleSwap", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "bool", + "name": "fromInternalBalance", + "type": "bool" + }, + { + "internalType": "address payable", + "name": "recipient", + "type": "address" + }, + { + "internalType": "bool", + "name": "toInternalBalance", + "type": "bool" + } + ], + "internalType": "struct IVault.FundManagement", + "name": "funds", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "limit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "amountCalculated", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file diff --git a/src/adapters/chimp-exchange/contracts/common.ts b/src/adapters/chimp-exchange/contracts/common.ts new file mode 100755 index 000000000..56b5f21e9 --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/common.ts @@ -0,0 +1,131 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + FunctionFragment, + Typed, + EventFragment, + ContractTransaction, + ContractTransactionResponse, + DeferredTopicFilter, + EventLog, + TransactionRequest, + LogDescription, +} from "ethers"; + +export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> + extends DeferredTopicFilter {} + +export interface TypedContractEvent< + InputTuple extends Array = any, + OutputTuple extends Array = any, + OutputObject = any +> { + (...args: Partial): TypedDeferredTopicFilter< + TypedContractEvent + >; + name: string; + fragment: EventFragment; + getFragment(...args: Partial): EventFragment; +} + +type __TypechainAOutputTuple = T extends TypedContractEvent< + infer _U, + infer W +> + ? W + : never; +type __TypechainOutputObject = T extends TypedContractEvent< + infer _U, + infer _W, + infer V +> + ? V + : never; + +export interface TypedEventLog + extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export interface TypedLogDescription + extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export type TypedListener = ( + ...listenerArg: [ + ...__TypechainAOutputTuple, + TypedEventLog, + ...undefined[] + ] +) => void; + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never; +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never; + +export type StateMutability = "nonpayable" | "payable" | "view"; + +export type BaseOverrides = Omit; +export type NonPayableOverrides = Omit< + BaseOverrides, + "value" | "blockTag" | "enableCcipRead" +>; +export type PayableOverrides = Omit< + BaseOverrides, + "blockTag" | "enableCcipRead" +>; +export type ViewOverrides = Omit; +export type Overrides = S extends "nonpayable" + ? NonPayableOverrides + : S extends "payable" + ? PayableOverrides + : ViewOverrides; + +export type PostfixOverrides, S extends StateMutability> = + | A + | [...A, Overrides]; +export type ContractMethodArgs< + A extends Array, + S extends StateMutability +> = PostfixOverrides<{ [I in keyof A]-?: A[I] | Typed }, S>; + +export type DefaultReturnType = R extends Array ? R[0] : R; + +// export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { +export interface TypedContractMethod< + A extends Array = Array, + R = any, + S extends StateMutability = "payable" +> { + (...args: ContractMethodArgs): S extends "view" + ? Promise> + : Promise; + + name: string; + + fragment: FunctionFragment; + + getFragment(...args: ContractMethodArgs): FunctionFragment; + + populateTransaction( + ...args: ContractMethodArgs + ): Promise; + staticCall( + ...args: ContractMethodArgs + ): Promise>; + send(...args: ContractMethodArgs): Promise; + estimateGas(...args: ContractMethodArgs): Promise; + staticCallResult(...args: ContractMethodArgs): Promise; +} diff --git a/src/adapters/chimp-exchange/contracts/factories/BalancerPoolDataQueries__factory.ts b/src/adapters/chimp-exchange/contracts/factories/BalancerPoolDataQueries__factory.ts new file mode 100644 index 000000000..6865a5ffa --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/factories/BalancerPoolDataQueries__factory.ts @@ -0,0 +1,474 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { + BalancerPoolDataQueries, + BalancerPoolDataQueriesInterface, +} from "../BalancerPoolDataQueries"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract IVault", + name: "_vault", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getAmpForPools", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getInRecoveryModeForPools", + outputs: [ + { + internalType: "bool[]", + name: "", + type: "bool[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getIsPausedForPools", + outputs: [ + { + internalType: "bool[]", + name: "", + type: "bool[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getLinearTargetsForPools", + outputs: [ + { + internalType: "uint256[][]", + name: "", + type: "uint256[][]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getNormalizedWeightsForPools", + outputs: [ + { + internalType: "uint256[][]", + name: "", + type: "uint256[][]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32[]", + name: "poolIds", + type: "bytes32[]", + }, + { + components: [ + { + internalType: "bool", + name: "loadTokenBalanceUpdatesAfterBlock", + type: "bool", + }, + { + internalType: "bool", + name: "loadTotalSupply", + type: "bool", + }, + { + internalType: "bool", + name: "loadSwapFees", + type: "bool", + }, + { + internalType: "bool", + name: "loadLinearWrappedTokenRates", + type: "bool", + }, + { + internalType: "bool", + name: "loadLinearTargets", + type: "bool", + }, + { + internalType: "bool", + name: "loadNormalizedWeights", + type: "bool", + }, + { + internalType: "bool", + name: "loadScalingFactors", + type: "bool", + }, + { + internalType: "bool", + name: "loadAmps", + type: "bool", + }, + { + internalType: "bool", + name: "loadRates", + type: "bool", + }, + { + internalType: "uint256", + name: "blockNumber", + type: "uint256", + }, + { + internalType: "enum TotalSupplyType[]", + name: "totalSupplyTypes", + type: "uint8[]", + }, + { + internalType: "enum SwapFeeType[]", + name: "swapFeeTypes", + type: "uint8[]", + }, + { + internalType: "uint256[]", + name: "linearPoolIdxs", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "weightedPoolIdxs", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "scalingFactorPoolIdxs", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "ampPoolIdxs", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "ratePoolIdxs", + type: "uint256[]", + }, + ], + internalType: "struct PoolDataQueryConfig", + name: "config", + type: "tuple", + }, + ], + name: "getPoolData", + outputs: [ + { + internalType: "uint256[][]", + name: "balances", + type: "uint256[][]", + }, + { + internalType: "uint256[]", + name: "totalSupplies", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "swapFees", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "linearWrappedTokenRates", + type: "uint256[]", + }, + { + internalType: "uint256[][]", + name: "linearTargets", + type: "uint256[][]", + }, + { + internalType: "uint256[][]", + name: "weights", + type: "uint256[][]", + }, + { + internalType: "uint256[][]", + name: "scalingFactors", + type: "uint256[][]", + }, + { + internalType: "uint256[]", + name: "amps", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "rates", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "ignoreIdxs", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32[]", + name: "poolIds", + type: "bytes32[]", + }, + { + components: [ + { + internalType: "bool", + name: "loadInRecoveryMode", + type: "bool", + }, + { + internalType: "bool", + name: "loadIsPaused", + type: "bool", + }, + ], + internalType: "struct PoolStatusQueryConfig", + name: "config", + type: "tuple", + }, + ], + name: "getPoolStatus", + outputs: [ + { + internalType: "bool[]", + name: "isPaused", + type: "bool[]", + }, + { + internalType: "bool[]", + name: "inRecoveryMode", + type: "bool[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32[]", + name: "poolIds", + type: "bytes32[]", + }, + { + internalType: "uint256", + name: "blockNumber", + type: "uint256", + }, + ], + name: "getPoolTokenBalancesWithUpdatesAfterBlock", + outputs: [ + { + internalType: "uint256[][]", + name: "", + type: "uint256[][]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getRateForPools", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getScalingFactorsForPools", + outputs: [ + { + internalType: "uint256[][]", + name: "", + type: "uint256[][]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + { + internalType: "enum SwapFeeType[]", + name: "swapFeeTypes", + type: "uint8[]", + }, + ], + name: "getSwapFeePercentageForPools", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + { + internalType: "enum TotalSupplyType[]", + name: "totalSupplyTypes", + type: "uint8[]", + }, + ], + name: "getTotalSupplyForPools", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "poolAddresses", + type: "address[]", + }, + ], + name: "getWrappedTokenRateForLinearPools", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "vault", + outputs: [ + { + internalType: "contract IVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class BalancerPoolDataQueries__factory { + static readonly abi = _abi; + static createInterface(): BalancerPoolDataQueriesInterface { + return new Interface(_abi) as BalancerPoolDataQueriesInterface; + } + static connect( + address: string, + runner?: ContractRunner | null + ): BalancerPoolDataQueries { + return new Contract( + address, + _abi, + runner + ) as unknown as BalancerPoolDataQueries; + } +} diff --git a/src/adapters/chimp-exchange/contracts/factories/Pool__factory.ts b/src/adapters/chimp-exchange/contracts/factories/Pool__factory.ts new file mode 100644 index 000000000..63cf72ebe --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/factories/Pool__factory.ts @@ -0,0 +1,1220 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { + Contract, + ContractFactory, + ContractTransactionResponse, + Interface, +} from "ethers"; +import type { + Signer, + BigNumberish, + AddressLike, + ContractDeployTransaction, + ContractRunner, +} from "ethers"; +import type { NonPayableOverrides } from "../common"; +import type { Pool, PoolInterface, WeightedPool } from "../Pool"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "symbol", + type: "string", + }, + { + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "normalizedWeights", + type: "uint256[]", + }, + { + internalType: "contract IRateProvider[]", + name: "rateProviders", + type: "address[]", + }, + { + internalType: "address[]", + name: "assetManagers", + type: "address[]", + }, + { + internalType: "uint256", + name: "swapFeePercentage", + type: "uint256", + }, + ], + internalType: "struct WeightedPool.NewPoolParams", + name: "params", + type: "tuple", + }, + { + internalType: "contract IVault", + name: "vault", + type: "address", + }, + { + internalType: "contract IProtocolFeePercentagesProvider", + name: "protocolFeeProvider", + type: "address", + }, + { + internalType: "uint256", + name: "pauseWindowDuration", + type: "uint256", + }, + { + internalType: "uint256", + name: "bufferPeriodDuration", + type: "uint256", + }, + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "oldATHRateProduct", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "newATHRateProduct", + type: "uint256", + }, + ], + name: "ATHRateProductUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "paused", + type: "bool", + }, + ], + name: "PausedStateChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes32", + name: "feeCache", + type: "bytes32", + }, + ], + name: "ProtocolFeePercentageCacheUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "enabled", + type: "bool", + }, + ], + name: "RecoveryModeStateChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "swapFeePercentage", + type: "uint256", + }, + ], + name: "SwapFeePercentageChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "disableRecoveryMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "enableRecoveryMode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "getATHRateProduct", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "selector", + type: "bytes4", + }, + ], + name: "getActionId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getActualSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAuthorizer", + outputs: [ + { + internalType: "contract IAuthorizer", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getDomainSeparator", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getInvariant", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getLastPostJoinExitInvariant", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "getNextNonce", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getNormalizedWeights", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPausedState", + outputs: [ + { + internalType: "bool", + name: "paused", + type: "bool", + }, + { + internalType: "uint256", + name: "pauseWindowEndTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "bufferPeriodEndTime", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPoolId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeType", + type: "uint256", + }, + ], + name: "getProtocolFeePercentageCache", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getProtocolFeesCollector", + outputs: [ + { + internalType: "contract IProtocolFeesCollector", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeType", + type: "uint256", + }, + ], + name: "getProviderFeeId", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getRateProviders", + outputs: [ + { + internalType: "contract IRateProvider[]", + name: "", + type: "address[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getScalingFactors", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getSwapFeePercentage", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getVault", + outputs: [ + { + internalType: "contract IVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "inRecoveryMode", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "nonces", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + { + internalType: "uint256", + name: "protocolSwapFeePercentage", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + name: "onExitPool", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + { + internalType: "uint256", + name: "protocolSwapFeePercentage", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + name: "onJoinPool", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "enum IVault.SwapKind", + name: "kind", + type: "uint8", + }, + { + internalType: "contract IERC20", + name: "tokenIn", + type: "address", + }, + { + internalType: "contract IERC20", + name: "tokenOut", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "address", + name: "to", + type: "address", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + internalType: "struct IPoolSwapStructs.SwapRequest", + name: "request", + type: "tuple", + }, + { + internalType: "uint256", + name: "balanceTokenIn", + type: "uint256", + }, + { + internalType: "uint256", + name: "balanceTokenOut", + type: "uint256", + }, + ], + name: "onSwap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "pause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + 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: "permit", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + { + internalType: "uint256", + name: "protocolSwapFeePercentage", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + name: "queryExit", + outputs: [ + { + internalType: "uint256", + name: "bptIn", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "amountsOut", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + { + internalType: "uint256", + name: "protocolSwapFeePercentage", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + name: "queryJoin", + outputs: [ + { + internalType: "uint256", + name: "bptOut", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "amountsIn", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "swapFeePercentage", + type: "uint256", + }, + ], + name: "setSwapFeePercentage", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "unpause", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "updateProtocolFeePercentageCache", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +const _bytecode = + "0x6106606040523480156200001257600080fd5b50604051620078e6380380620078e6833981016040819052620000359162001598565b856040015151866080015185604051806060016040528060008152602001600281526020016003815250888a600001518b602001518c604001518d60a001518e60c001518c8c8c600089875160021480156200008f575081155b6200009c5760016200009f565b60025b8a8a8a8a8a8a8a8a8983838a8a8e86336001600160a01b031660001b8480604051806040016040528060018152602001603160f81b81525087878160039080519060200190620000f192919062001262565b5080516200010790600490602084019062001262565b50506005805460ff19166012179055508151602092830120608052805191012060a052507f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60c05260e0526001600160601b0319606091821b81166101005291901b166101205250620001869050630163f50083111561019462000ac3565b6200019a6276a70082111561019562000ac3565b4291909101610140819052016101605260601b6001600160601b031916610180528551620001ce906002111560c862000ac3565b620001e8620001dc62000ad8565b8751111560c962000ac3565b620001f38462000add565b60006200020e8b8b898962000b7160201b620014341760201c565b9050806101a081815250508a6001600160a01b031663d2946c2b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200025357600080fd5b505afa15801562000268573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200028e919062001579565b6001600160a01b03166101c0816001600160a01b031660601b81525050505050505050505050505050505050505050505050816001600160a01b03166101e0816001600160a01b031660601b81525050600062000303826040015160088060000101600862000ba060201b620014541760201c565b6200032483602001516008600001600862000ba060201b620014541760201c565b6200034284600001516000600862000ba060201b620014541760201c565b1717610200819052905062000358838262000bb5565b506200036d915050600883111560c962000ac3565b6200038582825162000e3b60201b620014671760201c565b620003908162000e4a565b151560f81b6103205280518190600090620003a757fe5b60200260200101516001600160a01b0316610220816001600160a01b031660601b8152505080600181518110620003da57fe5b60200260200101516001600160a01b0316610240816001600160a01b031660601b81525050600282116200041057600062000427565b806002815181106200041e57fe5b60200260200101515b60601b6001600160601b03191661026052600382116200044957600062000460565b806003815181106200045757fe5b60200260200101515b60601b6001600160601b03191661028052600482116200048257600062000499565b806004815181106200049057fe5b60200260200101515b60601b6001600160601b0319166102a05260058211620004bb576000620004d2565b80600581518110620004c957fe5b60200260200101515b60601b6001600160601b0319166102c05260068211620004f45760006200050b565b806006815181106200050257fe5b60200260200101515b60601b6001600160601b0319166102e052600782116200052d57600062000544565b806007815181106200053b57fe5b60200260200101515b6001600160a01b0316610300816001600160a01b031660601b81525050505060008660400151519050620005898188606001515162000e3b60201b620014671760201c565b6103408190526000805b828160ff1610156200060357600089606001518260ff1681518110620005b557fe5b60200260200101519050620005dd662386f26fc1000082101561012e62000ac360201b60201c565b620005f7818462000ea660201b620014781790919060201c565b92505060010162000593565b506200061c670de0b6b3a7640000821461013462000ac3565b87604001516000815181106200062e57fe5b60200260200101516001600160a01b0316610360816001600160a01b031660601b8152505087604001516001815181106200066557fe5b60200260200101516001600160a01b0316610380816001600160a01b031660601b81525050600282116200069b576000620006b6565b8760400151600281518110620006ad57fe5b60200260200101515b60601b6001600160601b0319166103a05260038211620006d8576000620006f3565b8760400151600381518110620006ea57fe5b60200260200101515b60601b6001600160601b0319166103c052600482116200071557600062000730565b87604001516004815181106200072757fe5b60200260200101515b60601b6001600160601b0319166103e05260058211620007525760006200076d565b87604001516005815181106200076457fe5b60200260200101515b60601b6001600160601b03191661040052600682116200078f576000620007aa565b8760400151600681518110620007a157fe5b60200260200101515b60601b6001600160601b0319166104205260078211620007cc576000620007e7565b8760400151600781518110620007de57fe5b60200260200101515b6001600160a01b0316610440816001600160a01b031660601b815250506200082e88604001516000815181106200081a57fe5b602002602001015162000ec360201b60201c565b61046052604088015180516200084b919060019081106200081a57fe5b61048052600282116200086057600062000876565b6200087688604001516002815181106200081a57fe5b6104a052600382116200088b576000620008a1565b620008a188604001516003815181106200081a57fe5b6104c05260048211620008b6576000620008cc565b620008cc88604001516004815181106200081a57fe5b6104e05260058211620008e1576000620008f7565b620008f788604001516005815181106200081a57fe5b61050052600682116200090c57600062000922565b6200092288604001516006815181106200081a57fe5b6105205260078211620009375760006200094d565b6200094d88604001516007815181106200081a57fe5b61054052606088015180516000906200096257fe5b6020026020010151610560818152505087606001516001815181106200098457fe5b6020026020010151610580818152505060028211620009a5576000620009c0565b8760600151600281518110620009b757fe5b60200260200101515b6105a05260038211620009d5576000620009f0565b8760600151600381518110620009e757fe5b60200260200101515b6105c0526004821162000a0557600062000a20565b876060015160048151811062000a1757fe5b60200260200101515b6105e0526005821162000a3557600062000a50565b876060015160058151811062000a4757fe5b60200260200101515b610600526006821162000a6557600062000a80565b876060015160068151811062000a7757fe5b60200260200101515b610620526007821162000a9557600062000ab0565b876060015160078151811062000aa757fe5b60200260200101515b6106405250620018599650505050505050565b8162000ad45762000ad48162000f92565b5050565b600890565b62000af662000aeb62000fa7565b82101560cb62000ac3565b62000b0f62000b0462000fb0565b82111560ca62000ac3565b62000b318160c0603f60085462000fbc60201b6200148a17909392919060201c565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc9062000b6690839062001744565b60405180910390a150565b600062000b898362000fe160201b620014ad1760201c565b62000b978585858562000fed565b95945050505050565b600062000baf848484620010e7565b50501b90565b6000826001600160a01b0316631a7c326362000be460006008866200114760201b620014b7179092919060201c565b6040518263ffffffff1660e01b815260040162000c02919062001744565b60206040518083038186803b15801562000c1b57600080fd5b505afa15801562000c30573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000c56919062001560565b905060006001600160a01b038416631a7c326362000c838560088062001147602090811b620014b717901c565b6040518263ffffffff1660e01b815260040162000ca1919062001744565b60206040518083038186803b15801562000cba57600080fd5b505afa15801562000ccf573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000cf5919062001560565b905060006001600160a01b038516631a7c326362000d23866010600862001147602090811b620014b717901c565b6040518263ffffffff1660e01b815260040162000d41919062001744565b60206040518083038186803b15801562000d5a57600080fd5b505afa15801562000d6f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000d95919062001560565b9050600062000db88260408060000101604062000ba060201b620014541760201c565b62000dd5846040600001604062000ba060201b620014541760201c565b62000def866000604062000ba060201b620014541760201c565b17179050806009819055507fc3f0acc358200d8e08ac6ce20bc2f9f27893a344f813bf682b7859b3e521502e8160405162000e2b919062001744565b60405180910390a1505050505050565b62000ad4828214606762000ac3565b6000805b825181101562000e9b5760006001600160a01b031683828151811062000e7057fe5b60200260200101516001600160a01b03161462000e9257600091505062000ea1565b60010162000e4e565b50600190505b919050565b600082820162000eba848210158362000ac3565b90505b92915050565b60006001600160a01b03821630141562000ee75750670de0b6b3a764000062000ea1565b6000826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b15801562000f2357600080fd5b505afa15801562000f38573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000f5e919062001721565b60ff169050600062000f7d6012836200115660201b620014c61760201c565b600a0a670de0b6b3a764000002949350505050565b62000fa4816210905360ea1b6200116e565b50565b64e8d4a5100090565b67016345785d8a000090565b600062000fcb848484620010e7565b506001901b60001901811b1992909216911b1790565b8062000ad481620011cf565b600080856001600160a01b03166309b2760f866040518263ffffffff1660e01b81526004016200101e9190620017db565b602060405180830381600087803b1580156200103957600080fd5b505af11580156200104e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062001074919062001560565b604051633354e3e960e11b81529091506001600160a01b038716906366a9c7d290620010a9908490889088906004016200174d565b600060405180830381600087803b158015620010c457600080fd5b505af1158015620010d9573d6000803e3d6000fd5b509298975050505050505050565b620010f86101008310606462000ac3565b62001131600182101580156200112957506200112560ff84610100036200125660201b620014dc1760201c565b8211155b606462000ac3565b6200114283821c156101b462000ac3565b505050565b6001901b6000190191901c1690565b60006200116883831115600162000ac3565b50900390565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b600281511015620011e05762000fa4565b600081600081518110620011f057fe5b602002602001015190506000600190505b8251811015620011425760008382815181106200121a57fe5b602002602001015190506200124b816001600160a01b0316846001600160a01b031610606562000ac360201b60201c565b915060010162001201565b80820390821102900390565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620012a557805160ff1916838001178555620012d5565b82800160010185558215620012d5579182015b82811115620012d5578251825591602001919060010190620012b8565b50620012e3929150620012e7565b5090565b5b80821115620012e35760008155600101620012e8565b805162000ebd8162001843565b600082601f8301126200131c578081fd5b8151620013336200132d8262001817565b620017f0565b8181529150602080830190848101818402860182018710156200135557600080fd5b60005b84811015620013815781516200136e8162001843565b8452928201929082019060010162001358565b505050505092915050565b600082601f8301126200139d578081fd5b8151620013ae6200132d8262001817565b818152915060208083019084810181840286018201871015620013d057600080fd5b60005b8481101562001381578151620013e98162001843565b84529282019290820190600101620013d3565b600082601f8301126200140d578081fd5b81516200141e6200132d8262001817565b8181529150602080830190848101818402860182018710156200144057600080fd5b60005b8481101562001381578151620014598162001843565b8452928201929082019060010162001443565b600082601f8301126200147d578081fd5b81516200148e6200132d8262001817565b818152915060208083019084810181840286018201871015620014b057600080fd5b60005b848110156200138157815184529282019290820190600101620014b3565b600082601f830112620014e2578081fd5b81516001600160401b03811115620014f8578182fd5b60206200150e601f8301601f19168201620017f0565b925081835284818386010111156200152557600080fd5b60005b828110156200154557848101820151848201830152810162001528565b82811115620015575760008284860101525b50505092915050565b60006020828403121562001572578081fd5b5051919050565b6000602082840312156200158b578081fd5b815162000eba8162001843565b60008060008060008060c08789031215620015b1578182fd5b86516001600160401b0380821115620015c8578384fd5b9088019060e0828b031215620015dc578384fd5b620015e860e0620017f0565b825182811115620015f7578586fd5b620016058c828601620014d1565b8252506020830151828111156200161a578586fd5b620016288c828601620014d1565b60208301525060408301518281111562001640578586fd5b6200164e8c8286016200138c565b60408301525060608301518281111562001666578586fd5b620016748c8286016200146c565b6060830152506080830151828111156200168c578586fd5b6200169a8c828601620013fc565b60808301525060a083015182811115620016b2578586fd5b620016c08c8286016200130b565b60a08301525060c083015160c0820152809850505050620016e58860208901620012fe565b9450620016f68860408901620012fe565b93506060870151925060808701519150620017158860a08901620012fe565b90509295509295509295565b60006020828403121562001733578081fd5b815160ff8116811462000eba578182fd5b90815260200190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015620017995762001786855162001837565b8352938301939183019160010162001771565b505084810360408601528551808252908201925081860190845b81811015620010d957620017c8835162001837565b85529383019391830191600101620017b3565b6020810160038310620017ea57fe5b91905290565b6040518181016001600160401b03811182821017156200180f57600080fd5b604052919050565b60006001600160401b038211156200182d578081fd5b5060209081020190565b6001600160a01b031690565b6001600160a01b038116811462000fa457600080fd5b60805160a05160c05160e0516101005160601c6101205160601c61014051610160516101805160601c6101a0516101c05160601c6101e05160601c610200516102205160601c6102405160601c6102605160601c6102805160601c6102a05160601c6102c05160601c6102e05160601c6103005160601c6103205160f81c610340516103605160601c6103805160601c6103a05160601c6103c05160601c6103e05160601c6104005160601c6104205160601c6104405160601c61046051610480516104a0516104c0516104e05161050051610520516105405161056051610580516105a0516105c0516105e051610600516106205161064051615dea62001afc6000398061226752806135da52508061222452806135795250806121e1528061351852508061219e52806134b752508061215b528061345652508061211852806133f55250806120d5528061339452508061209b5280613333525080612c24525080612c00525080612bdc525080612bb8525080612b94525080612b70525080612b4c525080612b28525080612561528061359f52508061251f528061353e5250806124dd52806134dd52508061249b528061347c525080612459528061341b52508061241752806133ba5250806123d5528061335952508061238c52806132f8525080611ab152508061387f5250806109da5280613ae05250806109835280613a9452508061092c5280613a485250806108d552806139fc52508061087e52806139b0525080610819528061394f5250806107c252806138fe52508061077452806138c05250806106ba5280610b8b525080610699525080611213525080610ada5250806115525250806118f65250806118d2525080610ef5525080610ed1525080610e1f52508061287d5250806128bf52508061289e5250615dea6000f3fe608060405234801561001057600080fd5b50600436106102ff5760003560e01c80637ecebe001161019c578063a9059cbb116100ee578063d2946c2b11610097578063dd62ed3e11610071578063dd62ed3e146105ab578063ed24911d146105be578063f89f27ed146105c6576102ff565b8063d2946c2b1461057d578063d505accf14610585578063d5c096c414610598576102ff565b8063b35056b8116100c8578063b35056b814610565578063b7b814fc1461056d578063c0ff1a1514610575576102ff565b8063a9059cbb14610542578063aaabadc514610555578063b10962781461055d576102ff565b8063893d20e81161015057806395d89b411161012a57806395d89b41146105145780639d2c110c1461051c578063a457c2d71461052f576102ff565b8063893d20e8146104e45780638d928af8146104f957806390193b7c14610501576102ff565b8063851c1bb311610181578063851c1bb3146104b6578063876f303b146104c957806387ec6817146104d1576102ff565b80637ecebe001461049b5780638456cb59146104ae576102ff565b806338e9922e1161025557806354a844ba1161020957806370464016116101e3578063704640161461045457806370a082311461046757806374f3b0091461047a576102ff565b806354a844ba1461042357806355c676281461042b5780636028bfd414610433576102ff565b8063395093511161023a57806339509351146103f55780633f4ba83a146104085780634df77ce014610410576102ff565b806338e9922e146103da57806338fff2d0146103ed576102ff565b80631dd746ea116102b757806323ef89ed1161029157806323ef89ed146103b5578063313ce567146103bd5780633644e515146103d2576102ff565b80631dd746ea14610378578063238a2d591461038d57806323b872dd146103a2576102ff565b80630da0669c116102e85780630da0669c1461034257806318160ddd1461034c5780631c0de05114610361576102ff565b806306fdde0314610304578063095ea7b314610322575b600080fd5b61030c6105ce565b6040516103199190615cb7565b60405180910390f35b6103356103303660046154c6565b610665565b6040516103199190615b46565b61034a61067c565b005b6103546106e0565b6040516103199190615b69565b6103696106e6565b60405161031993929190615b51565b61038061070f565b6040516103199190615b0e565b61039561071e565b6040516103199190615ac1565b6103356103b0366004615416565b610a2d565b610354610aa3565b6103c5610aa9565b6040516103199190615ca9565b610354610ab2565b61034a6103e83660046159b3565b610abc565b610354610ad8565b6103356104033660046154c6565b610afc565b61034a610b37565b61035461041e3660046159b3565b610b49565b61034a610bbb565b610354610c0f565b6104466104413660046155f5565b610c22565b604051610319929190615cea565b6103546104623660046159b3565b610c59565b6103546104753660046153c2565b610cbb565b61048d6104883660046155f5565b610cd6565b604051610319929190615b21565b6103546104a93660046153c2565b610dfe565b61034a610e09565b6103546104c43660046156f2565b610e1b565b610354610e6d565b6104466104df3660046155f5565b610ea9565b6104ec610ecf565b6040516103199190615aad565b6104ec610ef3565b61035461050f3660046153c2565b610f17565b61030c610f32565b61035461052a3660046158b7565b610f93565b61033561053d3660046154c6565b61108c565b6103356105503660046154c6565b6110ca565b6104ec6110d7565b6103546110e1565b6103356110f9565b61034a61110a565b610354611154565b6104ec611211565b61034a610593366004615456565b611235565b61048d6105a63660046155f5565b6112c0565b6103546105b93660046153de565b6113e3565b610354611420565b61038061142a565b60038054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561065a5780601f1061062f5761010080835404028352916020019161065a565b820191906000526020600020905b81548152906001019060200180831161063d57829003601f168201915b505050505090505b90565b60006106723384846114e8565b5060015b92915050565b61068c610687611550565b611574565b610694611645565b6106de7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000061169f565b565b60025490565b60008060006106f36118b3565b1592506106fe6118d0565b91506107086118f4565b9050909192565b6060610719611918565b905090565b6060600061072a611aaf565b905060608167ffffffffffffffff8111801561074557600080fd5b5060405190808252806020026020018201604052801561076f578160200160208202803683370190505b5090507f0000000000000000000000000000000000000000000000000000000000000000816000815181106107a057fe5b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000000000000000000000000000000000000000000000816001815181106107ee57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600282111561086a577f00000000000000000000000000000000000000000000000000000000000000008160028151811061084557fe5b60200260200101906001600160a01b031690816001600160a01b031681525050610873565b91506106629050565b600382111561086a577f0000000000000000000000000000000000000000000000000000000000000000816003815181106108aa57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600482111561086a577f00000000000000000000000000000000000000000000000000000000000000008160048151811061090157fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600582111561086a577f00000000000000000000000000000000000000000000000000000000000000008160058151811061095857fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600682111561086a577f0000000000000000000000000000000000000000000000000000000000000000816006815181106109af57fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600782111561086a577f000000000000000000000000000000000000000000000000000000000000000081600781518110610a0657fe5b60200260200101906001600160a01b031690816001600160a01b0316815250505b91505090565b600080610a3a85336113e3565b9050610a5e336001600160a01b0387161480610a565750838210155b61019e611ad3565b610a69858585611ae1565b336001600160a01b03861614801590610a8457506000198114155b15610a9657610a9685338584036114e8565b60019150505b9392505050565b600a5490565b60055460ff1690565b6000610719611420565b610ac4611bc1565b610acc611bef565b610ad581611c02565b50565b7f000000000000000000000000000000000000000000000000000000000000000090565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610672918590610b329086611478565b6114e8565b610b3f611bc1565b6106de6000611c7b565b60008082610b5957506000610b86565b6002831415610b6a57506008610b86565b6003831415610b7b57506010610b86565b610b866101bb611cee565b610bb27f00000000000000000000000000000000000000000000000000000000000000008260086114b7565b9150505b919050565b610bc3611bc1565b610bcb611cfe565b610bd56001611d12565b7feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c86001604051610c059190615b46565b60405180910390a1565b6008546000906107199060c0603f6114b7565b60006060610c388651610c33611aaf565b611467565b610c4d89898989898989611d69611dcb611e3a565b97509795505050505050565b6000610c636110f9565b15610c7057506000610bb6565b600082610c7f57506000610cac565b6002831415610c9057506040610cac565b6003831415610ca157506080610cac565b610cac6101bb611cee565b600954610bb2908260406114b7565b6001600160a01b031660009081526020819052604090205490565b60608088610d00610ce5610ef3565b6001600160a01b0316336001600160a01b03161460cd611ad3565b610d15610d0b610ad8565b82146101f4611ad3565b60606000610d2286611f64565b15610d4a57610d2f611f93565b610d4189610d3b6106e0565b88611fa6565b92509050610d9c565b610d52611fca565b6060610d5c611918565b9050610d688a82611fd2565b610d8c8d8d8d8d8d610d786110f9565b610d82578d610d85565b60005b878e611d69565b93509150610d9a8382611dcb565b505b610da68b8261203b565b81895167ffffffffffffffff81118015610dbf57600080fd5b50604051908082528060200260200182016040528015610de9578160200160208202803683370190505b509450945050505b5097509795505050505050565b600061067682610f17565b610e11611bc1565b6106de6001611c7b565b60007f000000000000000000000000000000000000000000000000000000000000000082604051602001610e50929190615a4e565b604051602081830303815290604052805190602001209050919050565b600080610e786106e0565b90506000610e95610e87611154565b610e8f612045565b84612293565b509050610ea28282611478565b9250505090565b60006060610eba8651610c33611aaf565b610c4d898989898989896122d661231f611e3a565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6001600160a01b031660009081526006602052604090205490565b60048054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561065a5780601f1061062f5761010080835404028352916020019161065a565b60008360800151610fa5610ce5610ef3565b610fb0610d0b610ad8565b610fb8611fca565b6000610fc78660200151612388565b90506000610fd88760400151612388565b9050610fe486836125ac565b9550610ff085826125ac565b945060008751600181111561100157fe5b141561104d5761101487606001516125b8565b6060880181905261102590836125ac565b606088015260006110378888886125d9565b9050611043818361260c565b9450505050611084565b61105b8760600151826125ac565b6060880152600061106d888888612618565b90506110798184612643565b90506110438161264f565b509392505050565b60008061109933856113e3565b90508083106110b3576110ae338560006114e8565b6110c0565b6110c033858584036114e8565b5060019392505050565b6000610672338484611ae1565b600061071961266b565b6000610719600060c06110f26126e5565b91906114b7565b6008546000906107199060ff6126eb565b611112611bc1565b61111a611f93565b6111246000611d12565b7feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c86000604051610c059190615b46565b60006060611160610ef3565b6001600160a01b031663f94d4668611176610ad8565b6040518263ffffffff1660e01b81526004016111929190615b69565b60006040518083038186803b1580156111aa57600080fd5b505afa1580156111be573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111e691908101906154f1565b509150506111fb816111f6611918565b611fd2565b6060611205612045565b9050610ea281836126f2565b7f000000000000000000000000000000000000000000000000000000000000000090565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886112648c610f17565b8960405160200161127a96959493929190615b91565b6040516020818303038152906040528051906020012090506112ab88826112a2878787612764565b886101f86127a3565b6112b68888886114e8565b5050505050505050565b606080886112cf610ce5610ef3565b6112da610d0b610ad8565b6112e2611fca565b60606112ec611918565b90506112f66106e0565b6113a3576000606061130b8d8d8d868b6127fa565b9150915061132461131a61283d565b83101560cc611ad3565b611336600061133161283d565b612844565b6113498b61134261283d565b8403612844565b611353818461231f565b808a5167ffffffffffffffff8111801561136c57600080fd5b50604051908082528060200260200182016040528015611396578160200160208202803683370190505b5095509550505050610df1565b6113ad8882611fd2565b600060606113d58d8d8d8d8d6113c16110f9565b6113cb578d6113ce565b60005b898e6122d6565b915091506113498b83612844565b60006113ed610ef3565b6001600160a01b0316826001600160a01b0316141561140f5750600019610676565b611419838361284e565b9050610676565b6000610719612879565b6060610719612045565b600061143f836114ad565b61144b85858585612916565b95945050505050565b6000611461848484612a06565b50501b90565b6114748183146067611ad3565b5050565b6000828201610a9c8482101583611ad3565b6000611497848484612a06565b506001901b60001901811b1992909216911b1790565b8061147481612a4d565b6001901b6000190191901c1690565b60006114d6838311156001611ad3565b50900390565b80820390821102900390565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590611543908590615b69565b60405180910390a3505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b6060816001600160a01b0316612710630e8e3e8460e01b600060405160240161159d9190615ca9565b60408051601f198184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b03199094169390931790925290516115f09190615a76565b6000604051808303818686fa925050503d806000811461162c576040519150601f19603f3d011682016040523d82523d6000602084013e611631565b606091505b509150506114748151600014610190611ad3565b61164d611bef565b6000611657611154565b905060008061167583611668612045565b6116706106e0565b612293565b9150915061168282612ac6565b61168b83612add565b801561169a5761169a81612ae6565b505050565b60006001600160a01b038316631a7c32636116bc848460086114b7565b6040518263ffffffff1660e01b81526004016116d89190615b69565b60206040518083038186803b1580156116f057600080fd5b505afa158015611704573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172891906155dd565b905060006001600160a01b038416631a7c3263611747856008806114b7565b6040518263ffffffff1660e01b81526004016117639190615b69565b60206040518083038186803b15801561177b57600080fd5b505afa15801561178f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117b391906155dd565b905060006001600160a01b038516631a7c32636117d386601060086114b7565b6040518263ffffffff1660e01b81526004016117ef9190615b69565b60206040518083038186803b15801561180757600080fd5b505afa15801561181b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061183f91906155dd565b905060006118508260806040611454565b61185c84604080611454565b6118698660006040611454565b17179050806009819055507fc3f0acc358200d8e08ac6ce20bc2f9f27893a344f813bf682b7859b3e521502e816040516118a39190615b69565b60405180910390a1505050505050565b60006118bd6118f4565b42118061071957505060075460ff161590565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b60606000611924611aaf565b905060608167ffffffffffffffff8111801561193f57600080fd5b50604051908082528060200260200182016040528015611969578160200160208202803683370190505b509050611974612b26565b8160008151811061198157fe5b602002602001018181525050611995612b4a565b816001815181106119a257fe5b602002602001018181525050600282111561086a576119bf612b6e565b816002815181106119cc57fe5b602002602001018181525050600382111561086a576119e9612b92565b816003815181106119f657fe5b602002602001018181525050600482111561086a57611a13612bb6565b81600481518110611a2057fe5b602002602001018181525050600582111561086a57611a3d612bda565b81600581518110611a4a57fe5b602002602001018181525050600682111561086a57611a67612bfe565b81600681518110611a7457fe5b602002602001018181525050600782111561086a57611a91612c22565b81600781518110611a9e57fe5b602002602001018181525050610a27565b7f000000000000000000000000000000000000000000000000000000000000000090565b816114745761147481611cee565b611af86001600160a01b0384161515610198611ad3565b611b0f6001600160a01b0383161515610199611ad3565b611b1a83838361169a565b6001600160a01b038316600090815260208190526040902054611b4090826101a0612c46565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b6f9082611478565b6001600160a01b0380841660008181526020819052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611543908590615b69565b6000611bd86000356001600160e01b031916610e1b565b9050610ad5611be78233612c5c565b610191611ad3565b6106de611bfa6118b3565b610192611ad3565b611c17611c0d612d45565b82101560cb611ad3565b611c2c611c22612d4e565b82111560ca611ad3565b600854611c3d908260c0603f61148a565b6008556040517fa9ba3ffe0b6c366b81232caab38605a0699ad5398d6cce76f91ee809e322dafc90611c70908390615b69565b60405180910390a150565b8015611c9b57611c96611c8c6118d0565b4210610193611ad3565b611cb0565b611cb0611ca66118f4565b42106101a9611ad3565b6007805460ff19168215151790556040517f9e3a5e37224532dea67b89face185703738a228a6e8a23dee546960180d3be6490611c70908390615b46565b610ad5816210905360ea1b612d5a565b6106de611d096110f9565b156101b5611ad3565b600854611d21908260ff612dbb565b6008556040517feff3d4d215b42bf0960be9c6d5e05c22cba4df6627a3a523e2acee733b5854c890611d54908390615b46565b60405180910390a180610ad557610ad5612dca565b6000606080611d76612045565b9050600080611d858a84612e12565b9150915060006060611d9b8e8d878c888d612e72565b9092509050611db7838d838888611db281896114c6565b612f05565b909e909d509b505050505050505050505050565b81518151611dda908290611467565b60005b81811015611e3457611e15848281518110611df457fe5b6020026020010151848381518110611e0857fe5b6020026020010151612f29565b848281518110611e2157fe5b6020908102919091010152600101611ddd565b50505050565b333014611ef8576000306001600160a01b0316600036604051611e5e929190615a66565b6000604051808303816000865af19150503d8060008114611e9b576040519150601f19603f3d011682016040523d82523d6000602084013e611ea0565b606091505b505090508060008114611eaf57fe5b60046000803e6000516001600160e01b0319166343adbafb60e01b8114611eda573d6000803e3d6000fd5b506020600460003e604060205260243d03602460403e601c3d016000f35b611f00611fca565b6060611f0a611918565b9050611f168782611fd2565b60006060611f2e8c8c8c8c8c8c898d8d63ffffffff16565b91509150611f4081848663ffffffff16565b8051601f1982018390526343adbafb603f1983015260200260231982016044820181fd5b6000808251118015610676575060ff801682806020019051810190611f8991906159cb565b60ff161492915050565b6106de611f9e6110f9565b6101b6611ad3565b60006060611fb383612f7c565b9150611fc0858584612f92565b9050935093915050565b6106de611bef565b81518151611fe1908290611467565b60005b81811015611e345761201c848281518110611ffb57fe5b602002602001015184838151811061200f57fe5b6020026020010151613041565b84828151811061202857fe5b6020908102919091010152600101611fe4565b6114748282613074565b60606000612051611aaf565b905060608167ffffffffffffffff8111801561206c57600080fd5b50604051908082528060200260200182016040528015612096578160200160208202803683370190505b5090507f0000000000000000000000000000000000000000000000000000000000000000816000815181106120c757fe5b6020026020010181815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061210157fe5b602002602001018181525050600282111561086a577f00000000000000000000000000000000000000000000000000000000000000008160028151811061214457fe5b602002602001018181525050600382111561086a577f00000000000000000000000000000000000000000000000000000000000000008160038151811061218757fe5b602002602001018181525050600482111561086a577f0000000000000000000000000000000000000000000000000000000000000000816004815181106121ca57fe5b602002602001018181525050600582111561086a577f00000000000000000000000000000000000000000000000000000000000000008160058151811061220d57fe5b602002602001018181525050600682111561086a577f00000000000000000000000000000000000000000000000000000000000000008160068151811061225057fe5b602002602001018181525050600782111561086a577f000000000000000000000000000000000000000000000000000000000000000081600781518110611a9e57fe5b60008060006122ab866122a66000610c59565b613140565b90506000806122b987613166565b915091506122c9868385016131d6565b9890975095505050505050565b60006060806122e3612045565b90506000806122f28a84612e12565b91509150600060606123088e8d878c888d6131f3565b9092509050611db7838d838888611db28189611478565b8151815161232e908290611467565b60005b81811015611e345761236984828151811061234857fe5b602002602001015184838151811061235c57fe5b602002602001015161326f565b84828151811061237557fe5b6020908102919091010152600101612331565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156123d3576123cc612b26565b9050610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612415576123cc612b4a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612457576123cc612b6e565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b03161415612499576123cc612b92565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156124db576123cc612bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561251d576123cc612bda565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561255f576123cc612bfe565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125a1576123cc612c22565b610bb6610135611cee565b6000610a9c8383613041565b6000806125cd6125c6610c0f565b84906132bc565b9050610bb283826114c6565b6000612604836125ec86602001516132f4565b846125fa88604001516132f4565b88606001516135fe565b949350505050565b6000610a9c8383612f29565b60006126048361262b86602001516132f4565b8461263988604001516132f4565b8860600151613679565b6000610a9c838361326f565b600061067661266461265f610c0f565b6136ef565b839061326f565b6000612675610ef3565b6001600160a01b031663aaabadc56040518163ffffffff1660e01b815260040160206040518083038186803b1580156126ad57600080fd5b505afa1580156126c1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610719919061571a565b60085490565b1c60011690565b670de0b6b3a764000060005b83518110156127545761274a61274385838151811061271957fe5b602002602001015185848151811061272d57fe5b602002602001015161370190919063ffffffff16565b8390613041565b91506001016126fe565b5061067660008211610137611ad3565b60408051604180825260808201909252606091829190602082018180368337019050509050836020820152826040820152846060820153949350505050565b60006127ae856137b2565b90506127c46127be8783876137ce565b83611ad3565b6127d3428410156101b8611ad3565b5050506001600160a01b039092166000908152600660205260409020805460010190555050565b6000606061280661387d565b6128225761282261281d612818612045565b6138a1565b612ae6565b61282f8787878787613b04565b915091509550959350505050565b620f424090565b6114748282613b94565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006128e6613c27565b306040516020016128fb959493929190615c4b565b60405160208183030381529060405280519060200120905090565b600080856001600160a01b03166309b2760f866040518263ffffffff1660e01b81526004016129459190615c95565b602060405180830381600087803b15801561295f57600080fd5b505af1158015612973573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299791906155dd565b604051633354e3e960e11b81529091506001600160a01b038716906366a9c7d2906129ca90849088908890600401615bc5565b600060405180830381600087803b1580156129e457600080fd5b505af11580156129f8573d6000803e3d6000fd5b509298975050505050505050565b612a1561010083106064611ad3565b612a3e60018210158015612a375750612a3360ff84610100036114dc565b8211155b6064611ad3565b61169a83821c156101b4611ad3565b600281511015612a5c57610ad5565b600081600081518110612a6b57fe5b602002602001015190506000600190505b825181101561169a576000838281518110612a9357fe5b60200260200101519050612abc816001600160a01b0316846001600160a01b0316106065611ad3565b9150600101612a7c565b8015610ad557610ad5612ad7611211565b82612844565b610ad581613c2b565b7f836ff8964123d8b264c228d02eae300e3c2112664d4622b62c883b1128f66df5600a5482604051612b19929190615d03565b60405180910390a1600a55565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b7f000000000000000000000000000000000000000000000000000000000000000090565b6000612c558484111583611ad3565b5050900390565b600073ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1ba1b612c7b610ecf565b6001600160a01b031614158015612c965750612c9683613c4b565b15612cbe57612ca3610ecf565b6001600160a01b0316336001600160a01b0316149050610676565b612cc661266b565b6001600160a01b0316639be2a8848484306040518463ffffffff1660e01b8152600401612cf593929190615b72565b60206040518083038186803b158015612d0d57600080fd5b505afa158015612d21573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141991906155bd565b64e8d4a5100090565b67016345785d8a000090565b62461bcd60e51b600090815260206004526007602452600a808404818106603090810160081b958390069590950190829004918206850160101b01602363ffffff0060e086901c160160181b0190930160c81b60445260e882901c90606490fd5b6001811b1992909216911b1790565b612dda612dd5611154565b612add565b612de261387d565b6106de576000612df0610aa3565b90506000612dff612818612045565b9050818111156114745761147481612ae6565b6000806000612e1f6106e0565b90506000612e2d85876126f2565b9050600080612e3d838886612293565b90925090508015612e5157612e5181612ae6565b612e5a82612ac6565b612e648483611478565b989297509195505050505050565b600060606000612e8184613c56565b90506000816002811115612e9157fe5b1415612ead57612ea388888787613c6c565b9250925050612efa565b6001816002811115612ebb57fe5b1415612ecc57612ea3888686613d3b565b6002816002811115612eda57fe5b1415612eed57612ea38888888888613d67565b612ef8610150611cee565b505b965096945050505050565b6000612f15878787878787613dc6565b9050612f2081612ac6565b50505050505050565b6000612f388215156004611ad3565b670de0b6b3a76400008302612f6a841580612f635750670de0b6b3a7640000858381612f6057fe5b04145b6005611ad3565b828181612f7357fe5b04949350505050565b600081806020019051810190610a9c91906159e7565b60606000612fa08385612f29565b9050845167ffffffffffffffff81118015612fba57600080fd5b50604051908082528060200260200182016040528015612fe4578160200160208202803683370190505b50915060005b8551811015613038576130198287838151811061300357fe5b602002602001015161304190919063ffffffff16565b83828151811061302557fe5b6020908102919091010152600101612fea565b50509392505050565b600082820261306584158061305e57508385838161305b57fe5b04145b6003611ad3565b670de0b6b3a764000081612f73565b61308b6001600160a01b038316151561019b611ad3565b6130978260008361169a565b6001600160a01b0382166000908152602081905260409020546130bd90826101b2612c46565b6001600160a01b0383166000908152602081905260409020556130f06130eb826130e56106e0565b90613ebf565b613ecd565b60006001600160a01b0316826001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516131349190615b69565b60405180910390a35050565b6000610a9c6131576131506110e1565b8590612f29565b670de0b6b3a764000084613ed2565b60008061317161387d565b15613181575060009050806131d1565b600a54600061318f856138a1565b90508181116131a6576000809350935050506131d1565b6131cb6131b38284612f29565b670de0b6b3a76400006131c66002610c59565b613ed2565b93509150505b915091565b6000610a9c6131e58484613f10565b6131ee846136ef565b613f2a565b60006060600061320284613f4a565b9050600181600381111561321257fe5b141561322557612ea38888888888613f60565b600281600381111561323357fe5b141561324557612ea388888787613fb0565b600381600381111561325357fe5b141561326457612ea388868661400e565b612ef8610136611cee565b600061327e8215156004611ad3565b670de0b6b3a764000083026132a6841580612f635750670de0b6b3a7640000858381612f6057fe5b6001836001830304018115150291505092915050565b60008282026132d684158061305e57508385838161305b57fe5b6001670de0b6b3a76400006001830304018115150291505092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561335757507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156133b857507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561341957507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561347a57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156134db57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561353c57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b0316141561359d57507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316826001600160a01b031614156125a157507f0000000000000000000000000000000000000000000000000000000000000000610bb6565b600061362061361587670429d069189e0000613041565b831115610130611ad3565b600061362c8784611478565b9050600061363a888361326f565b905060006136488887612f29565b90506000613656838361402c565b905061366b613664826136ef565b8990613041565b9a9950505050505050505050565b600061369b61369085670429d069189e0000613041565b831115610131611ad3565b60006136b16136aa86856114c6565b869061326f565b905060006136bf858861326f565b905060006136cd838361402c565b905060006136e382670de0b6b3a76400006114c6565b905061366b8a826132bc565b670de0b6b3a764000081810391100290565b6000670de0b6b3a764000082141561371a575081610676565b671bc16d674ec80000821415613734576114198384613041565b673782dace9d9000008214156137645760006137508485613041565b905061375c8182613041565b915050610676565b600061377084846140b2565b9050600061378a613783836127106132bc565b6001611478565b90508082101561379f57600092505050610676565b6137a982826114c6565b92505050610676565b60006137bc612879565b82604051602001610e50929190615a92565b60006137e082516041146101b9611ad3565b60208281015160408085015160608601518251600080825295019283905292939092811a91600190613819908990859088908890615c77565b6020604051602081039080840390855afa15801561383b573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906138715750876001600160a01b0316816001600160a01b0316145b98975050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000090565b8051600090816139276138e48583856138b657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b613922866001815181106138f457fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b613041565b905060028211156139815761397a6139738560028151811061394557fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b8290613041565b905061398a565b9150610bb69050565b6003821115613981576139d4613973856003815181106139a657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600482111561398157613a20613973856004815181106139f257fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600582111561398157613a6c61397385600581518110613a3e57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b9050600682111561398157613ab861397385600681518110613a8a57fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b90506007821115610bb25761260461397385600781518110613ad657fe5b60200260200101517f00000000000000000000000000000000000000000000000000000000000000006141b2565b600060606000613b1384613f4a565b9050613b2e6000826003811115613b2657fe5b1460ce611ad3565b6060613b3985614253565b9050613b4781518751611467565b613b518187611fd2565b6060613b5b612045565b90506000613b6982846126f2565b90506000613b78828551613f10565b9050613b8382612add565b9b929a509198505050505050505050565b613ba06000838361169a565b613bb56130eb82613baf6106e0565b90611478565b6001600160a01b038216600090815260208190526040902054613bd89082611478565b6001600160a01b0383166000818152602081905260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613134908590615b69565b4690565b610ad5613c4682600060c0613c3e6126e5565b92919061148a565b614269565b60006106768261427e565b6000818060200190518101906106769190615736565b60006060600080613c7c85614289565b91509150613c8e885182106064611ad3565b6000613cca898381518110613c9f57fe5b6020026020010151898481518110613cb357fe5b6020026020010151858a613cc5610c0f565b6142ab565b90506060895167ffffffffffffffff81118015613ce657600080fd5b50604051908082528060200260200182016040528015613d10578160200160208202803683370190505b50905081818481518110613d2057fe5b60209081029190910101529299929850919650505050505050565b600060606000613d4a84614361565b90506060613d59878784612f92565b919791965090945050505050565b60006060806000613d7785614377565b91509150613d8782518a51611467565b613d918288611fd2565b6000613da78a8a858a613da2610c0f565b61438f565b9050613db78282111560cf611ad3565b99919850909650505050505050565b600082821015815b8751811015613e605781613e1157613e0c888281518110613deb57fe5b6020026020010151888381518110613dff57fe5b6020026020010151613ebf565b613e41565b613e41888281518110613e2057fe5b6020026020010151888381518110613e3457fe5b6020026020010151611478565b888281518110613e4d57fe5b6020908102919091010152600101613dce565b506000613e6d86896126f2565b90506000613e7b6000610c59565b9050613e8682612add565b80613e975760009350505050613eb5565b6000613eae613ea6848d612f29565b8888856144cd565b9450505050505b9695505050505050565b6000610a9c83836001612c46565b600255565b60008383101580613ee1575081155b15613eee57506000610a9c565b6000613efa8486612f29565b670de0b6b3a764000003905061144b8184613041565b6000828202610a9c84158061305e57508385838161305b57fe5b6000613f398215156004611ad3565b818381613f4257fe5b049392505050565b60008180602001905181019061067691906157f7565b60006060806000613f70856144f0565b91509150613f8089518351611467565b613f8a8288611fd2565b6000613fa08a8a858a613f9b610c0f565b614508565b9050613db78282101560d0611ad3565b60006060600080613fc08561463c565b91509150613fd2885182106064611ad3565b6000613cca898381518110613fe357fe5b6020026020010151898481518110613ff757fe5b6020026020010151858a614009610c0f565b614653565b60006060600061401d846146e9565b90506060613d598787846146ff565b6000670de0b6b3a7640000821415614045575081610676565b671bc16d674ec8000082141561405f5761141983846132bc565b673782dace9d90000082141561408757600061407b84856132bc565b905061375c81826132bc565b600061409384846140b2565b905060006140a6613783836127106132bc565b90506137a98282611478565b6000816140c85750670de0b6b3a7640000610676565b826140d557506000610676565b6140e560ff84901c156006611ad3565b8261410b770bce5086492111aea88f4bb1ca6bcf584181ea8059f7653284106007611ad3565b826000670c7d713b49da00008313801561412c5750670f43fc2c04ee000083125b1561416357600061413c8461478f565b9050670de0b6b3a764000080820784020583670de0b6b3a764000083050201915050614171565b8161416d846148b6565b0290505b670de0b6b3a764000090056141a9680238fd42c5cf03ffff1982128015906141a2575068070c1cc73b00c800008213155b6008611ad3565b613eb581614c56565b60006001600160a01b038216156142435761423e83836001600160a01b031663679aefce6040518163ffffffff1660e01b815260040160206040518083038186803b15801561420057600080fd5b505afa158015614214573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061423891906155dd565b90613701565b610a9c565b50670de0b6b3a764000092915050565b606081806020019051810190610a9c9190615812565b60085461427890826000615034565b60085550565b600061067682615060565b600080828060200190518101906142a091906157c2565b909590945092505050565b6000806142c2846142bc81886114c6565b9061326f565b90506142db6709b6e64a8ec60000821015610132611ad3565b60006142f96142f2670de0b6b3a764000089612f29565b839061402c565b90506000614310614309836136ef565b8a90613041565b905060006143276143208a6136ef565b83906132bc565b9050600061433583836114c6565b905060006143456125c6896136ef565b90506143518282611478565b9c9b505050505050505050505050565b600081806020019051810190610a9c9190615796565b60606000828060200190518101906142a09190615751565b60006060845167ffffffffffffffff811180156143ab57600080fd5b506040519080825280602002602001820160405280156143d5578160200160208202803683370190505b5090506000805b885181101561449a576144358982815181106143f457fe5b60200260200101516142bc89848151811061440b57fe5b60200260200101518c858151811061441f57fe5b60200260200101516114c690919063ffffffff16565b83828151811061444157fe5b60200260200101818152505061449061448989838151811061445f57fe5b602002602001015185848151811061447357fe5b60200260200101516132bc90919063ffffffff16565b8390611478565b91506001016143dc565b5060006144ab89898986868a615083565b90506144c06144b9826136ef565b87906132bc565b9998505050505050505050565b6000806144e4866144de8688612f29565b85613ed2565b9050613eb584826131d6565b60606000828060200190518101906142a0919061585f565b60006060845167ffffffffffffffff8111801561452457600080fd5b5060405190808252806020026020018201604052801561454e578160200160208202803683370190505b5090506000805b88518110156145fc576145b489828151811061456d57fe5b60200260200101516145ae89848151811061458457fe5b60200260200101518c858151811061459857fe5b602002602001015161147890919063ffffffff16565b90612f29565b8382815181106145c057fe5b6020026020010181815250506145f26144898983815181106145de57fe5b602002602001015185848151811061300357fe5b9150600101614555565b50600061460d89898986868a6151a1565b90506000670de0b6b3a7640000821161462757600061366b565b61366b87670de0b6b3a763ffff198401613041565b600080828060200190518101906142a09190615899565b600080614664846142bc8188611478565b905061467d6729a2241af62c0000821115610133611ad3565b60006146946142f2670de0b6b3a76400008961326f565b905060006146b46146ad83670de0b6b3a76400006114c6565b8a906132bc565b905060006146c46143208a6136ef565b905060006146d283836114c6565b905060006143456146e2896136ef565b849061326f565b600081806020019051810190610a9c919061587d565b6060600061470d838561326f565b9050845167ffffffffffffffff8111801561472757600080fd5b50604051908082528060200260200182016040528015614751578160200160208202803683370190505b50915060005b8551811015613038576147708287838151811061447357fe5b83828151811061477c57fe5b6020908102919091010152600101614757565b670de0b6b3a7640000026000806ec097ce7bc90715b34b9f1000000000808401906ec097ce7bc90715b34b9f0fffffffff19850102816147cb57fe5b05905060006ec097ce7bc90715b34b9f100000000082800205905081806ec097ce7bc90715b34b9f100000000081840205915060038205016ec097ce7bc90715b34b9f100000000082840205915060058205016ec097ce7bc90715b34b9f100000000082840205915060078205016ec097ce7bc90715b34b9f100000000082840205915060098205016ec097ce7bc90715b34b9f1000000000828402059150600b8205016ec097ce7bc90715b34b9f1000000000828402059150600d8205016ec097ce7bc90715b34b9f1000000000828402059150600f826002919005919091010295945050505050565b6000670de0b6b3a76400008212156148f3576148e9826ec097ce7bc90715b34b9f1000000000816148e357fe5b056148b6565b6000039050610bb6565b60007e1600ef3172e58d2e933ec884fde10064c63b5372d805e203c0000000000000831261494457770195e54c5dd42177f53a27172fa9ec630262827000000000830592506806f05b59d3b2000000015b73011798004d755d3c8bc8e03204cf44619e000000831261497c576b1425982cf597cd205cef7380830592506803782dace9d9000000015b606492830292026e01855144814a7ff805980ff008400083126149c4576e01855144814a7ff805980ff008400068056bc75e2d63100000840205925068ad78ebc5ac62000000015b6b02df0ab5a80a22c61ab5a70083126149ff576b02df0ab5a80a22c61ab5a70068056bc75e2d6310000084020592506856bc75e2d631000000015b693f1fce3da636ea5cf8508312614a3657693f1fce3da636ea5cf85068056bc75e2d631000008402059250682b5e3af16b18800000015b690127fa27722cc06cc5e28312614a6d57690127fa27722cc06cc5e268056bc75e2d6310000084020592506815af1d78b58c400000015b68280e60114edb805d038312614aa25768280e60114edb805d0368056bc75e2d631000008402059250680ad78ebc5ac6200000015b680ebc5fb417461211108312614acd57680ebc5fb4174612111068056bc75e2d631000009384020592015b6808f00f760a4b2db55d8312614b02576808f00f760a4b2db55d68056bc75e2d6310000084020592506802b5e3af16b1880000015b6806f5f17757889379378312614b37576806f5f177578893793768056bc75e2d63100000840205925068015af1d78b58c40000015b6806248f33704b2866038312614b6b576806248f33704b28660368056bc75e2d63100000840205925067ad78ebc5ac620000015b6805c548670b9510e7ac8312614b9f576805c548670b9510e7ac68056bc75e2d6310000084020592506756bc75e2d6310000015b600068056bc75e2d63100000840168056bc75e2d631000008086030281614bc257fe5b059050600068056bc75e2d63100000828002059050818068056bc75e2d63100000818402059150600382050168056bc75e2d63100000828402059150600582050168056bc75e2d63100000828402059150600782050168056bc75e2d63100000828402059150600982050168056bc75e2d63100000828402059150600b820501600202606485820105979650505050505050565b6000614c85680238fd42c5cf03ffff198312158015614c7e575068070c1cc73b00c800008313155b6009611ad3565b6000821215614cb957614c9a82600003614c56565b6ec097ce7bc90715b34b9f100000000081614cb157fe5b059050610bb6565b60006806f05b59d3b20000008312614cf957506806f05b59d3b1ffffff1990910190770195e54c5dd42177f53a27172fa9ec630262827000000000614d2f565b6803782dace9d90000008312614d2b57506803782dace9d8ffffff19909101906b1425982cf597cd205cef7380614d2f565b5060015b6064929092029168056bc75e2d6310000068ad78ebc5ac620000008412614d7f5768ad78ebc5ac61ffffff199093019268056bc75e2d631000006e01855144814a7ff805980ff008400082020590505b6856bc75e2d6310000008412614dbb576856bc75e2d630ffffff199093019268056bc75e2d631000006b02df0ab5a80a22c61ab5a70082020590505b682b5e3af16b188000008412614df557682b5e3af16b187fffff199093019268056bc75e2d63100000693f1fce3da636ea5cf85082020590505b6815af1d78b58c4000008412614e2f576815af1d78b58c3fffff199093019268056bc75e2d63100000690127fa27722cc06cc5e282020590505b680ad78ebc5ac62000008412614e6857680ad78ebc5ac61fffff199093019268056bc75e2d6310000068280e60114edb805d0382020590505b68056bc75e2d631000008412614ea15768056bc75e2d630fffff199093019268056bc75e2d63100000680ebc5fb4174612111082020590505b6802b5e3af16b18800008412614eda576802b5e3af16b187ffff199093019268056bc75e2d631000006808f00f760a4b2db55d82020590505b68015af1d78b58c400008412614f135768015af1d78b58c3ffff199093019268056bc75e2d631000006806f5f177578893793782020590505b68056bc75e2d631000008481019085906002908280020505918201919050600368056bc75e2d631000008783020505918201919050600468056bc75e2d631000008783020505918201919050600568056bc75e2d631000008783020505918201919050600668056bc75e2d631000008783020505918201919050600768056bc75e2d631000008783020505918201919050600868056bc75e2d631000008783020505918201919050600968056bc75e2d631000008783020505918201919050600a68056bc75e2d631000008783020505918201919050600b68056bc75e2d631000008783020505918201919050600c68056bc75e2d631000008783020505918201919050606468056bc75e2d63100000848402058502059695505050505050565b77ffffffffffffffffffffffffffffffffffffffffffffffff828116821b90821b198416179392505050565b6000615072631c74c91760e11b610e1b565b8214806106765750610676826152ad565b670de0b6b3a764000060005b87518110156151965760008582815181106150a657fe5b60200260200101518511156151095760006150cf6150c3876136ef565b8b858151811061300357fe5b905060006150e3828a868151811061441f57fe5b905060006150f3612664886136ef565b90506150ff8382611478565b935050505061512e565b86828151811061511557fe5b60200260200101519050806000141561512e575061518e565b60006151578a848151811061513f57fe5b60200260200101516145ae848d878151811061441f57fe5b90506151896151828a858151811061516b57fe5b60200260200101518361370190919063ffffffff16565b8590613041565b935050505b60010161508f565b509695505050505050565b670de0b6b3a764000060005b8751811015615196576000848683815181106151c557fe5b6020026020010151111561523e576000670de0b6b3a764000086116151eb576000615205565b615205670de0b6b3a764000087038b858151811061300357fe5b905060006152238661521d848c888151811061441f57fe5b906132bc565b9050615235818a868151811061441f57fe5b92505050615263565b86828151811061524a57fe5b60200260200101519050806000141561526357506152a5565b600061528c8a848151811061527457fe5b60200260200101516145ae848d878151811061459857fe5b90506152a06151828a858151811061516b57fe5b935050505b6001016151ad565b50600090565b803561067681615d90565b600082601f8301126152ce578081fd5b81516152e16152dc82615d38565b615d11565b81815291506020808301908481018184028601820187101561530257600080fd5b60005b8481101561532157815184529282019290820190600101615305565b505050505092915050565b600082601f83011261533c578081fd5b813567ffffffffffffffff811115615352578182fd5b615365601f8201601f1916602001615d11565b915080825283602082850101111561537c57600080fd5b8060208401602084013760009082016020015292915050565b80516003811061067657600080fd5b80516004811061067657600080fd5b80356002811061067657600080fd5b6000602082840312156153d3578081fd5b8135610a9c81615d90565b600080604083850312156153f0578081fd5b82356153fb81615d90565b9150602083013561540b81615d90565b809150509250929050565b60008060006060848603121561542a578081fd5b833561543581615d90565b9250602084013561544581615d90565b929592945050506040919091013590565b600080600080600080600060e0888a031215615470578283fd5b873561547b81615d90565b9650602088013561548b81615d90565b9550604088013594506060880135935060808801356154a981615da5565b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156154d8578182fd5b82356154e381615d90565b946020939093013593505050565b600080600060608486031215615505578081fd5b835167ffffffffffffffff8082111561551c578283fd5b818601915086601f83011261552f578283fd5b815161553d6152dc82615d38565b80828252602080830192508086018b82838702890101111561555d578788fd5b8796505b8487101561558857805161557481615d90565b845260019690960195928101928101615561565b50890151909750935050508082111561559f578283fd5b506155ac868287016152be565b925050604084015190509250925092565b6000602082840312156155ce578081fd5b81518015158114610a9c578182fd5b6000602082840312156155ee578081fd5b5051919050565b600080600080600080600060e0888a03121561560f578081fd5b8735965060208089013561562281615d90565b9650604089013561563281615d90565b9550606089013567ffffffffffffffff8082111561564e578384fd5b818b0191508b601f830112615661578384fd5b813561566f6152dc82615d38565b8082825285820191508585018f87888602880101111561568d578788fd5b8795505b838610156156af578035835260019590950194918601918601615691565b509850505060808b0135955060a08b0135945060c08b01359250808311156156d5578384fd5b50506156e38a828b0161532c565b91505092959891949750929550565b600060208284031215615703578081fd5b81356001600160e01b031981168114610a9c578182fd5b60006020828403121561572b578081fd5b8151610a9c81615d90565b600060208284031215615747578081fd5b610a9c8383615395565b600080600060608486031215615765578081fd5b61576f8585615395565b9250602084015167ffffffffffffffff81111561578a578182fd5b6155ac868287016152be565b600080604083850312156157a8578182fd5b6157b28484615395565b9150602083015190509250929050565b6000806000606084860312156157d6578081fd5b6157e08585615395565b925060208401519150604084015190509250925092565b600060208284031215615808578081fd5b610a9c83836153a4565b60008060408385031215615824578182fd5b61582e84846153a4565b9150602083015167ffffffffffffffff811115615849578182fd5b615855858286016152be565b9150509250929050565b600080600060608486031215615873578081fd5b61576f85856153a4565b6000806040838503121561588f578182fd5b6157b284846153a4565b6000806000606084860312156158ad578081fd5b6157e085856153a4565b6000806000606084860312156158cb578081fd5b833567ffffffffffffffff808211156158e2578283fd5b81860191506101208083890312156158f8578384fd5b61590181615d11565b905061590d88846153b3565b815261591c88602085016152b3565b602082015261592e88604085016152b3565b6040820152606083013560608201526080830135608082015260a083013560a082015261595e8860c085016152b3565b60c08201526159708860e085016152b3565b60e08201526101008084013583811115615988578586fd5b6159948a82870161532c565b9183019190915250976020870135975060409096013595945050505050565b6000602082840312156159c4578081fd5b5035919050565b6000602082840312156159dc578081fd5b8151610a9c81615da5565b600080604083850312156159f9578182fd5b8251615a0481615da5565b6020939093015192949293505050565b6000815180845260208085019450808401835b83811015615a4357815187529582019590820190600101615a27565b509495945050505050565b9182526001600160e01b031916602082015260240190565b6000828483379101908152919050565b60008251615a88818460208701615d64565b9190910192915050565b61190160f01b81526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015615b025783516001600160a01b031683529284019291840191600101615add565b50909695505050505050565b600060208252610a9c6020830184615a14565b600060408252615b346040830185615a14565b828103602084015261144b8185615a14565b901515815260200190565b92151583526020830191909152604082015260600190565b90815260200190565b9283526001600160a01b03918216602084015216604082015260600190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b60006060820185835260206060818501528186518084526080860191508288019350845b81811015615c0d57615bfb8551615d58565b83529383019391830191600101615be9565b505084810360408601528551808252908201925081860190845b818110156129f857615c398351615d58565b85529383019391830191600101615c27565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b93845260ff9290921660208401526040830152606082015260800190565b6020810160038310615ca357fe5b91905290565b60ff91909116815260200190565b6000602082528251806020840152615cd6816040850160208701615d64565b601f01601f19169190910160400192915050565b6000838252604060208301526126046040830184615a14565b918252602082015260400190565b60405181810167ffffffffffffffff81118282101715615d3057600080fd5b604052919050565b600067ffffffffffffffff821115615d4e578081fd5b5060209081020190565b6001600160a01b031690565b60005b83811015615d7f578181015183820152602001615d67565b83811115611e345750506000910152565b6001600160a01b0381168114610ad557600080fd5b60ff81168114610ad557600080fdfea2646970667358221220facd8832bd4db2cb689388ccb2716010e39c4c1f878e51c3c245b9f4a967e0bf64736f6c63430007010033"; + +type PoolConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: PoolConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class Pool__factory extends ContractFactory { + constructor(...args: PoolConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override getDeployTransaction( + params: WeightedPool.NewPoolParamsStruct, + vault: AddressLike, + protocolFeeProvider: AddressLike, + pauseWindowDuration: BigNumberish, + bufferPeriodDuration: BigNumberish, + owner: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ): Promise { + return super.getDeployTransaction( + params, + vault, + protocolFeeProvider, + pauseWindowDuration, + bufferPeriodDuration, + owner, + overrides || {} + ); + } + override deploy( + params: WeightedPool.NewPoolParamsStruct, + vault: AddressLike, + protocolFeeProvider: AddressLike, + pauseWindowDuration: BigNumberish, + bufferPeriodDuration: BigNumberish, + owner: AddressLike, + overrides?: NonPayableOverrides & { from?: string } + ) { + return super.deploy( + params, + vault, + protocolFeeProvider, + pauseWindowDuration, + bufferPeriodDuration, + owner, + overrides || {} + ) as Promise< + Pool & { + deploymentTransaction(): ContractTransactionResponse; + } + >; + } + override connect(runner: ContractRunner | null): Pool__factory { + return super.connect(runner) as Pool__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): PoolInterface { + return new Interface(_abi) as PoolInterface; + } + static connect(address: string, runner?: ContractRunner | null): Pool { + return new Contract(address, _abi, runner) as unknown as Pool; + } +} diff --git a/src/adapters/chimp-exchange/contracts/factories/Vault__factory.ts b/src/adapters/chimp-exchange/contracts/factories/Vault__factory.ts new file mode 100755 index 000000000..ed15f1dc7 --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/factories/Vault__factory.ts @@ -0,0 +1,1196 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { Vault, VaultInterface } from "../Vault"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract IAuthorizer", + name: "authorizer", + type: "address", + }, + { + internalType: "contract IWETH", + name: "weth", + type: "address", + }, + { + internalType: "uint256", + name: "pauseWindowDuration", + type: "uint256", + }, + { + internalType: "uint256", + name: "bufferPeriodDuration", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract IAuthorizer", + name: "newAuthorizer", + type: "address", + }, + ], + name: "AuthorizerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract IERC20", + name: "token", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "recipient", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "ExternalBalanceTransfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract IFlashLoanRecipient", + name: "recipient", + type: "address", + }, + { + indexed: true, + internalType: "contract IERC20", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + ], + name: "FlashLoan", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "user", + type: "address", + }, + { + indexed: true, + internalType: "contract IERC20", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "delta", + type: "int256", + }, + ], + name: "InternalBalanceChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "paused", + type: "bool", + }, + ], + name: "PausedStateChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "liquidityProvider", + type: "address", + }, + { + indexed: false, + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + { + indexed: false, + internalType: "int256[]", + name: "deltas", + type: "int256[]", + }, + { + indexed: false, + internalType: "uint256[]", + name: "protocolFeeAmounts", + type: "uint256[]", + }, + ], + name: "PoolBalanceChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "assetManager", + type: "address", + }, + { + indexed: true, + internalType: "contract IERC20", + name: "token", + type: "address", + }, + { + indexed: false, + internalType: "int256", + name: "cashDelta", + type: "int256", + }, + { + indexed: false, + internalType: "int256", + name: "managedDelta", + type: "int256", + }, + ], + name: "PoolBalanceManaged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + indexed: true, + internalType: "address", + name: "poolAddress", + type: "address", + }, + { + indexed: false, + internalType: "enum IVault.PoolSpecialization", + name: "specialization", + type: "uint8", + }, + ], + name: "PoolRegistered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "relayer", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "RelayerApprovalChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + indexed: true, + internalType: "contract IERC20", + name: "tokenIn", + type: "address", + }, + { + indexed: true, + internalType: "contract IERC20", + name: "tokenOut", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountIn", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amountOut", + type: "uint256", + }, + ], + name: "Swap", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + indexed: false, + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + ], + name: "TokensDeregistered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + indexed: false, + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + { + indexed: false, + internalType: "address[]", + name: "assetManagers", + type: "address[]", + }, + ], + name: "TokensRegistered", + type: "event", + }, + { + inputs: [], + name: "WETH", + outputs: [ + { + internalType: "contract IWETH", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "enum IVault.SwapKind", + name: "kind", + type: "uint8", + }, + { + components: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "uint256", + name: "assetInIndex", + type: "uint256", + }, + { + internalType: "uint256", + name: "assetOutIndex", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + internalType: "struct IVault.BatchSwapStep[]", + name: "swaps", + type: "tuple[]", + }, + { + internalType: "contract IAsset[]", + name: "assets", + type: "address[]", + }, + { + components: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "bool", + name: "fromInternalBalance", + type: "bool", + }, + { + internalType: "address payable", + name: "recipient", + type: "address", + }, + { + internalType: "bool", + name: "toInternalBalance", + type: "bool", + }, + ], + internalType: "struct IVault.FundManagement", + name: "funds", + type: "tuple", + }, + { + internalType: "int256[]", + name: "limits", + type: "int256[]", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "batchSwap", + outputs: [ + { + internalType: "int256[]", + name: "assetDeltas", + type: "int256[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + ], + name: "deregisterTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address payable", + name: "recipient", + type: "address", + }, + { + components: [ + { + internalType: "contract IAsset[]", + name: "assets", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "minAmountsOut", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + { + internalType: "bool", + name: "toInternalBalance", + type: "bool", + }, + ], + internalType: "struct IVault.ExitPoolRequest", + name: "request", + type: "tuple", + }, + ], + name: "exitPool", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IFlashLoanRecipient", + name: "recipient", + type: "address", + }, + { + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + name: "flashLoan", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes4", + name: "selector", + type: "bytes4", + }, + ], + name: "getActionId", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getAuthorizer", + outputs: [ + { + internalType: "contract IAuthorizer", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getDomainSeparator", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + ], + name: "getInternalBalance", + outputs: [ + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + ], + name: "getNextNonce", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPausedState", + outputs: [ + { + internalType: "bool", + name: "paused", + type: "bool", + }, + { + internalType: "uint256", + name: "pauseWindowEndTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "bufferPeriodEndTime", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + ], + name: "getPool", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "enum IVault.PoolSpecialization", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "contract IERC20", + name: "token", + type: "address", + }, + ], + name: "getPoolTokenInfo", + outputs: [ + { + internalType: "uint256", + name: "cash", + type: "uint256", + }, + { + internalType: "uint256", + name: "managed", + type: "uint256", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + { + internalType: "address", + name: "assetManager", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + ], + name: "getPoolTokens", + outputs: [ + { + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "balances", + type: "uint256[]", + }, + { + internalType: "uint256", + name: "lastChangeBlock", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getProtocolFeesCollector", + outputs: [ + { + internalType: "contract ProtocolFeesCollector", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "user", + type: "address", + }, + { + internalType: "address", + name: "relayer", + type: "address", + }, + ], + name: "hasApprovedRelayer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + components: [ + { + internalType: "contract IAsset[]", + name: "assets", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "maxAmountsIn", + type: "uint256[]", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + { + internalType: "bool", + name: "fromInternalBalance", + type: "bool", + }, + ], + internalType: "struct IVault.JoinPoolRequest", + name: "request", + type: "tuple", + }, + ], + name: "joinPool", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "enum IVault.PoolBalanceOpKind", + name: "kind", + type: "uint8", + }, + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "contract IERC20", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + internalType: "struct IVault.PoolBalanceOp[]", + name: "ops", + type: "tuple[]", + }, + ], + name: "managePoolBalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "enum IVault.UserBalanceOpKind", + name: "kind", + type: "uint8", + }, + { + internalType: "contract IAsset", + name: "asset", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address payable", + name: "recipient", + type: "address", + }, + ], + internalType: "struct IVault.UserBalanceOp[]", + name: "ops", + type: "tuple[]", + }, + ], + name: "manageUserBalance", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "enum IVault.SwapKind", + name: "kind", + type: "uint8", + }, + { + components: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "uint256", + name: "assetInIndex", + type: "uint256", + }, + { + internalType: "uint256", + name: "assetOutIndex", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + internalType: "struct IVault.BatchSwapStep[]", + name: "swaps", + type: "tuple[]", + }, + { + internalType: "contract IAsset[]", + name: "assets", + type: "address[]", + }, + { + components: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "bool", + name: "fromInternalBalance", + type: "bool", + }, + { + internalType: "address payable", + name: "recipient", + type: "address", + }, + { + internalType: "bool", + name: "toInternalBalance", + type: "bool", + }, + ], + internalType: "struct IVault.FundManagement", + name: "funds", + type: "tuple", + }, + ], + name: "queryBatchSwap", + outputs: [ + { + internalType: "int256[]", + name: "", + type: "int256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "enum IVault.PoolSpecialization", + name: "specialization", + type: "uint8", + }, + ], + name: "registerPool", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "contract IERC20[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "assetManagers", + type: "address[]", + }, + ], + name: "registerTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "contract IAuthorizer", + name: "newAuthorizer", + type: "address", + }, + ], + name: "setAuthorizer", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bool", + name: "paused", + type: "bool", + }, + ], + name: "setPaused", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "relayer", + type: "address", + }, + { + internalType: "bool", + name: "approved", + type: "bool", + }, + ], + name: "setRelayerApproval", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "enum IVault.SwapKind", + name: "kind", + type: "uint8", + }, + { + internalType: "contract IAsset", + name: "assetIn", + type: "address", + }, + { + internalType: "contract IAsset", + name: "assetOut", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bytes", + name: "userData", + type: "bytes", + }, + ], + internalType: "struct IVault.SingleSwap", + name: "singleSwap", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "bool", + name: "fromInternalBalance", + type: "bool", + }, + { + internalType: "address payable", + name: "recipient", + type: "address", + }, + { + internalType: "bool", + name: "toInternalBalance", + type: "bool", + }, + ], + internalType: "struct IVault.FundManagement", + name: "funds", + type: "tuple", + }, + { + internalType: "uint256", + name: "limit", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "swap", + outputs: [ + { + internalType: "uint256", + name: "amountCalculated", + type: "uint256", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; + +export class Vault__factory { + static readonly abi = _abi; + static createInterface(): VaultInterface { + return new Interface(_abi) as VaultInterface; + } + static connect(address: string, runner?: ContractRunner | null): Vault { + return new Contract(address, _abi, runner) as unknown as Vault; + } +} diff --git a/src/adapters/chimp-exchange/contracts/factories/index.ts b/src/adapters/chimp-exchange/contracts/factories/index.ts new file mode 100755 index 000000000..b97be7f5a --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/factories/index.ts @@ -0,0 +1,6 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { BalancerPoolDataQueries__factory } from "./BalancerPoolDataQueries__factory"; +export { Pool__factory } from "./Pool__factory"; +export { Vault__factory } from "./Vault__factory"; diff --git a/src/adapters/chimp-exchange/contracts/index.ts b/src/adapters/chimp-exchange/contracts/index.ts new file mode 100755 index 000000000..e56c13ba9 --- /dev/null +++ b/src/adapters/chimp-exchange/contracts/index.ts @@ -0,0 +1,10 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { BalancerPoolDataQueries } from "./BalancerPoolDataQueries"; +export type { Pool } from "./Pool"; +export type { Vault } from "./Vault"; +export * as factories from "./factories"; +export { BalancerPoolDataQueries__factory } from "./factories/BalancerPoolDataQueries__factory"; +export { Pool__factory } from "./factories/Pool__factory"; +export { Vault__factory } from "./factories/Vault__factory"; diff --git a/src/adapters/chimp-exchange/products/pool/chimpExchangePoolAdapter.ts b/src/adapters/chimp-exchange/products/pool/chimpExchangePoolAdapter.ts new file mode 100755 index 000000000..c7ba3dbb1 --- /dev/null +++ b/src/adapters/chimp-exchange/products/pool/chimpExchangePoolAdapter.ts @@ -0,0 +1,394 @@ +import { SimplePoolAdapter } from '../../../../core/adapters/SimplePoolAdapter' +import { Chain } from '../../../../core/constants/chains' +import { + IMetadataBuilder, + CacheToFile, +} from '../../../../core/decorators/cacheToFile' +import { NotImplementedError } from '../../../../core/errors/errors' +import { filterMapAsync } from '../../../../core/utils/filters' +import { getTokenMetadata } from '../../../../core/utils/getTokenMetadata' +import { logger } from '../../../../core/utils/logger' +import { + ProtocolDetails, + PositionType, + GetAprInput, + GetApyInput, + GetTotalValueLockedInput, + TokenBalance, + ProtocolTokenApr, + ProtocolTokenApy, + ProtocolTokenTvl, + UnderlyingTokenRate, + Underlying, + GetEventsInput, + TokenType, + MovementsByBlock, +} from '../../../../types/adapter' +import { Erc20Metadata } from '../../../../types/erc20Metadata' +import { + Vault__factory, + BalancerPoolDataQueries__factory, +} from '../../contracts' +import { PoolBalanceChangedEvent } from '../../contracts/Vault' + +type ChimpExchangePoolAdapterMetadata = Record< + string, + { + poolId: string + totalSupplyType: string + protocolToken: Erc20Metadata + underlyingTokens: (Erc20Metadata & { index: number })[] + } +> + +const vaultContractAddresses: Partial> = { + [Chain.Linea]: '0x286381aEdd20e51f642fE4A200B5CB2Fe3729695', +} +const poolDataQueryContractAddresses: Partial> = { + [Chain.Linea]: '0xb2F2537E332F9A1aADa289df9fC770D5120613C9', +} + +export class ChimpExchangePoolAdapter + extends SimplePoolAdapter + implements IMetadataBuilder +{ + productId = 'pool' + + getProtocolDetails(): ProtocolDetails { + return { + protocolId: this.protocolId, + name: 'ChimpExchange', + description: 'ChimpExchange pool adapter', + siteUrl: 'https://app.chimp.exchange', + iconUrl: 'https://', + positionType: PositionType.Supply, + chainId: this.chainId, + productId: this.productId, + } + } + + @CacheToFile({ fileKey: 'protocol-token' }) + async buildMetadata() { + const vaultContract = Vault__factory.connect( + vaultContractAddresses[this.chainId]!, + this.provider, + ) + + const eventFilter = vaultContract.filters.PoolRegistered() + const events = await vaultContract.queryFilter(eventFilter) + + const metadataObject: ChimpExchangePoolAdapterMetadata = {} + await Promise.all( + events.map(async (event) => { + const protocolToken = await getTokenMetadata( + event.args.poolAddress, + this.chainId, + this.provider, + ) + + const poolTokens = await vaultContract.getPoolTokens(event.args.poolId) + + const underlyingTokens = await filterMapAsync( + poolTokens[0], + async (token, index) => { + if (token.toLowerCase() === event.args.poolAddress.toLowerCase()) { + return undefined + } + + const tokenMetadata = await getTokenMetadata( + token, + this.chainId, + this.provider, + ) + + return { + ...tokenMetadata, + index, + } + }, + ) + + metadataObject[event.args.poolAddress.toLowerCase()] = { + poolId: event.args.poolId, + totalSupplyType: event.args.specialization === 0n ? '2' : '0', + protocolToken, + underlyingTokens, + } + }), + ) + + return metadataObject + } + + async getDeposits(input: GetEventsInput): Promise { + return this.getPoolChangeMovements({ + ...input, + filterPredicate: (total) => total > 0n, + }) + } + + async getWithdrawals(input: GetEventsInput): Promise { + return this.getPoolChangeMovements({ + ...input, + filterPredicate: (total) => total < 0n, + }) + } + + private async getPoolChangeMovements({ + protocolTokenAddress, + userAddress, + fromBlock, + toBlock, + filterPredicate, + }: GetEventsInput & { filterPredicate: (total: bigint) => boolean }): Promise< + MovementsByBlock[] + > { + const { poolId, protocolToken } = await this.fetchPoolMetadata( + protocolTokenAddress, + ) + + const vaultContract = Vault__factory.connect( + vaultContractAddresses[this.chainId]!, + this.provider, + ) + + const filter = vaultContract.filters[ + 'PoolBalanceChanged(bytes32,address,address[],int256[],uint256[])' + ](poolId, userAddress) + + const events = + await vaultContract.queryFilter( + filter, + fromBlock, + toBlock, + ) + + const movements = await filterMapAsync(events, async (event) => { + const amounts = event.args.deltas + + const total = amounts.reduce( + (accumulator, amount) => accumulator + amount, + 0n, + ) + + if (filterPredicate(total)) { + const tokensData = await filterMapAsync( + event.args.tokens, + async (token, index) => { + if ( + token.toLowerCase() === protocolTokenAddress.toLocaleLowerCase() + ) { + return undefined + } + + const tokenData = await getTokenMetadata( + token, + this.chainId, + this.provider, + ) + + const balanceRaw = event.args.deltas[index] ?? 0n + return { + ...tokenData, + balanceRaw: balanceRaw < 0n ? -balanceRaw : balanceRaw, + type: TokenType.Underlying, + } + }, + ) + + return { + transactionHash: event.transactionHash, + protocolToken, + tokens: tokensData, + blockNumber: event.blockNumber, + } + } + }) + + return movements + } + + async getProtocolTokens(): Promise { + return Object.values(await this.buildMetadata()).map( + ({ protocolToken }) => protocolToken, + ) + } + + protected async getUnderlyingTokenBalances({ + protocolTokenBalance, + blockNumber, + }: { + protocolTokenBalance: TokenBalance + blockNumber?: number + }): Promise { + const poolMetadata = await this.fetchPoolMetadata( + protocolTokenBalance.address, + ) + + const underlyingTokenConversionRate = + await this.getUnderlyingTokenConversionRate( + protocolTokenBalance, + blockNumber, + ) + + const underlyingBalances = poolMetadata.underlyingTokens.map( + ({ index: _tokenIndex, ...token }) => { + const underlyingTokenRateRaw = underlyingTokenConversionRate.find( + (tokenRate) => tokenRate.address === token.address, + )!.underlyingRateRaw + + return { + ...token, + balanceRaw: + (underlyingTokenRateRaw * protocolTokenBalance.balanceRaw) / + 10n ** BigInt(protocolTokenBalance.decimals), + type: TokenType.Underlying, + } + }, + ) + + return underlyingBalances + } + + async getTotalValueLocked( + input: GetTotalValueLockedInput, + ): Promise { + const vaultContract = Vault__factory.connect( + vaultContractAddresses[this.chainId]!, + this.provider, + ) + const balancerPoolDataQueriesContract = + BalancerPoolDataQueries__factory.connect( + poolDataQueryContractAddresses[this.chainId]!, + this.provider, + ) + + const protocolTokens = await this.getProtocolTokens() + + return Promise.all( + protocolTokens.map(async (protocolToken) => { + const poolMetadata = await this.fetchPoolMetadata(protocolToken.address) + + const [[_poolTokens, poolBalances], [totalSupplyRaw]] = + await Promise.all([ + vaultContract.getPoolTokens(poolMetadata.poolId, { + blockTag: input.blockNumber, + }), + balancerPoolDataQueriesContract.getTotalSupplyForPools( + [protocolToken.address], + [poolMetadata.totalSupplyType], + { + blockTag: input.blockNumber, + }, + ), + ]) + + const tokens = poolMetadata.underlyingTokens.map( + ({ index: tokenIndex, ...token }) => ({ + ...token, + totalSupplyRaw: poolBalances[tokenIndex]!, + type: TokenType.Underlying, + }), + ) + + return { + ...protocolToken, + type: TokenType.Protocol, + tokens, + totalSupplyRaw: totalSupplyRaw!, + } + }), + ) + } + + protected async fetchProtocolTokenMetadata( + protocolTokenAddress: string, + ): Promise { + const { protocolToken } = await this.fetchPoolMetadata(protocolTokenAddress) + + return protocolToken + } + + protected async getUnderlyingTokenConversionRate( + protocolTokenMetadata: Erc20Metadata, + blockNumber?: number | undefined, + ): Promise { + const vaultContract = Vault__factory.connect( + vaultContractAddresses[this.chainId]!, + this.provider, + ) + const balancerPoolDataQueriesContract = + BalancerPoolDataQueries__factory.connect( + poolDataQueryContractAddresses[this.chainId]!, + this.provider, + ) + + const poolMetadata = await this.fetchPoolMetadata( + protocolTokenMetadata.address, + ) + + const [_poolTokens, poolBalances] = await vaultContract.getPoolTokens( + poolMetadata.poolId, + { + blockTag: blockNumber, + }, + ) + + const [totalSupplyRaw] = + await balancerPoolDataQueriesContract.getTotalSupplyForPools( + [protocolTokenMetadata.address], + [poolMetadata.totalSupplyType], + { + blockTag: blockNumber, + }, + ) + + const underlyingRates = poolMetadata.underlyingTokens.map( + ({ index: tokenIndex, ...token }) => { + const underlyingPoolBalance = poolBalances[tokenIndex]! + const underlyingRateRaw = + totalSupplyRaw === 0n + ? 0n + : underlyingPoolBalance / + (totalSupplyRaw! / 10n ** BigInt(protocolTokenMetadata.decimals)) + + return { + ...token, + type: TokenType.Underlying, + underlyingRateRaw, + } + }, + ) + + return underlyingRates + } + + async getApr(_input: GetAprInput): Promise { + throw new NotImplementedError() + } + + async getApy(_input: GetApyInput): Promise { + throw new NotImplementedError() + } + + protected async fetchUnderlyingTokensMetadata( + protocolTokenAddress: string, + ): Promise { + const { underlyingTokens } = await this.fetchPoolMetadata( + protocolTokenAddress, + ) + + return underlyingTokens.map(({ index: _tokenIndex, ...token }) => token) + } + + private async fetchPoolMetadata(protocolTokenAddress: string) { + const poolMetadata = (await this.buildMetadata())[protocolTokenAddress] + + if (!poolMetadata) { + logger.error({ protocolTokenAddress }, 'Protocol token pool not found') + throw new Error('Protocol token pool not found') + } + + return poolMetadata + } +} diff --git a/src/adapters/chimp-exchange/products/pool/metadata/linea.protocol-token.json b/src/adapters/chimp-exchange/products/pool/metadata/linea.protocol-token.json new file mode 100644 index 000000000..33c3acaef --- /dev/null +++ b/src/adapters/chimp-exchange/products/pool/metadata/linea.protocol-token.json @@ -0,0 +1,87 @@ +{ + "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3": { + "poolId": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3000000000000000000000000", + "totalSupplyType": "2", + "protocolToken": { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18 + }, + "underlyingTokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "index": 0 + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "index": 1 + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "index": 3 + } + ] + }, + "0xe38df7880ef9408e9933fd0e96abcc3cebf76006": { + "poolId": "0xe38df7880ef9408e9933fd0e96abcc3cebf76006000200000000000000000001", + "totalSupplyType": "0", + "protocolToken": { + "address": "0xe38df7880ef9408e9933fd0e96abcc3cebf76006", + "name": "50USDC-50WETH", + "symbol": "50USDC-50WETH", + "decimals": 18 + }, + "underlyingTokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "index": 0 + }, + { + "address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + "name": "Wrapped Ether", + "symbol": "WETH", + "decimals": 18, + "index": 1 + } + ] + }, + "0xfee637c94e85b23472745f6b5ede2e4c0ad12a94": { + "poolId": "0xfee637c94e85b23472745f6b5ede2e4c0ad12a94000200000000000000000002", + "totalSupplyType": "0", + "protocolToken": { + "address": "0xfee637c94e85b23472745f6b5ede2e4c0ad12a94", + "name": "50USDT-50WETH", + "symbol": "50USDT-50WETH", + "decimals": 18 + }, + "underlyingTokens": [ + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "index": 0 + }, + { + "address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + "name": "Wrapped Ether", + "symbol": "WETH", + "decimals": 18, + "index": 1 + } + ] + } +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/tests/snapshots/linea.deposits.json b/src/adapters/chimp-exchange/tests/snapshots/linea.deposits.json new file mode 100644 index 000000000..690c015b8 --- /dev/null +++ b/src/adapters/chimp-exchange/tests/snapshots/linea.deposits.json @@ -0,0 +1,132 @@ +{ + "snapshot": { + "protocolId": "chimp-exchange", + "name": "ChimpExchange", + "description": "ChimpExchange pool adapter", + "siteUrl": "https://app.chimp.exchange", + "iconUrl": "https://", + "positionType": "supply", + "chainId": 59144, + "productId": "pool", + "success": true, + "movements": [ + { + "transactionHash": "0x7ef11599d074cfb0c89fc253145a7f3d11d67ac51cdd1b254b67c1b2323d94ec", + "protocolToken": { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "balanceRaw": "100000n", + "type": "underlying", + "balance": "0.1" + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "balanceRaw": "1000000000000000000n", + "type": "underlying", + "balance": "1.0" + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "balanceRaw": "1000000n", + "type": "underlying", + "balance": "1.0" + } + ], + "blockNumber": 759469 + }, + { + "transactionHash": "0xe74428f84e9c90f2e7d943a10d3859e64c7e0cd38132c4dde782d0f5247b62c5", + "protocolToken": { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "balanceRaw": "900000n", + "type": "underlying", + "balance": "0.9" + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "balanceRaw": "0n", + "type": "underlying", + "balance": "0.0" + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "balanceRaw": "0n", + "type": "underlying", + "balance": "0.0" + } + ], + "blockNumber": 760370 + }, + { + "transactionHash": "0xcab5bb34294c17915ec2c3d501b2a66a424b6c9e71ceda4562365eb41dd28a21", + "protocolToken": { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "balanceRaw": "999000000n", + "type": "underlying", + "balance": "999.0" + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "balanceRaw": "999000000000000000000n", + "type": "underlying", + "balance": "999.0" + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "balanceRaw": "999000000n", + "type": "underlying", + "balance": "999.0" + } + ], + "blockNumber": 760382 + } + ] + } +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/tests/snapshots/linea.positions.json b/src/adapters/chimp-exchange/tests/snapshots/linea.positions.json new file mode 100644 index 000000000..d55f730dc --- /dev/null +++ b/src/adapters/chimp-exchange/tests/snapshots/linea.positions.json @@ -0,0 +1,59 @@ +{ + "blockNumber": 1498597, + "snapshot": [ + { + "protocolId": "chimp-exchange", + "name": "ChimpExchange", + "description": "ChimpExchange pool adapter", + "siteUrl": "https://app.chimp.exchange", + "iconUrl": "https://", + "positionType": "supply", + "chainId": 59144, + "productId": "pool", + "success": true, + "tokens": [ + { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18, + "balanceRaw": "86830690256541733912n", + "type": "protocol", + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "balanceRaw": "48448746n", + "type": "underlying", + "balance": "48.448746", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0x176211869cA2b568f2A7D4EE941E073a821EE1ff/logo.png" + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "balanceRaw": "15877102106260630158n", + "type": "underlying", + "balance": "15.877102106260630158", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5/logo.png" + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "balanceRaw": "24668512n", + "type": "underlying", + "balance": "24.668512", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0xA219439258ca9da29E9Cc4cE5596924745e12B93/logo.png" + } + ], + "balance": "86.830690256541733912" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/tests/snapshots/linea.profits.json b/src/adapters/chimp-exchange/tests/snapshots/linea.profits.json new file mode 100644 index 000000000..a8305358f --- /dev/null +++ b/src/adapters/chimp-exchange/tests/snapshots/linea.profits.json @@ -0,0 +1,22 @@ +{ + "blockNumber": 1498597, + "snapshot": [ + { + "protocolId": "chimp-exchange", + "name": "ChimpExchange", + "description": "ChimpExchange pool adapter", + "siteUrl": "https://app.chimp.exchange", + "iconUrl": "https://", + "positionType": "supply", + "chainId": 59144, + "productId": "pool", + "success": false, + "error": { + "message": "Unable to calculate profits, missing USD price for token position 0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "details": { + "name": "Error" + } + } + } + ] +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/tests/snapshots/linea.tvl.json b/src/adapters/chimp-exchange/tests/snapshots/linea.tvl.json new file mode 100644 index 000000000..0eebe1ea3 --- /dev/null +++ b/src/adapters/chimp-exchange/tests/snapshots/linea.tvl.json @@ -0,0 +1,121 @@ +{ + "blockNumber": 1498597, + "snapshot": [ + { + "protocolId": "chimp-exchange", + "name": "ChimpExchange", + "description": "ChimpExchange pool adapter", + "siteUrl": "https://app.chimp.exchange", + "iconUrl": "https://", + "positionType": "supply", + "chainId": 59144, + "productId": "pool", + "success": true, + "tokens": [ + { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18, + "type": "protocol", + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "totalSupplyRaw": "2127532354n", + "type": "underlying", + "totalSupply": "2127.532354", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0x176211869cA2b568f2A7D4EE941E073a821EE1ff/logo.png" + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "totalSupplyRaw": "697211897686265463110n", + "type": "underlying", + "totalSupply": "697.21189768626546311", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0x4AF15ec2A0BD43Db75dd04E62FAA3B8EF36b00d5/logo.png" + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "totalSupplyRaw": "1083270116n", + "type": "underlying", + "totalSupply": "1083.270116", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0xA219439258ca9da29E9Cc4cE5596924745e12B93/logo.png" + } + ], + "totalSupplyRaw": "3813413987853259358679n", + "totalSupply": "3813.413987853259358679" + }, + { + "address": "0xe38df7880ef9408e9933fd0e96abcc3cebf76006", + "name": "50USDC-50WETH", + "symbol": "50USDC-50WETH", + "decimals": 18, + "type": "protocol", + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "totalSupplyRaw": "8050409498n", + "type": "underlying", + "totalSupply": "8050.409498", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0x176211869cA2b568f2A7D4EE941E073a821EE1ff/logo.png" + }, + { + "address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + "name": "Wrapped Ether", + "symbol": "WETH", + "decimals": 18, + "totalSupplyRaw": "3478357629090545092n", + "type": "underlying", + "totalSupply": "3.478357629090545092", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f/logo.png" + } + ], + "totalSupplyRaw": "300249694415489425553n", + "totalSupply": "300.249694415489425553" + }, + { + "address": "0xfee637c94e85b23472745f6b5ede2e4c0ad12a94", + "name": "50USDT-50WETH", + "symbol": "50USDT-50WETH", + "decimals": 18, + "type": "protocol", + "tokens": [ + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "totalSupplyRaw": "0n", + "type": "underlying", + "totalSupply": "0.0", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0xA219439258ca9da29E9Cc4cE5596924745e12B93/logo.png" + }, + { + "address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f", + "name": "Wrapped Ether", + "symbol": "WETH", + "decimals": 18, + "totalSupplyRaw": "0n", + "type": "underlying", + "totalSupply": "0.0", + "iconUrl": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/linea/assets/0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f/logo.png" + } + ], + "totalSupplyRaw": "0n", + "totalSupply": "0.0" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/tests/snapshots/linea.withdrawals.json b/src/adapters/chimp-exchange/tests/snapshots/linea.withdrawals.json new file mode 100644 index 000000000..63fa6f621 --- /dev/null +++ b/src/adapters/chimp-exchange/tests/snapshots/linea.withdrawals.json @@ -0,0 +1,54 @@ +{ + "snapshot": { + "protocolId": "chimp-exchange", + "name": "ChimpExchange", + "description": "ChimpExchange pool adapter", + "siteUrl": "https://app.chimp.exchange", + "iconUrl": "https://", + "positionType": "supply", + "chainId": 59144, + "productId": "pool", + "success": true, + "movements": [ + { + "transactionHash": "0xd49c6ee47b53c838c6e319535e9758cbed36f51847b543567883886a35c9a684", + "protocolToken": { + "address": "0x90d8053f7e29faaf5189bdce796a516e29f1f5d3", + "name": "Chimp USDC-DAI-USDT Stable Pool", + "symbol": "USDC-DAI-USDT", + "decimals": 18 + }, + "tokens": [ + { + "address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff", + "name": "USDC", + "symbol": "USDC", + "decimals": 6, + "balanceRaw": "101107315n", + "type": "underlying", + "balance": "101.107315" + }, + { + "address": "0x4af15ec2a0bd43db75dd04e62faa3b8ef36b00d5", + "name": "Dai Stablecoin", + "symbol": "DAI", + "decimals": 18, + "balanceRaw": "0n", + "type": "underlying", + "balance": "0.0" + }, + { + "address": "0xa219439258ca9da29e9cc4ce5596924745e12b93", + "name": "Tether USD", + "symbol": "USDT", + "decimals": 6, + "balanceRaw": "0n", + "type": "underlying", + "balance": "0.0" + } + ], + "blockNumber": 1346848 + } + ] + } +} \ No newline at end of file diff --git a/src/adapters/chimp-exchange/tests/testCases.ts b/src/adapters/chimp-exchange/tests/testCases.ts new file mode 100755 index 000000000..c4973f46d --- /dev/null +++ b/src/adapters/chimp-exchange/tests/testCases.ts @@ -0,0 +1,48 @@ +import { Chain } from '../../../core/constants/chains' +import type { TestCase } from '../../../types/testCase' + +export const testCases: TestCase[] = [ + { + chainId: Chain.Linea, + method: 'positions', + input: { + userAddress: '0xe510668b3f77f4d3be91072fd484f2e6134e65ff', + }, + blockNumber: 1498597, + }, + { + chainId: Chain.Linea, + method: 'profits', + input: { + userAddress: '0xe510668b3f77f4d3be91072fd484f2e6134e65ff', + }, + blockNumber: 1498597, + }, + { + chainId: Chain.Linea, + method: 'tvl', + blockNumber: 1498597, + }, + { + chainId: Chain.Linea, + method: 'deposits', + input: { + userAddress: '0xD19f62b5A721747A04b969C90062CBb85D4aAaA8', + fromBlock: 750000, + toBlock: 850000, + protocolTokenAddress: '0x90d8053f7e29faaf5189bdce796a516e29f1f5d3', + productId: 'pool', + }, + }, + { + chainId: Chain.Linea, + method: 'withdrawals', + input: { + userAddress: '0xb84c573f9d5492606727e54cd3f356a53b7a9262', + fromBlock: 1340000, + toBlock: 1498597, + protocolTokenAddress: '0x90d8053f7e29faaf5189bdce796a516e29f1f5d3', + productId: 'pool', + }, + }, +] diff --git a/src/adapters/index.ts b/src/adapters/index.ts index da251c9ab..414492215 100644 --- a/src/adapters/index.ts +++ b/src/adapters/index.ts @@ -8,6 +8,7 @@ import { AaveV2VariableDebtTokenPoolAdapter } from './aave-v2/products/variable- import { AaveV3ATokenPoolAdapter } from './aave-v3/products/a-token/aaveV3ATokenPoolAdapter' import { AaveV3StableDebtTokenPoolAdapter } from './aave-v3/products/stable-debt-token/aaveV3StableDebtTokenPoolAdapter' import { AaveV3VariableDebtTokenPoolAdapter } from './aave-v3/products/variable-debt-token/aaveV3VariableDebtTokenPoolAdapter' +import { ChimpExchangePoolAdapter } from './chimp-exchange/products/pool/chimpExchangePoolAdapter' import { CompoundPoolAdapter } from './compound/products/pool/compoundPoolAdapter' import { ConvexCvxcrvWrapperAdapter } from './convex/products/cvxcrv-wrapper/convexCvxcrvWrapperAdapter' import { ConvexExtraRewardAdapter } from './convex/products/extra-reward/convexExtraRewardAdapter' @@ -157,4 +158,8 @@ export const supportedProtocols: Record< [Chain.Arbitrum]: [IZiswapAdapter], [Chain.Linea]: [IZiswapAdapter], }, + + [Protocol.ChimpExchange]: { + [Chain.Linea]: [ChimpExchangePoolAdapter], + }, } diff --git a/src/adapters/integration.test.ts b/src/adapters/integration.test.ts index a6139dd93..87e9a57c8 100644 --- a/src/adapters/integration.test.ts +++ b/src/adapters/integration.test.ts @@ -7,6 +7,7 @@ import { logger } from '../core/utils/logger' import { DefiProvider } from '../defiProvider' import { TestCase } from '../types/testCase' import { testCases as aaveV2TestCases } from './aave-v2/tests/testCases' +import { testCases as chimpExchangeTestCases } from './chimp-exchange/tests/testCases' import { testCases as compoundTestCases } from './compound/tests/testCases' import { testCases as convexTestCases } from './convex/tests/testCases' import { testCases as curveTestCases } from './curve/tests/testCases' @@ -39,6 +40,7 @@ function runAllTests() { runProtocolTests(Protocol.Convex, convexTestCases) runProtocolTests(Protocol.Prices, pricesTestCases) runProtocolTests(Protocol.IZiSwap, iZiSwapTestCases) + runProtocolTests(Protocol.ChimpExchange, chimpExchangeTestCases) } function runProtocolTests(protocolId: Protocol, testCases: TestCase[]) { diff --git a/src/adapters/protocols.ts b/src/adapters/protocols.ts index 605254333..c4e7969e1 100644 --- a/src/adapters/protocols.ts +++ b/src/adapters/protocols.ts @@ -13,5 +13,6 @@ export const Protocol = { Convex: 'convex', Prices: 'prices', IZiSwap: 'iziswap', + ChimpExchange: 'chimp-exchange', } as const export type Protocol = (typeof Protocol)[keyof typeof Protocol] diff --git a/src/core/metadata/AdapterMetadata.ts b/src/core/metadata/AdapterMetadata.ts index cef42d385..e0a3c82d8 100644 --- a/src/core/metadata/AdapterMetadata.ts +++ b/src/core/metadata/AdapterMetadata.ts @@ -29,6 +29,7 @@ import AaveV3VariableDebtTokenEthereumVariableDebtTokenV3 from '../../adapters/a import AaveV3VariableDebtTokenFantomVariableDebtTokenV3 from '../../adapters/aave-v3/products/variable-debt-token/metadata/fantom.variable-debt-token-v3.json' import AaveV3VariableDebtTokenOptimismVariableDebtTokenV3 from '../../adapters/aave-v3/products/variable-debt-token/metadata/optimism.variable-debt-token-v3.json' import AaveV3VariableDebtTokenPolygonVariableDebtTokenV3 from '../../adapters/aave-v3/products/variable-debt-token/metadata/polygon.variable-debt-token-v3.json' +import ChimpExchangePoolLineaProtocolToken from '../../adapters/chimp-exchange/products/pool/metadata/linea.protocol-token.json' import CompoundPoolEthereumProtocolToken from '../../adapters/compound/products/pool/metadata/ethereum.protocol-token.json' import ConvexCvxcrvWrapperEthereumProtocolToken from '../../adapters/convex/products/cvxcrv-wrapper/metadata/ethereum.protocol-token.json' import ConvexExtraRewardEthereumProtocolToken from '../../adapters/convex/products/extra-reward/metadata/ethereum.protocol-token.json' @@ -485,7 +486,6 @@ export const MetadataFiles = new Map([ }), PricesUsdArbitrumProtocolToken, ], - [ metadataKey({ protocolId: Protocol.Prices, @@ -495,6 +495,15 @@ export const MetadataFiles = new Map([ }), PricesUsdOptimismProtocolToken, ], + [ + metadataKey({ + protocolId: Protocol.ChimpExchange, + productId: 'pool', + chainId: Chain.Linea, + fileKey: 'protocol-token', + }), + ChimpExchangePoolLineaProtocolToken, + ], ]) export function metadataKey({