Skip to content

Instantly share code, notes, and snippets.

View 0xlny's full-sized avatar
🌏
Nomad

0xlenny 0xlny

🌏
Nomad
View GitHub Profile
@0xlny
0xlny / dydxFlashLoanTemplate.sol
Created July 20, 2021 19:38 — 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 }