Skip to content

Instantly share code, notes, and snippets.

View SmitK's full-sized avatar

Korry Smith SmitK

  • Florida
View GitHub Profile
@SmitK
SmitK / dydxFlashLoanTemplate.sol
Created January 19, 2022 21:16 — forked from cryptoscopia/dydxFlashLoanTemplate.sol
A single-file simplest possible template for a contract that obtains a flash loan from dydx, does things, and pays it back.
// SPDX-License-Identifier: AGPL-3.0-or-later
// The ABI encoder is necessary, but older Solidity versions should work
pragma solidity ^0.7.0;
pragma experimental ABIEncoderV2;
// These definitions are taken from across multiple dydx contracts, and are
// limited to just the bare minimum necessary to make flash loans work.
library Types {
enum AssetDenomination { Wei, Par }