diff --git a/src/apps/rubicon/assets/logo.png b/src/apps/rubicon/assets/logo.png new file mode 100644 index 000000000..d5c446bca Binary files /dev/null and b/src/apps/rubicon/assets/logo.png differ diff --git a/src/apps/rubicon/contracts/abis/bath-token.json b/src/apps/rubicon/contracts/abis/bath-token.json new file mode 100644 index 000000000..0500d3429 --- /dev/null +++ b/src/apps/rubicon/contracts/abis/bath-token.json @@ -0,0 +1,584 @@ +[ + { + "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": "caller", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "Deposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "indexed": false, "internalType": "contract IERC20", "name": "bonusToken", "type": "address" } + ], + "name": "LogClaimBonusTokn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "depositedAmt", "type": "uint256" }, + { "indexed": false, "internalType": "contract IERC20", "name": "asset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "sharesReceived", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "depositor", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } + ], + "name": "LogDeposit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [{ "indexed": false, "internalType": "uint256", "name": "timeOfInit", "type": "uint256" }], + "name": "LogInit", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "orderId", "type": "uint256" }, + { "indexed": false, "internalType": "contract IERC20", "name": "pool_asset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmountToCancel", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } + ], + "name": "LogPoolCancel", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "id", "type": "uint256" }, + { "indexed": false, "internalType": "contract IERC20", "name": "pool_asset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } + ], + "name": "LogPoolOffer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IERC20", "name": "pool_asset", "type": "address" }, + { "indexed": false, "internalType": "address", "name": "destination", "type": "address" }, + { "indexed": false, "internalType": "contract IERC20", "name": "transferAsset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "rebalAmt", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "stratReward", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } + ], + "name": "LogRebalance", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "contract IERC20", "name": "pool_asset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "fillAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } + ], + "name": "LogRemoveFilledTradeAmount", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": false, "internalType": "uint256", "name": "amountWithdrawn", "type": "uint256" }, + { "indexed": false, "internalType": "contract IERC20", "name": "asset", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "sharesWithdrawn", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "withdrawer", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "fee", "type": "uint256" }, + { "indexed": false, "internalType": "address", "name": "feeTo", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "underlyingBalance", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "outstandingAmount", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "totalSupply", "type": "uint256" } + ], + "name": "LogWithdraw", + "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" + }, + { + "anonymous": false, + "inputs": [ + { "indexed": true, "internalType": "address", "name": "caller", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "receiver", "type": "address" }, + { "indexed": true, "internalType": "address", "name": "owner", "type": "address" }, + { "indexed": false, "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "indexed": false, "internalType": "uint256", "name": "shares", "type": "uint256" } + ], + "name": "Withdraw", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "PERMIT_TYPEHASH", + "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "RubiconMarketAddress", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "", "type": "address" }, + { "internalType": "address", "name": "", "type": "address" } + ], + "name": "allowance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "approve", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { "inputs": [], "name": "approveMarket", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "asset", + "outputs": [{ "internalType": "address", "name": "assetTokenAddress", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "balanceOf", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bathBuddy", + "outputs": [{ "internalType": "contract IBathBuddy", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "bathHouse", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "name": "bonusTokens", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "id", "type": "uint256" }, + { "internalType": "uint256", "name": "amt", "type": "uint256" } + ], + "name": "cancel", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "name": "convertToAssets", + "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "name": "convertToShares", + "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" } + ], + "name": "deposit", + "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "name": "deposit", + "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "feeBPS", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "feeTo", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getAllBonusTokenReward", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "rewardToken", "type": "address" }], + "name": "getBonusTokenReward", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "contract ERC20", "name": "token", "type": "address" }, + { "internalType": "address", "name": "market", "type": "address" }, + { "internalType": "address", "name": "_feeTo", "type": "address" } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initialized", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], + "name": "maxDeposit", + "outputs": [{ "internalType": "uint256", "name": "maxAssets", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "receiver", "type": "address" }], + "name": "maxMint", + "outputs": [{ "internalType": "uint256", "name": "maxShares", "type": "uint256" }], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "maxRedeem", + "outputs": [{ "internalType": "uint256", "name": "maxShares", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }], + "name": "maxWithdraw", + "outputs": [{ "internalType": "uint256", "name": "maxAssets", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" } + ], + "name": "mint", + "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "", "type": "address" }], + "name": "nonces", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "outstandingAmount", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "owner", "type": "address" }, + { "internalType": "address", "name": "spender", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" }, + { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { "internalType": "uint8", "name": "v", "type": "uint8" }, + { "internalType": "bytes32", "name": "r", "type": "bytes32" }, + { "internalType": "bytes32", "name": "s", "type": "bytes32" } + ], + "name": "permit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "pay_amt", "type": "uint256" }, + { "internalType": "contract ERC20", "name": "pay_gem", "type": "address" }, + { "internalType": "uint256", "name": "buy_amt", "type": "uint256" }, + { "internalType": "contract ERC20", "name": "buy_gem", "type": "address" } + ], + "name": "placeOffer", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "name": "previewDeposit", + "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "name": "previewMint", + "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "name": "previewRedeem", + "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "name": "previewWithdraw", + "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "destination", "type": "address" }, + { "internalType": "address", "name": "filledAssetToRebalance", "type": "address" }, + { "internalType": "uint256", "name": "stratProportion", "type": "uint256" }, + { "internalType": "uint256", "name": "rebalAmt", "type": "uint256" } + ], + "name": "rebalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "shares", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "redeem", + "outputs": [{ "internalType": "uint256", "name": "assets", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "amt", "type": "uint256" }], + "name": "removeFilledTradeAmount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newBuddy", "type": "address" }], + "name": "setBathBuddy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newBathHouse", "type": "address" }], + "name": "setBathHouse", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newBonusERC20", "type": "address" }], + "name": "setBonusToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_feeBPS", "type": "uint256" }], + "name": "setFeeBPS", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "_feeTo", "type": "address" }], + "name": "setFeeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [{ "internalType": "address", "name": "newRubiconMarket", "type": "address" }], + "name": "setMarket", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [{ "internalType": "string", "name": "", "type": "string" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalAssets", + "outputs": [{ "internalType": "uint256", "name": "totalManagedAssets", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transfer", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "address", "name": "from", "type": "address" }, + { "internalType": "address", "name": "to", "type": "address" }, + { "internalType": "uint256", "name": "value", "type": "uint256" } + ], + "name": "transferFrom", + "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "underlyingBalance", + "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "underlyingERC20", + "outputs": [{ "internalType": "address", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "underlyingToken", + "outputs": [{ "internalType": "contract IERC20", "name": "", "type": "address" }], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [{ "internalType": "uint256", "name": "_shares", "type": "uint256" }], + "name": "withdraw", + "outputs": [{ "internalType": "uint256", "name": "amountWithdrawn", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { "internalType": "uint256", "name": "assets", "type": "uint256" }, + { "internalType": "address", "name": "receiver", "type": "address" }, + { "internalType": "address", "name": "owner", "type": "address" } + ], + "name": "withdraw", + "outputs": [{ "internalType": "uint256", "name": "shares", "type": "uint256" }], + "stateMutability": "nonpayable", + "type": "function" + } +] diff --git a/src/apps/rubicon/contracts/ethers/BathToken.ts b/src/apps/rubicon/contracts/ethers/BathToken.ts new file mode 100644 index 000000000..2fdea2a6d --- /dev/null +++ b/src/apps/rubicon/contracts/ethers/BathToken.ts @@ -0,0 +1,1570 @@ +/* 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 BathTokenInterface extends utils.Interface { + functions: { + 'DOMAIN_SEPARATOR()': FunctionFragment; + 'PERMIT_TYPEHASH()': FunctionFragment; + 'RubiconMarketAddress()': FunctionFragment; + 'allowance(address,address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'approveMarket()': FunctionFragment; + 'asset()': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'bathBuddy()': FunctionFragment; + 'bathHouse()': FunctionFragment; + 'bonusTokens(uint256)': FunctionFragment; + 'cancel(uint256,uint256)': FunctionFragment; + 'convertToAssets(uint256)': FunctionFragment; + 'convertToShares(uint256)': FunctionFragment; + 'decimals()': FunctionFragment; + 'deposit(uint256,address)': FunctionFragment; + 'deposit(uint256)': FunctionFragment; + 'feeBPS()': FunctionFragment; + 'feeTo()': FunctionFragment; + 'getAllBonusTokenReward()': FunctionFragment; + 'getBonusTokenReward(address)': FunctionFragment; + 'initialize(address,address,address)': FunctionFragment; + 'initialized()': FunctionFragment; + 'maxDeposit(address)': FunctionFragment; + 'maxMint(address)': FunctionFragment; + 'maxRedeem(address)': FunctionFragment; + 'maxWithdraw(address)': FunctionFragment; + 'mint(uint256,address)': FunctionFragment; + 'name()': FunctionFragment; + 'nonces(address)': FunctionFragment; + 'outstandingAmount()': FunctionFragment; + 'permit(address,address,uint256,uint256,uint8,bytes32,bytes32)': FunctionFragment; + 'placeOffer(uint256,address,uint256,address)': FunctionFragment; + 'previewDeposit(uint256)': FunctionFragment; + 'previewMint(uint256)': FunctionFragment; + 'previewRedeem(uint256)': FunctionFragment; + 'previewWithdraw(uint256)': FunctionFragment; + 'rebalance(address,address,uint256,uint256)': FunctionFragment; + 'redeem(uint256,address,address)': FunctionFragment; + 'removeFilledTradeAmount(uint256)': FunctionFragment; + 'setBathBuddy(address)': FunctionFragment; + 'setBathHouse(address)': FunctionFragment; + 'setBonusToken(address)': FunctionFragment; + 'setFeeBPS(uint256)': FunctionFragment; + 'setFeeTo(address)': FunctionFragment; + 'setMarket(address)': FunctionFragment; + 'symbol()': FunctionFragment; + 'totalAssets()': FunctionFragment; + 'totalSupply()': FunctionFragment; + 'transfer(address,uint256)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + 'underlyingBalance()': FunctionFragment; + 'underlyingERC20()': FunctionFragment; + 'underlyingToken()': FunctionFragment; + 'withdraw(uint256)': FunctionFragment; + 'withdraw(uint256,address,address)': FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | 'DOMAIN_SEPARATOR' + | 'PERMIT_TYPEHASH' + | 'RubiconMarketAddress' + | 'allowance' + | 'approve' + | 'approveMarket' + | 'asset' + | 'balanceOf' + | 'bathBuddy' + | 'bathHouse' + | 'bonusTokens' + | 'cancel' + | 'convertToAssets' + | 'convertToShares' + | 'decimals' + | 'deposit(uint256,address)' + | 'deposit(uint256)' + | 'feeBPS' + | 'feeTo' + | 'getAllBonusTokenReward' + | 'getBonusTokenReward' + | 'initialize' + | 'initialized' + | 'maxDeposit' + | 'maxMint' + | 'maxRedeem' + | 'maxWithdraw' + | 'mint' + | 'name' + | 'nonces' + | 'outstandingAmount' + | 'permit' + | 'placeOffer' + | 'previewDeposit' + | 'previewMint' + | 'previewRedeem' + | 'previewWithdraw' + | 'rebalance' + | 'redeem' + | 'removeFilledTradeAmount' + | 'setBathBuddy' + | 'setBathHouse' + | 'setBonusToken' + | 'setFeeBPS' + | 'setFeeTo' + | 'setMarket' + | 'symbol' + | 'totalAssets' + | 'totalSupply' + | 'transfer' + | 'transferFrom' + | 'underlyingBalance' + | 'underlyingERC20' + | 'underlyingToken' + | 'withdraw(uint256)' + | 'withdraw(uint256,address,address)', + ): FunctionFragment; + + encodeFunctionData(functionFragment: 'DOMAIN_SEPARATOR', values?: undefined): string; + encodeFunctionData(functionFragment: 'PERMIT_TYPEHASH', values?: undefined): string; + encodeFunctionData(functionFragment: 'RubiconMarketAddress', values?: undefined): string; + encodeFunctionData(functionFragment: 'allowance', values: [string, string]): string; + encodeFunctionData(functionFragment: 'approve', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'approveMarket', values?: undefined): string; + encodeFunctionData(functionFragment: 'asset', values?: undefined): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [string]): string; + encodeFunctionData(functionFragment: 'bathBuddy', values?: undefined): string; + encodeFunctionData(functionFragment: 'bathHouse', values?: undefined): string; + encodeFunctionData(functionFragment: 'bonusTokens', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'cancel', values: [BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'convertToAssets', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'convertToShares', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'decimals', values?: undefined): string; + encodeFunctionData(functionFragment: 'deposit(uint256,address)', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'deposit(uint256)', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'feeBPS', values?: undefined): string; + encodeFunctionData(functionFragment: 'feeTo', values?: undefined): string; + encodeFunctionData(functionFragment: 'getAllBonusTokenReward', values?: undefined): string; + encodeFunctionData(functionFragment: 'getBonusTokenReward', values: [string]): string; + encodeFunctionData(functionFragment: 'initialize', values: [string, string, string]): string; + encodeFunctionData(functionFragment: 'initialized', values?: undefined): string; + encodeFunctionData(functionFragment: 'maxDeposit', values: [string]): string; + encodeFunctionData(functionFragment: 'maxMint', values: [string]): string; + encodeFunctionData(functionFragment: 'maxRedeem', values: [string]): string; + encodeFunctionData(functionFragment: 'maxWithdraw', values: [string]): string; + encodeFunctionData(functionFragment: 'mint', values: [BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'nonces', values: [string]): string; + encodeFunctionData(functionFragment: 'outstandingAmount', values?: undefined): string; + encodeFunctionData( + functionFragment: 'permit', + values: [string, string, BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike], + ): string; + encodeFunctionData(functionFragment: 'placeOffer', values: [BigNumberish, string, BigNumberish, string]): string; + encodeFunctionData(functionFragment: 'previewDeposit', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'previewMint', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'previewRedeem', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'previewWithdraw', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'rebalance', values: [string, string, BigNumberish, BigNumberish]): string; + encodeFunctionData(functionFragment: 'redeem', values: [BigNumberish, string, string]): string; + encodeFunctionData(functionFragment: 'removeFilledTradeAmount', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'setBathBuddy', values: [string]): string; + encodeFunctionData(functionFragment: 'setBathHouse', values: [string]): string; + encodeFunctionData(functionFragment: 'setBonusToken', values: [string]): string; + encodeFunctionData(functionFragment: 'setFeeBPS', values: [BigNumberish]): string; + encodeFunctionData(functionFragment: 'setFeeTo', values: [string]): string; + encodeFunctionData(functionFragment: 'setMarket', values: [string]): string; + encodeFunctionData(functionFragment: 'symbol', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalAssets', values?: undefined): string; + encodeFunctionData(functionFragment: 'totalSupply', values?: undefined): string; + encodeFunctionData(functionFragment: 'transfer', values: [string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [string, string, BigNumberish]): string; + encodeFunctionData(functionFragment: 'underlyingBalance', values?: undefined): string; + encodeFunctionData(functionFragment: 'underlyingERC20', values?: undefined): string; + encodeFunctionData(functionFragment: 'underlyingToken', values?: undefined): string; + encodeFunctionData(functionFragment: 'withdraw(uint256)', values: [BigNumberish]): string; + encodeFunctionData( + functionFragment: 'withdraw(uint256,address,address)', + values: [BigNumberish, string, string], + ): string; + + decodeFunctionResult(functionFragment: 'DOMAIN_SEPARATOR', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'PERMIT_TYPEHASH', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'RubiconMarketAddress', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allowance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approveMarket', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'asset', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bathBuddy', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bathHouse', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'bonusTokens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'cancel', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'convertToAssets', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'convertToShares', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'decimals', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'deposit(uint256,address)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'deposit(uint256)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'feeBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'feeTo', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getAllBonusTokenReward', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getBonusTokenReward', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initialize', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'initialized', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxDeposit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxMint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxRedeem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxWithdraw', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'mint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nonces', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'outstandingAmount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'permit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'placeOffer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'previewDeposit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'previewMint', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'previewRedeem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'previewWithdraw', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rebalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'redeem', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'removeFilledTradeAmount', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBathBuddy', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBathHouse', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setBonusToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFeeBPS', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFeeTo', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setMarket', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'symbol', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalAssets', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'totalSupply', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transfer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'underlyingBalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'underlyingERC20', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'underlyingToken', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdraw(uint256)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdraw(uint256,address,address)', data: BytesLike): Result; + + events: { + 'Approval(address,address,uint256)': EventFragment; + 'Deposit(address,address,uint256,uint256)': EventFragment; + 'LogClaimBonusTokn(address,address,address,uint256,uint256,address)': EventFragment; + 'LogDeposit(uint256,address,uint256,address,uint256,uint256,uint256)': EventFragment; + 'LogInit(uint256)': EventFragment; + 'LogPoolCancel(uint256,address,uint256,uint256,uint256,uint256)': EventFragment; + 'LogPoolOffer(uint256,address,uint256,uint256,uint256)': EventFragment; + 'LogRebalance(address,address,address,uint256,uint256,uint256,uint256,uint256)': EventFragment; + 'LogRemoveFilledTradeAmount(address,uint256,uint256,uint256,uint256)': EventFragment; + 'LogWithdraw(uint256,address,uint256,address,uint256,address,uint256,uint256,uint256)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + 'Withdraw(address,address,address,uint256,uint256)': EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Deposit'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogClaimBonusTokn'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogDeposit'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogInit'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogPoolCancel'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogPoolOffer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogRebalance'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogRemoveFilledTradeAmount'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'LogWithdraw'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Withdraw'): EventFragment; +} + +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; +} +export type ApprovalEvent = TypedEvent<[string, string, BigNumber], ApprovalEventObject>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface DepositEventObject { + caller: string; + owner: string; + assets: BigNumber; + shares: BigNumber; +} +export type DepositEvent = TypedEvent<[string, string, BigNumber, BigNumber], DepositEventObject>; + +export type DepositEventFilter = TypedEventFilter; + +export interface LogClaimBonusToknEventObject { + caller: string; + receiver: string; + owner: string; + assets: BigNumber; + shares: BigNumber; + bonusToken: string; +} +export type LogClaimBonusToknEvent = TypedEvent< + [string, string, string, BigNumber, BigNumber, string], + LogClaimBonusToknEventObject +>; + +export type LogClaimBonusToknEventFilter = TypedEventFilter; + +export interface LogDepositEventObject { + depositedAmt: BigNumber; + asset: string; + sharesReceived: BigNumber; + depositor: string; + underlyingBalance: BigNumber; + outstandingAmount: BigNumber; + totalSupply: BigNumber; +} +export type LogDepositEvent = TypedEvent< + [BigNumber, string, BigNumber, string, BigNumber, BigNumber, BigNumber], + LogDepositEventObject +>; + +export type LogDepositEventFilter = TypedEventFilter; + +export interface LogInitEventObject { + timeOfInit: BigNumber; +} +export type LogInitEvent = TypedEvent<[BigNumber], LogInitEventObject>; + +export type LogInitEventFilter = TypedEventFilter; + +export interface LogPoolCancelEventObject { + orderId: BigNumber; + pool_asset: string; + outstandingAmountToCancel: BigNumber; + underlyingBalance: BigNumber; + outstandingAmount: BigNumber; + totalSupply: BigNumber; +} +export type LogPoolCancelEvent = TypedEvent< + [BigNumber, string, BigNumber, BigNumber, BigNumber, BigNumber], + LogPoolCancelEventObject +>; + +export type LogPoolCancelEventFilter = TypedEventFilter; + +export interface LogPoolOfferEventObject { + id: BigNumber; + pool_asset: string; + underlyingBalance: BigNumber; + outstandingAmount: BigNumber; + totalSupply: BigNumber; +} +export type LogPoolOfferEvent = TypedEvent< + [BigNumber, string, BigNumber, BigNumber, BigNumber], + LogPoolOfferEventObject +>; + +export type LogPoolOfferEventFilter = TypedEventFilter; + +export interface LogRebalanceEventObject { + pool_asset: string; + destination: string; + transferAsset: string; + rebalAmt: BigNumber; + stratReward: BigNumber; + underlyingBalance: BigNumber; + outstandingAmount: BigNumber; + totalSupply: BigNumber; +} +export type LogRebalanceEvent = TypedEvent< + [string, string, string, BigNumber, BigNumber, BigNumber, BigNumber, BigNumber], + LogRebalanceEventObject +>; + +export type LogRebalanceEventFilter = TypedEventFilter; + +export interface LogRemoveFilledTradeAmountEventObject { + pool_asset: string; + fillAmount: BigNumber; + underlyingBalance: BigNumber; + outstandingAmount: BigNumber; + totalSupply: BigNumber; +} +export type LogRemoveFilledTradeAmountEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, BigNumber], + LogRemoveFilledTradeAmountEventObject +>; + +export type LogRemoveFilledTradeAmountEventFilter = TypedEventFilter; + +export interface LogWithdrawEventObject { + amountWithdrawn: BigNumber; + asset: string; + sharesWithdrawn: BigNumber; + withdrawer: string; + fee: BigNumber; + feeTo: string; + underlyingBalance: BigNumber; + outstandingAmount: BigNumber; + totalSupply: BigNumber; +} +export type LogWithdrawEvent = TypedEvent< + [BigNumber, string, BigNumber, string, BigNumber, string, BigNumber, BigNumber, BigNumber], + LogWithdrawEventObject +>; + +export type LogWithdrawEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent<[string, string, BigNumber], TransferEventObject>; + +export type TransferEventFilter = TypedEventFilter; + +export interface WithdrawEventObject { + caller: string; + receiver: string; + owner: string; + assets: BigNumber; + shares: BigNumber; +} +export type WithdrawEvent = TypedEvent<[string, string, string, BigNumber, BigNumber], WithdrawEventObject>; + +export type WithdrawEventFilter = TypedEventFilter; + +export interface BathToken extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: BathTokenInterface; + + 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]>; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise<[string]>; + + RubiconMarketAddress(overrides?: CallOverrides): Promise<[string]>; + + allowance(arg0: string, arg1: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approveMarket(overrides?: Overrides & { from?: string | Promise }): Promise; + + asset(overrides?: CallOverrides): Promise<[string] & { assetTokenAddress: string }>; + + balanceOf(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + bathBuddy(overrides?: CallOverrides): Promise<[string]>; + + bathHouse(overrides?: CallOverrides): Promise<[string]>; + + bonusTokens(arg0: BigNumberish, overrides?: CallOverrides): Promise<[string]>; + + cancel( + id: BigNumberish, + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + convertToAssets(shares: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { assets: BigNumber }>; + + convertToShares(assets: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { shares: BigNumber }>; + + decimals(overrides?: CallOverrides): Promise<[number]>; + + 'deposit(uint256,address)'( + assets: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'deposit(uint256)'( + assets: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + feeBPS(overrides?: CallOverrides): Promise<[BigNumber]>; + + feeTo(overrides?: CallOverrides): Promise<[string]>; + + getAllBonusTokenReward(overrides?: Overrides & { from?: string | Promise }): Promise; + + getBonusTokenReward( + rewardToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + token: string, + market: string, + _feeTo: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialized(overrides?: CallOverrides): Promise<[boolean]>; + + maxDeposit(receiver: string, overrides?: CallOverrides): Promise<[BigNumber] & { maxAssets: BigNumber }>; + + maxMint(receiver: string, overrides?: CallOverrides): Promise<[BigNumber] & { maxShares: BigNumber }>; + + maxRedeem(owner: string, overrides?: CallOverrides): Promise<[BigNumber] & { maxShares: BigNumber }>; + + maxWithdraw(owner: string, overrides?: CallOverrides): Promise<[BigNumber] & { maxAssets: BigNumber }>; + + mint( + shares: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise<[string]>; + + nonces(arg0: string, overrides?: CallOverrides): Promise<[BigNumber]>; + + outstandingAmount(overrides?: CallOverrides): Promise<[BigNumber]>; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + placeOffer( + pay_amt: BigNumberish, + pay_gem: string, + buy_amt: BigNumberish, + buy_gem: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + previewDeposit(assets: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { shares: BigNumber }>; + + previewMint(shares: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { assets: BigNumber }>; + + previewRedeem(shares: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { assets: BigNumber }>; + + previewWithdraw(assets: BigNumberish, overrides?: CallOverrides): Promise<[BigNumber] & { shares: BigNumber }>; + + rebalance( + destination: string, + filledAssetToRebalance: string, + stratProportion: BigNumberish, + rebalAmt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + shares: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + removeFilledTradeAmount( + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathBuddy( + newBuddy: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathHouse( + newBathHouse: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBonusToken( + newBonusERC20: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeBPS( + _feeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeTo(_feeTo: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + setMarket( + newRubiconMarket: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + totalAssets(overrides?: CallOverrides): Promise<[BigNumber] & { totalManagedAssets: BigNumber }>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + underlyingBalance(overrides?: CallOverrides): Promise<[BigNumber]>; + + underlyingERC20(overrides?: CallOverrides): Promise<[string]>; + + underlyingToken(overrides?: CallOverrides): Promise<[string]>; + + 'withdraw(uint256)'( + _shares: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'withdraw(uint256,address,address)'( + assets: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + RubiconMarketAddress(overrides?: CallOverrides): Promise; + + allowance(arg0: string, arg1: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approveMarket(overrides?: Overrides & { from?: string | Promise }): Promise; + + asset(overrides?: CallOverrides): Promise; + + balanceOf(arg0: string, overrides?: CallOverrides): Promise; + + bathBuddy(overrides?: CallOverrides): Promise; + + bathHouse(overrides?: CallOverrides): Promise; + + bonusTokens(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + cancel( + id: BigNumberish, + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + convertToAssets(shares: BigNumberish, overrides?: CallOverrides): Promise; + + convertToShares(assets: BigNumberish, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + 'deposit(uint256,address)'( + assets: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'deposit(uint256)'( + assets: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + feeBPS(overrides?: CallOverrides): Promise; + + feeTo(overrides?: CallOverrides): Promise; + + getAllBonusTokenReward(overrides?: Overrides & { from?: string | Promise }): Promise; + + getBonusTokenReward( + rewardToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + token: string, + market: string, + _feeTo: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialized(overrides?: CallOverrides): Promise; + + maxDeposit(receiver: string, overrides?: CallOverrides): Promise; + + maxMint(receiver: string, overrides?: CallOverrides): Promise; + + maxRedeem(owner: string, overrides?: CallOverrides): Promise; + + maxWithdraw(owner: string, overrides?: CallOverrides): Promise; + + mint( + shares: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(arg0: string, overrides?: CallOverrides): Promise; + + outstandingAmount(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + placeOffer( + pay_amt: BigNumberish, + pay_gem: string, + buy_amt: BigNumberish, + buy_gem: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + previewDeposit(assets: BigNumberish, overrides?: CallOverrides): Promise; + + previewMint(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewRedeem(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewWithdraw(assets: BigNumberish, overrides?: CallOverrides): Promise; + + rebalance( + destination: string, + filledAssetToRebalance: string, + stratProportion: BigNumberish, + rebalAmt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + shares: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + removeFilledTradeAmount( + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathBuddy( + newBuddy: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathHouse( + newBathHouse: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBonusToken( + newBonusERC20: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeBPS( + _feeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeTo(_feeTo: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + setMarket( + newRubiconMarket: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalAssets(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + underlyingBalance(overrides?: CallOverrides): Promise; + + underlyingERC20(overrides?: CallOverrides): Promise; + + underlyingToken(overrides?: CallOverrides): Promise; + + 'withdraw(uint256)'( + _shares: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'withdraw(uint256,address,address)'( + assets: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + callStatic: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + RubiconMarketAddress(overrides?: CallOverrides): Promise; + + allowance(arg0: string, arg1: string, overrides?: CallOverrides): Promise; + + approve(spender: string, value: BigNumberish, overrides?: CallOverrides): Promise; + + approveMarket(overrides?: CallOverrides): Promise; + + asset(overrides?: CallOverrides): Promise; + + balanceOf(arg0: string, overrides?: CallOverrides): Promise; + + bathBuddy(overrides?: CallOverrides): Promise; + + bathHouse(overrides?: CallOverrides): Promise; + + bonusTokens(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + cancel(id: BigNumberish, amt: BigNumberish, overrides?: CallOverrides): Promise; + + convertToAssets(shares: BigNumberish, overrides?: CallOverrides): Promise; + + convertToShares(assets: BigNumberish, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + 'deposit(uint256,address)'(assets: BigNumberish, receiver: string, overrides?: CallOverrides): Promise; + + 'deposit(uint256)'(assets: BigNumberish, overrides?: CallOverrides): Promise; + + feeBPS(overrides?: CallOverrides): Promise; + + feeTo(overrides?: CallOverrides): Promise; + + getAllBonusTokenReward(overrides?: CallOverrides): Promise; + + getBonusTokenReward(rewardToken: string, overrides?: CallOverrides): Promise; + + initialize(token: string, market: string, _feeTo: string, overrides?: CallOverrides): Promise; + + initialized(overrides?: CallOverrides): Promise; + + maxDeposit(receiver: string, overrides?: CallOverrides): Promise; + + maxMint(receiver: string, overrides?: CallOverrides): Promise; + + maxRedeem(owner: string, overrides?: CallOverrides): Promise; + + maxWithdraw(owner: string, overrides?: CallOverrides): Promise; + + mint(shares: BigNumberish, receiver: string, overrides?: CallOverrides): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(arg0: string, overrides?: CallOverrides): Promise; + + outstandingAmount(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: CallOverrides, + ): Promise; + + placeOffer( + pay_amt: BigNumberish, + pay_gem: string, + buy_amt: BigNumberish, + buy_gem: string, + overrides?: CallOverrides, + ): Promise; + + previewDeposit(assets: BigNumberish, overrides?: CallOverrides): Promise; + + previewMint(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewRedeem(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewWithdraw(assets: BigNumberish, overrides?: CallOverrides): Promise; + + rebalance( + destination: string, + filledAssetToRebalance: string, + stratProportion: BigNumberish, + rebalAmt: BigNumberish, + overrides?: CallOverrides, + ): Promise; + + redeem(shares: BigNumberish, receiver: string, owner: string, overrides?: CallOverrides): Promise; + + removeFilledTradeAmount(amt: BigNumberish, overrides?: CallOverrides): Promise; + + setBathBuddy(newBuddy: string, overrides?: CallOverrides): Promise; + + setBathHouse(newBathHouse: string, overrides?: CallOverrides): Promise; + + setBonusToken(newBonusERC20: string, overrides?: CallOverrides): Promise; + + setFeeBPS(_feeBPS: BigNumberish, overrides?: CallOverrides): Promise; + + setFeeTo(_feeTo: string, overrides?: CallOverrides): Promise; + + setMarket(newRubiconMarket: string, overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalAssets(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer(to: string, value: BigNumberish, overrides?: CallOverrides): Promise; + + transferFrom(from: string, to: string, value: BigNumberish, overrides?: CallOverrides): Promise; + + underlyingBalance(overrides?: CallOverrides): Promise; + + underlyingERC20(overrides?: CallOverrides): Promise; + + underlyingToken(overrides?: CallOverrides): Promise; + + 'withdraw(uint256)'(_shares: BigNumberish, overrides?: CallOverrides): Promise; + + 'withdraw(uint256,address,address)'( + assets: BigNumberish, + receiver: string, + owner: string, + 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; + + 'Deposit(address,address,uint256,uint256)'( + caller?: string | null, + owner?: string | null, + assets?: null, + shares?: null, + ): DepositEventFilter; + Deposit(caller?: string | null, owner?: string | null, assets?: null, shares?: null): DepositEventFilter; + + 'LogClaimBonusTokn(address,address,address,uint256,uint256,address)'( + caller?: string | null, + receiver?: string | null, + owner?: string | null, + assets?: null, + shares?: null, + bonusToken?: null, + ): LogClaimBonusToknEventFilter; + LogClaimBonusTokn( + caller?: string | null, + receiver?: string | null, + owner?: string | null, + assets?: null, + shares?: null, + bonusToken?: null, + ): LogClaimBonusToknEventFilter; + + 'LogDeposit(uint256,address,uint256,address,uint256,uint256,uint256)'( + depositedAmt?: null, + asset?: null, + sharesReceived?: null, + depositor?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogDepositEventFilter; + LogDeposit( + depositedAmt?: null, + asset?: null, + sharesReceived?: null, + depositor?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogDepositEventFilter; + + 'LogInit(uint256)'(timeOfInit?: null): LogInitEventFilter; + LogInit(timeOfInit?: null): LogInitEventFilter; + + 'LogPoolCancel(uint256,address,uint256,uint256,uint256,uint256)'( + orderId?: null, + pool_asset?: null, + outstandingAmountToCancel?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogPoolCancelEventFilter; + LogPoolCancel( + orderId?: null, + pool_asset?: null, + outstandingAmountToCancel?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogPoolCancelEventFilter; + + 'LogPoolOffer(uint256,address,uint256,uint256,uint256)'( + id?: null, + pool_asset?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogPoolOfferEventFilter; + LogPoolOffer( + id?: null, + pool_asset?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogPoolOfferEventFilter; + + 'LogRebalance(address,address,address,uint256,uint256,uint256,uint256,uint256)'( + pool_asset?: null, + destination?: null, + transferAsset?: null, + rebalAmt?: null, + stratReward?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogRebalanceEventFilter; + LogRebalance( + pool_asset?: null, + destination?: null, + transferAsset?: null, + rebalAmt?: null, + stratReward?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogRebalanceEventFilter; + + 'LogRemoveFilledTradeAmount(address,uint256,uint256,uint256,uint256)'( + pool_asset?: null, + fillAmount?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogRemoveFilledTradeAmountEventFilter; + LogRemoveFilledTradeAmount( + pool_asset?: null, + fillAmount?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogRemoveFilledTradeAmountEventFilter; + + 'LogWithdraw(uint256,address,uint256,address,uint256,address,uint256,uint256,uint256)'( + amountWithdrawn?: null, + asset?: null, + sharesWithdrawn?: null, + withdrawer?: null, + fee?: null, + feeTo?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogWithdrawEventFilter; + LogWithdraw( + amountWithdrawn?: null, + asset?: null, + sharesWithdrawn?: null, + withdrawer?: null, + fee?: null, + feeTo?: null, + underlyingBalance?: null, + outstandingAmount?: null, + totalSupply?: null, + ): LogWithdrawEventFilter; + + 'Transfer(address,address,uint256)'(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + Transfer(from?: string | null, to?: string | null, value?: null): TransferEventFilter; + + 'Withdraw(address,address,address,uint256,uint256)'( + caller?: string | null, + receiver?: string | null, + owner?: string | null, + assets?: null, + shares?: null, + ): WithdrawEventFilter; + Withdraw( + caller?: string | null, + receiver?: string | null, + owner?: string | null, + assets?: null, + shares?: null, + ): WithdrawEventFilter; + }; + + estimateGas: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + RubiconMarketAddress(overrides?: CallOverrides): Promise; + + allowance(arg0: string, arg1: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approveMarket(overrides?: Overrides & { from?: string | Promise }): Promise; + + asset(overrides?: CallOverrides): Promise; + + balanceOf(arg0: string, overrides?: CallOverrides): Promise; + + bathBuddy(overrides?: CallOverrides): Promise; + + bathHouse(overrides?: CallOverrides): Promise; + + bonusTokens(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + cancel( + id: BigNumberish, + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + convertToAssets(shares: BigNumberish, overrides?: CallOverrides): Promise; + + convertToShares(assets: BigNumberish, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + 'deposit(uint256,address)'( + assets: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'deposit(uint256)'( + assets: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + feeBPS(overrides?: CallOverrides): Promise; + + feeTo(overrides?: CallOverrides): Promise; + + getAllBonusTokenReward(overrides?: Overrides & { from?: string | Promise }): Promise; + + getBonusTokenReward( + rewardToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + token: string, + market: string, + _feeTo: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialized(overrides?: CallOverrides): Promise; + + maxDeposit(receiver: string, overrides?: CallOverrides): Promise; + + maxMint(receiver: string, overrides?: CallOverrides): Promise; + + maxRedeem(owner: string, overrides?: CallOverrides): Promise; + + maxWithdraw(owner: string, overrides?: CallOverrides): Promise; + + mint( + shares: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(arg0: string, overrides?: CallOverrides): Promise; + + outstandingAmount(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + placeOffer( + pay_amt: BigNumberish, + pay_gem: string, + buy_amt: BigNumberish, + buy_gem: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + previewDeposit(assets: BigNumberish, overrides?: CallOverrides): Promise; + + previewMint(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewRedeem(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewWithdraw(assets: BigNumberish, overrides?: CallOverrides): Promise; + + rebalance( + destination: string, + filledAssetToRebalance: string, + stratProportion: BigNumberish, + rebalAmt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + shares: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + removeFilledTradeAmount( + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathBuddy(newBuddy: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + setBathHouse(newBathHouse: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + setBonusToken( + newBonusERC20: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeBPS(_feeBPS: BigNumberish, overrides?: Overrides & { from?: string | Promise }): Promise; + + setFeeTo(_feeTo: string, overrides?: Overrides & { from?: string | Promise }): Promise; + + setMarket( + newRubiconMarket: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalAssets(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + underlyingBalance(overrides?: CallOverrides): Promise; + + underlyingERC20(overrides?: CallOverrides): Promise; + + underlyingToken(overrides?: CallOverrides): Promise; + + 'withdraw(uint256)'( + _shares: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'withdraw(uint256,address,address)'( + assets: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; + + populateTransaction: { + DOMAIN_SEPARATOR(overrides?: CallOverrides): Promise; + + PERMIT_TYPEHASH(overrides?: CallOverrides): Promise; + + RubiconMarketAddress(overrides?: CallOverrides): Promise; + + allowance(arg0: string, arg1: string, overrides?: CallOverrides): Promise; + + approve( + spender: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + approveMarket(overrides?: Overrides & { from?: string | Promise }): Promise; + + asset(overrides?: CallOverrides): Promise; + + balanceOf(arg0: string, overrides?: CallOverrides): Promise; + + bathBuddy(overrides?: CallOverrides): Promise; + + bathHouse(overrides?: CallOverrides): Promise; + + bonusTokens(arg0: BigNumberish, overrides?: CallOverrides): Promise; + + cancel( + id: BigNumberish, + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + convertToAssets(shares: BigNumberish, overrides?: CallOverrides): Promise; + + convertToShares(assets: BigNumberish, overrides?: CallOverrides): Promise; + + decimals(overrides?: CallOverrides): Promise; + + 'deposit(uint256,address)'( + assets: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'deposit(uint256)'( + assets: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + feeBPS(overrides?: CallOverrides): Promise; + + feeTo(overrides?: CallOverrides): Promise; + + getAllBonusTokenReward(overrides?: Overrides & { from?: string | Promise }): Promise; + + getBonusTokenReward( + rewardToken: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialize( + token: string, + market: string, + _feeTo: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + initialized(overrides?: CallOverrides): Promise; + + maxDeposit(receiver: string, overrides?: CallOverrides): Promise; + + maxMint(receiver: string, overrides?: CallOverrides): Promise; + + maxRedeem(owner: string, overrides?: CallOverrides): Promise; + + maxWithdraw(owner: string, overrides?: CallOverrides): Promise; + + mint( + shares: BigNumberish, + receiver: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + name(overrides?: CallOverrides): Promise; + + nonces(arg0: string, overrides?: CallOverrides): Promise; + + outstandingAmount(overrides?: CallOverrides): Promise; + + permit( + owner: string, + spender: string, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + placeOffer( + pay_amt: BigNumberish, + pay_gem: string, + buy_amt: BigNumberish, + buy_gem: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + previewDeposit(assets: BigNumberish, overrides?: CallOverrides): Promise; + + previewMint(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewRedeem(shares: BigNumberish, overrides?: CallOverrides): Promise; + + previewWithdraw(assets: BigNumberish, overrides?: CallOverrides): Promise; + + rebalance( + destination: string, + filledAssetToRebalance: string, + stratProportion: BigNumberish, + rebalAmt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + redeem( + shares: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + removeFilledTradeAmount( + amt: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathBuddy( + newBuddy: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBathHouse( + newBathHouse: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setBonusToken( + newBonusERC20: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeBPS( + _feeBPS: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setFeeTo( + _feeTo: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + setMarket( + newRubiconMarket: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + totalAssets(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + transferFrom( + from: string, + to: string, + value: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + underlyingBalance(overrides?: CallOverrides): Promise; + + underlyingERC20(overrides?: CallOverrides): Promise; + + underlyingToken(overrides?: CallOverrides): Promise; + + 'withdraw(uint256)'( + _shares: BigNumberish, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + + 'withdraw(uint256,address,address)'( + assets: BigNumberish, + receiver: string, + owner: string, + overrides?: Overrides & { from?: string | Promise }, + ): Promise; + }; +} diff --git a/src/apps/rubicon/contracts/ethers/common.ts b/src/apps/rubicon/contracts/ethers/common.ts new file mode 100644 index 000000000..6cfb10425 --- /dev/null +++ b/src/apps/rubicon/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/rubicon/contracts/ethers/factories/BathToken__factory.ts b/src/apps/rubicon/contracts/ethers/factories/BathToken__factory.ts new file mode 100644 index 000000000..70c1ad427 --- /dev/null +++ b/src/apps/rubicon/contracts/ethers/factories/BathToken__factory.ts @@ -0,0 +1,1466 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from 'ethers'; +import type { Provider } from '@ethersproject/providers'; +import type { BathToken, BathTokenInterface } from '../BathToken'; + +const _abi = [ + { + 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: 'caller', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'Deposit', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'bonusToken', + type: 'address', + }, + ], + name: 'LogClaimBonusTokn', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'depositedAmt', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'sharesReceived', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'depositor', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'underlyingBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'LogDeposit', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'timeOfInit', + type: 'uint256', + }, + ], + name: 'LogInit', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'orderId', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'pool_asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmountToCancel', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'underlyingBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'LogPoolCancel', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'pool_asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'underlyingBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'LogPoolOffer', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract IERC20', + name: 'pool_asset', + type: 'address', + }, + { + indexed: false, + internalType: 'address', + name: 'destination', + type: 'address', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'transferAsset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'rebalAmt', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'stratReward', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'underlyingBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'LogRebalance', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'contract IERC20', + name: 'pool_asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'fillAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'underlyingBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'LogRemoveFilledTradeAmount', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 'amountWithdrawn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'contract IERC20', + name: 'asset', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'sharesWithdrawn', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'withdrawer', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'fee', + type: 'uint256', + }, + { + indexed: false, + internalType: 'address', + name: 'feeTo', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'underlyingBalance', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'outstandingAmount', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'totalSupply', + type: 'uint256', + }, + ], + name: 'LogWithdraw', + 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', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'caller', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'Withdraw', + type: 'event', + }, + { + inputs: [], + name: 'DOMAIN_SEPARATOR', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'PERMIT_TYPEHASH', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'RubiconMarketAddress', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'allowance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'approveMarket', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'asset', + outputs: [ + { + internalType: 'address', + name: 'assetTokenAddress', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'bathBuddy', + outputs: [ + { + internalType: 'contract IBathBuddy', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'bathHouse', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'bonusTokens', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amt', + type: 'uint256', + }, + ], + name: 'cancel', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'convertToAssets', + outputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + name: 'convertToShares', + outputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'decimals', + outputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'deposit', + outputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + name: 'deposit', + outputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'feeBPS', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'feeTo', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getAllBonusTokenReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'rewardToken', + type: 'address', + }, + ], + name: 'getBonusTokenReward', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract ERC20', + name: 'token', + type: 'address', + }, + { + internalType: 'address', + name: 'market', + type: 'address', + }, + { + internalType: 'address', + name: '_feeTo', + type: 'address', + }, + ], + name: 'initialize', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'initialized', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'maxDeposit', + outputs: [ + { + internalType: 'uint256', + name: 'maxAssets', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'maxMint', + outputs: [ + { + internalType: 'uint256', + name: 'maxShares', + type: 'uint256', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'maxRedeem', + outputs: [ + { + internalType: 'uint256', + name: 'maxShares', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'maxWithdraw', + outputs: [ + { + internalType: 'uint256', + name: 'maxAssets', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + ], + name: 'mint', + outputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'nonces', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'outstandingAmount', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'spender', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'deadline', + type: 'uint256', + }, + { + internalType: 'uint8', + name: 'v', + type: 'uint8', + }, + { + internalType: 'bytes32', + name: 'r', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 's', + type: 'bytes32', + }, + ], + name: 'permit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'pay_amt', + type: 'uint256', + }, + { + internalType: 'contract ERC20', + name: 'pay_gem', + type: 'address', + }, + { + internalType: 'uint256', + name: 'buy_amt', + type: 'uint256', + }, + { + internalType: 'contract ERC20', + name: 'buy_gem', + type: 'address', + }, + ], + name: 'placeOffer', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + name: 'previewDeposit', + outputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'previewMint', + outputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + name: 'previewRedeem', + outputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + name: 'previewWithdraw', + outputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'destination', + type: 'address', + }, + { + internalType: 'address', + name: 'filledAssetToRebalance', + type: 'address', + }, + { + internalType: 'uint256', + name: 'stratProportion', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'rebalAmt', + type: 'uint256', + }, + ], + name: 'rebalance', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'redeem', + outputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'amt', + type: 'uint256', + }, + ], + name: 'removeFilledTradeAmount', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newBuddy', + type: 'address', + }, + ], + name: 'setBathBuddy', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newBathHouse', + type: 'address', + }, + ], + name: 'setBathHouse', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newBonusERC20', + type: 'address', + }, + ], + name: 'setBonusToken', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_feeBPS', + type: 'uint256', + }, + ], + name: 'setFeeBPS', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_feeTo', + type: 'address', + }, + ], + name: 'setFeeTo', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newRubiconMarket', + type: 'address', + }, + ], + name: 'setMarket', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'symbol', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalAssets', + outputs: [ + { + internalType: 'uint256', + name: 'totalManagedAssets', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'totalSupply', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'transfer', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'underlyingBalance', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'underlyingERC20', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'underlyingToken', + outputs: [ + { + internalType: 'contract IERC20', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '_shares', + type: 'uint256', + }, + ], + name: 'withdraw', + outputs: [ + { + internalType: 'uint256', + name: 'amountWithdrawn', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'assets', + type: 'uint256', + }, + { + internalType: 'address', + name: 'receiver', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'withdraw', + outputs: [ + { + internalType: 'uint256', + name: 'shares', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +]; + +export class BathToken__factory { + static readonly abi = _abi; + static createInterface(): BathTokenInterface { + return new utils.Interface(_abi) as BathTokenInterface; + } + static connect(address: string, signerOrProvider: Signer | Provider): BathToken { + return new Contract(address, _abi, signerOrProvider) as BathToken; + } +} diff --git a/src/apps/rubicon/contracts/ethers/factories/index.ts b/src/apps/rubicon/contracts/ethers/factories/index.ts new file mode 100644 index 000000000..535755134 --- /dev/null +++ b/src/apps/rubicon/contracts/ethers/factories/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { BathToken__factory } from './BathToken__factory'; diff --git a/src/apps/rubicon/contracts/ethers/index.ts b/src/apps/rubicon/contracts/ethers/index.ts new file mode 100644 index 000000000..a48df1a00 --- /dev/null +++ b/src/apps/rubicon/contracts/ethers/index.ts @@ -0,0 +1,6 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { BathToken } from './BathToken'; +export * as factories from './factories'; +export { BathToken__factory } from './factories/BathToken__factory'; diff --git a/src/apps/rubicon/contracts/index.ts b/src/apps/rubicon/contracts/index.ts new file mode 100644 index 000000000..73af08bc4 --- /dev/null +++ b/src/apps/rubicon/contracts/index.ts @@ -0,0 +1,23 @@ +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 { BathToken__factory } from './ethers'; + +// eslint-disable-next-line +type ContractOpts = { address: string; network: Network }; + +@Injectable() +export class RubiconContractFactory extends ContractFactory { + constructor(@Inject(APP_TOOLKIT) protected readonly appToolkit: IAppToolkit) { + super((network: Network) => appToolkit.getNetworkProvider(network)); + } + + bathToken({ address, network }: ContractOpts) { + return BathToken__factory.connect(address, this.appToolkit.getNetworkProvider(network)); + } +} + +export type { BathToken } from './ethers'; diff --git a/src/apps/rubicon/index.ts b/src/apps/rubicon/index.ts new file mode 100644 index 000000000..e4822ace0 --- /dev/null +++ b/src/apps/rubicon/index.ts @@ -0,0 +1,3 @@ +export { RUBICON_DEFINITION, RubiconAppDefinition } from './rubicon.definition'; +export { RubiconAppModule } from './rubicon.module'; +export { RubiconContractFactory } from './contracts'; diff --git a/src/apps/rubicon/optimism/rubicon.balance-fetcher.ts b/src/apps/rubicon/optimism/rubicon.balance-fetcher.ts new file mode 100644 index 000000000..f8cb3781a --- /dev/null +++ b/src/apps/rubicon/optimism/rubicon.balance-fetcher.ts @@ -0,0 +1,35 @@ +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 { RUBICON_DEFINITION } from '../rubicon.definition'; + +const network = Network.OPTIMISM_MAINNET; + +@Register.BalanceFetcher(RUBICON_DEFINITION.id, network) +export class OptimismRubiconBalanceFetcher implements BalanceFetcher { + constructor(@Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit) { } + async getBathTokenBalances(address: string) { + return this.appToolkit.helpers.tokenBalanceHelper.getTokenBalances({ + address, + appId: RUBICON_DEFINITION.id, + groupId: RUBICON_DEFINITION.groups.bathToken.id, + network: network, + }); + } + + async getBalances(address: string) { + const [bathTokenBalances] = await Promise.all([this.getBathTokenBalances(address)]); + + return presentBalanceFetcherResponse([ + { + label: 'Bath Tokens', + assets: bathTokenBalances, + }, + ]); + } +} diff --git a/src/apps/rubicon/optimism/rubicon.bath-token.token-fetcher.ts b/src/apps/rubicon/optimism/rubicon.bath-token.token-fetcher.ts new file mode 100644 index 000000000..96f22e84f --- /dev/null +++ b/src/apps/rubicon/optimism/rubicon.bath-token.token-fetcher.ts @@ -0,0 +1,132 @@ +import { Inject } from '@nestjs/common'; +import { BigNumber } from 'ethers/lib/ethers'; +import _ from 'lodash'; + +import { IAppToolkit, APP_TOOLKIT } from '~app-toolkit/app-toolkit.interface'; +import { Register } from '~app-toolkit/decorators'; +import { buildDollarDisplayItem } from '~app-toolkit/helpers/presentation/display-item.present'; +import { getImagesFromToken, getLabelFromToken } from '~app-toolkit/helpers/presentation/image.present'; +import { ContractType } from '~position/contract.interface'; +import { PositionFetcher } from '~position/position-fetcher.interface'; +import { AppTokenPosition } from '~position/position.interface'; +import { Network } from '~types/network.interface'; + +import { RubiconContractFactory } from '../contracts'; +import { RUBICON_DEFINITION } from '../rubicon.definition'; + +const appId = RUBICON_DEFINITION.id; +const groupId = RUBICON_DEFINITION.groups.bathToken.id; +const network = Network.OPTIMISM_MAINNET; + +// Test: +// http://localhost:5001/apps/rubicon/tokens?groupIds[]=bathToken&network=optimism + +@Register.TokenPositionFetcher({ appId, groupId, network }) +export class OptimismRubiconBathTokenTokenFetcher implements PositionFetcher { + constructor( + @Inject(APP_TOOLKIT) private readonly appToolkit: IAppToolkit, + @Inject(RubiconContractFactory) private readonly rubiconContractFactory: RubiconContractFactory, + ) { } + + async getPositions() { + // For now, hardcoded in docs + const bathTokens = [ + '0xb0be5d911e3bd4ee2a8706cf1fac8d767a550497', + '0x7571cc9895d8e997853b1e0a1521ebd8481aa186', + '0xe0e112e8f33d3f437d1f895cbb1a456836125952', + '0x60daec2fc9d2e0de0577a5c708bcadba1458a833', + '0xffbd695bf246c514110f5dae3fa88b8c2f42c411', + '0xeb5f29afaaa3f44eca8559c3e8173003060e919f', + '0x574a21fe5ea9666dbca804c9d69d8caf21d5322b', + ]; + // Create a multicall wrapper instance to batch chain RPC calls together + const multicall = this.appToolkit.getMulticall(network); + + const appTokenDependencies = await this.appToolkit.getBaseTokenPrices(network); + + const allTokenDependencies = [...appTokenDependencies]; + + const tokens = await Promise.all( + bathTokens.map(async btAddress => { + // Instantiate a smart contract instance pointing to the Bath Token address + const contract = this.rubiconContractFactory.bathToken({ + address: btAddress, + network, + }); + + // Request the symbol, decimals, ands supply for the Bath Token + const [symbol, decimals, supplyRaw] = await Promise.all([ + multicall.wrap(contract).symbol(), + multicall.wrap(contract).decimals(), + multicall.wrap(contract).totalSupply(), + ]); + + // Denormalize the supply + const supply = Number(supplyRaw) / 10 ** decimals; + + // *******price ************ + // A user can deposit base tokens like WETH or USDC + + // Request the underlying token address and ratio for the Bath Token + const [underlyingTokenAddressRaw, ratioRaw] = await Promise.all([ + multicall + .wrap(contract) + .asset() + .catch(() => ''), + multicall + .wrap(contract) + .convertToAssets(BigNumber.from((1e18).toString())) + .catch(() => 'Convert to assets failed'), + ]); + + // Find the underlying token in our dependencies. + // Note: If it is not found, then we have not indexed the underlying token, and we cannot + // index the Bath Token since its price depends on the underlying token price. + const underlyingTokenAddress = underlyingTokenAddressRaw.toLowerCase(); + const underlyingToken = allTokenDependencies.find(v => v.address === underlyingTokenAddress); + if (!underlyingToken) { + // console.log('No underlyingToken!', underlyingTokenAddress); + + return null; + } + const tokens = [underlyingToken]; + + // Denormalize the price per share + const pricePerShare = Number(ratioRaw) / 10 ** 18; + const price = pricePerShare * underlyingToken.price; + + // As a label, we'll use the underlying label (i.e.: 'WETH' or 'UNI-V2 WETH / ETH'), and suffix it with 'Jar' + const label = `bath${getLabelFromToken(underlyingToken)}`; + // For images, we'll use the underlying token images as well + const images = getImagesFromToken(underlyingToken); + // For the secondary label, we'll use the price of the Bath Token + const secondaryLabel = buildDollarDisplayItem(price); + + // Create the token object + const token: AppTokenPosition = { + type: ContractType.APP_TOKEN, + appId, + groupId, + address: btAddress, + network, + symbol, + decimals, + supply, + tokens, + price, + pricePerShare, + dataProps: {}, + displayProps: { + label, + images, + secondaryLabel, + }, + }; + + return token; + }), + ); + + return _.compact(tokens); + } +} diff --git a/src/apps/rubicon/rubicon.definition.ts b/src/apps/rubicon/rubicon.definition.ts new file mode 100644 index 000000000..a31561828 --- /dev/null +++ b/src/apps/rubicon/rubicon.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 RUBICON_DEFINITION = appDefinition({ + id: 'rubicon', + name: 'rubicon', + description: 'Rubicon is the order book exchange standard of Ethereum', + url: 'https://app.rubicon.finance', + + // https://studio.zapper.fi/docs/tutorial/update-app-definition#what-are-groups + groups: { + bathToken: { + id: 'bathToken', + type: GroupType.TOKEN, + label: 'Bath Tokens', + }, + }, + + tags: [ + AppTag.CROSS_CHAIN, + AppTag.DECENTRALIZED_EXCHANGE, + AppTag.INFRASTRUCTURE, + AppTag.LIQUIDITY_POOL, + AppTag.LIQUID_STAKING, + ], + + keywords: [], + links: {}, + + supportedNetworks: { + [Network.OPTIMISM_MAINNET]: [AppAction.VIEW], + }, + + primaryColor: '#fff', +}); + +@Register.AppDefinition(RUBICON_DEFINITION.id) +export class RubiconAppDefinition extends AppDefinition { + constructor() { + super(RUBICON_DEFINITION); + } +} + +export default RUBICON_DEFINITION; diff --git a/src/apps/rubicon/rubicon.module.ts b/src/apps/rubicon/rubicon.module.ts new file mode 100644 index 000000000..39874d351 --- /dev/null +++ b/src/apps/rubicon/rubicon.module.ts @@ -0,0 +1,18 @@ +import { Register } from '~app-toolkit/decorators'; +import { AbstractApp } from '~app/app.dynamic-module'; + +import { RubiconContractFactory } from './contracts'; +import { OptimismRubiconBalanceFetcher } from './optimism/rubicon.balance-fetcher'; +import { OptimismRubiconBathTokenTokenFetcher } from './optimism/rubicon.bath-token.token-fetcher'; +import { RubiconAppDefinition, RUBICON_DEFINITION } from './rubicon.definition'; + +@Register.AppModule({ + appId: RUBICON_DEFINITION.id, + providers: [ + OptimismRubiconBalanceFetcher, + OptimismRubiconBathTokenTokenFetcher, + RubiconAppDefinition, + RubiconContractFactory, + ], +}) +export class RubiconAppModule extends AbstractApp() { }