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 EthDater = require("ethereum-block-by-date"); | |
const ethers = require('ethers'); | |
const TOKEN_ADDRESS = ".."; | |
const MULTISIG_ADDRESS = ".."; | |
const HISTORICAL_RPC = ".."; | |
const ERC_20_ABI = [".."]' | |
const getBlockForTimestamp = async (timestamp, provider) => { | |
const dater = new EthDater( |
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
export const wrapContract = async function wrapContract(contract, assets) { | |
//for more symbols in data feed it's more optimal to not specify asset list | |
const providedAssets = (assets && assets.length <= 5) ? assets : undefined; | |
return WrapperBuilder.wrap(contract).usingDataService( | |
{ | |
dataServiceId: dataProviderId, //dataProviderId = 'redstone-arbitrum-prod' (DeltaPrime Arbitrum of DegenPrime) or 'redstone-avalanche-prod' (DeltaPrime Avalanche) | |
uniqueSignersCount: 3, | |
dataFeeds: providedAssets, | |
disablePayloadsDryRun: true | |
}, |
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
/** | |
* @notice Allows prime accounts to claim accumulated fees from an Aerodrome position. | |
* @param tokenId The ID of the Aerodrome NFT position for which fees should be collected. | |
*/ | |
function collectFeesAerodrome(uint256 tokenId) external remainsSolvent nonReentrant onlyOwner { | |
( | |
,, | |
address token0Address, | |
address token1Address, | |
int24 tickSpacing, |
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
function getTwap( | |
address pool, | |
uint32 secondsAgo | |
) external view returns (int24 twap) { | |
require(secondsAgo > 0, "Seconds must be > 0"); | |
IUniswapV3Pool uniswapPool = IUniswapV3Pool(pool); | |
uint32; | |
secondsAgos[0] = secondsAgo; |
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 Decimal from "decimal.js"; | |
import { | |
MulticallParsedResponse, | |
MulticallParsedResponses, | |
} from "../../../../../../types"; | |
import PendleLpTokenAbi from "../../shared/abis/WombatLPToken.abi.json"; | |
import { IEvmRequestHandlers } from "../../../../shared/IEvmRequestHandlers"; | |
import { buildMulticallRequests } from "../utils/build-multicall-request"; | |
import { extractValueFromMulticallResponse } from "../../../../shared/utils/extract-value-from-multicall-response"; | |
import { getLastPriceOrFail } from "../../../../db/local-cache"; |
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 {WrapperBuilder} from "@redstone-finance/evm-connector"; | |
import config from "../../src/config"; | |
import CACHE_LAYER_URLS from "../../common/redstone-cache-layer-urls.json"; | |
const contractName = "SmartLoanGigaChadInterface"; | |
const contractMethod = "getFullLoanStatus"; | |
const jsonRPC = "https://nd-942-045-793.p2pify.com/8a3ab811da8703a863d7f2b93f65f3d0/ext/bc/C/rpc"; | |
const ARTIFACT = require(`../../artifacts/contracts/interfaces/${contractName}.sol/${contractName}.json`); | |
const ethers = require("ethers"); |
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 SLF_ARTIFACT = require(`../../artifacts/contracts/SmartLoansFactory.sol/SmartLoansFactory.json`); | |
const ethers = require("ethers"); | |
const fs = require("fs"); | |
const key = fs.readFileSync("./.secret").toString().trim(); | |
let mnemonicWallet = new ethers.Wallet(key); | |
let provider = new ethers.providers.JsonRpcProvider(jsonRPC); | |
let wallet = mnemonicWallet.connect(provider); |
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 {web3} from "hardhat"; | |
const loanAddress = "0xB058DDDBcF513D7159cca9e7D776Ee0bF18E36E9"; | |
const jsonRPC = "https://api.avax.network/ext/bc/C/rpc"; | |
const ARTIFACT = require(`../../artifacts/contracts/interfaces/SmartLoanGigaChadInterface.sol/SmartLoanGigaChadInterface.json`); | |
const ethers = require("ethers"); | |
const fs = require("fs"); | |
const {WrapperBuilder} = require("@redstone-finance/evm-connector"); | |
const {queryHistoricalFeeds} = require("./query-arweave"); |
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 loanAddress = "0xB058DDDBcF513D7159cca9e7D776Ee0bF18E36E9"; | |
const jsonRPC = "https://api.avax.network/ext/bc/C/rpc"; | |
const ARTIFACT = require(`../../artifacts/contracts/interfaces/SmartLoanGigaChadInterface.sol/SmartLoanGigaChadInterface.json`); | |
const ethers = require("ethers"); | |
const fs = require("fs"); | |
const {WrapperBuilder} = require("@redstone-finance/evm-connector"); | |
const {queryHistoricalFeeds} = require("./query-arweave"); | |
import { SignedDataPackage } from "redstone-protocol"; |
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
{ | |
"_format": "hh-sol-artifact-1", | |
"contractName": "SmartLoanGigaChadInterface", | |
"sourceName": "contracts/interfaces/SmartLoanGigaChadInterface.sol", | |
"abi": [ | |
{ | |
"anonymous": false, | |
"inputs": [ | |
{ | |
"indexed": true, |
NewerOlder