瀏覽代碼

删除非必要文件

skyfffire 2 年之前
父節點
當前提交
f3d9907ccc
共有 8 個文件被更改,包括 0 次插入147 次删除
  1. 0 13
      README.md
  2. 0 14
      config/contracts.ts
  3. 0 6
      config/fee.ts
  4. 0 1
      config/v2_routers.ts
  5. 0 53
      contracts/base/Address.sol
  6. 0 26
      contracts/base/TransferHelper.sol
  7. 0 1
      utils/encodeUtils.ts
  8. 0 33
      utils/http.ts

+ 0 - 13
README.md

@@ -1,17 +1,4 @@
-# Sample Hardhat Project
-
-This project demonstrates a basic Hardhat use case. It comes with a sample contract, a test for that contract, and a script that deploys that contract.
-
-Try running some of the following tasks:
-
 ```
 cp .secret.ts.sample .secret.ts
 ```
 
-```shell
-npx hardhat help
-npx hardhat test
-REPORT_GAS=true npx hardhat test
-npx hardhat node
-npx hardhat run scripts/deploy.ts
-```

+ 0 - 14
config/contracts.ts

@@ -1,14 +0,0 @@
-export default {
-  WETH: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2',
-  HEX: '0x2b591e99afE9f32eAA6214f7B7629768c40Eeb39',
-  USDT: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
-  UNIV3: '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45',
-  UNIV3_POSITION: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',
-  UNIV3_FACTORY: '0x1F98431c8aD98523631AE4a59f267346ea31F984',
-  QUOTER: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
-  ZERO: '0x0000000000000000000000000000000000000000',
-  CALC: '0x30c34b111121aCDb423eF2C0e39235Dc68a793A4',
-  FLASH: '0x672746E54B6FB7Bf6748De46271b68B112B79a66',
-  TOOLS_410_V2: '0x8c72ef5448274f9a79d2a5addb10374dc3f58f08',
-  TOOLS_V3: '0x5261aD5CB71fE1A37a3722c40E93a80e84f62613'
-}

+ 0 - 6
config/fee.ts

@@ -1,6 +0,0 @@
-export default {
-    _1_per_10000: 100,
-    _5_per_10000: 500,
-    _30_per_10000: 3000,
-    _100_per_10000: 10000,
-}

+ 0 - 1
config/v2_routers.ts

@@ -1 +0,0 @@
-export default ['0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f', '0x7a250d5630b4cf539739df2c5dacb4c659f2488d', '0xf6a86eaa9ea0f38f66b3718114ae79acaf35e02f', '0x03f7724180aa6b939894b5ca4314783b0b36b329', '0x53e0e51b5ed9202110d7ecd637a4581db8b9879f', '0x0c17e776cd218252adfca8d4e761d3fe757e9778', '0x25553828f22bdd19a20e4f12f052903cb474a335', '0x45815d3d2cd2a1cfbcf08dcfbdc6e11774ed9e39', '0x8cda39226daf33ae1aba0c92c34d1a1982cf0210', '0x59fe14af3ce9f15b06fb23dad670f3e68f885024', '0xea566e16af328085e75c7b4d3a007cf23f3f208d', '0x1fdd76e18dd21046b7e7d54c8254bf08b239e4d9', '0xdc6844ced486ec04803f02f2ee40bbdbef615f21', '0x07f72839d7a71a117fa859cba643c9291eeba921', '0x3e445e3280c5747a188db8d0ab7762838a50e4ff', '0x05f6bb6b96ca657a3666d2f1bca302b999a671b4', '0x3018234c038d524147ff47148baa8381306f28cf', '0x39d660d507f1bc34dbce94831081d6cf9131c3b9', '0xceb90e4c17d626be0facd78b79c9c87d7ca181b3', '0xb5e9f6c58f548cee53257304e287b23757effca1', '0xb9960d9bca016e9748be75dd52f02188b9d0829f', '0xe6e90bc9f3b95cdb69f48c7bfdd0ede1386b135a', '0xff062471eaf07b50fc1b77e61787301867610f80', '0xfe1f5bb11db3a9dead9d00ceb6f4e607b847d08e', '0xc14d550632db8592d1243edc8b95b0ad06703867', '0x5f509a3c3f16df2fba7bf84dee1efbce6bb85587', '0x6c78d71ce7300343e3633e0c45d6c7a79fee4650', '0xfcdf5cc307964ffabfc14fbd2dc4fad8e0fe9f45', '0xf73ba36cf5466abf1cfbc16ce4096eea135b5ea1', '0xcf7d4b75b7bccdb8b4f992fe05970680e2ee1a02', '0x463672ffded540f7613d3e8248e3a8a51baf7217', '0x3b505af97031b75e2be39e7f8fa1fa634857f29d', '0x1d5c6f1607a171ad52efb270121331b3039dd83e', '0x37d7f26405103c9bc9d8f9352cf32c5b655cbe02', '0x3bc722f252c7bae2f55647e49adcb9d33ff6ebcc', '0x8f589dcef8bc9564c17fba05ab6204e9793c9223', '0xdafb251f372d040f0da0f9b787623aae9cf1acb6', '0xbcc59f7397e78133d0b7ad0e044aaa26015292a1', '0x57556d10e6e9de56d72b9b322d433b9ed06741d0']

