-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from Jeff-CCH/feat/mopho-flashloan
Add Morphoblue flashloan
- Loading branch information
Showing
21 changed files
with
707 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@protocolink/logics': patch | ||
--- | ||
|
||
add Morphoblue flashloan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CHAIN_ID=5 | ||
HTTP_RPC_URL=https://rpc.ankr.com/eth_goerli | ||
BLOCK_NUMBER=10310000 | ||
BLOCK_NUMBER=10320000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
[ | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "router_", "type": "address" }, | ||
{ "internalType": "address", "name": "morpho_", "type": "address" }, | ||
{ "internalType": "uint256", "name": "feeRate_", "type": "uint256" } | ||
], | ||
"stateMutability": "nonpayable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"inputs": [{ "internalType": "address", "name": "token", "type": "address" }], | ||
"name": "InvalidBalance", | ||
"type": "error" | ||
}, | ||
{ "inputs": [], "name": "InvalidCaller", "type": "error" }, | ||
{ | ||
"inputs": [], | ||
"name": "feeRate", | ||
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "address", "name": "token", "type": "address" }, | ||
{ "internalType": "uint256", "name": "assets", "type": "uint256" }, | ||
{ "internalType": "bytes", "name": "data", "type": "bytes" } | ||
], | ||
"name": "flashLoan", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "metadata", | ||
"outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "morpho", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ "internalType": "uint256", "name": "assets", "type": "uint256" }, | ||
{ "internalType": "bytes", "name": "data", "type": "bytes" } | ||
], | ||
"name": "onMorphoFlashLoan", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "router", | ||
"outputs": [{ "internalType": "address", "name": "", "type": "address" }], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
178 changes: 178 additions & 0 deletions
178
src/logics/morphoblue/contracts/MorphoFlashLoanCallback.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
/* Autogenerated file. Do not edit manually. */ | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
import type { | ||
BaseContract, | ||
BigNumber, | ||
BigNumberish, | ||
BytesLike, | ||
CallOverrides, | ||
ContractTransaction, | ||
Overrides, | ||
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 } from './common'; | ||
|
||
export interface MorphoFlashLoanCallbackInterface extends utils.Interface { | ||
functions: { | ||
'feeRate()': FunctionFragment; | ||
'flashLoan(address,uint256,bytes)': FunctionFragment; | ||
'metadata()': FunctionFragment; | ||
'morpho()': FunctionFragment; | ||
'onMorphoFlashLoan(uint256,bytes)': FunctionFragment; | ||
'router()': FunctionFragment; | ||
}; | ||
|
||
getFunction( | ||
nameOrSignatureOrTopic: 'feeRate' | 'flashLoan' | 'metadata' | 'morpho' | 'onMorphoFlashLoan' | 'router' | ||
): FunctionFragment; | ||
|
||
encodeFunctionData(functionFragment: 'feeRate', values?: undefined): string; | ||
encodeFunctionData(functionFragment: 'flashLoan', values: [string, BigNumberish, BytesLike]): string; | ||
encodeFunctionData(functionFragment: 'metadata', values?: undefined): string; | ||
encodeFunctionData(functionFragment: 'morpho', values?: undefined): string; | ||
encodeFunctionData(functionFragment: 'onMorphoFlashLoan', values: [BigNumberish, BytesLike]): string; | ||
encodeFunctionData(functionFragment: 'router', values?: undefined): string; | ||
|
||
decodeFunctionResult(functionFragment: 'feeRate', data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: 'flashLoan', data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: 'metadata', data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: 'morpho', data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: 'onMorphoFlashLoan', data: BytesLike): Result; | ||
decodeFunctionResult(functionFragment: 'router', data: BytesLike): Result; | ||
|
||
events: {}; | ||
} | ||
|
||
export interface MorphoFlashLoanCallback extends BaseContract { | ||
connect(signerOrProvider: Signer | Provider | string): this; | ||
attach(addressOrName: string): this; | ||
deployed(): Promise<this>; | ||
|
||
interface: MorphoFlashLoanCallbackInterface; | ||
|
||
queryFilter<TEvent extends TypedEvent>( | ||
event: TypedEventFilter<TEvent>, | ||
fromBlockOrBlockhash?: string | number | undefined, | ||
toBlock?: string | number | undefined | ||
): Promise<Array<TEvent>>; | ||
|
||
listeners<TEvent extends TypedEvent>(eventFilter?: TypedEventFilter<TEvent>): Array<TypedListener<TEvent>>; | ||
listeners(eventName?: string): Array<Listener>; | ||
removeAllListeners<TEvent extends TypedEvent>(eventFilter: TypedEventFilter<TEvent>): this; | ||
removeAllListeners(eventName?: string): this; | ||
off: OnEvent<this>; | ||
on: OnEvent<this>; | ||
once: OnEvent<this>; | ||
removeListener: OnEvent<this>; | ||
|
||
functions: { | ||
feeRate(overrides?: CallOverrides): Promise<[BigNumber]>; | ||
|
||
flashLoan( | ||
token: string, | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<ContractTransaction>; | ||
|
||
metadata(overrides?: CallOverrides): Promise<[string]>; | ||
|
||
morpho(overrides?: CallOverrides): Promise<[string]>; | ||
|
||
onMorphoFlashLoan( | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<ContractTransaction>; | ||
|
||
router(overrides?: CallOverrides): Promise<[string]>; | ||
}; | ||
|
||
feeRate(overrides?: CallOverrides): Promise<BigNumber>; | ||
|
||
flashLoan( | ||
token: string, | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<ContractTransaction>; | ||
|
||
metadata(overrides?: CallOverrides): Promise<string>; | ||
|
||
morpho(overrides?: CallOverrides): Promise<string>; | ||
|
||
onMorphoFlashLoan( | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<ContractTransaction>; | ||
|
||
router(overrides?: CallOverrides): Promise<string>; | ||
|
||
callStatic: { | ||
feeRate(overrides?: CallOverrides): Promise<BigNumber>; | ||
|
||
flashLoan(token: string, assets: BigNumberish, data: BytesLike, overrides?: CallOverrides): Promise<void>; | ||
|
||
metadata(overrides?: CallOverrides): Promise<string>; | ||
|
||
morpho(overrides?: CallOverrides): Promise<string>; | ||
|
||
onMorphoFlashLoan(assets: BigNumberish, data: BytesLike, overrides?: CallOverrides): Promise<void>; | ||
|
||
router(overrides?: CallOverrides): Promise<string>; | ||
}; | ||
|
||
filters: {}; | ||
|
||
estimateGas: { | ||
feeRate(overrides?: CallOverrides): Promise<BigNumber>; | ||
|
||
flashLoan( | ||
token: string, | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<BigNumber>; | ||
|
||
metadata(overrides?: CallOverrides): Promise<BigNumber>; | ||
|
||
morpho(overrides?: CallOverrides): Promise<BigNumber>; | ||
|
||
onMorphoFlashLoan( | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<BigNumber>; | ||
|
||
router(overrides?: CallOverrides): Promise<BigNumber>; | ||
}; | ||
|
||
populateTransaction: { | ||
feeRate(overrides?: CallOverrides): Promise<PopulatedTransaction>; | ||
|
||
flashLoan( | ||
token: string, | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<PopulatedTransaction>; | ||
|
||
metadata(overrides?: CallOverrides): Promise<PopulatedTransaction>; | ||
|
||
morpho(overrides?: CallOverrides): Promise<PopulatedTransaction>; | ||
|
||
onMorphoFlashLoan( | ||
assets: BigNumberish, | ||
data: BytesLike, | ||
overrides?: Overrides & { from?: string } | ||
): Promise<PopulatedTransaction>; | ||
|
||
router(overrides?: CallOverrides): Promise<PopulatedTransaction>; | ||
}; | ||
} |
Oops, something went wrong.