diff --git a/src/adaptors/looped-hype/accountantAbi.json b/src/adaptors/looped-hype/accountantAbi.json new file mode 100644 index 0000000000..e2bc125052 --- /dev/null +++ b/src/adaptors/looped-hype/accountantAbi.json @@ -0,0 +1,667 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "_owner", + "type": "address", + "internalType": "address" + }, + { + "name": "_vault", + "type": "address", + "internalType": "address" + }, + { + "name": "payoutAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "startingExchangeRate", + "type": "uint96", + "internalType": "uint96" + }, + { + "name": "_base", + "type": "address", + "internalType": "address" + }, + { + "name": "allowedExchangeRateChangeUpper", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "allowedExchangeRateChangeLower", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "minimumUpdateDelayInSeconds", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "managementFee", + "type": "uint16", + "internalType": "uint16" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "accountantState", + "inputs": [], + "outputs": [ + { + "name": "payoutAddress", + "type": "address", + "internalType": "address" + }, + { + "name": "feesOwedInBase", + "type": "uint128", + "internalType": "uint128" + }, + { + "name": "totalSharesLastUpdate", + "type": "uint128", + "internalType": "uint128" + }, + { + "name": "exchangeRate", + "type": "uint96", + "internalType": "uint96" + }, + { + "name": "allowedExchangeRateChangeUpper", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "allowedExchangeRateChangeLower", + "type": "uint16", + "internalType": "uint16" + }, + { + "name": "lastUpdateTimestamp", + "type": "uint64", + "internalType": "uint64" + }, + { + "name": "isPaused", + "type": "bool", + "internalType": "bool" + }, + { + "name": "minimumUpdateDelayInSeconds", + "type": "uint32", + "internalType": "uint32" + }, + { + "name": "managementFee", + "type": "uint16", + "internalType": "uint16" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "authority", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract Authority" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "base", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ERC20" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "claimFees", + "inputs": [ + { + "name": "feeAsset", + "type": "address", + "internalType": "contract ERC20" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "decimals", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRate", + "inputs": [], + "outputs": [ + { + "name": "rate", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRateInQuote", + "inputs": [ + { + "name": "quote", + "type": "address", + "internalType": "contract ERC20" + } + ], + "outputs": [ + { + "name": "rateInQuote", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRateInQuoteSafe", + "inputs": [ + { + "name": "quote", + "type": "address", + "internalType": "contract ERC20" + } + ], + "outputs": [ + { + "name": "rateInQuote", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "getRateSafe", + "inputs": [], + "outputs": [ + { + "name": "rate", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "rateProviderData", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "contract ERC20" + } + ], + "outputs": [ + { + "name": "isPeggedToBase", + "type": "bool", + "internalType": "bool" + }, + { + "name": "rateProvider", + "type": "address", + "internalType": "contract IRateProvider" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setAuthority", + "inputs": [ + { + "name": "newAuthority", + "type": "address", + "internalType": "contract Authority" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "setRateProviderData", + "inputs": [ + { + "name": "asset", + "type": "address", + "internalType": "contract ERC20" + }, + { + "name": "isPeggedToBase", + "type": "bool", + "internalType": "bool" + }, + { + "name": "rateProvider", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "transferOwnership", + "inputs": [ + { + "name": "newOwner", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "unpause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateDelay", + "inputs": [ + { + "name": "minimumUpdateDelayInSeconds", + "type": "uint32", + "internalType": "uint32" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateExchangeRate", + "inputs": [ + { + "name": "newExchangeRate", + "type": "uint96", + "internalType": "uint96" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateLower", + "inputs": [ + { + "name": "allowedExchangeRateChangeLower", + "type": "uint16", + "internalType": "uint16" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateManagementFee", + "inputs": [ + { + "name": "managementFee", + "type": "uint16", + "internalType": "uint16" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updatePayoutAddress", + "inputs": [ + { + "name": "payoutAddress", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "updateUpper", + "inputs": [ + { + "name": "allowedExchangeRateChangeUpper", + "type": "uint16", + "internalType": "uint16" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "vault", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract BoringVault" + } + ], + "stateMutability": "view" + }, + { + "type": "event", + "name": "AuthorityUpdated", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newAuthority", + "type": "address", + "indexed": true, + "internalType": "contract Authority" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "DelayInSecondsUpdated", + "inputs": [ + { + "name": "oldDelay", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + }, + { + "name": "newDelay", + "type": "uint32", + "indexed": false, + "internalType": "uint32" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ExchangeRateUpdated", + "inputs": [ + { + "name": "oldRate", + "type": "uint96", + "indexed": false, + "internalType": "uint96" + }, + { + "name": "newRate", + "type": "uint96", + "indexed": false, + "internalType": "uint96" + }, + { + "name": "currentTime", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "FeesClaimed", + "inputs": [ + { + "name": "feeAsset", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "LowerBoundUpdated", + "inputs": [ + { + "name": "oldBound", + "type": "uint16", + "indexed": false, + "internalType": "uint16" + }, + { + "name": "newBound", + "type": "uint16", + "indexed": false, + "internalType": "uint16" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "ManagementFeeUpdated", + "inputs": [ + { + "name": "oldFee", + "type": "uint16", + "indexed": false, + "internalType": "uint16" + }, + { + "name": "newFee", + "type": "uint16", + "indexed": false, + "internalType": "uint16" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "user", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paused", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "PayoutAddressUpdated", + "inputs": [ + { + "name": "oldPayout", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "newPayout", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "RateProviderUpdated", + "inputs": [ + { + "name": "asset", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "isPegged", + "type": "bool", + "indexed": false, + "internalType": "bool" + }, + { + "name": "rateProvider", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Unpaused", + "inputs": [], + "anonymous": false + }, + { + "type": "event", + "name": "UpperBoundUpdated", + "inputs": [ + { + "name": "oldBound", + "type": "uint16", + "indexed": false, + "internalType": "uint16" + }, + { + "name": "newBound", + "type": "uint16", + "indexed": false, + "internalType": "uint16" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AccountantWithRateProviders__LowerBoundTooLarge", + "inputs": [] + }, + { + "type": "error", + "name": "AccountantWithRateProviders__ManagementFeeTooLarge", + "inputs": [] + }, + { + "type": "error", + "name": "AccountantWithRateProviders__OnlyCallableByBoringVault", + "inputs": [] + }, + { + "type": "error", + "name": "AccountantWithRateProviders__Paused", + "inputs": [] + }, + { + "type": "error", + "name": "AccountantWithRateProviders__UpdateDelayTooLarge", + "inputs": [] + }, + { + "type": "error", + "name": "AccountantWithRateProviders__UpperBoundTooSmall", + "inputs": [] + }, + { + "type": "error", + "name": "AccountantWithRateProviders__ZeroFeesOwed", + "inputs": [] + } +] diff --git a/src/adaptors/looped-hype/index.ts b/src/adaptors/looped-hype/index.ts new file mode 100644 index 0000000000..8cbd7a1073 --- /dev/null +++ b/src/adaptors/looped-hype/index.ts @@ -0,0 +1,141 @@ + +const axios = require('axios'); +const utils = require('../utils'); +const sdk = require('@defillama/sdk'); + +const poolAbi = require('./poolAbi.json'); +const accountantAbi = require('./accountantAbi.json'); + +const LHYPE = '0x5748ae796AE46A4F1348a1693de4b50560485562'; +const LHYPE_ACCOUNTANT = '0xcE621a3CA6F72706678cFF0572ae8d15e5F001c3'; +const UNDERLYING = '0x5555555555555555555555555555555555555555'; // WHYPE on Hyperliquid +const CHAIN = 'hyperliquid'; + +/* --------------------------------- + TVL Calculation Section +----------------------------------*/ +const calculateTVL = async (chain = CHAIN) => { + const totalSupplyCall = sdk.api.abi.call({ + target: LHYPE, + abi: poolAbi.find((m) => m.name === 'totalSupply'), + chain, + }); + + const decimalsCall = sdk.api.abi.call({ + target: LHYPE, + abi: poolAbi.find((m) => m.name === 'decimals'), + chain, + }); + + const priceKey = `${chain}:${UNDERLYING}`; + const underlyingPriceCall = axios.get( + `https://coins.llama.fi/prices/current/${priceKey}?searchWidth=24h` + ); + + const currentRateCall = sdk.api.abi.call({ + target: LHYPE_ACCOUNTANT, + abi: accountantAbi.find((m) => m.name === 'getRate'), + chain, + }); + + const [ + totalSupplyResponse, + decimalsResponse, + underlyingPriceResponse, + currentRateResponse, + ] = await Promise.all([ + totalSupplyCall, + decimalsCall, + underlyingPriceCall, + currentRateCall, + ]); + + const decimals = Number(decimalsResponse.output); + const scalingFactor = 10 ** decimals; + + const totalSupply = Number(totalSupplyResponse.output) / scalingFactor; + const currentRate = Number(currentRateResponse.output); + + const priceObj = underlyingPriceResponse.data?.coins?.[priceKey]; + if (!priceObj || typeof priceObj.price !== 'number') { + throw new Error(`No price found for ${priceKey}`); + } + const underlyingPrice = priceObj.price; + const tvlUsd = totalSupply * currentRate * underlyingPrice / scalingFactor; + + return { + tvlUsd, + underlyingPrice, + decimals, + scalingFactor, + totalSupply, + currentRate, + }; +}; + +/* --------------------------------- + APY Calculation Section +----------------------------------*/ +const calculateAPY = async (currentRate, scalingFactor, chain = CHAIN) => { + const now = Math.floor(Date.now() / 1000); + const t1d = now - 86400; + const t7d = now - 86400 * 7; + + const [b1, b7] = await Promise.all([ + axios.get(`https://coins.llama.fi/block/${chain}/${t1d}`), + axios.get(`https://coins.llama.fi/block/${chain}/${t7d}`), + ]); + + const block1d = b1.data?.height; + const block7d = b7.data?.height; + + const [r1, r7] = await Promise.all([ + sdk.api.abi.call({ + target: LHYPE_ACCOUNTANT, + abi: accountantAbi.find((m) => m.name === 'getRate'), + block: block1d, + chain, + }), + sdk.api.abi.call({ + target: LHYPE_ACCOUNTANT, + abi: accountantAbi.find((m) => m.name === 'getRate'), + block: block7d, + chain, + }), + ]); + + const apy1d = ((Number(currentRate) - Number(r1.output)) / scalingFactor) * 365 * 100; + const apy7d = ((Number(currentRate) - Number(r7.output)) / scalingFactor / 7) * 365 * 100; + + return { + apy1d, + apy7d, + }; +}; + +/* --------------------------------- + Adapter Export +----------------------------------*/ +const apy = async () => { + const { tvlUsd, currentRate, scalingFactor } = await calculateTVL(CHAIN); + const { apy1d, apy7d } = await calculateAPY(currentRate, scalingFactor, CHAIN); + + const pool = { + pool: `${LHYPE}-${CHAIN}`.toLowerCase(), + project: 'looped-hype', + chain: utils.formatChain(CHAIN), + symbol: 'LHYPE', + tvlUsd, + apyBase: apy1d, + apyBase7d: apy7d, + underlyingTokens: [UNDERLYING], + }; + + return [pool]; +}; + +module.exports = { + apy, + timetravel: false, + url: 'https://app.loopingcollective.org/product/lhype', +}; diff --git a/src/adaptors/looped-hype/poolAbi.json b/src/adaptors/looped-hype/poolAbi.json new file mode 100644 index 0000000000..69a73b0ccb --- /dev/null +++ b/src/adaptors/looped-hype/poolAbi.json @@ -0,0 +1,744 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "contract Authority", + "name": "newAuthority", + "type": "address" + } + ], + "name": "AuthorityUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Enter", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "asset", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "Exit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "user", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "authority", + "outputs": [ + { + "internalType": "contract Authority", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assetAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shareAmount", + "type": "uint256" + } + ], + "name": "enter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "contract ERC20", + "name": "asset", + "type": "address" + }, + { + "internalType": "uint256", + "name": "assetAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shareAmount", + "type": "uint256" + } + ], + "name": "exit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "hook", + "outputs": [ + { + "internalType": "contract BeforeTransferHook", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "targets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + }, + { + "internalType": "uint256[]", + "name": "values", + "type": "uint256[]" + } + ], + "name": "manage", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "manage", + "outputs": [ + { + "internalType": "bytes", + "name": "result", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155BatchReceived", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC1155Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "onERC721Received", + "outputs": [ + { + "internalType": "bytes4", + "name": "", + "type": "bytes4" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract Authority", + "name": "newAuthority", + "type": "address" + } + ], + "name": "setAuthority", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_hook", + "type": "address" + } + ], + "name": "setBeforeTransferHook", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + } + ], + "name": "supportsInterface", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +]