This file contains hidden or 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
| import { ethers } from "ethers"; | |
| // 定义智能合约的 ABI 和 bytecode | |
| const abi = [...]; | |
| const bytecode = "0x6080604052..."; | |
| // 连接到以太坊网络 | |
| const provider = new ethers.providers.JsonRpcProvider("http://localhost:8545"); | |
| // 创建一个以太坊钱包 |
This file contains hidden or 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
| // 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 } |
This file contains hidden or 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
| const hre = require('hardhat'); | |
| const { map } = require('underscore'); | |
| require('dotenv').config(); | |
| const { | |
| FlashbotsBundleProvider, | |
| } = require('@flashbots/ethers-provider-bundle'); | |
| const ENS = require('./ENSABI.json'); |