diff --git a/src/apps/tempus/assets/logo.png b/src/apps/tempus/assets/logo.png new file mode 100644 index 000000000..d68cf5fb4 Binary files /dev/null and b/src/apps/tempus/assets/logo.png differ diff --git a/src/apps/tempus/contracts/abis/tempus-amm.json b/src/apps/tempus/contracts/abis/tempus-amm.json new file mode 100644 index 000000000..991002ccd --- /dev/null +++ b/src/apps/tempus/contracts/abis/tempus-amm.json @@ -0,0 +1,1146 @@ +[ + { + "inputs": [ + { + "internalType": "contract IVault", + "name": "vault", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "contract ITempusPool", + "name": "pool", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amplificationStart", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amplificationEnd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "pauseWindowDuration", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodDuration", + "type": "uint256" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "startValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endValue", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "AmpUpdateStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "currentValue", + "type": "uint256" + } + ], + "name": "AmpUpdateStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "PausedStateChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "SwapFeePercentageChanged", + "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": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "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": [ + { + "internalType": "address", + "name": "account", + "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": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes4", + "name": "selector", + "type": "bytes4" + } + ], + "name": "getActionId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAmplificationParameter", + "outputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isUpdating", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "precision", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAuthorizer", + "outputs": [ + { + "internalType": "contract IAuthorizer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "principalsStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yieldsStaked", + "type": "uint256" + } + ], + "name": "getExpectedBPTInGivenTokensOut", + "outputs": [ + { + "internalType": "uint256", + "name": "lpTokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "name": "getExpectedLPTokensForTokensIn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "yieldShareIn", + "type": "bool" + } + ], + "name": "getExpectedReturnGivenIn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "bptAmountIn", + "type": "uint256" + } + ], + "name": "getExpectedTokensOutGivenBPTIn", + "outputs": [ + { + "internalType": "uint256", + "name": "principals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yields", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastInvariant", + "outputs": [ + { + "internalType": "uint256", + "name": "lastInvariant", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastInvariantAmp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPausedState", + "outputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "pauseWindowEndTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "bufferPeriodEndTime", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getPoolId", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getScalingFactors", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "principals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yields", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + } + ], + "name": "getSwapAmountToEndWithEqualShares", + "outputs": [ + { + "internalType": "uint256", + "name": "amountIn", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "yieldsIn", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getSwapFeePercentage", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVault", + "outputs": [ + { + "internalType": "contract IVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onExitPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "onJoinPool", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + }, + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "enum IVault.SwapKind", + "name": "kind", + "type": "uint8" + }, + { + "internalType": "contract IERC20", + "name": "tokenIn", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "tokenOut", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "internalType": "struct IPoolSwapStructs.SwapRequest", + "name": "request", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "balanceTokenIn", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceTokenOut", + "type": "uint256" + } + ], + "name": "onSwap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "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": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryExit", + "outputs": [ + { + "internalType": "uint256", + "name": "bptIn", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsOut", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "poolId", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256[]", + "name": "balances", + "type": "uint256[]" + }, + { + "internalType": "uint256", + "name": "lastChangeBlock", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "protocolSwapFeePercentage", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "userData", + "type": "bytes" + } + ], + "name": "queryJoin", + "outputs": [ + { + "internalType": "uint256", + "name": "bptOut", + "type": "uint256" + }, + { + "internalType": "uint256[]", + "name": "amountsIn", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "bytes", + "name": "poolConfig", + "type": "bytes" + } + ], + "name": "setAssetManagerPoolConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "paused", + "type": "bool" + } + ], + "name": "setPaused", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "swapFeePercentage", + "type": "uint256" + } + ], + "name": "setSwapFeePercentage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "rawEndValue", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "endTime", + "type": "uint256" + } + ], + "name": "startAmplificationParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stopAmplificationParameterUpdate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tempusPool", + "outputs": [ + { + "internalType": "contract ITempusPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/tempus/contracts/abis/tempus-pool.json b/src/apps/tempus/contracts/abis/tempus-pool.json new file mode 100644 index 000000000..20f70eca8 --- /dev/null +++ b/src/apps/tempus/contracts/abis/tempus-pool.json @@ -0,0 +1,867 @@ +[ + { + "inputs": [ + { + "internalType": "contract ILido", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "uint256", + "name": "maturity", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estYield", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "internalType": "struct TokenData", + "name": "principalsData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + } + ], + "internalType": "struct TokenData", + "name": "yieldsData", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "depositPercent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "earlyRedeemPercent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "matureRedeemPercent", + "type": "uint256" + } + ], + "internalType": "struct ITempusFees.FeesConfig", + "name": "maxFeeSetup", + "type": "tuple" + }, + { + "internalType": "address", + "name": "referrerAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "currentOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "proposedOwner", + "type": "address" + } + ], + "name": "OwnershipProposed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "backingToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "backingTokenONE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "controller", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "currentInterestRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "isBackingToken", + "type": "bool" + } + ], + "name": "estimatedMintedShares", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "principals", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yields", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "toBackingToken", + "type": "bool" + } + ], + "name": "estimatedRedeem", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "exceptionalHaltTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "exchangeRateONE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "finalize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getFeesConfig", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "depositPercent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "earlyRedeemPercent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "matureRedeemPercent", + "type": "uint256" + } + ], + "internalType": "struct ITempusFees.FeesConfig", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "initialInterestRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "matured", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maturityInterestRate", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maturityTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxDepositFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxEarlyRedeemFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxMatureRedeemFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maximumNegativeYieldDuration", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "yieldTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "numAssetsPerYieldToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "backingTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "numYieldTokensPerAsset", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "backingTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "onDepositBacking", + "outputs": [ + { + "internalType": "uint256", + "name": "mintedShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositedYBT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "yieldTokenAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "onDepositYieldBearing", + "outputs": [ + { + "internalType": "uint256", + "name": "mintedShares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "depositedBT", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pricePerPrincipalShare", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pricePerPrincipalShareStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pricePerYieldShare", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "pricePerYieldShareStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "principalShare", + "outputs": [ + { + "internalType": "contract IPoolShare", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "protocolName", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "principalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yieldAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "redeem", + "outputs": [ + { + "internalType": "uint256", + "name": "redeemedYieldTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "uint256", + "name": "principalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "yieldAmount", + "type": "uint256" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "redeemToBacking", + "outputs": [ + { + "internalType": "uint256", + "name": "redeemedYieldTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "redeemedBackingTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "fee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "rate", + "type": "uint256" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "depositPercent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "earlyRedeemPercent", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "matureRedeemPercent", + "type": "uint256" + } + ], + "internalType": "struct ITempusFees.FeesConfig", + "name": "newFeesConfig", + "type": "tuple" + } + ], + "name": "setFeesConfig", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "startTime", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalFees", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + } + ], + "name": "transferFees", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "components": [ + { + "internalType": "uint16", + "name": "major", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "minor", + "type": "uint16" + }, + { + "internalType": "uint16", + "name": "patch", + "type": "uint16" + } + ], + "internalType": "struct IVersioned.Version", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "yieldBearingONE", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "yieldBearingToken", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "yieldShare", + "outputs": [ + { + "internalType": "contract IPoolShare", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } +] diff --git a/src/apps/tempus/contracts/abis/tempus-py-token.json b/src/apps/tempus/contracts/abis/tempus-py-token.json new file mode 100644 index 000000000..daa11bed9 --- /dev/null +++ b/src/apps/tempus/contracts/abis/tempus-py-token.json @@ -0,0 +1,412 @@ +[ + { + "inputs": [ + { + "internalType": "contract ITempusPool", + "name": "_pool", + "type": "address" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "symbol", + "type": "string" + }, + { + "internalType": "uint8", + "name": "decimals", + "type": "uint8" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "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": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "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": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "burnFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getPricePerFullShare", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getPricePerFullShareStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "kind", + "outputs": [ + { + "internalType": "enum IPoolShare.ShareKind", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "manager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "mint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pool", + "outputs": [ + { + "internalType": "contract ITempusPool", + "name": "", + "type": "address" + } + ], + "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": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/tempus/contracts/ethers/TempusAmm.ts b/src/apps/tempus/contracts/ethers/TempusAmm.ts new file mode 100644 index 000000000..f41d1fbe2 --- /dev/null +++ b/src/apps/tempus/contracts/ethers/TempusAmm.ts @@ -0,0 +1,1306 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export declare namespace IPoolSwapStructs { + export type SwapRequestStruct = { + kind: BigNumberish; + tokenIn: string; + tokenOut: string; + amount: BigNumberish; + poolId: BytesLike; + lastChangeBlock: BigNumberish; + from: string; + to: string; + userData: BytesLike; + }; + + export type SwapRequestStructOutput = [ + number, + string, + string, + BigNumber, + string, + BigNumber, + string, + string, + string, + ] & { + kind: number; + tokenIn: string; + tokenOut: string; + amount: BigNumber; + poolId: string; + lastChangeBlock: BigNumber; + from: string; + to: string; + userData: string; + }; +} + +export interface TempusAmmInterface extends utils.Interface { + functions: { + 'DOMAIN_SEPARATOR()': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'getActionId(bytes4)': FunctionFragment; + 'getAmplificationParameter()': FunctionFragment; + 'getAuthorizer()': FunctionFragment; + 'getExpectedBPTInGivenTokensOut(uint256,uint256)': FunctionFragment; + 'getExpectedLPTokensForTokensIn(uint256[])': FunctionFragment; + 'getExpectedReturnGivenIn(uint256,bool)': FunctionFragment; + 'getExpectedTokensOutGivenBPTIn(uint256)': FunctionFragment; + 'getLastInvariant()': FunctionFragment; + 'getOwner()': FunctionFragment; + 'getPausedState()': FunctionFragment; + 'getPoolId()': FunctionFragment; + 'getRate()': FunctionFragment; + 'getScalingFactors()': FunctionFragment; + 'getSwapAmountToEndWithEqualShares(uint256,uint256,uint256)': FunctionFragment; + 'getSwapFeePercentage()': FunctionFragment; + 'getVault()': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'name()': FunctionFragment; + 'nonces(address)': FunctionFragment; + 'onExitPool(bytes32,address,address,uint256[],uint256,uint256,bytes)': FunctionFragment; + 'onJoinPool(bytes32,address,address,uint256[],uint256,uint256,bytes)': FunctionFragment; + 'onSwap((uint8,address,address,uint256,bytes32,uint256,address,address,bytes),uint256,uint256)': FunctionFragment; + 'permit(address,address,uint256,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'queryExit(bytes32,address,address,uint256[],uint256,uint256,bytes)': FunctionFragment; + 'queryJoin(bytes32,address,address,uint256[],uint256,uint256,bytes)': FunctionFragment; + 'setAssetManagerPoolConfig(address,bytes)': FunctionFragment; + 'setPaused(bool)': FunctionFragment; + 'setSwapFeePercentage(uint256)': FunctionFragment; + 'startAmplificationParameterUpdate(uint256,uint256)': FunctionFragment; + 'stopAmplificationParameterUpdate()': FunctionFragment; + 'symbol()': FunctionFragment; + 'tempusPool()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'DOMAIN_SEPARATOR' + | 'allowance' + | 'approve' + | 'balanceOf' + | 'decimals' + | 'decreaseAllowance' + | 'getActionId' + | 'getAmplificationParameter' + | 'getAuthorizer' + | 'getExpectedBPTInGivenTokensOut' + | 'getExpectedLPTokensForTokensIn' + | 'getExpectedReturnGivenIn' + | 'getExpectedTokensOutGivenBPTIn' + | 'getLastInvariant' + | 'getOwner' + | 'getPausedState' + | 'getPoolId' + | 'getRate' + | 'getScalingFactors' + | 'getSwapAmountToEndWithEqualShares' + | 'getSwapFeePercentage' + | 'getVault' + | 'increaseAllowance' + | 'name' + | 'nonces' + | 'onExitPool' + | 'onJoinPool' + | 'onSwap' + | 'permit' + | 'queryExit' + | 'queryJoin' + | 'setAssetManagerPoolConfig' + | 'setPaused' + | 'setSwapFeePercentage' + | 'startAmplificationParameterUpdate' + | 'stopAmplificationParameterUpdate' + | 'symbol' + | 'tempusPool' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'DOMAIN_SEPARATOR', values?: undefined): string; + encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'decreaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'getActionId', values: [BytesLike]): string; + encodeFunctionData(functionFragment: 'getAmplificationParameter', values?: undefined): string; + encodeFunctionData(functionFragment: 'getAuthorizer', values?: undefined): string; + encodeFunctionData(functionFragment: 'getExpectedBPTInGivenTokensOut', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'getExpectedLPTokensForTokensIn', values: [BigNumberish[]]): string; + encodeFunctionData(functionFragment: 'getExpectedReturnGivenIn', values: [BigNumberish, boolean]): string; + encodeFunctionData(functionFragment: 'getExpectedTokensOutGivenBPTIn', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'getLastInvariant', values?: undefined): string; + encodeFunctionData(functionFragment: 'getOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'getPausedState', values?: undefined): string; + encodeFunctionData(functionFragment: 'getPoolId', values?: undefined): string; + encodeFunctionData(functionFragment: 'getRate', values?: undefined): string; + encodeFunctionData(functionFragment: 'getScalingFactors', values?: undefined): string; + encodeFunctionData( + functionFragment: 'getSwapAmountToEndWithEqualShares', + values: [BigNumberish, BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'getSwapFeePercentage', values?: undefined): string; + encodeFunctionData(functionFragment: 'getVault', values?: undefined): string; + encodeFunctionData(functionFragment: 'increaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'nonces', values: [string]): string; + encodeFunctionData( + functionFragment: 'onExitPool', + values: [BytesLike, string, string, BigNumberish[], BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'onJoinPool', + values: [BytesLike, string, string, BigNumberish[], BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'onSwap', + values: [IPoolSwapStructs.SwapRequestStruct, BigNumberish, BigNumberish], + ): string; + encodeFunctionData( + functionFragment: 'permit', + values: [string, string, BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'queryExit', + values: [BytesLike, string, string, BigNumberish[], BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData( + functionFragment: 'queryJoin', + values: [BytesLike, string, string, BigNumberish[], BigNumberish, BigNumberish, BytesLike], + ): string; + encodeFunctionData(functionFragment: 'setAssetManagerPoolConfig', values: [string, BytesLike]): string; + encodeFunctionData(functionFragment: 'setPaused', values: [boolean]): string; + encodeFunctionData(functionFragment: 'setSwapFeePercentage', values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: 'startAmplificationParameterUpdate', + values: [BigNumberish, BigNumberish], + ): string; + encodeFunctionData(functionFragment: 'stopAmplificationParameterUpdate', values?: undefined): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'tempusPool', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + + decodeFunctionResult(functionFragment: 'DOMAIN_SEPARATOR', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getActionId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getAmplificationParameter', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getAuthorizer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getExpectedBPTInGivenTokensOut', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getExpectedLPTokensForTokensIn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getExpectedReturnGivenIn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getExpectedTokensOutGivenBPTIn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLastInvariant', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPausedState', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPoolId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getRate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getScalingFactors', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getSwapAmountToEndWithEqualShares', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getSwapFeePercentage', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getVault', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nonces', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'onExitPool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'onJoinPool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'onSwap', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'permit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'queryExit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'queryJoin', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setAssetManagerPoolConfig', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setPaused', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setSwapFeePercentage', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'startAmplificationParameterUpdate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'stopAmplificationParameterUpdate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tempusPool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + + events: { + 'AmpUpdateStarted(uint256,uint256,uint256,uint256)': EventFragment; + 'AmpUpdateStopped(uint256)': EventFragment; + 'Approval(address,address,uint256)': EventFragment; + 'PausedStateChanged(bool)': EventFragment; + 'SwapFeePercentageChanged(uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'AmpUpdateStarted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'AmpUpdateStopped'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PausedStateChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'SwapFeePercentageChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface AmpUpdateStartedEventObject { + startValue: BigNumber; + endValue: BigNumber; + startTime: BigNumber; + endTime: BigNumber; +} +export type AmpUpdateStartedEvent = TypedEvent< + [BigNumber, BigNumber, BigNumber, BigNumber], + AmpUpdateStartedEventObject +>; + +export type AmpUpdateStartedEventFilter = TypedEventFilter; + +export interface AmpUpdateStoppedEventObject { + currentValue: BigNumber; +} +export type AmpUpdateStoppedEvent = TypedEvent<[BigNumber], AmpUpdateStoppedEventObject>; + +export type AmpUpdateStoppedEventFilter = TypedEventFilter; + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface PausedStateChangedEventObject { + paused: boolean; +} +export type PausedStateChangedEvent = TypedEvent<[boolean], PausedStateChangedEventObject>; + +export type PausedStateChangedEventFilter = TypedEventFilter; + +export interface SwapFeePercentageChangedEventObject { + swapFeePercentage: BigNumber; +} +export type SwapFeePercentageChangedEvent = TypedEvent<[BigNumber], SwapFeePercentageChangedEventObject>; + +export type SwapFeePercentageChangedEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface TempusAmm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: TempusAmmInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise<[string]>; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getActionId(selector: BytesLike, overrides?: CallOverrides): Promise<[string]>; + + getAmplificationParameter(overrides?: CallOverrides): Promise< + [BigNumber, boolean, BigNumber] & { + value: BigNumber; + isUpdating: boolean; + precision: BigNumber; + } + >; + + getAuthorizer(overrides?: CallOverrides): Promise<[string]>; + + getExpectedBPTInGivenTokensOut( + principalsStaked: BigNumberish, + yieldsStaked: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber] & { lpTokens: BigNumber }>; + + getExpectedLPTokensForTokensIn(amountsIn: BigNumberish[], overrides?: CallOverrides): Promise<[BigNumber]>; + + getExpectedReturnGivenIn( + amount: BigNumberish, + yieldShareIn: boolean, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + getExpectedTokensOutGivenBPTIn( + bptAmountIn: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { principals: BigNumber; yields: BigNumber }>; + + getLastInvariant(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + lastInvariant: BigNumber; + lastInvariantAmp: BigNumber; + } + >; + + getOwner(overrides?: CallOverrides): Promise<[string]>; + + getPausedState(overrides?: CallOverrides): Promise< + [boolean, BigNumber, BigNumber] & { + paused: boolean; + pauseWindowEndTime: BigNumber; + bufferPeriodEndTime: BigNumber; + } + >; + + getPoolId(overrides?: CallOverrides): Promise<[string]>; + + getRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + getScalingFactors(overrides?: CallOverrides): Promise<[BigNumber[]]>; + + getSwapAmountToEndWithEqualShares( + principals: BigNumberish, + yields: BigNumberish, + threshold: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, boolean] & { amountIn: BigNumber; yieldsIn: boolean }>; + + getSwapFeePercentage(overrides?: CallOverrides): Promise<[BigNumber]>; + + getVault(overrides?: CallOverrides): Promise<[string]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + nonces(owner: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + onExitPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onJoinPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onSwap( + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryExit( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryJoin( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setAssetManagerPoolConfig( + token: string, + poolConfig: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPaused( + paused: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setSwapFeePercentage( + swapFeePercentage: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startAmplificationParameterUpdate( + rawEndValue: BigNumberish, + endTime: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + stopAmplificationParameterUpdate( + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + tempusPool(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getActionId(selector: BytesLike, overrides?: CallOverrides): Promise; + + getAmplificationParameter(overrides?: CallOverrides): Promise< + [BigNumber, boolean, BigNumber] & { + value: BigNumber; + isUpdating: boolean; + precision: BigNumber; + } + >; + + getAuthorizer(overrides?: CallOverrides): Promise; + + getExpectedBPTInGivenTokensOut( + principalsStaked: BigNumberish, + yieldsStaked: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getExpectedLPTokensForTokensIn(amountsIn: BigNumberish[], overrides?: CallOverrides): Promise; + + getExpectedReturnGivenIn(amount: BigNumberish, yieldShareIn: boolean, overrides?: CallOverrides): Promise; + + getExpectedTokensOutGivenBPTIn( + bptAmountIn: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { principals: BigNumber; yields: BigNumber }>; + + getLastInvariant(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + lastInvariant: BigNumber; + lastInvariantAmp: BigNumber; + } + >; + + getOwner(overrides?: CallOverrides): Promise; + + getPausedState(overrides?: CallOverrides): Promise< + [boolean, BigNumber, BigNumber] & { + paused: boolean; + pauseWindowEndTime: BigNumber; + bufferPeriodEndTime: BigNumber; + } + >; + + getPoolId(overrides?: CallOverrides): Promise; + + getRate(overrides?: CallOverrides): Promise; + + getScalingFactors(overrides?: CallOverrides): Promise; + + getSwapAmountToEndWithEqualShares( + principals: BigNumberish, + yields: BigNumberish, + threshold: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, boolean] & { amountIn: BigNumber; yieldsIn: boolean }>; + + getSwapFeePercentage(overrides?: CallOverrides): Promise; + + getVault(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(owner: string, overrides?: CallOverrides): Promise; + + onExitPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onJoinPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onSwap( + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryExit( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryJoin( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setAssetManagerPoolConfig( + token: string, + poolConfig: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPaused(paused: boolean, overrides?: Overrides & { from?: string | Promise }): Promise; + + setSwapFeePercentage( + swapFeePercentage: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startAmplificationParameterUpdate( + rawEndValue: BigNumberish, + endTime: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + stopAmplificationParameterUpdate( + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tempusPool(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve(spender: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance(spender: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + getActionId(selector: BytesLike, overrides?: CallOverrides): Promise; + + getAmplificationParameter(overrides?: CallOverrides): Promise< + [BigNumber, boolean, BigNumber] & { + value: BigNumber; + isUpdating: boolean; + precision: BigNumber; + } + >; + + getAuthorizer(overrides?: CallOverrides): Promise; + + getExpectedBPTInGivenTokensOut( + principalsStaked: BigNumberish, + yieldsStaked: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getExpectedLPTokensForTokensIn(amountsIn: BigNumberish[], overrides?: CallOverrides): Promise; + + getExpectedReturnGivenIn( + amount: BigNumberish, + yieldShareIn: boolean, + overrides?: CallOverrides, + ): Promise; + + getExpectedTokensOutGivenBPTIn( + bptAmountIn: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber] & { principals: BigNumber; yields: BigNumber }>; + + getLastInvariant(overrides?: CallOverrides): Promise< + [BigNumber, BigNumber] & { + lastInvariant: BigNumber; + lastInvariantAmp: BigNumber; + } + >; + + getOwner(overrides?: CallOverrides): Promise; + + getPausedState(overrides?: CallOverrides): Promise< + [boolean, BigNumber, BigNumber] & { + paused: boolean; + pauseWindowEndTime: BigNumber; + bufferPeriodEndTime: BigNumber; + } + >; + + getPoolId(overrides?: CallOverrides): Promise; + + getRate(overrides?: CallOverrides): Promise; + + getScalingFactors(overrides?: CallOverrides): Promise; + + getSwapAmountToEndWithEqualShares( + principals: BigNumberish, + yields: BigNumberish, + threshold: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber, boolean] & { amountIn: BigNumber; yieldsIn: boolean }>; + + getSwapFeePercentage(overrides?: CallOverrides): Promise; + + getVault(overrides?: CallOverrides): Promise; + + increaseAllowance(spender: string, addedValue: BigNumberish, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(owner: string, overrides?: CallOverrides): Promise; + + onExitPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: CallOverrides, + ): Promise<[BigNumber[], BigNumber[]]>; + + onJoinPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: CallOverrides, + ): Promise<[BigNumber[], BigNumber[]]>; + + onSwap( + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + queryExit( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber[]] & { bptIn: BigNumber; amountsOut: BigNumber[] }>; + + queryJoin( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: CallOverrides, + ): Promise<[BigNumber, BigNumber[]] & { bptOut: BigNumber; amountsIn: BigNumber[] }>; + + setAssetManagerPoolConfig(token: string, poolConfig: BytesLike, overrides?: CallOverrides): Promise; + + setPaused(paused: boolean, overrides?: CallOverrides): Promise; + + setSwapFeePercentage(swapFeePercentage: BigNumberish, overrides?: CallOverrides): Promise; + + startAmplificationParameterUpdate( + rawEndValue: BigNumberish, + endTime: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + stopAmplificationParameterUpdate(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tempusPool(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer(recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferFrom(sender: string, recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + }; + + filters: { + 'AmpUpdateStarted(uint256,uint256,uint256,uint256)'( + startValue?: null, + endValue?: null, + startTime?: null, + endTime?: null, + ): AmpUpdateStartedEventFilter; + AmpUpdateStarted(startValue?: null, endValue?: null, startTime?: null, endTime?: null): AmpUpdateStartedEventFilter; + + 'AmpUpdateStopped(uint256)'(currentValue?: null): AmpUpdateStoppedEventFilter; + AmpUpdateStopped(currentValue?: null): AmpUpdateStoppedEventFilter; + + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; + + 'PausedStateChanged(bool)'(paused?: null): PausedStateChangedEventFilter; + PausedStateChanged(paused?: null): PausedStateChangedEventFilter; + + 'SwapFeePercentageChanged(uint256)'(swapFeePercentage?: null): SwapFeePercentageChangedEventFilter; + SwapFeePercentageChanged(swapFeePercentage?: null): SwapFeePercentageChangedEventFilter; + + 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + }; + + estimateGas: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getActionId(selector: BytesLike, overrides?: CallOverrides): Promise; + + getAmplificationParameter(overrides?: CallOverrides): Promise; + + getAuthorizer(overrides?: CallOverrides): Promise; + + getExpectedBPTInGivenTokensOut( + principalsStaked: BigNumberish, + yieldsStaked: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getExpectedLPTokensForTokensIn(amountsIn: BigNumberish[], overrides?: CallOverrides): Promise; + + getExpectedReturnGivenIn( + amount: BigNumberish, + yieldShareIn: boolean, + overrides?: CallOverrides, + ): Promise; + + getExpectedTokensOutGivenBPTIn(bptAmountIn: BigNumberish, overrides?: CallOverrides): Promise; + + getLastInvariant(overrides?: CallOverrides): Promise; + + getOwner(overrides?: CallOverrides): Promise; + + getPausedState(overrides?: CallOverrides): Promise; + + getPoolId(overrides?: CallOverrides): Promise; + + getRate(overrides?: CallOverrides): Promise; + + getScalingFactors(overrides?: CallOverrides): Promise; + + getSwapAmountToEndWithEqualShares( + principals: BigNumberish, + yields: BigNumberish, + threshold: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getSwapFeePercentage(overrides?: CallOverrides): Promise; + + getVault(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(owner: string, overrides?: CallOverrides): Promise; + + onExitPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onJoinPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onSwap( + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryExit( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryJoin( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setAssetManagerPoolConfig( + token: string, + poolConfig: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPaused(paused: boolean, overrides?: Overrides & { from?: string | Promise }): Promise; + + setSwapFeePercentage( + swapFeePercentage: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startAmplificationParameterUpdate( + rawEndValue: BigNumberish, + endTime: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + stopAmplificationParameterUpdate(overrides?: Overrides & { from?: string | Promise }): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tempusPool(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getActionId(selector: BytesLike, overrides?: CallOverrides): Promise; + + getAmplificationParameter(overrides?: CallOverrides): Promise; + + getAuthorizer(overrides?: CallOverrides): Promise; + + getExpectedBPTInGivenTokensOut( + principalsStaked: BigNumberish, + yieldsStaked: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getExpectedLPTokensForTokensIn(amountsIn: BigNumberish[], overrides?: CallOverrides): Promise; + + getExpectedReturnGivenIn( + amount: BigNumberish, + yieldShareIn: boolean, + overrides?: CallOverrides, + ): Promise; + + getExpectedTokensOutGivenBPTIn(bptAmountIn: BigNumberish, overrides?: CallOverrides): Promise; + + getLastInvariant(overrides?: CallOverrides): Promise; + + getOwner(overrides?: CallOverrides): Promise; + + getPausedState(overrides?: CallOverrides): Promise; + + getPoolId(overrides?: CallOverrides): Promise; + + getRate(overrides?: CallOverrides): Promise; + + getScalingFactors(overrides?: CallOverrides): Promise; + + getSwapAmountToEndWithEqualShares( + principals: BigNumberish, + yields: BigNumberish, + threshold: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + getSwapFeePercentage(overrides?: CallOverrides): Promise; + + getVault(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(owner: string, overrides?: CallOverrides): Promise; + + onExitPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onJoinPool( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + onSwap( + request: IPoolSwapStructs.SwapRequestStruct, + balanceTokenIn: BigNumberish, + balanceTokenOut: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryExit( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + queryJoin( + poolId: BytesLike, + sender: string, + recipient: string, + balances: BigNumberish[], + lastChangeBlock: BigNumberish, + protocolSwapFeePercentage: BigNumberish, + userData: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setAssetManagerPoolConfig( + token: string, + poolConfig: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setPaused( + paused: boolean, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setSwapFeePercentage( + swapFeePercentage: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startAmplificationParameterUpdate( + rawEndValue: BigNumberish, + endTime: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + stopAmplificationParameterUpdate( + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + tempusPool(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/tempus/contracts/ethers/TempusPool.ts b/src/apps/tempus/contracts/ethers/TempusPool.ts new file mode 100644 index 000000000..d8f9beeea --- /dev/null +++ b/src/apps/tempus/contracts/ethers/TempusPool.ts @@ -0,0 +1,937 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export type TokenDataStruct = { name: string; symbol: string }; + +export type TokenDataStructOutput = [string, string] & { + name: string; + symbol: string; +}; + +export declare namespace ITempusFees { + export type FeesConfigStruct = { + depositPercent: BigNumberish; + earlyRedeemPercent: BigNumberish; + matureRedeemPercent: BigNumberish; + }; + + export type FeesConfigStructOutput = [BigNumber, BigNumber, BigNumber] & { + depositPercent: BigNumber; + earlyRedeemPercent: BigNumber; + matureRedeemPercent: BigNumber; + }; +} + +export declare namespace IVersioned { + export type VersionStruct = { + major: BigNumberish; + minor: BigNumberish; + patch: BigNumberish; + }; + + export type VersionStructOutput = [number, number, number] & { + major: number; + minor: number; + patch: number; + }; +} + +export interface TempusPoolInterface extends utils.Interface { + functions: { + 'acceptOwnership()': FunctionFragment; + 'backingToken()': FunctionFragment; + 'backingTokenONE()': FunctionFragment; + 'controller()': FunctionFragment; + 'currentInterestRate()': FunctionFragment; + 'estimatedMintedShares(uint256,bool)': FunctionFragment; + 'estimatedRedeem(uint256,uint256,bool)': FunctionFragment; + 'exceptionalHaltTime()': FunctionFragment; + 'exchangeRateONE()': FunctionFragment; + 'finalize()': FunctionFragment; + 'getFeesConfig()': FunctionFragment; + 'initialInterestRate()': FunctionFragment; + 'matured()': FunctionFragment; + 'maturityInterestRate()': FunctionFragment; + 'maturityTime()': FunctionFragment; + 'maxDepositFee()': FunctionFragment; + 'maxEarlyRedeemFee()': FunctionFragment; + 'maxMatureRedeemFee()': FunctionFragment; + 'maximumNegativeYieldDuration()': FunctionFragment; + 'numAssetsPerYieldToken(uint256,uint256)': FunctionFragment; + 'numYieldTokensPerAsset(uint256,uint256)': FunctionFragment; + 'onDepositBacking(uint256,address)': FunctionFragment; + 'onDepositYieldBearing(uint256,address)': FunctionFragment; + 'owner()': FunctionFragment; + 'pricePerPrincipalShare()': FunctionFragment; + 'pricePerPrincipalShareStored()': FunctionFragment; + 'pricePerYieldShare()': FunctionFragment; + 'pricePerYieldShareStored()': FunctionFragment; + 'principalShare()': FunctionFragment; + 'protocolName()': FunctionFragment; + 'redeem(address,uint256,uint256,address)': FunctionFragment; + 'redeemToBacking(address,uint256,uint256,address)': FunctionFragment; + 'setFeesConfig((uint256,uint256,uint256))': FunctionFragment; + 'startTime()': FunctionFragment; + 'totalFees()': FunctionFragment; + 'transferFees(address)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + 'version()': FunctionFragment; + 'yieldBearingONE()': FunctionFragment; + 'yieldBearingToken()': FunctionFragment; + 'yieldShare()': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'acceptOwnership' + | 'backingToken' + | 'backingTokenONE' + | 'controller' + | 'currentInterestRate' + | 'estimatedMintedShares' + | 'estimatedRedeem' + | 'exceptionalHaltTime' + | 'exchangeRateONE' + | 'finalize' + | 'getFeesConfig' + | 'initialInterestRate' + | 'matured' + | 'maturityInterestRate' + | 'maturityTime' + | 'maxDepositFee' + | 'maxEarlyRedeemFee' + | 'maxMatureRedeemFee' + | 'maximumNegativeYieldDuration' + | 'numAssetsPerYieldToken' + | 'numYieldTokensPerAsset' + | 'onDepositBacking' + | 'onDepositYieldBearing' + | 'owner' + | 'pricePerPrincipalShare' + | 'pricePerPrincipalShareStored' + | 'pricePerYieldShare' + | 'pricePerYieldShareStored' + | 'principalShare' + | 'protocolName' + | 'redeem' + | 'redeemToBacking' + | 'setFeesConfig' + | 'startTime' + | 'totalFees' + | 'transferFees' + | 'transferOwnership' + | 'version' + | 'yieldBearingONE' + | 'yieldBearingToken' + | 'yieldShare', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'acceptOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'backingToken', values?: undefined): string; + encodeFunctionData(functionFragment: 'backingTokenONE', values?: undefined): string; + encodeFunctionData(functionFragment: 'controller', values?: undefined): string; + encodeFunctionData(functionFragment: 'currentInterestRate', values?: undefined): string; + encodeFunctionData(functionFragment: 'estimatedMintedShares', values: [BigNumberish, boolean]): string; + encodeFunctionData(functionFragment: 'estimatedRedeem', values: [BigNumberish, BigNumberish, boolean]): string; + encodeFunctionData(functionFragment: 'exceptionalHaltTime', values?: undefined): string; + encodeFunctionData(functionFragment: 'exchangeRateONE', values?: undefined): string; + encodeFunctionData(functionFragment: 'finalize', values?: undefined): string; + encodeFunctionData(functionFragment: 'getFeesConfig', values?: undefined): string; + encodeFunctionData(functionFragment: 'initialInterestRate', values?: undefined): string; + encodeFunctionData(functionFragment: 'matured', values?: undefined): string; + encodeFunctionData(functionFragment: 'maturityInterestRate', values?: undefined): string; + encodeFunctionData(functionFragment: 'maturityTime', values?: undefined): string; + encodeFunctionData(functionFragment: 'maxDepositFee', values?: undefined): string; + encodeFunctionData(functionFragment: 'maxEarlyRedeemFee', values?: undefined): string; + encodeFunctionData(functionFragment: 'maxMatureRedeemFee', values?: undefined): string; + encodeFunctionData(functionFragment: 'maximumNegativeYieldDuration', values?: undefined): string; + encodeFunctionData(functionFragment: 'numAssetsPerYieldToken', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'numYieldTokensPerAsset', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'onDepositBacking', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'onDepositYieldBearing', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'pricePerPrincipalShare', values?: undefined): string; + encodeFunctionData(functionFragment: 'pricePerPrincipalShareStored', values?: undefined): string; + encodeFunctionData(functionFragment: 'pricePerYieldShare', values?: undefined): string; + encodeFunctionData(functionFragment: 'pricePerYieldShareStored', values?: undefined): string; + encodeFunctionData(functionFragment: 'principalShare', values?: undefined): string; + encodeFunctionData(functionFragment: 'protocolName', values?: undefined): string; + encodeFunctionData(functionFragment: 'redeem', values: [string, BigNumberish, BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'redeemToBacking', values: [string, BigNumberish, BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'setFeesConfig', values: [ITempusFees.FeesConfigStruct]): string; + encodeFunctionData(functionFragment: 'startTime', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalFees', values?: undefined): string; + encodeFunctionData(functionFragment: 'transferFees', values: [string]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [string]): string; + encodeFunctionData(functionFragment: 'version', values?: undefined): string; + encodeFunctionData(functionFragment: 'yieldBearingONE', values?: undefined): string; + encodeFunctionData(functionFragment: 'yieldBearingToken', values?: undefined): string; + encodeFunctionData(functionFragment: 'yieldShare', values?: undefined): string; + + decodeFunctionResult(functionFragment: 'acceptOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'backingToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'backingTokenONE', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'controller', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'currentInterestRate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'estimatedMintedShares', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'estimatedRedeem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'exceptionalHaltTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'exchangeRateONE', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'finalize', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getFeesConfig', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initialInterestRate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'matured', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maturityInterestRate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maturityTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxDepositFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxEarlyRedeemFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxMatureRedeemFee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maximumNegativeYieldDuration', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'numAssetsPerYieldToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'numYieldTokensPerAsset', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'onDepositBacking', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'onDepositYieldBearing', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pricePerPrincipalShare', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pricePerPrincipalShareStored', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pricePerYieldShare', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pricePerYieldShareStored', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'principalShare', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'protocolName', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'redeemToBacking', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFeesConfig', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'startTime', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalFees', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFees', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'version', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'yieldBearingONE', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'yieldBearingToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'yieldShare', data: BytesLike): Result; + + events: { + 'OwnershipProposed(address,address)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'OwnershipProposed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; +} + +export interface OwnershipProposedEventObject { + currentOwner: string; + proposedOwner: string; +} +export type OwnershipProposedEvent = TypedEvent<[string, string], OwnershipProposedEventObject>; + +export type OwnershipProposedEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export type OwnershipTransferredEvent = TypedEvent<[string, string], OwnershipTransferredEventObject>; + +export type OwnershipTransferredEventFilter = TypedEventFilter; + +export interface TempusPool extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: TempusPoolInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + backingToken(overrides?: CallOverrides): Promise<[string]>; + + backingTokenONE(overrides?: CallOverrides): Promise<[BigNumber]>; + + controller(overrides?: CallOverrides): Promise<[string]>; + + currentInterestRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + estimatedMintedShares( + amount: BigNumberish, + isBackingToken: boolean, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + estimatedRedeem( + principals: BigNumberish, + yields: BigNumberish, + toBackingToken: boolean, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + exceptionalHaltTime(overrides?: CallOverrides): Promise<[BigNumber]>; + + exchangeRateONE(overrides?: CallOverrides): Promise<[BigNumber]>; + + finalize(overrides?: Overrides & { from?: string | Promise }): Promise; + + getFeesConfig(overrides?: CallOverrides): Promise<[ITempusFees.FeesConfigStructOutput]>; + + initialInterestRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + matured(overrides?: CallOverrides): Promise<[boolean]>; + + maturityInterestRate(overrides?: CallOverrides): Promise<[BigNumber]>; + + maturityTime(overrides?: CallOverrides): Promise<[BigNumber]>; + + maxDepositFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + maxEarlyRedeemFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + maxMatureRedeemFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + maximumNegativeYieldDuration(overrides?: CallOverrides): Promise<[BigNumber]>; + + numAssetsPerYieldToken( + yieldTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + numYieldTokensPerAsset( + backingTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise<[BigNumber]>; + + onDepositBacking( + backingTokenAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + onDepositYieldBearing( + yieldTokenAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + owner(overrides?: CallOverrides): Promise<[string]>; + + pricePerPrincipalShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerPrincipalShareStored(overrides?: CallOverrides): Promise<[BigNumber]>; + + pricePerYieldShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerYieldShareStored(overrides?: CallOverrides): Promise<[BigNumber]>; + + principalShare(overrides?: CallOverrides): Promise<[string]>; + + protocolName(overrides?: CallOverrides): Promise<[string]>; + + redeem( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeemToBacking( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + setFeesConfig( + newFeesConfig: ITempusFees.FeesConfigStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startTime(overrides?: CallOverrides): Promise<[BigNumber]>; + + totalFees(overrides?: CallOverrides): Promise<[BigNumber]>; + + transferFees( + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + version(overrides?: CallOverrides): Promise<[IVersioned.VersionStructOutput]>; + + yieldBearingONE(overrides?: CallOverrides): Promise<[BigNumber]>; + + yieldBearingToken(overrides?: CallOverrides): Promise<[string]>; + + yieldShare(overrides?: CallOverrides): Promise<[string]>; + }; + + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + backingToken(overrides?: CallOverrides): Promise; + + backingTokenONE(overrides?: CallOverrides): Promise; + + controller(overrides?: CallOverrides): Promise; + + currentInterestRate(overrides?: CallOverrides): Promise; + + estimatedMintedShares(amount: BigNumberish, isBackingToken: boolean, overrides?: CallOverrides): Promise; + + estimatedRedeem( + principals: BigNumberish, + yields: BigNumberish, + toBackingToken: boolean, + overrides?: CallOverrides, + ): Promise; + + exceptionalHaltTime(overrides?: CallOverrides): Promise; + + exchangeRateONE(overrides?: CallOverrides): Promise; + + finalize(overrides?: Overrides & { from?: string | Promise }): Promise; + + getFeesConfig(overrides?: CallOverrides): Promise; + + initialInterestRate(overrides?: CallOverrides): Promise; + + matured(overrides?: CallOverrides): Promise; + + maturityInterestRate(overrides?: CallOverrides): Promise; + + maturityTime(overrides?: CallOverrides): Promise; + + maxDepositFee(overrides?: CallOverrides): Promise; + + maxEarlyRedeemFee(overrides?: CallOverrides): Promise; + + maxMatureRedeemFee(overrides?: CallOverrides): Promise; + + maximumNegativeYieldDuration(overrides?: CallOverrides): Promise; + + numAssetsPerYieldToken(yieldTokens: BigNumberish, arg1: BigNumberish, overrides?: CallOverrides): Promise; + + numYieldTokensPerAsset( + backingTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + onDepositBacking( + backingTokenAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + onDepositYieldBearing( + yieldTokenAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + pricePerPrincipalShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerPrincipalShareStored(overrides?: CallOverrides): Promise; + + pricePerYieldShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerYieldShareStored(overrides?: CallOverrides): Promise; + + principalShare(overrides?: CallOverrides): Promise; + + protocolName(overrides?: CallOverrides): Promise; + + redeem( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeemToBacking( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + setFeesConfig( + newFeesConfig: ITempusFees.FeesConfigStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startTime(overrides?: CallOverrides): Promise; + + totalFees(overrides?: CallOverrides): Promise; + + transferFees( + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + version(overrides?: CallOverrides): Promise; + + yieldBearingONE(overrides?: CallOverrides): Promise; + + yieldBearingToken(overrides?: CallOverrides): Promise; + + yieldShare(overrides?: CallOverrides): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + backingToken(overrides?: CallOverrides): Promise; + + backingTokenONE(overrides?: CallOverrides): Promise; + + controller(overrides?: CallOverrides): Promise; + + currentInterestRate(overrides?: CallOverrides): Promise; + + estimatedMintedShares(amount: BigNumberish, isBackingToken: boolean, overrides?: CallOverrides): Promise; + + estimatedRedeem( + principals: BigNumberish, + yields: BigNumberish, + toBackingToken: boolean, + overrides?: CallOverrides, + ): Promise; + + exceptionalHaltTime(overrides?: CallOverrides): Promise; + + exchangeRateONE(overrides?: CallOverrides): Promise; + + finalize(overrides?: CallOverrides): Promise; + + getFeesConfig(overrides?: CallOverrides): Promise; + + initialInterestRate(overrides?: CallOverrides): Promise; + + matured(overrides?: CallOverrides): Promise; + + maturityInterestRate(overrides?: CallOverrides): Promise; + + maturityTime(overrides?: CallOverrides): Promise; + + maxDepositFee(overrides?: CallOverrides): Promise; + + maxEarlyRedeemFee(overrides?: CallOverrides): Promise; + + maxMatureRedeemFee(overrides?: CallOverrides): Promise; + + maximumNegativeYieldDuration(overrides?: CallOverrides): Promise; + + numAssetsPerYieldToken( + yieldTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + numYieldTokensPerAsset( + backingTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + onDepositBacking( + backingTokenAmount: BigNumberish, + recipient: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + mintedShares: BigNumber; + depositedYBT: BigNumber; + fee: BigNumber; + rate: BigNumber; + } + >; + + onDepositYieldBearing( + yieldTokenAmount: BigNumberish, + recipient: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + mintedShares: BigNumber; + depositedBT: BigNumber; + fee: BigNumber; + rate: BigNumber; + } + >; + + owner(overrides?: CallOverrides): Promise; + + pricePerPrincipalShare(overrides?: CallOverrides): Promise; + + pricePerPrincipalShareStored(overrides?: CallOverrides): Promise; + + pricePerYieldShare(overrides?: CallOverrides): Promise; + + pricePerYieldShareStored(overrides?: CallOverrides): Promise; + + principalShare(overrides?: CallOverrides): Promise; + + protocolName(overrides?: CallOverrides): Promise; + + redeem( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + redeemedYieldTokens: BigNumber; + fee: BigNumber; + rate: BigNumber; + } + >; + + redeemToBacking( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: CallOverrides, + ): Promise< + [BigNumber, BigNumber, BigNumber, BigNumber] & { + redeemedYieldTokens: BigNumber; + redeemedBackingTokens: BigNumber; + fee: BigNumber; + rate: BigNumber; + } + >; + + setFeesConfig(newFeesConfig: ITempusFees.FeesConfigStruct, overrides?: CallOverrides): Promise; + + startTime(overrides?: CallOverrides): Promise; + + totalFees(overrides?: CallOverrides): Promise; + + transferFees(recipient: string, overrides?: CallOverrides): Promise; + + transferOwnership(newOwner: string, overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + yieldBearingONE(overrides?: CallOverrides): Promise; + + yieldBearingToken(overrides?: CallOverrides): Promise; + + yieldShare(overrides?: CallOverrides): Promise; + }; + + filters: { + 'OwnershipProposed(address,address)'( + currentOwner?: string | null, + proposedOwner?: string | null, + ): OwnershipProposedEventFilter; + OwnershipProposed(currentOwner?: string | null, proposedOwner?: string | null): OwnershipProposedEventFilter; + + 'OwnershipTransferred(address,address)'( + previousOwner?: string | null, + newOwner?: string | null, + ): OwnershipTransferredEventFilter; + OwnershipTransferred(previousOwner?: string | null, newOwner?: string | null): OwnershipTransferredEventFilter; + }; + + estimateGas: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + backingToken(overrides?: CallOverrides): Promise; + + backingTokenONE(overrides?: CallOverrides): Promise; + + controller(overrides?: CallOverrides): Promise; + + currentInterestRate(overrides?: CallOverrides): Promise; + + estimatedMintedShares(amount: BigNumberish, isBackingToken: boolean, overrides?: CallOverrides): Promise; + + estimatedRedeem( + principals: BigNumberish, + yields: BigNumberish, + toBackingToken: boolean, + overrides?: CallOverrides, + ): Promise; + + exceptionalHaltTime(overrides?: CallOverrides): Promise; + + exchangeRateONE(overrides?: CallOverrides): Promise; + + finalize(overrides?: Overrides & { from?: string | Promise }): Promise; + + getFeesConfig(overrides?: CallOverrides): Promise; + + initialInterestRate(overrides?: CallOverrides): Promise; + + matured(overrides?: CallOverrides): Promise; + + maturityInterestRate(overrides?: CallOverrides): Promise; + + maturityTime(overrides?: CallOverrides): Promise; + + maxDepositFee(overrides?: CallOverrides): Promise; + + maxEarlyRedeemFee(overrides?: CallOverrides): Promise; + + maxMatureRedeemFee(overrides?: CallOverrides): Promise; + + maximumNegativeYieldDuration(overrides?: CallOverrides): Promise; + + numAssetsPerYieldToken( + yieldTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + numYieldTokensPerAsset( + backingTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + onDepositBacking( + backingTokenAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + onDepositYieldBearing( + yieldTokenAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + pricePerPrincipalShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerPrincipalShareStored(overrides?: CallOverrides): Promise; + + pricePerYieldShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerYieldShareStored(overrides?: CallOverrides): Promise; + + principalShare(overrides?: CallOverrides): Promise; + + protocolName(overrides?: CallOverrides): Promise; + + redeem( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeemToBacking( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + setFeesConfig( + newFeesConfig: ITempusFees.FeesConfigStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startTime(overrides?: CallOverrides): Promise; + + totalFees(overrides?: CallOverrides): Promise; + + transferFees(recipient: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + version(overrides?: CallOverrides): Promise; + + yieldBearingONE(overrides?: CallOverrides): Promise; + + yieldBearingToken(overrides?: CallOverrides): Promise; + + yieldShare(overrides?: CallOverrides): Promise; + }; + + populateTransaction: { + acceptOwnership(overrides?: Overrides & { from?: string | Promise }): Promise; + + backingToken(overrides?: CallOverrides): Promise; + + backingTokenONE(overrides?: CallOverrides): Promise; + + controller(overrides?: CallOverrides): Promise; + + currentInterestRate(overrides?: CallOverrides): Promise; + + estimatedMintedShares( + amount: BigNumberish, + isBackingToken: boolean, + overrides?: CallOverrides, + ): Promise; + + estimatedRedeem( + principals: BigNumberish, + yields: BigNumberish, + toBackingToken: boolean, + overrides?: CallOverrides, + ): Promise; + + exceptionalHaltTime(overrides?: CallOverrides): Promise; + + exchangeRateONE(overrides?: CallOverrides): Promise; + + finalize(overrides?: Overrides & { from?: string | Promise }): Promise; + + getFeesConfig(overrides?: CallOverrides): Promise; + + initialInterestRate(overrides?: CallOverrides): Promise; + + matured(overrides?: CallOverrides): Promise; + + maturityInterestRate(overrides?: CallOverrides): Promise; + + maturityTime(overrides?: CallOverrides): Promise; + + maxDepositFee(overrides?: CallOverrides): Promise; + + maxEarlyRedeemFee(overrides?: CallOverrides): Promise; + + maxMatureRedeemFee(overrides?: CallOverrides): Promise; + + maximumNegativeYieldDuration(overrides?: CallOverrides): Promise; + + numAssetsPerYieldToken( + yieldTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + numYieldTokensPerAsset( + backingTokens: BigNumberish, + arg1: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + onDepositBacking( + backingTokenAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + onDepositYieldBearing( + yieldTokenAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + owner(overrides?: CallOverrides): Promise; + + pricePerPrincipalShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerPrincipalShareStored(overrides?: CallOverrides): Promise; + + pricePerYieldShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + pricePerYieldShareStored(overrides?: CallOverrides): Promise; + + principalShare(overrides?: CallOverrides): Promise; + + protocolName(overrides?: CallOverrides): Promise; + + redeem( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeemToBacking( + from: string, + principalAmount: BigNumberish, + yieldAmount: BigNumberish, + recipient: string, + overrides?: PayableOverrides & { from?: string | Promise }, + ): Promise; + + setFeesConfig( + newFeesConfig: ITempusFees.FeesConfigStruct, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + startTime(overrides?: CallOverrides): Promise; + + totalFees(overrides?: CallOverrides): Promise; + + transferFees( + recipient: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferOwnership( + newOwner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + version(overrides?: CallOverrides): Promise; + + yieldBearingONE(overrides?: CallOverrides): Promise; + + yieldBearingToken(overrides?: CallOverrides): Promise; + + yieldShare(overrides?: CallOverrides): Promise; + }; +} diff --git a/src/apps/tempus/contracts/ethers/TempusPyToken.ts b/src/apps/tempus/contracts/ethers/TempusPyToken.ts new file mode 100644 index 000000000..828170a90 --- /dev/null +++ b/src/apps/tempus/contracts/ethers/TempusPyToken.ts @@ -0,0 +1,486 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BigNumberish, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from 'ethers'; +import type { FunctionFragment, Result, EventFragment } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/providers'; +import type { TypedEventFilter, TypedEvent, TypedListener, OnEvent } from './common'; + +export interface TempusPyTokenInterface extends utils.Interface { + functions: { + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'burn(uint256)': FunctionFragment; + 'burnFrom(address,uint256)': FunctionFragment; + 'decimals()': FunctionFragment; + 'decreaseAllowance(address,uint256)': FunctionFragment; + 'getPricePerFullShare()': FunctionFragment; + 'getPricePerFullShareStored()': FunctionFragment; + 'increaseAllowance(address,uint256)': FunctionFragment; + 'kind()': FunctionFragment; + 'manager()': FunctionFragment; + 'mint(address,uint256)': FunctionFragment; + 'name()': FunctionFragment; + 'pool()': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'allowance' + | 'approve' + | 'balanceOf' + | 'burn' + | 'burnFrom' + | 'decimals' + | 'decreaseAllowance' + | 'getPricePerFullShare' + | 'getPricePerFullShareStored' + | 'increaseAllowance' + | 'kind' + | 'manager' + | 'mint' + | 'name' + | 'pool' + | 'symbol' + | 'totalSupply' + | 'transfer' + | 'transferFrom', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'burn', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'burnFrom', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'decreaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'getPricePerFullShare', values?: undefined): string; + encodeFunctionData(functionFragment: 'getPricePerFullShareStored', values?: undefined): string; + encodeFunctionData(functionFragment: 'increaseAllowance', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'kind', values?: undefined): string; + encodeFunctionData(functionFragment: 'manager', values?: undefined): string; + encodeFunctionData(functionFragment: 'mint', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'pool', values?: undefined): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burn', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'burnFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decreaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPricePerFullShare', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getPricePerFullShareStored', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'increaseAllowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'kind', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'manager', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pool', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface TempusPyToken extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: TempusPyTokenInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise>; + + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + burn( + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + burnFrom( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getPricePerFullShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + getPricePerFullShareStored(overrides?: CallOverrides): Promise<[BigNumber]>; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + kind(overrides?: CallOverrides): Promise<[number]>; + + manager(overrides?: CallOverrides): Promise<[string]>; + + mint( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + pool(overrides?: CallOverrides): Promise<[string]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn(amount: BigNumberish, overrides?: Overrides & { from?: string | Promise }): Promise; + + burnFrom( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getPricePerFullShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + getPricePerFullShareStored(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + kind(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + mint( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve(spender: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn(amount: BigNumberish, overrides?: CallOverrides): Promise; + + burnFrom(account: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance(spender: string, subtractedValue: BigNumberish, overrides?: CallOverrides): Promise; + + getPricePerFullShare(overrides?: CallOverrides): Promise; + + getPricePerFullShareStored(overrides?: CallOverrides): Promise; + + increaseAllowance(spender: string, addedValue: BigNumberish, overrides?: CallOverrides): Promise; + + kind(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + mint(account: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer(recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + + transferFrom(sender: string, recipient: string, amount: BigNumberish, overrides?: CallOverrides): Promise; + }; + + filters: { + 'Approval(address,address,uint256)'( + owner?: string | null, + spender?: string | null, + value?: null, + ): ApprovalEventFilter; + Approval(owner?: string | null, spender?: string | null, value?: null): ApprovalEventFilter; + + 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + }; + + estimateGas: { + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn(amount: BigNumberish, overrides?: Overrides & { from?: string | Promise }): Promise; + + burnFrom( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getPricePerFullShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + getPricePerFullShareStored(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + kind(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + mint( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + allowance(owner: string, spender: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + balanceOf(account: string, overrides?: CallOverrides): Promise; + + burn( + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + burnFrom( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: string, + subtractedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + getPricePerFullShare(overrides?: Overrides & { from?: string | Promise }): Promise; + + getPricePerFullShareStored(overrides?: CallOverrides): Promise; + + increaseAllowance( + spender: string, + addedValue: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + kind(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + mint( + account: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + sender: string, + recipient: string, + amount: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/tempus/contracts/ethers/common.ts b/src/apps/tempus/contracts/ethers/common.ts new file mode 100644 index 000000000..6cfb10425 --- /dev/null +++ b/src/apps/tempus/contracts/ethers/common.ts @@ -0,0 +1,30 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { Listener } from '@ethersproject/providers'; +import type { Event, EventFilter } from 'ethers'; + +export interface TypedEvent = any, TArgsObject = any> extends Event { + args: TArgsArray & TArgsObject; +} + +export interface TypedEventFilter<_TEvent extends TypedEvent> extends EventFilter {} + +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; +} + +type __TypechainArgsArray = T extends TypedEvent ? U : never; + +export interface OnEvent { + (eventFilter: TypedEventFilter, listener: TypedListener): TRes; + (eventName: string, listener: Listener): TRes; +} + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never; + +export type GetARGsTypeFromFactory = F extends MinEthersFactory ? Parameters : never; diff --git a/src/apps/tempus/contracts/ethers/factories/TempusAmm__factory.ts b/src/apps/tempus/contracts/ethers/factories/TempusAmm__factory.ts new file mode 100644 index 000000000..53330b011 --- /dev/null +++ b/src/apps/tempus/contracts/ethers/factories/TempusAmm__factory.ts @@ -0,0 +1,1164 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { TempusAmm, TempusAmmInterface } from '../TempusAmm'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract IVault', + name: 'vault', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'contract ITempusPool', + name: 'pool', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amplificationStart', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amplificationEnd', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'pauseWindowDuration', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'bufferPeriodDuration', + type: 'uint256', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'startValue', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'endValue', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'startTime', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + ], + name: 'AmpUpdateStarted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'currentValue', + type: 'uint256', + }, + ], + name: 'AmpUpdateStopped', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'PausedStateChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + ], + name: 'SwapFeePercentageChanged', + 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: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + 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: [ + { + internalType: 'address', + name: 'account', + 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: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'selector', + type: 'bytes4', + }, + ], + name: 'getActionId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getAmplificationParameter', + outputs: [ + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isUpdating', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'precision', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getAuthorizer', + outputs: [ + { + internalType: 'contract IAuthorizer', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'principalsStaked', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yieldsStaked', + type: 'uint256', + }, + ], + name: 'getExpectedBPTInGivenTokensOut', + outputs: [ + { + internalType: 'uint256', + name: 'lpTokens', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256[]', + name: 'amountsIn', + type: 'uint256[]', + }, + ], + name: 'getExpectedLPTokensForTokensIn', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'yieldShareIn', + type: 'bool', + }, + ], + name: 'getExpectedReturnGivenIn', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'bptAmountIn', + type: 'uint256', + }, + ], + name: 'getExpectedTokensOutGivenBPTIn', + outputs: [ + { + internalType: 'uint256', + name: 'principals', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yields', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLastInvariant', + outputs: [ + { + internalType: 'uint256', + name: 'lastInvariant', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'lastInvariantAmp', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getOwner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPausedState', + outputs: [ + { + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'pauseWindowEndTime', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'bufferPeriodEndTime', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getPoolId', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getRate', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getScalingFactors', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'principals', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yields', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'threshold', + type: 'uint256', + }, + ], + name: 'getSwapAmountToEndWithEqualShares', + outputs: [ + { + internalType: 'uint256', + name: 'amountIn', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'yieldsIn', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getSwapFeePercentage', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getVault', + outputs: [ + { + internalType: 'contract IVault', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'poolId', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'balances', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'lastChangeBlock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'protocolSwapFeePercentage', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'userData', + type: 'bytes', + }, + ], + name: 'onExitPool', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'poolId', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'balances', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'lastChangeBlock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'protocolSwapFeePercentage', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'userData', + type: 'bytes', + }, + ], + name: 'onJoinPool', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'enum IVault.SwapKind', + name: 'kind', + type: 'uint8', + }, + { + internalType: 'contract IERC20', + name: 'tokenIn', + type: 'address', + }, + { + internalType: 'contract IERC20', + name: 'tokenOut', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'poolId', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'lastChangeBlock', + type: 'uint256', + }, + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'bytes', + name: 'userData', + type: 'bytes', + }, + ], + internalType: 'struct IPoolSwapStructs.SwapRequest', + name: 'request', + type: 'tuple', + }, + { + internalType: 'uint256', + name: 'balanceTokenIn', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'balanceTokenOut', + type: 'uint256', + }, + ], + name: 'onSwap', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + 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: 'bytes32', + name: 'poolId', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'balances', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'lastChangeBlock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'protocolSwapFeePercentage', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'userData', + type: 'bytes', + }, + ], + name: 'queryExit', + outputs: [ + { + internalType: 'uint256', + name: 'bptIn', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'amountsOut', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'poolId', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'balances', + type: 'uint256[]', + }, + { + internalType: 'uint256', + name: 'lastChangeBlock', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'protocolSwapFeePercentage', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'userData', + type: 'bytes', + }, + ], + name: 'queryJoin', + outputs: [ + { + internalType: 'uint256', + name: 'bptOut', + type: 'uint256', + }, + { + internalType: 'uint256[]', + name: 'amountsIn', + type: 'uint256[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'bytes', + name: 'poolConfig', + type: 'bytes', + }, + ], + name: 'setAssetManagerPoolConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'paused', + type: 'bool', + }, + ], + name: 'setPaused', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'swapFeePercentage', + type: 'uint256', + }, + ], + name: 'setSwapFeePercentage', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'rawEndValue', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'endTime', + type: 'uint256', + }, + ], + name: 'startAmplificationParameterUpdate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'stopAmplificationParameterUpdate', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'tempusPool', + outputs: [ + { + internalType: 'contract ITempusPool', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class TempusAmm__factory { + static readonly abi = _abi; + static createInterface(): TempusAmmInterface { + return new utils.Interface(_abi) as TempusAmmInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): TempusAmm { + return new Contract(address, _abi, signerOrProvider) as TempusAmm; + } +} diff --git a/src/apps/tempus/contracts/ethers/factories/TempusPool__factory.ts b/src/apps/tempus/contracts/ethers/factories/TempusPool__factory.ts new file mode 100644 index 000000000..652ee7dda --- /dev/null +++ b/src/apps/tempus/contracts/ethers/factories/TempusPool__factory.ts @@ -0,0 +1,885 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { TempusPool, TempusPoolInterface, TokenDataStruct, ITempusFees } from '../TempusPool'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ILido', + name: 'token', + type: 'address', + }, + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + { + internalType: 'uint256', + name: 'maturity', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'estYield', + type: 'uint256', + }, + { + components: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + ], + internalType: 'struct TokenData', + name: 'principalsData', + type: 'tuple', + }, + { + components: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + ], + internalType: 'struct TokenData', + name: 'yieldsData', + type: 'tuple', + }, + { + components: [ + { + internalType: 'uint256', + name: 'depositPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'earlyRedeemPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'matureRedeemPercent', + type: 'uint256', + }, + ], + internalType: 'struct ITempusFees.FeesConfig', + name: 'maxFeeSetup', + type: 'tuple', + }, + { + internalType: 'address', + name: 'referrerAddress', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'currentOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'proposedOwner', + type: 'address', + }, + ], + name: 'OwnershipProposed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'acceptOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'backingToken', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'backingTokenONE', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'controller', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'currentInterestRate', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'isBackingToken', + type: 'bool', + }, + ], + name: 'estimatedMintedShares', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'principals', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yields', + type: 'uint256', + }, + { + internalType: 'bool', + name: 'toBackingToken', + type: 'bool', + }, + ], + name: 'estimatedRedeem', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'exceptionalHaltTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'exchangeRateONE', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'finalize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getFeesConfig', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'depositPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'earlyRedeemPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'matureRedeemPercent', + type: 'uint256', + }, + ], + internalType: 'struct ITempusFees.FeesConfig', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'initialInterestRate', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'matured', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maturityInterestRate', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maturityTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxDepositFee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxEarlyRedeemFee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maxMatureRedeemFee', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'maximumNegativeYieldDuration', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yieldTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'numAssetsPerYieldToken', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'backingTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'numYieldTokensPerAsset', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'backingTokenAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'onDepositBacking', + outputs: [ + { + internalType: 'uint256', + name: 'mintedShares', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositedYBT', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'fee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rate', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'yieldTokenAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'onDepositYieldBearing', + outputs: [ + { + internalType: 'uint256', + name: 'mintedShares', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'depositedBT', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'fee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rate', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pricePerPrincipalShare', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'pricePerPrincipalShareStored', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pricePerYieldShare', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'pricePerYieldShareStored', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'principalShare', + outputs: [ + { + internalType: 'contract IPoolShare', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'protocolName', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'uint256', + name: 'principalAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yieldAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'redeem', + outputs: [ + { + internalType: 'uint256', + name: 'redeemedYieldTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'fee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rate', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'uint256', + name: 'principalAmount', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'yieldAmount', + type: 'uint256', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'redeemToBacking', + outputs: [ + { + internalType: 'uint256', + name: 'redeemedYieldTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'redeemedBackingTokens', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'fee', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rate', + type: 'uint256', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'depositPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'earlyRedeemPercent', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'matureRedeemPercent', + type: 'uint256', + }, + ], + internalType: 'struct ITempusFees.FeesConfig', + name: 'newFeesConfig', + type: 'tuple', + }, + ], + name: 'setFeesConfig', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'startTime', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalFees', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + ], + name: 'transferFees', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'version', + outputs: [ + { + components: [ + { + internalType: 'uint16', + name: 'major', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'minor', + type: 'uint16', + }, + { + internalType: 'uint16', + name: 'patch', + type: 'uint16', + }, + ], + internalType: 'struct IVersioned.Version', + name: '', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'yieldBearingONE', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'yieldBearingToken', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'yieldShare', + outputs: [ + { + internalType: 'contract IPoolShare', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, +]; + +export class TempusPool__factory { + static readonly abi = _abi; + static createInterface(): TempusPoolInterface { + return new utils.Interface(_abi) as TempusPoolInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): TempusPool { + return new Contract(address, _abi, signerOrProvider) as TempusPool; + } +} diff --git a/src/apps/tempus/contracts/ethers/factories/TempusPyToken__factory.ts b/src/apps/tempus/contracts/ethers/factories/TempusPyToken__factory.ts new file mode 100644 index 000000000..ee53d2f48 --- /dev/null +++ b/src/apps/tempus/contracts/ethers/factories/TempusPyToken__factory.ts @@ -0,0 +1,430 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { TempusPyToken, TempusPyTokenInterface } from '../TempusPyToken'; + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ITempusPool', + name: '_pool', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'string', + name: 'symbol', + type: 'string', + }, + { + internalType: 'uint8', + name: 'decimals', + type: 'uint8', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'Approval', + 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: 'value', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + 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: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burn', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'burnFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'subtractedValue', + type: 'uint256', + }, + ], + name: 'decreaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getPricePerFullShare', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'getPricePerFullShareStored', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'addedValue', + type: 'uint256', + }, + ], + name: 'increaseAllowance', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'kind', + outputs: [ + { + internalType: 'enum IPoolShare.ShareKind', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'manager', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'mint', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'pool', + outputs: [ + { + internalType: 'contract ITempusPool', + name: '', + type: 'address', + }, + ], + 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: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'address', + name: 'recipient', + type: 'address', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class TempusPyToken__factory { + static readonly abi = _abi; + static createInterface(): TempusPyTokenInterface { + return new utils.Interface(_abi) as TempusPyTokenInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): TempusPyToken { + return new Contract(address, _abi, signerOrProvider) as TempusPyToken; + } +} diff --git a/src/apps/tempus/contracts/ethers/factories/index.ts b/src/apps/tempus/contracts/ethers/factories/index.ts new file mode 100644 index 000000000..9db54077b --- /dev/null +++ b/src/apps/tempus/contracts/ethers/factories/index.ts @@ -0,0 +1,6 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { TempusAmm__factory } from './TempusAmm__factory'; +export { TempusPool__factory } from './TempusPool__factory'; +export { TempusPyToken__factory } from './TempusPyToken__factory'; diff --git a/src/apps/tempus/contracts/ethers/index.ts b/src/apps/tempus/contracts/ethers/index.ts new file mode 100644 index 000000000..0a675611a --- /dev/null +++ b/src/apps/tempus/contracts/ethers/index.ts @@ -0,0 +1,10 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { TempusAmm } from './TempusAmm'; +export type { TempusPool } from './TempusPool'; +export type { TempusPyToken } from './TempusPyToken'; +export * as factories from './factories'; +export { TempusAmm__factory } from './factories/TempusAmm__factory'; +export { TempusPool__factory } from './factories/TempusPool__factory'; +export { TempusPyToken__factory } from './factories/TempusPyToken__factory'; diff --git a/src/apps/tempus/contracts/index.ts b/src/apps/tempus/contracts/index.ts new file mode 100644 index 000000000..258ef0991 --- /dev/null +++ b/src/apps/tempus/contracts/index.ts @@ -0,0 +1,33 @@ +import { Injectable, Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { ContractFactory } from '~contract/contracts'; +import { Network } from '~types/network.interface'; + +import { TempusAmm__factory } from './ethers'; +import { TempusPool__factory } from './ethers'; +import { TempusPyToken__factory } from './ethers'; + +// eslint-disable-next-line +type ContractOpts = { address: string; network: Network }; + +@Injectable() +export class TempusContractFactory extends ContractFactory { + constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) { + super((network: Network) => appToolkit.getNetworkProvider(network)); + } + + tempusAmm({ address, network }: ContractOpts) { + return TempusAmm__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + tempusPool({ address, network }: ContractOpts) { + return TempusPool__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } + tempusPyToken({ address, network }: ContractOpts) { + return TempusPyToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } +} + +export type { TempusAmm } from './ethers'; +export type { TempusPool } from './ethers'; +export type { TempusPyToken } from './ethers'; diff --git a/src/apps/tempus/ethereum/tempus.amm.token-fetcher.ts b/src/apps/tempus/ethereum/tempus.amm.token-fetcher.ts new file mode 100644 index 000000000..5ca94b8cd --- /dev/null +++ b/src/apps/tempus/ethereum/tempus.amm.token-fetcher.ts @@ -0,0 +1,25 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { TempusAmmTokenFetcher } from '../helpers/tempus.amm.token-helper'; +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +const appId = TEMPUS_DEFINITION.id; +const groupId = TEMPUS_DEFINITION.groups.amm.id; +const network = Network.ETHEREUM_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class EthereumTempusAmmTokenFetcher implements PositionFetcher { + constructor( + @Inject(TempusAmmTokenFetcher) + private readonly tempusAmmTokenFetcher: TempusAmmTokenFetcher, + ) {} + + async getPositions() { + return this.tempusAmmTokenFetcher.getPositions(network); + } +} diff --git a/src/apps/tempus/ethereum/tempus.balance-fetcher.ts b/src/apps/tempus/ethereum/tempus.balance-fetcher.ts new file mode 100644 index 000000000..7372be5dd --- /dev/null +++ b/src/apps/tempus/ethereum/tempus.balance-fetcher.ts @@ -0,0 +1,52 @@ +import { Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +const network = Network.ETHEREUM_MAINNET; +const appId = TEMPUS_DEFINITION.id; + +@Register.BalanceFetcher(TEMPUS_DEFINITION.id, network) +export class EthereumTempusBalanceFetcher implements BalanceFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + private async getPoolTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId, + groupId: TEMPUS_DEFINITION.groups.pool.id, + network, + }); + } + + private async getAMMTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId, + groupId: TEMPUS_DEFINITION.groups.amm.id, + network, + }); + } + + async getBalances(address: string) { + const [poolTokenBalances, AMMTokenBalances] = await Promise.all([ + this.getPoolTokenBalances(address), + this.getAMMTokenBalances(address), + ]); + return presentBalanceFetcherResponse([ + { + label: 'Pools', + assets: poolTokenBalances, + }, + { + label: 'AMM', + assets: AMMTokenBalances, + }, + ]); + } +} diff --git a/src/apps/tempus/ethereum/tempus.pool.token-fetcher.ts b/src/apps/tempus/ethereum/tempus.pool.token-fetcher.ts new file mode 100644 index 000000000..718456487 --- /dev/null +++ b/src/apps/tempus/ethereum/tempus.pool.token-fetcher.ts @@ -0,0 +1,22 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { TempusTokensTokenFetcher } from '../helpers/tempus.pool.token-helper'; +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +const appId = TEMPUS_DEFINITION.id; +const groupId = TEMPUS_DEFINITION.groups.pool.id; +const network = Network.ETHEREUM_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class EthereumTempusTokensTokenFetcher implements PositionFetcher { + constructor(@Inject(TempusTokensTokenFetcher) private readonly tempusTokensTokenFetcher: TempusTokensTokenFetcher) {} + + async getPositions() { + return this.tempusTokensTokenFetcher.getPositions(network); + } +} diff --git a/src/apps/tempus/fantom/tempus.amm.token-fetcher.ts b/src/apps/tempus/fantom/tempus.amm.token-fetcher.ts new file mode 100644 index 000000000..115700e2a --- /dev/null +++ b/src/apps/tempus/fantom/tempus.amm.token-fetcher.ts @@ -0,0 +1,25 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { TempusAmmTokenFetcher } from '../helpers/tempus.amm.token-helper'; +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +const appId = TEMPUS_DEFINITION.id; +const groupId = TEMPUS_DEFINITION.groups.amm.id; +const network = Network.FANTOM_OPERA_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class FantomTempusAmmTokenFetcher implements PositionFetcher { + constructor( + @Inject(TempusAmmTokenFetcher) + private readonly tempusAmmTokenFetcher: TempusAmmTokenFetcher, + ) {} + + async getPositions() { + return this.tempusAmmTokenFetcher.getPositions(network); + } +} diff --git a/src/apps/tempus/fantom/tempus.balance-fetcher.ts b/src/apps/tempus/fantom/tempus.balance-fetcher.ts new file mode 100644 index 000000000..ae3827ab3 --- /dev/null +++ b/src/apps/tempus/fantom/tempus.balance-fetcher.ts @@ -0,0 +1,52 @@ +import { Inject } from '@nestjs/common'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { presentBalanceFetcherResponse } from '~app-toolkit/helpers/presentation/balance-fetcher-response.present'; +import { BalanceFetcher } from '~balance/balance-fetcher.interface'; +import { Network } from '~types/network.interface'; + +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +const network = Network.FANTOM_OPERA_MAINNET; +const appId = TEMPUS_DEFINITION.id; + +@Register.BalanceFetcher(TEMPUS_DEFINITION.id, network) +export class FantomTempusBalanceFetcher implements BalanceFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) {} + + private async getPoolTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId, + groupId: TEMPUS_DEFINITION.groups.pool.id, + network, + }); + } + + private async getAMMTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId, + groupId: TEMPUS_DEFINITION.groups.amm.id, + network, + }); + } + + async getBalances(address: string) { + const [poolTokenBalances, AMMTokenBalances] = await Promise.all([ + this.getPoolTokenBalances(address), + this.getAMMTokenBalances(address), + ]); + return presentBalanceFetcherResponse([ + { + label: 'Pools', + assets: poolTokenBalances, + }, + { + label: 'AMM', + assets: AMMTokenBalances, + }, + ]); + } +} diff --git a/src/apps/tempus/fantom/tempus.pool.token-fetcher.ts b/src/apps/tempus/fantom/tempus.pool.token-fetcher.ts new file mode 100644 index 000000000..0b0edefc7 --- /dev/null +++ b/src/apps/tempus/fantom/tempus.pool.token-fetcher.ts @@ -0,0 +1,22 @@ +import { Inject } from '@nestjs/common'; + +import { Register } from '~app-toolkit/decorators'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { TempusTokensTokenFetcher } from '../helpers/tempus.pool.token-helper'; +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +const appId = TEMPUS_DEFINITION.id; +const groupId = TEMPUS_DEFINITION.groups.pool.id; +const network = Network.FANTOM_OPERA_MAINNET; + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class FantomTempusTokensTokenFetcher implements PositionFetcher { + constructor(@Inject(TempusTokensTokenFetcher) private readonly tempusTokensTokenFetcher: TempusTokensTokenFetcher) {} + + async getPositions() { + return this.tempusTokensTokenFetcher.getPositions(network); + } +} diff --git a/src/apps/tempus/helpers/tempus.amm.token-helper.ts b/src/apps/tempus/helpers/tempus.amm.token-helper.ts new file mode 100644 index 000000000..a8d95db82 --- /dev/null +++ b/src/apps/tempus/helpers/tempus.amm.token-helper.ts @@ -0,0 +1,68 @@ +import { Inject, Injectable } from '@nestjs/common'; +import { BigNumber } from 'ethers'; + +import { CurvePoolTokenHelper } from '~apps/curve'; +import { Erc20 } from '~contract/contracts'; +import { Network } from '~types/network.interface'; + +import { TempusContractFactory, TempusAmm } from '../contracts'; +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +import { getTempusData } from './tempus.datasource'; + +const appId = TEMPUS_DEFINITION.id; +const groupId = TEMPUS_DEFINITION.groups.amm.id; + +@Injectable() +export class TempusAmmTokenFetcher { + constructor( + @Inject(CurvePoolTokenHelper) + private readonly curvePoolTokenHelper: CurvePoolTokenHelper, + @Inject(TempusContractFactory) private readonly contractFactory: TempusContractFactory, + ) {} + + async getPositions(network: Network) { + const data = await getTempusData(network); + if (!data) return []; + + return await this.curvePoolTokenHelper.getTokens({ + network, + appId, + groupId, + appTokenDependencies: [{ appId, groupIds: [TEMPUS_DEFINITION.groups.pool.id], network }], + resolvePoolDefinitions: async () => + data.tempusPools.map(pool => ({ + swapAddress: pool.ammAddress.toLowerCase(), + tokenAddress: pool.ammAddress.toLowerCase(), + })), + resolvePoolContract: ({ network, definition }) => + this.contractFactory.tempusAmm({ network, address: definition.swapAddress }), + resolvePoolTokenContract: ({ network, definition }) => + this.contractFactory.erc20({ network, address: definition.tokenAddress }), + resolvePoolCoinAddresses: async ({ poolContract }) => { + const pool = data.tempusPools.find( + pool => pool.ammAddress.toLowerCase() === poolContract.address.toLowerCase(), + )!; + return [pool.principalsAddress.toLowerCase(), pool.yieldsAddress.toLowerCase()]; + }, + resolvePoolReserves: async ({ multicall, poolContract }) => { + const totalSupply = await multicall.wrap(poolContract).totalSupply(); + const [principals, yields] = await multicall.wrap(poolContract).getExpectedTokensOutGivenBPTIn(totalSupply); + return [principals.toString(), yields.toString()]; + }, + resolvePoolFee: ({ multicall, poolContract }) => + multicall + .wrap(poolContract) + .getSwapFeePercentage() + .then(result => BigNumber.from(Number(result) / 1e8)), // Convert 1e18 percentage to curve 1e8 + resolvePoolTokenSymbol: ({ multicall, poolTokenContract }) => multicall.wrap(poolTokenContract).symbol(), + resolvePoolTokenSupply: ({ multicall, poolTokenContract }) => multicall.wrap(poolTokenContract).totalSupply(), + resolvePoolTokenPrice: async ({ tokens, reserves, supply }) => { + const [principalToken, yieldToken] = tokens; + const [sizePrincipal, sizeYield] = reserves; + const price = principalToken.price * sizePrincipal + (yieldToken.price * sizeYield) / supply; + return price; + }, + }); + } +} diff --git a/src/apps/tempus/helpers/tempus.datasource.ts b/src/apps/tempus/helpers/tempus.datasource.ts new file mode 100644 index 000000000..dfc0a453e --- /dev/null +++ b/src/apps/tempus/helpers/tempus.datasource.ts @@ -0,0 +1,23 @@ +import Axios from 'axios'; + +import { Network } from '~types'; + +const datasourceUrl = 'https://raw.githubusercontent.com/tempus-finance/tempus-pools-config/master/config.json'; + +export type TempusPool = { + address: string; + ammAddress: string; + yieldsAddress: string; + principalsAddress: string; + // Should probably use yieldBearingTokenAddress instead, but that may have dependency issues in the future + backingTokenAddress: string; +}; +type TempusData = { + tempusPools: TempusPool[]; +}; +type TempusDataResponse = Record; + +export const getTempusData = async (network: string) => { + const pools = (await Axios.get(datasourceUrl)).data[network]; + return pools as TempusData; +}; diff --git a/src/apps/tempus/helpers/tempus.pool.token-helper.ts b/src/apps/tempus/helpers/tempus.pool.token-helper.ts new file mode 100644 index 000000000..a689fd80f --- /dev/null +++ b/src/apps/tempus/helpers/tempus.pool.token-helper.ts @@ -0,0 +1,46 @@ +import { Inject, Injectable } from '@nestjs/common'; +import _ from 'lodash'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Network } from '~types/network.interface'; + +import { TempusContractFactory, TempusPyToken } from '../contracts'; +import { TEMPUS_DEFINITION } from '../tempus.definition'; + +import { getTempusData, TempusPool } from './tempus.datasource'; + +const appId = TEMPUS_DEFINITION.id; +const groupId = TEMPUS_DEFINITION.groups.pool.id; + +@Injectable() +export class TempusTokensTokenFetcher { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(TempusContractFactory) private readonly contractFactory: TempusContractFactory, + ) {} + + async getPoolTokens(data: TempusPool, network: Network) { + return await this.appToolkit.helpers.vaultTokenHelper.getTokens({ + appId, + groupId, + network, + resolveVaultAddresses: () => [data.principalsAddress.toLowerCase(), data.yieldsAddress.toLowerCase()], + resolveContract: ({ address, network }) => this.contractFactory.tempusPyToken({ address, network }), + resolveUnderlyingTokenAddress: () => data.backingTokenAddress.toLowerCase(), + resolveReserve: () => 0, + resolvePricePerShare: async ({ multicall, contract }) => { + const decimals = await multicall.wrap(contract).decimals(); + const pricePerShare = await multicall.wrap(contract).getPricePerFullShareStored(); + return Number(pricePerShare) / 10 ** Number(decimals); + }, + }); + } + + async getPositions(network: Network) { + const data = await getTempusData(network); + if (!data) return []; + + const tokens = await Promise.all(data.tempusPools.map(pool => this.getPoolTokens(pool, network))); + return _.flatten(tokens); + } +} diff --git a/src/apps/tempus/index.ts b/src/apps/tempus/index.ts new file mode 100644 index 000000000..95c19dc8f --- /dev/null +++ b/src/apps/tempus/index.ts @@ -0,0 +1,3 @@ +export { TEMPUS_DEFINITION, TempusAppDefinition } from './tempus.definition'; +export { TempusAppModule } from './tempus.module'; +export { TempusContractFactory } from './contracts'; diff --git a/src/apps/tempus/tempus.definition.ts b/src/apps/tempus/tempus.definition.ts new file mode 100644 index 000000000..b7159955a --- /dev/null +++ b/src/apps/tempus/tempus.definition.ts @@ -0,0 +1,46 @@ +import { Register } from '~app-toolkit/decorators'; +import { appDefinition, AppDefinition } from '~app/app.definition'; +import { AppAction, AppTag, GroupType } from '~app/app.interface'; +import { Network } from '~types/network.interface'; + +export const TEMPUS_DEFINITION = appDefinition({ + id: 'tempus', + name: 'Tempus Finance', + description: + 'Tempus is a multi-chain fixed-income protocol that integrates with lending protocols, staking protocols, and yield aggregators, and lets users fix or speculate on the yield generated by them.', + url: 'https://tempus.finance/', + + groups: { + pool: { + id: 'pool', + type: GroupType.TOKEN, + label: 'P-Y Tokens', + }, + + amm: { + id: 'amm', + type: GroupType.TOKEN, + label: 'AMM Liquidity', + }, + }, + + tags: [AppTag.CROSS_CHAIN, AppTag.YIELD_AGGREGATOR], + keywords: [], + links: {}, + + supportedNetworks: { + [Network.ETHEREUM_MAINNET]: [AppAction.VIEW], + [Network.FANTOM_OPERA_MAINNET]: [AppAction.VIEW], + }, + + primaryColor: '#fff', +}); + +@Register.AppDefinition(TEMPUS_DEFINITION.id) +export class TempusAppDefinition extends AppDefinition { + constructor() { + super(TEMPUS_DEFINITION); + } +} + +export default TEMPUS_DEFINITION; diff --git a/src/apps/tempus/tempus.module.ts b/src/apps/tempus/tempus.module.ts new file mode 100644 index 000000000..7c7519c4f --- /dev/null +++ b/src/apps/tempus/tempus.module.ts @@ -0,0 +1,32 @@ +import { Register } from '~app-toolkit/decorators'; +import { AbstractApp } from '~app/app.dynamic-module'; +import { CurvePoolTokenHelper } from '~apps/curve'; + +import { TempusContractFactory } from './contracts'; +import { EthereumTempusAmmTokenFetcher } from './ethereum/tempus.amm.token-fetcher'; +import { EthereumTempusBalanceFetcher } from './ethereum/tempus.balance-fetcher'; +import { EthereumTempusTokensTokenFetcher } from './ethereum/tempus.pool.token-fetcher'; +import { FantomTempusAmmTokenFetcher } from './fantom/tempus.amm.token-fetcher'; +import { FantomTempusBalanceFetcher } from './fantom/tempus.balance-fetcher'; +import { FantomTempusTokensTokenFetcher } from './fantom/tempus.pool.token-fetcher'; +import { TempusAmmTokenFetcher } from './helpers/tempus.amm.token-helper'; +import { TempusTokensTokenFetcher } from './helpers/tempus.pool.token-helper'; +import { TempusAppDefinition, TEMPUS_DEFINITION } from './tempus.definition'; + +@Register.AppModule({ + appId: TEMPUS_DEFINITION.id, + providers: [ + CurvePoolTokenHelper, + TempusTokensTokenFetcher, + TempusAmmTokenFetcher, + EthereumTempusAmmTokenFetcher, + EthereumTempusBalanceFetcher, + EthereumTempusTokensTokenFetcher, + FantomTempusAmmTokenFetcher, + FantomTempusBalanceFetcher, + FantomTempusTokensTokenFetcher, + TempusAppDefinition, + TempusContractFactory, + ], +}) +export class TempusAppModule extends AbstractApp() {}