+ 0 - 53
contracts/base/Address.sol

@@ -1,53 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-pragma solidity ^0.7.6;
-pragma abicoder v2;
-
-library Address {
-    function isContract(address account) internal view returns (bool) {
-        uint256 size;
-        assembly { size := extcodesize(account) }
-        return size > 0;
-    }
-
-    function sendValue(address payable recipient, uint256 amount) internal {
-        require(address(this).balance >= amount, "Address: insufficient balance");
-
-        (bool success, ) = recipient.call{ value: amount }("");
-        require(success, "Address: unable to send value, recipient may have reverted");
-    }
-
-    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
-      return functionCall(target, data, "Address: low-level call failed");
-    }
-
-    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
-        return functionCallWithValue(target, data, 0, errorMessage);
-    }
-
-    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
-        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
-    }
-
-    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
-        require(address(this).balance >= value, "Address: insufficient balance for call");
-        require(isContract(target), "Address: call to non-contract");
-
-        (bool success, bytes memory returndata) = target.call{ value: value }(data);
-        return _verifyCallResult(success, returndata, errorMessage);
-    }
-
-    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
-        if (success) {
-            return returndata;
-        } else {
-            if (returndata.length > 0) {
-                assembly {
-                    let returndata_size := mload(returndata)
-                    revert(add(32, returndata), returndata_size)
-                }
-            } else {
-                revert(errorMessage);
-            }
-        }
-    }
-}

+ 0 - 26
contracts/base/TransferHelper.sol

@@ -1,26 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later
-pragma solidity ^0.7.6;
-pragma abicoder v2;
-
-// base library
-library TransferHelper {
-    function safeApprove(address token, address to, uint256 value) internal {
-        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
-        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED.');
-    }
-
-    function safeTransfer(address token, address to, uint value) internal {
-        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
-        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED.');
-    }
-
-    function safeTransferFrom(address token, address from, address to, uint value) internal {
-        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
-        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED.');
-    }
-
-    function safeTransferETH(address to, uint value) internal {
-        (bool success,) = to.call{value: value}(new bytes(0));
-        require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
-    }
-}

+ 0 - 1
utils/encodeUtils.ts

@@ -1 +0,0 @@
-export default class encode {}

+ 0 - 33
utils/http.ts

@@ -1,33 +0,0 @@
-import axios from 'axios'
-import { Md5 } from 'ts-md5'
-import qs from 'qs'
-import {replaceAll} from "hardhat/internal/util/strings";
-
-axios.defaults.baseURL = 'http://www.410eth.com:8088'
-
-axios.interceptors.request.use(
-  function(config) {
-    // auth
-    let timestamp = parseInt((Date.parse(new Date().toString()) / 1000) + '')
-    let baseStr = '410410' + timestamp
-    let splitStrList = baseStr.split("")
-    let replacedStr = replaceAll(baseStr, splitStrList[splitStrList.length - 1], "")
-    let authStr = Md5.hashStr(replacedStr)
-
-    config.data.timestamp = timestamp
-    config.data.auth = authStr
-
-    // headers处理
-    // @ts-ignore
-    config.headers['content-type'] = 'application/x-www-form-urlencoded'
-    config.data = qs.stringify(config.data)
-
-    return config;
-  },
-  function(error) {
-    // Do something with request error
-    return Promise.reject(error);
-  }
-)
-
-export default axios