diff --git a/src/artifacts/tapioca-mocks/BalancerVaultMock.json b/src/artifacts/tapioca-mocks/BalancerVaultMock.json new file mode 100644 index 00000000..e0ec8a85 --- /dev/null +++ b/src/artifacts/tapioca-mocks/BalancerVaultMock.json @@ -0,0 +1,99 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "BalancerVaultMock", + "sourceName": "contracts/BalancerVaultMock.sol", + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "enum BalancerVaultMock.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 BalancerVaultMock.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 BalancerVaultMock.FundManagement", + "name": "", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "swap", + "outputs": [ + { + "internalType": "uint256", + "name": "amountCalculated", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": "0x6080806040523461001657610476908161001c8239f35b600080fdfe60806004908136101561001157600080fd5b600091823560e01c6352bbbe291461002857600080fd5b6003199160e0368401126103585781359167ffffffffffffffff938484116103605760c090843603011261037a5760c08201938285108186111761036757604094855283820135835260248085013596600288101561036457602097888601526044926100968488016103b6565b8887019081526064966100aa888a016103b6565b9060608101918252608081019960848101358b5260a481013590858211610342570136602382011215610360579081898d930135906100f46100eb836103dc565b9451948561037e565b8184523689838301011161035c578e8260a094938b8b9401838801378501015201526080366023190112610358578951916080830183811085821117610346578b5273ffffffffffffffffffffffffffffffffffffffff928635848116810361034257815287358015158103610342578d82015289358481168103610342578c820152608435908115158203610342579060608593920152511689518b518d8101916323b872dd60e01b83523389830152308a8301528b8201528a815260a0810181811087821117610330578d5251869283929083905af16101d46103f8565b81610300575b50156102bf575116908751908951908b82019263a9059cbb60e01b84523387840152878301528682526080820190828210908211176102ad578493929184918c5251925af16102276103f8565b8161027d575b501561023f5750505050519051908152f35b855162461bcd60e51b8152928301879052601c908301527f426f72696e6745524332303a205472616e73666572206661696c65640000000090820152fd5b80518015925089908315610295575b5050503861022d565b6102a59350820181019101610428565b38888161028c565b634e487b7160e01b8552604188528585fd5b5050875162461bcd60e51b8152948501899052505082018690527f426f72696e6745524332303a205472616e7366657246726f6d206661696c656490820152fd5b8051801592508d908315610318575b505050386101da565b6103289350820181019101610428565b388c8161030f565b634e487b7160e01b885260418b528888fd5b8680fd5b634e487b7160e01b8652604189528686fd5b8380fd5b8780fd5b8580fd5b80fd5b634e487b7160e01b865260418252602486fd5b8480fd5b90601f8019910116810190811067ffffffffffffffff8211176103a057604052565b634e487b7160e01b600052604160045260246000fd5b359073ffffffffffffffffffffffffffffffffffffffff821682036103d757565b600080fd5b67ffffffffffffffff81116103a057601f01601f191660200190565b3d15610423573d90610409826103dc565b91610417604051938461037e565b82523d6000602084013e565b606090565b908160209103126103d7575180151581036103d7579056fea2646970667358221220e560053cb5a82d8467b8176bbd05f1f380d22c7cd66d04579dab3002ac2d75c864736f6c63430008120033", + "deployedBytecode": "0x60806004908136101561001157600080fd5b600091823560e01c6352bbbe291461002857600080fd5b6003199160e0368401126103585781359167ffffffffffffffff938484116103605760c090843603011261037a5760c08201938285108186111761036757604094855283820135835260248085013596600288101561036457602097888601526044926100968488016103b6565b8887019081526064966100aa888a016103b6565b9060608101918252608081019960848101358b5260a481013590858211610342570136602382011215610360579081898d930135906100f46100eb836103dc565b9451948561037e565b8184523689838301011161035c578e8260a094938b8b9401838801378501015201526080366023190112610358578951916080830183811085821117610346578b5273ffffffffffffffffffffffffffffffffffffffff928635848116810361034257815287358015158103610342578d82015289358481168103610342578c820152608435908115158203610342579060608593920152511689518b518d8101916323b872dd60e01b83523389830152308a8301528b8201528a815260a0810181811087821117610330578d5251869283929083905af16101d46103f8565b81610300575b50156102bf575116908751908951908b82019263a9059cbb60e01b84523387840152878301528682526080820190828210908211176102ad578493929184918c5251925af16102276103f8565b8161027d575b501561023f5750505050519051908152f35b855162461bcd60e51b8152928301879052601c908301527f426f72696e6745524332303a205472616e73666572206661696c65640000000090820152fd5b80518015925089908315610295575b5050503861022d565b6102a59350820181019101610428565b38888161028c565b634e487b7160e01b8552604188528585fd5b5050875162461bcd60e51b8152948501899052505082018690527f426f72696e6745524332303a205472616e7366657246726f6d206661696c656490820152fd5b8051801592508d908315610318575b505050386101da565b6103289350820181019101610428565b388c8161030f565b634e487b7160e01b885260418b528888fd5b8680fd5b634e487b7160e01b8652604189528686fd5b8380fd5b8780fd5b8580fd5b80fd5b634e487b7160e01b865260418252602486fd5b8480fd5b90601f8019910116810190811067ffffffffffffffff8211176103a057604052565b634e487b7160e01b600052604160045260246000fd5b359073ffffffffffffffffffffffffffffffffffffffff821682036103d757565b600080fd5b67ffffffffffffffff81116103a057601f01601f191660200190565b3d15610423573d90610409826103dc565b91610417604051938461037e565b82523d6000602084013e565b606090565b908160209103126103d7575180151581036103d7579056fea2646970667358221220e560053cb5a82d8467b8176bbd05f1f380d22c7cd66d04579dab3002ac2d75c864736f6c63430008120033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/src/typechain/tapioca-mocks/BalancerVaultMock.ts b/src/typechain/tapioca-mocks/BalancerVaultMock.ts new file mode 100644 index 00000000..f5372fd6 --- /dev/null +++ b/src/typechain/tapioca-mocks/BalancerVaultMock.ts @@ -0,0 +1,228 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { FunctionFragment, Result } from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, + PromiseOrValue, +} from "./common"; + +export declare namespace BalancerVaultMock { + export type SingleSwapStruct = { + poolId: PromiseOrValue; + kind: PromiseOrValue; + assetIn: PromiseOrValue; + assetOut: PromiseOrValue; + amount: PromiseOrValue; + userData: PromiseOrValue; + }; + + export type SingleSwapStructOutput = [ + string, + number, + string, + string, + BigNumber, + string + ] & { + poolId: string; + kind: number; + assetIn: string; + assetOut: string; + amount: BigNumber; + userData: string; + }; + + export type FundManagementStruct = { + sender: PromiseOrValue; + fromInternalBalance: PromiseOrValue; + recipient: PromiseOrValue; + toInternalBalance: PromiseOrValue; + }; + + export type FundManagementStructOutput = [ + string, + boolean, + string, + boolean + ] & { + sender: string; + fromInternalBalance: boolean; + recipient: string; + toInternalBalance: boolean; + }; +} + +export interface BalancerVaultMockInterface extends utils.Interface { + functions: { + "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "swap" + | "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "swap", + values: [ + BalancerVaultMock.SingleSwapStruct, + BalancerVaultMock.FundManagementStruct, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)", + values: [ + BalancerVaultMock.SingleSwapStruct, + BalancerVaultMock.FundManagementStruct, + PromiseOrValue, + PromiseOrValue + ] + ): string; + + decodeFunctionResult(functionFragment: "swap", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)", + data: BytesLike + ): Result; + + events: {}; +} + +export interface BalancerVaultMock extends BaseContract { + contractName: "BalancerVaultMock"; + + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: BalancerVaultMockInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + swap( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)"( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + }; + + swap( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)"( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + swap( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)"( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + filters: {}; + + estimateGas: { + swap( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)"( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + swap( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + "swap((bytes32,uint8,address,address,uint256,bytes),(address,bool,address,bool),uint256,uint256)"( + singleSwap: BalancerVaultMock.SingleSwapStruct, + arg1: BalancerVaultMock.FundManagementStruct, + arg2: PromiseOrValue, + arg3: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/src/typechain/tapioca-mocks/factories/BalancerVaultMock__factory.ts b/src/typechain/tapioca-mocks/factories/BalancerVaultMock__factory.ts new file mode 100644 index 00000000..a5f228c5 --- /dev/null +++ b/src/typechain/tapioca-mocks/factories/BalancerVaultMock__factory.ts @@ -0,0 +1,155 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; +import type { Provider, TransactionRequest } from "@ethersproject/providers"; +import type { PromiseOrValue } from "../common"; +import type { + BalancerVaultMock, + BalancerVaultMockInterface, +} from "../BalancerVaultMock"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "bytes32", + name: "poolId", + type: "bytes32", + }, + { + internalType: "enum BalancerVaultMock.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 BalancerVaultMock.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 BalancerVaultMock.FundManagement", + name: "", + type: "tuple", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "swap", + outputs: [ + { + internalType: "uint256", + name: "amountCalculated", + type: "uint256", + }, + ], + stateMutability: "payable", + type: "function", + }, +] as const; + +const _bytecode = + "0x6080806040523461001657610476908161001c8239f35b600080fdfe60806004908136101561001157600080fd5b600091823560e01c6352bbbe291461002857600080fd5b6003199160e0368401126103585781359167ffffffffffffffff938484116103605760c090843603011261037a5760c08201938285108186111761036757604094855283820135835260248085013596600288101561036457602097888601526044926100968488016103b6565b8887019081526064966100aa888a016103b6565b9060608101918252608081019960848101358b5260a481013590858211610342570136602382011215610360579081898d930135906100f46100eb836103dc565b9451948561037e565b8184523689838301011161035c578e8260a094938b8b9401838801378501015201526080366023190112610358578951916080830183811085821117610346578b5273ffffffffffffffffffffffffffffffffffffffff928635848116810361034257815287358015158103610342578d82015289358481168103610342578c820152608435908115158203610342579060608593920152511689518b518d8101916323b872dd60e01b83523389830152308a8301528b8201528a815260a0810181811087821117610330578d5251869283929083905af16101d46103f8565b81610300575b50156102bf575116908751908951908b82019263a9059cbb60e01b84523387840152878301528682526080820190828210908211176102ad578493929184918c5251925af16102276103f8565b8161027d575b501561023f5750505050519051908152f35b855162461bcd60e51b8152928301879052601c908301527f426f72696e6745524332303a205472616e73666572206661696c65640000000090820152fd5b80518015925089908315610295575b5050503861022d565b6102a59350820181019101610428565b38888161028c565b634e487b7160e01b8552604188528585fd5b5050875162461bcd60e51b8152948501899052505082018690527f426f72696e6745524332303a205472616e7366657246726f6d206661696c656490820152fd5b8051801592508d908315610318575b505050386101da565b6103289350820181019101610428565b388c8161030f565b634e487b7160e01b885260418b528888fd5b8680fd5b634e487b7160e01b8652604189528686fd5b8380fd5b8780fd5b8580fd5b80fd5b634e487b7160e01b865260418252602486fd5b8480fd5b90601f8019910116810190811067ffffffffffffffff8211176103a057604052565b634e487b7160e01b600052604160045260246000fd5b359073ffffffffffffffffffffffffffffffffffffffff821682036103d757565b600080fd5b67ffffffffffffffff81116103a057601f01601f191660200190565b3d15610423573d90610409826103dc565b91610417604051938461037e565b82523d6000602084013e565b606090565b908160209103126103d7575180151581036103d7579056fea2646970667358221220e560053cb5a82d8467b8176bbd05f1f380d22c7cd66d04579dab3002ac2d75c864736f6c63430008120033"; + +type BalancerVaultMockConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: BalancerVaultMockConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class BalancerVaultMock__factory extends ContractFactory { + constructor(...args: BalancerVaultMockConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + this.contractName = "BalancerVaultMock"; + } + + override deploy( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise { + return super.deploy(overrides || {}) as Promise; + } + override getDeployTransaction( + overrides?: Overrides & { from?: PromiseOrValue } + ): TransactionRequest { + return super.getDeployTransaction(overrides || {}); + } + override attach(address: string): BalancerVaultMock { + return super.attach(address) as BalancerVaultMock; + } + override connect(signer: Signer): BalancerVaultMock__factory { + return super.connect(signer) as BalancerVaultMock__factory; + } + static readonly contractName: "BalancerVaultMock"; + + public readonly contractName: "BalancerVaultMock"; + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): BalancerVaultMockInterface { + return new utils.Interface(_abi) as BalancerVaultMockInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): BalancerVaultMock { + return new Contract(address, _abi, signerOrProvider) as BalancerVaultMock; + } +} diff --git a/src/typechain/tapioca-mocks/factories/index.ts b/src/typechain/tapioca-mocks/factories/index.ts index f10c132b..d3e18fdc 100644 --- a/src/typechain/tapioca-mocks/factories/index.ts +++ b/src/typechain/tapioca-mocks/factories/index.ts @@ -5,6 +5,7 @@ export * as flashBorrowerMockSol from "./FlashBorrowerMock.sol"; export * as twTapMockSol from "./TwTapMock.sol"; export * as research from "./research"; export * as uniswapv2 from "./uniswapv2"; +export { BalancerVaultMock__factory } from "./BalancerVaultMock__factory"; export { ContractThatCannotBeDeployed__factory } from "./ContractThatCannotBeDeployed__factory"; export { ContractThatReverts__factory } from "./ContractThatReverts__factory"; export { CurvePoolMock__factory } from "./CurvePoolMock__factory"; diff --git a/src/typechain/tapioca-mocks/hardhat.d.ts b/src/typechain/tapioca-mocks/hardhat.d.ts index 31e6a7c7..fc60c7f1 100644 --- a/src/typechain/tapioca-mocks/hardhat.d.ts +++ b/src/typechain/tapioca-mocks/hardhat.d.ts @@ -12,6 +12,10 @@ import * as Contracts from "."; declare module "hardhat/types/runtime" { interface HardhatEthersHelpers extends HardhatEthersHelpersBase { + getContractFactory( + name: "BalancerVaultMock", + signerOrOptions?: ethers.Signer | FactoryOptions + ): Promise; getContractFactory( name: "ContractThatCannotBeDeployed", signerOrOptions?: ethers.Signer | FactoryOptions @@ -133,6 +137,11 @@ declare module "hardhat/types/runtime" { signerOrOptions?: ethers.Signer | FactoryOptions ): Promise; + getContractAt( + name: "BalancerVaultMock", + address: string, + signer?: ethers.Signer + ): Promise; getContractAt( name: "ContractThatCannotBeDeployed", address: string, diff --git a/src/typechain/tapioca-mocks/index.ts b/src/typechain/tapioca-mocks/index.ts index de7bdeb9..0c7a3f41 100644 --- a/src/typechain/tapioca-mocks/index.ts +++ b/src/typechain/tapioca-mocks/index.ts @@ -9,6 +9,7 @@ import type * as research from "./research"; export type { research }; import type * as uniswapv2 from "./uniswapv2"; export type { uniswapv2 }; +export type { BalancerVaultMock } from "./BalancerVaultMock"; export type { ContractThatCannotBeDeployed } from "./ContractThatCannotBeDeployed"; export type { ContractThatReverts } from "./ContractThatReverts"; export type { CurvePoolMock } from "./CurvePoolMock"; @@ -31,6 +32,7 @@ export type { UniswapV3SwapperMock } from "./UniswapV3SwapperMock"; export type { VulnMultiSwapper } from "./VulnMultiSwapper"; export type { YieldBoxMock } from "./YieldBoxMock"; export * as factories from "./factories"; +export { BalancerVaultMock__factory } from "./factories/BalancerVaultMock__factory"; export { ContractThatCannotBeDeployed__factory } from "./factories/ContractThatCannotBeDeployed__factory"; export { ContractThatReverts__factory } from "./factories/ContractThatReverts__factory"; export { CurvePoolMock__factory } from "./factories/CurvePoolMock__factory";