diff --git a/package.json b/package.json index 799d1e1c..8ae60ad1 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "@graphql-mesh/store": "^0.9.20", "@graphql-mesh/types": "^0.91.14", "@graphql-mesh/utils": "^0.43.22", - "@railgun-community/shared-models": "^7.5.0", + "@railgun-community/shared-models": "git+https://github.com/Railgun-Community/shared-models.git#mattgle/ink-integration", "axios": "1.7.2", "custom-uniswap-v2-sdk": "^3.2.0", "ethers": "6.13.1", @@ -46,7 +46,7 @@ }, "devDependencies": { "@graphprotocol/client-cli": "^2.2.22", - "@railgun-community/wallet": "10.3.3", + "@railgun-community/wallet": "git+https://github.com/Railgun-Community/wallet.git#mattgle/ink-integration", "@typechain/ethers-v6": "^0.3.3", "@types/chai": "^4.3.4", "@types/chai-as-promised": "^7.1.5", diff --git a/src/abi/lido/LidoSTETH.json b/src/abi/lido/LidoSTETH.json new file mode 100644 index 00000000..fb7f7fb1 --- /dev/null +++ b/src/abi/lido/LidoSTETH.json @@ -0,0 +1,1600 @@ +[ + { + "constant": false, + "inputs": [], + "name": "resume", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "name", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "stop", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "hasInitialized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "STAKING_CONTROL_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_ethAmount", + "type": "uint256" + } + ], + "name": "getSharesByPooledEth", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isStakingPaused", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_script", + "type": "bytes" + } + ], + "name": "getEVMScriptExecutor", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_maxStakeLimit", + "type": "uint256" + }, + { + "name": "_stakeLimitIncreasePerBlock", + "type": "uint256" + } + ], + "name": "setStakingLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "RESUME_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_lidoLocator", + "type": "address" + }, + { + "name": "_eip712StETH", + "type": "address" + } + ], + "name": "finalizeUpgrade_v2", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "decimals", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getRecoveryVault", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalPooledEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_newDepositedValidators", + "type": "uint256" + } + ], + "name": "unsafeChangeDepositedValidators", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "PAUSE_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTreasury", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isStopped", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBufferedEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_lidoLocator", + "type": "address" + }, + { + "name": "_eip712StETH", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "receiveELRewards", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getWithdrawalCredentials", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getCurrentStakeLimit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getStakeLimitFullInfo", + "outputs": [ + { + "name": "isStakingPaused", + "type": "bool" + }, + { + "name": "isStakingLimitSet", + "type": "bool" + }, + { + "name": "currentStakeLimit", + "type": "uint256" + }, + { + "name": "maxStakeLimit", + "type": "uint256" + }, + { + "name": "maxStakeLimitGrowthBlocks", + "type": "uint256" + }, + { + "name": "prevStakeLimit", + "type": "uint256" + }, + { + "name": "prevStakeBlockNumber", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_sharesAmount", + "type": "uint256" + } + ], + "name": "transferSharesFrom", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "resumeStaking", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getFeeDistribution", + "outputs": [ + { + "name": "treasuryFeeBasisPoints", + "type": "uint16" + }, + { + "name": "insuranceFeeBasisPoints", + "type": "uint16" + }, + { + "name": "operatorsFeeBasisPoints", + "type": "uint16" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "receiveWithdrawals", + "outputs": [], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_sharesAmount", + "type": "uint256" + } + ], + "name": "getPooledEthByShares", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "token", + "type": "address" + } + ], + "name": "allowRecoverability", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "appId", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getOracle", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "name": "name", + "type": "string" + }, + { + "name": "version", + "type": "string" + }, + { + "name": "chainId", + "type": "uint256" + }, + { + "name": "verifyingContract", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getContractVersion", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getInitializationBlock", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_sharesAmount", + "type": "uint256" + } + ], + "name": "transferShares", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "symbol", + "outputs": [ + { + "name": "", + "type": "string" + } + ], + "payable": false, + "stateMutability": "pure", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getEIP712StETH", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "transferToVault", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_sender", + "type": "address" + }, + { + "name": "_role", + "type": "bytes32" + }, + { + "name": "_params", + "type": "uint256[]" + } + ], + "name": "canPerform", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_referral", + "type": "address" + } + ], + "name": "submit", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": true, + "stateMutability": "payable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_spender", + "type": "address" + }, + { + "name": "_subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getEVMScriptRegistry", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_recipient", + "type": "address" + }, + { + "name": "_amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_maxDepositsCount", + "type": "uint256" + }, + { + "name": "_stakingModuleId", + "type": "uint256" + }, + { + "name": "_depositCalldata", + "type": "bytes" + } + ], + "name": "deposit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBeaconStat", + "outputs": [ + { + "name": "depositedValidators", + "type": "uint256" + }, + { + "name": "beaconValidators", + "type": "uint256" + }, + { + "name": "beaconBalance", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "removeStakingLimit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_reportTimestamp", + "type": "uint256" + }, + { + "name": "_timeElapsed", + "type": "uint256" + }, + { + "name": "_clValidators", + "type": "uint256" + }, + { + "name": "_clBalance", + "type": "uint256" + }, + { + "name": "_withdrawalVaultBalance", + "type": "uint256" + }, + { + "name": "_elRewardsVaultBalance", + "type": "uint256" + }, + { + "name": "_sharesRequestedToBurn", + "type": "uint256" + }, + { + "name": "_withdrawalFinalizationBatches", + "type": "uint256[]" + }, + { + "name": "_simulatedShareRate", + "type": "uint256" + } + ], + "name": "handleOracleReport", + "outputs": [ + { + "name": "postRebaseAmounts", + "type": "uint256[4]" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getFee", + "outputs": [ + { + "name": "totalFee", + "type": "uint16" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "kernel", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalShares", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + }, + { + "name": "_value", + "type": "uint256" + }, + { + "name": "_deadline", + "type": "uint256" + }, + { + "name": "_v", + "type": "uint8" + }, + { + "name": "_r", + "type": "bytes32" + }, + { + "name": "_s", + "type": "bytes32" + } + ], + "name": "permit", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_owner", + "type": "address" + }, + { + "name": "_spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "isPetrified", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getLidoLocator", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "canDeposit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "STAKING_PAUSE_ROLE", + "outputs": [ + { + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getDepositableEther", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_account", + "type": "address" + } + ], + "name": "sharesOf", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [], + "name": "pauseStaking", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTotalELRewardsCollected", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "payable": true, + "stateMutability": "payable", + "type": "fallback" + }, + { + "anonymous": false, + "inputs": [], + "name": "StakingPaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "StakingResumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "maxStakeLimit", + "type": "uint256" + }, + { + "indexed": false, + "name": "stakeLimitIncreasePerBlock", + "type": "uint256" + } + ], + "name": "StakingLimitSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "StakingLimitRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "preCLValidators", + "type": "uint256" + }, + { + "indexed": false, + "name": "postCLValidators", + "type": "uint256" + } + ], + "name": "CLValidatorsUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "depositedValidators", + "type": "uint256" + } + ], + "name": "DepositedValidatorsChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "preCLBalance", + "type": "uint256" + }, + { + "indexed": false, + "name": "postCLBalance", + "type": "uint256" + }, + { + "indexed": false, + "name": "withdrawalsWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "name": "executionLayerRewardsWithdrawn", + "type": "uint256" + }, + { + "indexed": false, + "name": "postBufferedEther", + "type": "uint256" + } + ], + "name": "ETHDistributed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "reportTimestamp", + "type": "uint256" + }, + { + "indexed": false, + "name": "timeElapsed", + "type": "uint256" + }, + { + "indexed": false, + "name": "preTotalShares", + "type": "uint256" + }, + { + "indexed": false, + "name": "preTotalEther", + "type": "uint256" + }, + { + "indexed": false, + "name": "postTotalShares", + "type": "uint256" + }, + { + "indexed": false, + "name": "postTotalEther", + "type": "uint256" + }, + { + "indexed": false, + "name": "sharesMintedAsFees", + "type": "uint256" + } + ], + "name": "TokenRebased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "lidoLocator", + "type": "address" + } + ], + "name": "LidoLocatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "ELRewardsReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawalsReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "name": "referral", + "type": "address" + } + ], + "name": "Submitted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "Unbuffered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "executor", + "type": "address" + }, + { + "indexed": false, + "name": "script", + "type": "bytes" + }, + { + "indexed": false, + "name": "input", + "type": "bytes" + }, + { + "indexed": false, + "name": "returnData", + "type": "bytes" + } + ], + "name": "ScriptResult", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "vault", + "type": "address" + }, + { + "indexed": true, + "name": "token", + "type": "address" + }, + { + "indexed": false, + "name": "amount", + "type": "uint256" + } + ], + "name": "RecoverToVault", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "eip712StETH", + "type": "address" + } + ], + "name": "EIP712StETHInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "sharesValue", + "type": "uint256" + } + ], + "name": "TransferShares", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "account", + "type": "address" + }, + { + "indexed": false, + "name": "preRebaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "name": "postRebaseTokenAmount", + "type": "uint256" + }, + { + "indexed": false, + "name": "sharesAmount", + "type": "uint256" + } + ], + "name": "SharesBurnt", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Stopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Resumed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "from", + "type": "address" + }, + { + "indexed": true, + "name": "to", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "name": "version", + "type": "uint256" + } + ], + "name": "ContractVersionSet", + "type": "event" + } +] \ No newline at end of file diff --git a/src/abi/lido/LidoWSTETH.json b/src/abi/lido/LidoWSTETH.json new file mode 100644 index 00000000..a92820b2 --- /dev/null +++ b/src/abi/lido/LidoWSTETH.json @@ -0,0 +1,477 @@ +[ + { + "inputs": [ + { + "internalType": "contract IStETH", + "name": "_stETH", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [], + "name": "DOMAIN_SEPARATOR", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "subtractedValue", + "type": "uint256" + } + ], + "name": "decreaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_wstETHAmount", + "type": "uint256" + } + ], + "name": "getStETHByWstETH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_stETHAmount", + "type": "uint256" + } + ], + "name": "getWstETHByStETH", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "addedValue", + "type": "uint256" + } + ], + "name": "increaseAllowance", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "nonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "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": [], + "name": "stETH", + "outputs": [ + { + "internalType": "contract IStETH", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "stEthPerToken", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tokensPerStEth", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_wstETHAmount", + "type": "uint256" + } + ], + "name": "unwrap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_stETHAmount", + "type": "uint256" + } + ], + "name": "wrap", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file diff --git a/src/api/beefy/beefy-api.ts b/src/api/beefy/beefy-api.ts index e6eeceba..70fbd36f 100644 --- a/src/api/beefy/beefy-api.ts +++ b/src/api/beefy/beefy-api.ts @@ -103,6 +103,7 @@ export class BeefyAPI { return { network: 'polygon', chain: 'polygon' }; case NetworkName.Arbitrum: return { network: 'arbitrum', chain: 'arbitrum' }; + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.EthereumRopsten_DEPRECATED: case NetworkName.EthereumGoerli_DEPRECATED: case NetworkName.PolygonMumbai_DEPRECATED: diff --git a/src/api/uni-v2-like/uni-v2-like-sdk.ts b/src/api/uni-v2-like/uni-v2-like-sdk.ts index c79b3008..71cccabf 100644 --- a/src/api/uni-v2-like/uni-v2-like-sdk.ts +++ b/src/api/uni-v2-like/uni-v2-like-sdk.ts @@ -71,6 +71,7 @@ export class UniV2LikeSDK { case NetworkName.Arbitrum: factoryAddress = '0xc35DADB65012eC5796536bD9864eD8773aBc74C4'; break; + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.EthereumRopsten_DEPRECATED: case NetworkName.EthereumGoerli_DEPRECATED: case NetworkName.ArbitrumGoerli_DEPRECATED: @@ -125,6 +126,7 @@ export class UniV2LikeSDK { return '0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506'; case NetworkName.Arbitrum: return '0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506'; + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.EthereumRopsten_DEPRECATED: case NetworkName.EthereumGoerli_DEPRECATED: case NetworkName.ArbitrumGoerli_DEPRECATED: diff --git a/src/api/zero-x/zero-x-fetch.ts b/src/api/zero-x/zero-x-fetch.ts index 817c1c63..fc4ce4c6 100644 --- a/src/api/zero-x/zero-x-fetch.ts +++ b/src/api/zero-x/zero-x-fetch.ts @@ -21,6 +21,7 @@ export const zeroXApiSubdomain = (networkName: NetworkName): string => { return 'arbitrum.api'; case NetworkName.EthereumSepolia: return 'sepolia.api'; + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.Hardhat: case NetworkName.PolygonAmoy: case NetworkName.EthereumRopsten_DEPRECATED: diff --git a/src/contract/adapt/relay-adapt-contract.ts b/src/contract/adapt/relay-adapt-contract.ts index 1bb8edf7..3503cefb 100644 --- a/src/contract/adapt/relay-adapt-contract.ts +++ b/src/contract/adapt/relay-adapt-contract.ts @@ -75,4 +75,11 @@ export class RelayAdaptContract { }; return this.contract.transfer.populateTransaction([erc20Transfer]); } + + multicall( + requireSuccess: boolean, + calls: Array<{ to: string; data: string; value: bigint }>, + ): Promise { + return this.contract.multicall.populateTransaction(requireSuccess, calls); + } } diff --git a/src/contract/lido/index.ts b/src/contract/lido/index.ts new file mode 100644 index 00000000..92b6326c --- /dev/null +++ b/src/contract/lido/index.ts @@ -0,0 +1,2 @@ +export * from './lido-stETH-contract'; +export * from './lido-wstETH-contract'; diff --git a/src/contract/lido/lido-stETH-contract.ts b/src/contract/lido/lido-stETH-contract.ts new file mode 100644 index 00000000..1a0786da --- /dev/null +++ b/src/contract/lido/lido-stETH-contract.ts @@ -0,0 +1,29 @@ +import { Contract, ContractRunner } from 'ethers'; + +import { LidoSTETH } from 'typechain'; +import lidoSTETHAbi from '../../abi/lido/LidoSTETH.json'; + +export class LidoSTETHContract { + private readonly contract: LidoSTETH; + constructor(contractAddress: string, provider?: ContractRunner) { + this.contract = new Contract( + contractAddress, + lidoSTETHAbi, + provider, + ) as unknown as LidoSTETH; + } + + async submit(amount: bigint, referralAddress: string) { + const tx = await this.contract.submit.populateTransaction(referralAddress); + tx.value = amount; + return tx; + } + + balanceOf(address: string): Promise { + return this.contract.balanceOf(address); + } + + sharesOf(address: string): Promise { + return this.contract.sharesOf(address); + } +} diff --git a/src/contract/lido/lido-wstETH-contract.ts b/src/contract/lido/lido-wstETH-contract.ts new file mode 100644 index 00000000..5c08c655 --- /dev/null +++ b/src/contract/lido/lido-wstETH-contract.ts @@ -0,0 +1,26 @@ +import { Addressable, Contract, ContractRunner } from 'ethers'; +import { LidoWSTETH } from 'typechain'; +import lidoWSTETHAbi from '../../abi/lido/LidoWSTETH.json'; + +export class LidoWSTETHContract { + private readonly contract: LidoWSTETH; + constructor(contractAddress: string, provider?: ContractRunner) { + this.contract = new Contract( + contractAddress, + lidoWSTETHAbi, + provider, + ) as unknown as LidoWSTETH; + } + + wrap(amount: bigint) { + return this.contract.wrap.populateTransaction(amount); + } + + getWstETHByStETH(amount: bigint): Promise { + return this.contract.getWstETHByStETH(amount); + } + + balanceOf(address: Addressable | string): Promise { + return this.contract.balanceOf(address); + } +} diff --git a/src/graph/graph-cache/uni-v2-like-subgraph-cache.ts b/src/graph/graph-cache/uni-v2-like-subgraph-cache.ts index fb4c750e..a4154368 100644 --- a/src/graph/graph-cache/uni-v2-like-subgraph-cache.ts +++ b/src/graph/graph-cache/uni-v2-like-subgraph-cache.ts @@ -136,6 +136,7 @@ export class UniV2LikeSubgraphCache { SUSHI_V2_ARBITRUM_PAIRS, UniswapV2Fork.SushiSwap, ); + case NetworkName.Ink: // TODO-INK: Check if this is ok case NetworkName.EthereumSepolia: case NetworkName.Hardhat: case NetworkName.PolygonAmoy: diff --git a/src/graph/uni-v2-like-subgraph.ts b/src/graph/uni-v2-like-subgraph.ts index 62b81e41..6c9bc82d 100644 --- a/src/graph/uni-v2-like-subgraph.ts +++ b/src/graph/uni-v2-like-subgraph.ts @@ -1,8 +1,4 @@ -import { - NETWORK_CONFIG, - NetworkName, - isDefined, -} from '@railgun-community/shared-models'; +import { NetworkName, isDefined } from '@railgun-community/shared-models'; import { getMeshOptions, getSdk } from './graphql/.graphclient'; import { MeshInstance, getMesh } from '@graphql-mesh/runtime'; import { LiquidityV2Pool } from '../models/uni-v2-like'; @@ -146,6 +142,7 @@ export class UniV2LikeSubgraph { return 'sushiswap-v2-arbitrum'; case NetworkName.EthereumSepolia: case NetworkName.Hardhat: + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.PolygonAmoy: case NetworkName.EthereumRopsten_DEPRECATED: case NetworkName.EthereumGoerli_DEPRECATED: diff --git a/src/recipes/index.ts b/src/recipes/index.ts index 2ef0ad20..e256fe40 100644 --- a/src/recipes/index.ts +++ b/src/recipes/index.ts @@ -3,3 +3,4 @@ export * from './adapt'; export * from './swap'; export * from './liquidity'; export * from './vault'; +export * from './lido'; diff --git a/src/recipes/lido/__tests__/FORK-lido-stake-recipe.test.ts b/src/recipes/lido/__tests__/FORK-lido-stake-recipe.test.ts new file mode 100644 index 00000000..ae7a40b2 --- /dev/null +++ b/src/recipes/lido/__tests__/FORK-lido-stake-recipe.test.ts @@ -0,0 +1,117 @@ +import { LidoStakeRecipe } from '../lido-stake-recipe'; +import { RecipeERC20Info, RecipeInput } from '../../../models'; +import { + MOCK_RAILGUN_WALLET_ADDRESS, + MOCK_UNSHIELD_FEE_BASIS_POINTS, + MOCK_SHIELD_FEE_BASIS_POINTS, +} from '../../../test/mocks.test'; +import { NETWORK_CONFIG, NetworkName } from '@railgun-community/shared-models'; +import { expect } from 'chai'; +import { setRailgunFees } from '../../../init'; +import { + executeRecipeStepsAndAssertUnshieldBalances, + shouldSkipForkTest, +} from '../../../test/common.test'; +import { + getTestProvider, + getTestRailgunWallet, +} from '../../../test/shared.test'; +import { refreshBalances } from '@railgun-community/wallet'; +import { LidoWSTETHContract, LidoSTETHContract } from '../../../contract/lido'; + +const networkName = NetworkName.Ethereum; +const STETH_TOKEN_INFO: RecipeERC20Info = { + tokenAddress: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', + decimals: 18n, +}; + +const WSTETH_TOKEN_INFO: RecipeERC20Info = { + tokenAddress: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0', + decimals: 18n, + isBaseToken: false, +}; + +const baseTokenAddress = NETWORK_CONFIG[networkName].baseToken.wrappedAddress; + +describe('Stake ETH to get stETH and wrap it to wstETH', () => { + before(async function () { + this.timeout(100_000); + setRailgunFees( + networkName, + MOCK_SHIELD_FEE_BASIS_POINTS, + MOCK_UNSHIELD_FEE_BASIS_POINTS, + ); + + // @TODO syncing balance at the start of test doesn't reflect the balance, we have to resync it again + const railgunId = getTestRailgunWallet().id; + await refreshBalances(NETWORK_CONFIG[networkName].chain, [railgunId]); + }); + + it('[FORK] Should stake ETH to get stETH', async function () { + if (shouldSkipForkTest(networkName)) { + this.skip(); + return; + } + + const unshieldAmount = 10000n; + const recipeInput: RecipeInput = { + railgunAddress: MOCK_RAILGUN_WALLET_ADDRESS, + networkName: networkName, + erc20Amounts: [ + { + tokenAddress: baseTokenAddress, + decimals: 18n, + amount: unshieldAmount, + }, + ], + nfts: [], + }; + + const provider = getTestProvider(); + + const recipe = new LidoStakeRecipe( + STETH_TOKEN_INFO, + WSTETH_TOKEN_INFO, + provider, + ); + const recipeOutput = await recipe.getRecipeOutput(recipeInput); + + const { proxyContract: railgun, relayAdaptContract } = + NETWORK_CONFIG[networkName]; + const wstETHContract = new LidoWSTETHContract( + WSTETH_TOKEN_INFO.tokenAddress, + provider, + ); + const railgunPrevBalance = await wstETHContract.balanceOf(railgun); + + await executeRecipeStepsAndAssertUnshieldBalances( + recipe.config.name, + recipeInput, + recipeOutput, + true, + ); + + const stETHContract = new LidoSTETHContract( + STETH_TOKEN_INFO.tokenAddress, + provider, + ); + + const stETHBalance = await stETHContract.balanceOf(relayAdaptContract); + expect(stETHBalance).equal(0n); + + const stETHShares = await stETHContract.sharesOf(relayAdaptContract); + expect(stETHShares).equal(0n); + + const railgunPostBalance = await wstETHContract.balanceOf(railgun); + const railgunBalance = railgunPostBalance - railgunPrevBalance; + + const unshieldFee = 25n; + const amountMinusUnshieldFee = unshieldAmount - unshieldFee; // Unshield fee + const shieldFee = 20n; + + const expectedBalance = await wstETHContract.getWstETHByStETH( + amountMinusUnshieldFee, + ); + expect(expectedBalance - shieldFee).equals(railgunBalance); + }).timeout(100_000); +}); diff --git a/src/recipes/lido/__tests__/FORK-lido-stake-shortcut-recipe.test.ts b/src/recipes/lido/__tests__/FORK-lido-stake-shortcut-recipe.test.ts new file mode 100644 index 00000000..b703b3c7 --- /dev/null +++ b/src/recipes/lido/__tests__/FORK-lido-stake-shortcut-recipe.test.ts @@ -0,0 +1,94 @@ +import { RecipeERC20Info, RecipeInput } from '../../../models'; +import { + MOCK_RAILGUN_WALLET_ADDRESS, + MOCK_UNSHIELD_FEE_BASIS_POINTS, + MOCK_SHIELD_FEE_BASIS_POINTS, +} from '../../../test/mocks.test'; +import { NETWORK_CONFIG, NetworkName } from '@railgun-community/shared-models'; +import { setRailgunFees } from '../../../init'; +import { + executeRecipeStepsAndAssertUnshieldBalances, + shouldSkipForkTest, +} from '../../../test/common.test'; +import { + getTestProvider, + getTestRailgunWallet, +} from '../../../test/shared.test'; +import { refreshBalances } from '@railgun-community/wallet'; +import { LidoStakeShortcutRecipe } from '../lido-stake-shortcut-recipe'; +import { LidoWSTETHContract } from '../../../contract/lido'; +import { expect } from 'chai'; + +const networkName = NetworkName.Ethereum; +const WSTETH_TOKEN_INFO: RecipeERC20Info = { + tokenAddress: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0', + decimals: 18n, + isBaseToken: false, +}; + +const tokenAddress = NETWORK_CONFIG[networkName].baseToken.wrappedAddress; + +describe('Lido Liquid Staking', () => { + before(async function () { + this.timeout(1_000_000); + + setRailgunFees( + networkName, + MOCK_SHIELD_FEE_BASIS_POINTS, + MOCK_UNSHIELD_FEE_BASIS_POINTS, + ); + const railgunId = getTestRailgunWallet().id; + await refreshBalances(NETWORK_CONFIG[networkName].chain, [railgunId]); + }); + + it('Should directly stake ETH to get wstETH', async function () { + if (shouldSkipForkTest(networkName)) { + this.skip(); + return; + } + + const unshieldAmount = 10000n; + const recipeInput: RecipeInput = { + railgunAddress: MOCK_RAILGUN_WALLET_ADDRESS, + networkName: networkName, + erc20Amounts: [ + { + tokenAddress, + decimals: 18n, + amount: unshieldAmount, + isBaseToken: false, + }, + ], + nfts: [], + }; + + const provider = getTestProvider(); + const recipe = new LidoStakeShortcutRecipe(WSTETH_TOKEN_INFO, provider); + + const { proxyContract: railgun } = NETWORK_CONFIG[networkName]; + const wstETHContract = new LidoWSTETHContract( + WSTETH_TOKEN_INFO.tokenAddress, + provider, + ); + const railgunPrevBalance = await wstETHContract.balanceOf(railgun); + + const recipeOutput = await recipe.getRecipeOutput(recipeInput); + await executeRecipeStepsAndAssertUnshieldBalances( + recipe.config.name, + recipeInput, + recipeOutput, + true, + ); + + const railgunPostBalance = await wstETHContract.balanceOf(railgun); + const railgunBalance = railgunPostBalance - railgunPrevBalance; + + const unshieldFee = 25n; + const amountMinusFee = unshieldAmount - unshieldFee; + const expectedBalance = await wstETHContract.getWstETHByStETH( + amountMinusFee, + ); + const shieldFee = 20n; + expect(expectedBalance - shieldFee).equals(railgunBalance); + }).timeout(1_000_000); +}); diff --git a/src/recipes/lido/index.ts b/src/recipes/lido/index.ts new file mode 100644 index 00000000..67fd6ddd --- /dev/null +++ b/src/recipes/lido/index.ts @@ -0,0 +1,2 @@ +export * from './lido-stake-recipe'; +export * from './lido-stake-shortcut-recipe'; diff --git a/src/recipes/lido/lido-stake-recipe.ts b/src/recipes/lido/lido-stake-recipe.ts new file mode 100644 index 00000000..d0986ede --- /dev/null +++ b/src/recipes/lido/lido-stake-recipe.ts @@ -0,0 +1,65 @@ +import { NetworkName } from '@railgun-community/shared-models'; +import { RecipeConfig, RecipeERC20Info, StepInput } from 'models'; +import { Recipe } from '../recipe'; +import { + ApproveERC20SpenderStep, + Step, + UnwrapBaseTokenStep, +} from '../../steps'; +import { LidoStakeStep, LidoWrapSTETHStep } from '../../steps/lido'; +import { Provider } from 'ethers'; + +const MIN_GAS_LIMIT_LIDO_STAKING = 2_400_000n; + +export class LidoStakeRecipe extends Recipe { + readonly config: RecipeConfig = { + name: 'Lido Staking Recipe', + description: 'Stake Eth to Get stETH and wrap it to wstETH', + minGasLimit: MIN_GAS_LIMIT_LIDO_STAKING, + }; + + private stETHTokenInfo: RecipeERC20Info; + private wstETHTokenInfo: RecipeERC20Info; + private provider: Provider; + + constructor( + stETHTokenInfo: RecipeERC20Info, + wstETHTokenInfo: RecipeERC20Info, + provider: Provider, + ) { + super(); + this.stETHTokenInfo = stETHTokenInfo; + this.wstETHTokenInfo = wstETHTokenInfo; + this.provider = provider; + } + + protected supportsNetwork(networkName: NetworkName): boolean { + switch (networkName) { + case NetworkName.Ethereum: + case NetworkName.EthereumSepolia: + return true; + default: + return false; + } + } + + protected async getInternalSteps( + firstInternalStepInput: StepInput, + ): Promise { + const steps: Step[] = [ + new UnwrapBaseTokenStep(), // WETH => ETH + new LidoStakeStep(this.stETHTokenInfo), // ETH => stETH + new ApproveERC20SpenderStep( + this.wstETHTokenInfo.tokenAddress, + this.stETHTokenInfo, + ), // approve wstETH to wrap stETH + new LidoWrapSTETHStep( + this.wstETHTokenInfo, + this.stETHTokenInfo, + this.provider, + ), // wrap stETH to wstETH + ]; + + return steps; + } +} diff --git a/src/recipes/lido/lido-stake-shortcut-recipe.ts b/src/recipes/lido/lido-stake-shortcut-recipe.ts new file mode 100644 index 00000000..7d2ed7af --- /dev/null +++ b/src/recipes/lido/lido-stake-shortcut-recipe.ts @@ -0,0 +1,45 @@ +import { NetworkName } from '@railgun-community/shared-models'; +import { RecipeConfig, RecipeERC20Info, StepInput } from 'models'; +import { Recipe } from '../recipe'; +import { Step, UnwrapBaseTokenStep } from '../../steps'; +import { LidoStakeShortcutStep } from '../../steps/lido'; +import { Provider } from 'ethers'; + +const MIN_GAS_LIMIT_LIDO_STAKING = 2_400_000n; + +export class LidoStakeShortcutRecipe extends Recipe { + readonly config: RecipeConfig = { + name: 'Lido Staking Shortcut Recipe', + description: 'Stake Eth to Get wstETH', + minGasLimit: MIN_GAS_LIMIT_LIDO_STAKING, + }; + + private wstETHTokenInfo: RecipeERC20Info; + private provider: Provider; + constructor(wstETHTokenInfo: RecipeERC20Info, provider: Provider) { + super(); + this.wstETHTokenInfo = wstETHTokenInfo; + this.provider = provider; + } + + protected supportsNetwork(networkName: NetworkName): boolean { + switch (networkName) { + case NetworkName.Ethereum: + case NetworkName.EthereumSepolia: + return true; + default: + return false; + } + } + + protected async getInternalSteps( + firstInternalStepInput: StepInput, + ): Promise { + const steps: Step[] = [ + new UnwrapBaseTokenStep(), // WETH => ETH + new LidoStakeShortcutStep(this.wstETHTokenInfo, this.provider), // ETH => wstETH + ]; + + return steps; + } +} diff --git a/src/steps/lido/__tests__/lido-stake-step.test.ts b/src/steps/lido/__tests__/lido-stake-step.test.ts new file mode 100644 index 00000000..052aeb63 --- /dev/null +++ b/src/steps/lido/__tests__/lido-stake-step.test.ts @@ -0,0 +1,55 @@ +import { NetworkName } from '@railgun-community/shared-models'; +import { LidoStakeStep } from '../lido-stake-step'; +import { RecipeERC20Info, StepInput } from '../../../models'; +import { expect } from 'chai'; +import { NETWORK_CONFIG } from '@railgun-community/shared-models'; + +const STETH_TOKEN: RecipeERC20Info = { + tokenAddress: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', + decimals: 18n, +}; +const networkName = NetworkName.Ethereum; +const tokenAddress = + NETWORK_CONFIG[NetworkName.Ethereum].baseToken.wrappedAddress; + +const amount = 10000n; + +const stepInput: StepInput = { + networkName, + erc20Amounts: [ + { + tokenAddress, + decimals: 18n, + isBaseToken: true, + expectedBalance: 10000n, + minBalance: 10000n, + approvedSpender: undefined, + }, + ], + nfts: [], +}; + +describe('lido staking step', () => { + it('Should stake ETH and get stETH', async () => { + const step = new LidoStakeStep(STETH_TOKEN); + const output = await step.getValidStepOutput(stepInput); + + expect(output.spentERC20Amounts).to.deep.equals([ + { + amount, + isBaseToken: true, + recipient: 'Lido', + tokenAddress, + decimals: 18n, + }, + ]); + + expect(output.outputERC20Amounts[0]).to.deep.equal({ + approvedSpender: undefined, + expectedBalance: amount, + minBalance: amount, + tokenAddress: STETH_TOKEN.tokenAddress, + decimals: 18n, + }); + }); +}); diff --git a/src/steps/lido/index.ts b/src/steps/lido/index.ts new file mode 100644 index 00000000..61deb35a --- /dev/null +++ b/src/steps/lido/index.ts @@ -0,0 +1,3 @@ +export * from './lido-stake-step'; +export * from './lido-wrap-steth-step'; +export * from './lido-stake-shortcut-step'; diff --git a/src/steps/lido/lido-stake-shortcut-step.ts b/src/steps/lido/lido-stake-shortcut-step.ts new file mode 100644 index 00000000..1d3a0395 --- /dev/null +++ b/src/steps/lido/lido-stake-shortcut-step.ts @@ -0,0 +1,84 @@ +import { RelayAdaptContract } from '../../contract/adapt/relay-adapt-contract'; +import { + RecipeERC20AmountRecipient, + RecipeERC20Info, + StepConfig, + StepInput, + StepOutputERC20Amount, + UnvalidatedStepOutput, +} from '../../models/export-models'; +import { compareERC20Info } from '../../utils/token'; +import { Step } from '../step'; +import { getBaseToken } from '../../utils/wrap-util'; +import { ContractTransaction } from 'ethers'; +import { LidoWSTETHContract } from '../../contract/lido'; +import { Provider } from 'ethers'; + +export class LidoStakeShortcutStep extends Step { + readonly config: StepConfig = { + name: 'Lido Staking [wstETH]', + description: 'Stake ETH to get wstETH', + }; + + private provider: Provider; + + constructor(private wstETHTokenInfo: RecipeERC20Info, provider: Provider) { + super(); + this.provider = provider; + } + + private getWrappedAmount(stakeAmount: bigint): Promise { + const wstETHContract = new LidoWSTETHContract( + this.wstETHTokenInfo.tokenAddress, + this.provider, + ); + return wstETHContract.getWstETHByStETH(stakeAmount); + } + + protected async getStepOutput( + input: StepInput, + ): Promise { + const { networkName, erc20Amounts } = input; + + const baseToken = getBaseToken(networkName); + const { erc20AmountForStep, unusedERC20Amounts } = + this.getValidInputERC20Amount( + erc20Amounts, + erc20Amount => compareERC20Info(erc20Amount, baseToken), + undefined, + ); + + const amount = erc20AmountForStep.expectedBalance; + const contract = new RelayAdaptContract(input.networkName); + const crossContractCalls: ContractTransaction[] = [ + await contract.multicall(false, [ + { + to: this.wstETHTokenInfo.tokenAddress, + data: '0x', + value: amount, + }, + ]), + ]; + + const transferredBaseToken: RecipeERC20AmountRecipient = { + ...baseToken, + amount, + recipient: this.wstETHTokenInfo.tokenAddress, + }; + + const wrappedAmount = await this.getWrappedAmount(amount); + const outputWSTETHToken: StepOutputERC20Amount = { + ...this.wstETHTokenInfo, + expectedBalance: wrappedAmount, + minBalance: wrappedAmount, + approvedSpender: undefined, + }; + + return { + crossContractCalls, + spentERC20Amounts: [transferredBaseToken], + outputERC20Amounts: [outputWSTETHToken, ...unusedERC20Amounts], + outputNFTs: input.nfts, + }; + } +} diff --git a/src/steps/lido/lido-stake-step.ts b/src/steps/lido/lido-stake-step.ts new file mode 100644 index 00000000..266635d9 --- /dev/null +++ b/src/steps/lido/lido-stake-step.ts @@ -0,0 +1,64 @@ +import { ZeroAddress } from 'ethers'; +import { + RecipeERC20AmountRecipient, + RecipeERC20Info, + StepConfig, + StepInput, + StepOutputERC20Amount, + UnvalidatedStepOutput, +} from 'models'; +import { Step } from '../../steps/step'; +import { compareERC20Info, getBaseToken } from '../../utils'; +import { LidoSTETHContract } from '../../contract/lido'; + +export class LidoStakeStep extends Step { + readonly config: StepConfig = { + name: 'Lido Staking [stETH]', + description: 'Stake ETH to get stETH', + hasNonDeterministicOutput: false, + }; + + readonly stETHTokenInfo: RecipeERC20Info; + + constructor(stETHTokenInfo: RecipeERC20Info) { + super(); + this.stETHTokenInfo = stETHTokenInfo; + } + + protected async getStepOutput( + input: StepInput, + ): Promise { + const { erc20Amounts, networkName } = input; + const baseToken = getBaseToken(networkName); + const { erc20AmountForStep, unusedERC20Amounts } = + this.getValidInputERC20Amount( + erc20Amounts, + erc20Amount => compareERC20Info(erc20Amount, baseToken), + undefined, + ); + + const amount = erc20AmountForStep.minBalance; + const stakedBaseToken: RecipeERC20AmountRecipient = { + ...baseToken, + amount, + recipient: 'Lido', + }; + + const stETHTokenAmount: StepOutputERC20Amount = { + ...this.stETHTokenInfo, + expectedBalance: amount, + minBalance: amount, + approvedSpender: undefined, + }; + + const stEthContract = new LidoSTETHContract(stETHTokenAmount.tokenAddress); + const crossContractCall = await stEthContract.submit(amount, ZeroAddress); + + return { + crossContractCalls: [crossContractCall], + spentERC20Amounts: [stakedBaseToken], + outputERC20Amounts: [stETHTokenAmount, ...unusedERC20Amounts], + outputNFTs: input.nfts, + }; + } +} diff --git a/src/steps/lido/lido-wrap-steth-step.ts b/src/steps/lido/lido-wrap-steth-step.ts new file mode 100644 index 00000000..8fe19241 --- /dev/null +++ b/src/steps/lido/lido-wrap-steth-step.ts @@ -0,0 +1,83 @@ +import { + RecipeERC20AmountRecipient, + StepConfig, + StepInput, + StepOutputERC20Amount, + UnvalidatedStepOutput, + RecipeERC20Info, +} from '../../models'; +import { Step } from '../../steps/step'; +import { compareERC20Info } from '../../utils'; +import { LidoWSTETHContract } from '../../contract/lido'; +import { Provider } from 'ethers'; + +export class LidoWrapSTETHStep extends Step { + readonly config: StepConfig = { + name: 'Lido Wrap stETH', + description: 'Wrap stETH to wstETH', + hasNonDeterministicOutput: false, + }; + + readonly wstETHTokenInfo: RecipeERC20Info; + readonly stETHTokenInfo: RecipeERC20Info; + private provider: Provider; + + constructor( + wstETHTokenInfo: RecipeERC20Info, + stETHTokenInfo: RecipeERC20Info, + provider: Provider, + ) { + super(); + this.wstETHTokenInfo = wstETHTokenInfo; + this.stETHTokenInfo = stETHTokenInfo; + this.provider = provider; + } + + private getWrapAmount(stakeAmount: bigint): Promise { + const wstETHContract = new LidoWSTETHContract( + this.wstETHTokenInfo.tokenAddress, + this.provider, + ); + return wstETHContract.getWstETHByStETH(stakeAmount); + } + + protected async getStepOutput( + input: StepInput, + ): Promise { + const { erc20Amounts } = input; + const { erc20AmountForStep, unusedERC20Amounts } = + this.getValidInputERC20Amount( + erc20Amounts, + erc20Amount => compareERC20Info(erc20Amount, this.stETHTokenInfo), + undefined, + ); + + const wrapAmount = erc20AmountForStep.minBalance; + + const spentTokenAmount: RecipeERC20AmountRecipient = { + ...this.stETHTokenInfo, + amount: wrapAmount, + recipient: this.wstETHTokenInfo.tokenAddress, + }; + + const wrappedAmount = await this.getWrapAmount(wrapAmount); + const wrappedTokenAmount: StepOutputERC20Amount = { + ...this.wstETHTokenInfo, + expectedBalance: wrappedAmount, + minBalance: wrappedAmount, + approvedSpender: undefined, + }; + + const wstethContract = new LidoWSTETHContract( + this.wstETHTokenInfo.tokenAddress, + ); + const crossContractCall = await wstethContract.wrap(wrapAmount); + + return { + crossContractCalls: [crossContractCall], + spentERC20Amounts: [spentTokenAmount], + outputERC20Amounts: [wrappedTokenAmount, ...unusedERC20Amounts], + outputNFTs: input.nfts, + }; + } +} diff --git a/src/steps/token/erc20/approve-erc20-spender-step.ts b/src/steps/token/erc20/approve-erc20-spender-step.ts index bb753dc3..01b8a1ee 100644 --- a/src/steps/token/erc20/approve-erc20-spender-step.ts +++ b/src/steps/token/erc20/approve-erc20-spender-step.ts @@ -113,6 +113,7 @@ export class ApproveERC20SpenderStep extends Step { case NetworkName.BNBChain: case NetworkName.Polygon: case NetworkName.Arbitrum: + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.EthereumSepolia: case NetworkName.Hardhat: case NetworkName.PolygonAmoy: diff --git a/src/test/common.test.ts b/src/test/common.test.ts index 69a54cb3..2c981b4f 100644 --- a/src/test/common.test.ts +++ b/src/test/common.test.ts @@ -6,7 +6,6 @@ import { NETWORK_CONFIG, NetworkName, TXIDVersion, - TransactionReceiptLog, delay, isDefined, } from '@railgun-community/shared-models'; @@ -43,6 +42,7 @@ export const getRPCPort = (networkName: NetworkName) => { return 8600; case NetworkName.Arbitrum: return 8601; + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.BNBChain: case NetworkName.Polygon: case NetworkName.Hardhat: diff --git a/src/test/setup.test.ts b/src/test/setup.test.ts index 86e7790c..f8f89f38 100644 --- a/src/test/setup.test.ts +++ b/src/test/setup.test.ts @@ -46,6 +46,7 @@ const getTestERC20Addresses = (networkName: NetworkName): string[] => { ]; case NetworkName.Arbitrum: return [testConfig.contractsArbitrum.dai]; + case NetworkName.Ink: // TODO-INK: Check if this is correct case NetworkName.BNBChain: case NetworkName.Polygon: case NetworkName.EthereumSepolia: @@ -67,7 +68,7 @@ export const setupForkTests = async () => { try { const networkName = getForkTestNetworkName(); const txidVersion = TXIDVersion.V2_PoseidonMerkle; - + if (!Object.keys(NetworkName).includes(networkName)) { throw new Error( `Unrecognized network name, expected one of list: ${getSupportedNetworkNamesForTest().join( @@ -75,21 +76,21 @@ export const setupForkTests = async () => { )}`, ); } - + const tokenAddresses: string[] = getTestERC20Addresses(networkName); const testChain: Chain = { id: 1, type: 0 }; - + const forkRPCType = isDefined(process.env.USE_GANACHE) ? ForkRPCType.Ganache : isDefined(process.env.USE_HARDHAT) ? ForkRPCType.Hardhat : ForkRPCType.Anvil; - + // Ganache forked Ethereum RPC setup await setupTestRPCAndWallets(forkRPCType, networkName, tokenAddresses); // Quickstart setup await startRailgunForTests(); - + await loadLocalhostFallbackProviderForTests(networkName); void refreshBalances(testChain, undefined); @@ -101,11 +102,15 @@ export const setupForkTests = async () => { await createRailgunWallet2ForTests(); // Shield tokens for tests await shieldAllTokensForTests(networkName, tokenAddresses); - + // Make sure shielded balances are updated - await waitForShieldedTokenBalances(txidVersion, networkName, tokenAddresses); - } catch(error) { - console.error("Setup Fork tests error: ", error); + await waitForShieldedTokenBalances( + txidVersion, + networkName, + tokenAddresses, + ); + } catch (error) { + console.error('Setup Fork tests error: ', error); throw error; } }; diff --git a/src/typechain/factories/index.ts b/src/typechain/factories/index.ts index 8728e9e5..0e7e8ad6 100644 --- a/src/typechain/factories/index.ts +++ b/src/typechain/factories/index.ts @@ -2,6 +2,7 @@ /* tslint:disable */ /* eslint-disable */ export * as adapt from "./adapt"; +export * as lido from "./lido"; export * as liquidity from "./liquidity"; export * as token from "./token"; export * as vault from "./vault"; diff --git a/src/typechain/factories/lido/LidoSTETH__factory.ts b/src/typechain/factories/lido/LidoSTETH__factory.ts new file mode 100644 index 00000000..14429c88 --- /dev/null +++ b/src/typechain/factories/lido/LidoSTETH__factory.ts @@ -0,0 +1,1617 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { LidoSTETH, LidoSTETHInterface } from "../../lido/LidoSTETH"; + +const _abi = [ + { + constant: false, + inputs: [], + name: "resume", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "name", + outputs: [ + { + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "pure", + type: "function", + }, + { + constant: false, + inputs: [], + name: "stop", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "hasInitialized", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "STAKING_CONTROL_ROLE", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "totalSupply", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_ethAmount", + type: "uint256", + }, + ], + name: "getSharesByPooledEth", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isStakingPaused", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_sender", + type: "address", + }, + { + name: "_recipient", + type: "address", + }, + { + name: "_amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_script", + type: "bytes", + }, + ], + name: "getEVMScriptExecutor", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_maxStakeLimit", + type: "uint256", + }, + { + name: "_stakeLimitIncreasePerBlock", + type: "uint256", + }, + ], + name: "setStakingLimit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "RESUME_ROLE", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_lidoLocator", + type: "address", + }, + { + name: "_eip712StETH", + type: "address", + }, + ], + name: "finalizeUpgrade_v2", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "decimals", + outputs: [ + { + name: "", + type: "uint8", + }, + ], + payable: false, + stateMutability: "pure", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getRecoveryVault", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getTotalPooledEther", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_newDepositedValidators", + type: "uint256", + }, + ], + name: "unsafeChangeDepositedValidators", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "PAUSE_ROLE", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getTreasury", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isStopped", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getBufferedEther", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_lidoLocator", + type: "address", + }, + { + name: "_eip712StETH", + type: "address", + }, + ], + name: "initialize", + outputs: [], + payable: true, + stateMutability: "payable", + type: "function", + }, + { + constant: false, + inputs: [], + name: "receiveELRewards", + outputs: [], + payable: true, + stateMutability: "payable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getWithdrawalCredentials", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getCurrentStakeLimit", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getStakeLimitFullInfo", + outputs: [ + { + name: "isStakingPaused", + type: "bool", + }, + { + name: "isStakingLimitSet", + type: "bool", + }, + { + name: "currentStakeLimit", + type: "uint256", + }, + { + name: "maxStakeLimit", + type: "uint256", + }, + { + name: "maxStakeLimitGrowthBlocks", + type: "uint256", + }, + { + name: "prevStakeLimit", + type: "uint256", + }, + { + name: "prevStakeBlockNumber", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_sender", + type: "address", + }, + { + name: "_recipient", + type: "address", + }, + { + name: "_sharesAmount", + type: "uint256", + }, + ], + name: "transferSharesFrom", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "resumeStaking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getFeeDistribution", + outputs: [ + { + name: "treasuryFeeBasisPoints", + type: "uint16", + }, + { + name: "insuranceFeeBasisPoints", + type: "uint16", + }, + { + name: "operatorsFeeBasisPoints", + type: "uint16", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "receiveWithdrawals", + outputs: [], + payable: true, + stateMutability: "payable", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_sharesAmount", + type: "uint256", + }, + ], + name: "getPooledEthByShares", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "token", + type: "address", + }, + ], + name: "allowRecoverability", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "owner", + type: "address", + }, + ], + name: "nonces", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "appId", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getOracle", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "eip712Domain", + outputs: [ + { + name: "name", + type: "string", + }, + { + name: "version", + type: "string", + }, + { + name: "chainId", + type: "uint256", + }, + { + name: "verifyingContract", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getContractVersion", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getInitializationBlock", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_recipient", + type: "address", + }, + { + name: "_sharesAmount", + type: "uint256", + }, + ], + name: "transferShares", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "symbol", + outputs: [ + { + name: "", + type: "string", + }, + ], + payable: false, + stateMutability: "pure", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getEIP712StETH", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "", + type: "address", + }, + ], + name: "transferToVault", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_sender", + type: "address", + }, + { + name: "_role", + type: "bytes32", + }, + { + name: "_params", + type: "uint256[]", + }, + ], + name: "canPerform", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_referral", + type: "address", + }, + ], + name: "submit", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: true, + stateMutability: "payable", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_spender", + type: "address", + }, + { + name: "_subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getEVMScriptRegistry", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_recipient", + type: "address", + }, + { + name: "_amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_maxDepositsCount", + type: "uint256", + }, + { + name: "_stakingModuleId", + type: "uint256", + }, + { + name: "_depositCalldata", + type: "bytes", + }, + ], + name: "deposit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getBeaconStat", + outputs: [ + { + name: "depositedValidators", + type: "uint256", + }, + { + name: "beaconValidators", + type: "uint256", + }, + { + name: "beaconBalance", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "removeStakingLimit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_reportTimestamp", + type: "uint256", + }, + { + name: "_timeElapsed", + type: "uint256", + }, + { + name: "_clValidators", + type: "uint256", + }, + { + name: "_clBalance", + type: "uint256", + }, + { + name: "_withdrawalVaultBalance", + type: "uint256", + }, + { + name: "_elRewardsVaultBalance", + type: "uint256", + }, + { + name: "_sharesRequestedToBurn", + type: "uint256", + }, + { + name: "_withdrawalFinalizationBatches", + type: "uint256[]", + }, + { + name: "_simulatedShareRate", + type: "uint256", + }, + ], + name: "handleOracleReport", + outputs: [ + { + name: "postRebaseAmounts", + type: "uint256[4]", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getFee", + outputs: [ + { + name: "totalFee", + type: "uint16", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "kernel", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getTotalShares", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + name: "_owner", + type: "address", + }, + { + name: "_spender", + type: "address", + }, + { + name: "_value", + type: "uint256", + }, + { + name: "_deadline", + type: "uint256", + }, + { + name: "_v", + type: "uint8", + }, + { + name: "_r", + type: "bytes32", + }, + { + name: "_s", + type: "bytes32", + }, + ], + name: "permit", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_owner", + type: "address", + }, + { + name: "_spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isPetrified", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getLidoLocator", + outputs: [ + { + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "canDeposit", + outputs: [ + { + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "STAKING_PAUSE_ROLE", + outputs: [ + { + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getDepositableEther", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + name: "_account", + type: "address", + }, + ], + name: "sharesOf", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [], + name: "pauseStaking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "getTotalELRewardsCollected", + outputs: [ + { + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + payable: true, + stateMutability: "payable", + type: "fallback", + }, + { + anonymous: false, + inputs: [], + name: "StakingPaused", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "StakingResumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "maxStakeLimit", + type: "uint256", + }, + { + indexed: false, + name: "stakeLimitIncreasePerBlock", + type: "uint256", + }, + ], + name: "StakingLimitSet", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "StakingLimitRemoved", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "reportTimestamp", + type: "uint256", + }, + { + indexed: false, + name: "preCLValidators", + type: "uint256", + }, + { + indexed: false, + name: "postCLValidators", + type: "uint256", + }, + ], + name: "CLValidatorsUpdated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "depositedValidators", + type: "uint256", + }, + ], + name: "DepositedValidatorsChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "reportTimestamp", + type: "uint256", + }, + { + indexed: false, + name: "preCLBalance", + type: "uint256", + }, + { + indexed: false, + name: "postCLBalance", + type: "uint256", + }, + { + indexed: false, + name: "withdrawalsWithdrawn", + type: "uint256", + }, + { + indexed: false, + name: "executionLayerRewardsWithdrawn", + type: "uint256", + }, + { + indexed: false, + name: "postBufferedEther", + type: "uint256", + }, + ], + name: "ETHDistributed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "reportTimestamp", + type: "uint256", + }, + { + indexed: false, + name: "timeElapsed", + type: "uint256", + }, + { + indexed: false, + name: "preTotalShares", + type: "uint256", + }, + { + indexed: false, + name: "preTotalEther", + type: "uint256", + }, + { + indexed: false, + name: "postTotalShares", + type: "uint256", + }, + { + indexed: false, + name: "postTotalEther", + type: "uint256", + }, + { + indexed: false, + name: "sharesMintedAsFees", + type: "uint256", + }, + ], + name: "TokenRebased", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "lidoLocator", + type: "address", + }, + ], + name: "LidoLocatorSet", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "amount", + type: "uint256", + }, + ], + name: "ELRewardsReceived", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "amount", + type: "uint256", + }, + ], + name: "WithdrawalsReceived", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "sender", + type: "address", + }, + { + indexed: false, + name: "amount", + type: "uint256", + }, + { + indexed: false, + name: "referral", + type: "address", + }, + ], + name: "Submitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "amount", + type: "uint256", + }, + ], + name: "Unbuffered", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "executor", + type: "address", + }, + { + indexed: false, + name: "script", + type: "bytes", + }, + { + indexed: false, + name: "input", + type: "bytes", + }, + { + indexed: false, + name: "returnData", + type: "bytes", + }, + ], + name: "ScriptResult", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "vault", + type: "address", + }, + { + indexed: true, + name: "token", + type: "address", + }, + { + indexed: false, + name: "amount", + type: "uint256", + }, + ], + name: "RecoverToVault", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "eip712StETH", + type: "address", + }, + ], + name: "EIP712StETHInitialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "from", + type: "address", + }, + { + indexed: true, + name: "to", + type: "address", + }, + { + indexed: false, + name: "sharesValue", + type: "uint256", + }, + ], + name: "TransferShares", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "account", + type: "address", + }, + { + indexed: false, + name: "preRebaseTokenAmount", + type: "uint256", + }, + { + indexed: false, + name: "postRebaseTokenAmount", + type: "uint256", + }, + { + indexed: false, + name: "sharesAmount", + type: "uint256", + }, + ], + name: "SharesBurnt", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "Stopped", + type: "event", + }, + { + anonymous: false, + inputs: [], + name: "Resumed", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "from", + type: "address", + }, + { + indexed: true, + name: "to", + type: "address", + }, + { + indexed: false, + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + name: "owner", + type: "address", + }, + { + indexed: true, + name: "spender", + type: "address", + }, + { + indexed: false, + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + name: "version", + type: "uint256", + }, + ], + name: "ContractVersionSet", + type: "event", + }, +] as const; + +export class LidoSTETH__factory { + static readonly abi = _abi; + static createInterface(): LidoSTETHInterface { + return new Interface(_abi) as LidoSTETHInterface; + } + static connect(address: string, runner?: ContractRunner | null): LidoSTETH { + return new Contract(address, _abi, runner) as unknown as LidoSTETH; + } +} diff --git a/src/typechain/factories/lido/LidoWSTETH__factory.ts b/src/typechain/factories/lido/LidoWSTETH__factory.ts new file mode 100644 index 00000000..37fb97cf --- /dev/null +++ b/src/typechain/factories/lido/LidoWSTETH__factory.ts @@ -0,0 +1,494 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { LidoWSTETH, LidoWSTETHInterface } from "../../lido/LidoWSTETH"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract IStETH", + name: "_stETH", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "Transfer", + type: "event", + }, + { + inputs: [], + name: "DOMAIN_SEPARATOR", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approve", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "subtractedValue", + type: "uint256", + }, + ], + name: "decreaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_wstETHAmount", + type: "uint256", + }, + ], + name: "getStETHByWstETH", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_stETHAmount", + type: "uint256", + }, + ], + name: "getWstETHByStETH", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + ], + name: "nonces", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "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: [], + name: "stETH", + outputs: [ + { + internalType: "contract IStETH", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stEthPerToken", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "tokensPerStEth", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_wstETHAmount", + type: "uint256", + }, + ], + name: "unwrap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_stETHAmount", + type: "uint256", + }, + ], + name: "wrap", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; + +export class LidoWSTETH__factory { + static readonly abi = _abi; + static createInterface(): LidoWSTETHInterface { + return new Interface(_abi) as LidoWSTETHInterface; + } + static connect(address: string, runner?: ContractRunner | null): LidoWSTETH { + return new Contract(address, _abi, runner) as unknown as LidoWSTETH; + } +} diff --git a/src/typechain/factories/lido/index.ts b/src/typechain/factories/lido/index.ts new file mode 100644 index 00000000..1c03dd37 --- /dev/null +++ b/src/typechain/factories/lido/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { LidoSTETH__factory } from "./LidoSTETH__factory"; +export { LidoWSTETH__factory } from "./LidoWSTETH__factory"; diff --git a/src/typechain/index.ts b/src/typechain/index.ts index b0a0e0bb..3c6175c9 100644 --- a/src/typechain/index.ts +++ b/src/typechain/index.ts @@ -3,6 +3,8 @@ /* eslint-disable */ import type * as adapt from "./adapt"; export type { adapt }; +import type * as lido from "./lido"; +export type { lido }; import type * as liquidity from "./liquidity"; export type { liquidity }; import type * as token from "./token"; @@ -12,6 +14,10 @@ export type { vault }; export * as factories from "./factories"; export type { RelayAdapt } from "./adapt/RelayAdapt"; export { RelayAdapt__factory } from "./factories/adapt/RelayAdapt__factory"; +export type { LidoSTETH } from "./lido/LidoSTETH"; +export { LidoSTETH__factory } from "./factories/lido/LidoSTETH__factory"; +export type { LidoWSTETH } from "./lido/LidoWSTETH"; +export { LidoWSTETH__factory } from "./factories/lido/LidoWSTETH__factory"; export type { UniV2LikeFactory } from "./liquidity/UniV2LikeFactory"; export { UniV2LikeFactory__factory } from "./factories/liquidity/UniV2LikeFactory__factory"; export type { UniV2LikePair } from "./liquidity/UniV2LikePair"; diff --git a/src/typechain/lido/LidoSTETH.ts b/src/typechain/lido/LidoSTETH.ts new file mode 100644 index 00000000..a4e643f5 --- /dev/null +++ b/src/typechain/lido/LidoSTETH.ts @@ -0,0 +1,2079 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export interface LidoSTETHInterface extends Interface { + getFunction( + nameOrSignature: + | "resume" + | "name" + | "stop" + | "hasInitialized" + | "approve" + | "STAKING_CONTROL_ROLE" + | "totalSupply" + | "getSharesByPooledEth" + | "isStakingPaused" + | "transferFrom" + | "getEVMScriptExecutor" + | "setStakingLimit" + | "RESUME_ROLE" + | "finalizeUpgrade_v2" + | "decimals" + | "getRecoveryVault" + | "DOMAIN_SEPARATOR" + | "getTotalPooledEther" + | "unsafeChangeDepositedValidators" + | "PAUSE_ROLE" + | "increaseAllowance" + | "getTreasury" + | "isStopped" + | "getBufferedEther" + | "initialize" + | "receiveELRewards" + | "getWithdrawalCredentials" + | "getCurrentStakeLimit" + | "getStakeLimitFullInfo" + | "transferSharesFrom" + | "balanceOf" + | "resumeStaking" + | "getFeeDistribution" + | "receiveWithdrawals" + | "getPooledEthByShares" + | "allowRecoverability" + | "nonces" + | "appId" + | "getOracle" + | "eip712Domain" + | "getContractVersion" + | "getInitializationBlock" + | "transferShares" + | "symbol" + | "getEIP712StETH" + | "transferToVault" + | "canPerform" + | "submit" + | "decreaseAllowance" + | "getEVMScriptRegistry" + | "transfer" + | "deposit" + | "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE" + | "getBeaconStat" + | "removeStakingLimit" + | "handleOracleReport" + | "getFee" + | "kernel" + | "getTotalShares" + | "permit" + | "allowance" + | "isPetrified" + | "getLidoLocator" + | "canDeposit" + | "STAKING_PAUSE_ROLE" + | "getDepositableEther" + | "sharesOf" + | "pauseStaking" + | "getTotalELRewardsCollected" + ): FunctionFragment; + + getEvent( + nameOrSignatureOrTopic: + | "StakingPaused" + | "StakingResumed" + | "StakingLimitSet" + | "StakingLimitRemoved" + | "CLValidatorsUpdated" + | "DepositedValidatorsChanged" + | "ETHDistributed" + | "TokenRebased" + | "LidoLocatorSet" + | "ELRewardsReceived" + | "WithdrawalsReceived" + | "Submitted" + | "Unbuffered" + | "ScriptResult" + | "RecoverToVault" + | "EIP712StETHInitialized" + | "TransferShares" + | "SharesBurnt" + | "Stopped" + | "Resumed" + | "Transfer" + | "Approval" + | "ContractVersionSet" + ): EventFragment; + + encodeFunctionData(functionFragment: "resume", values?: undefined): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "stop", values?: undefined): string; + encodeFunctionData( + functionFragment: "hasInitialized", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "STAKING_CONTROL_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getSharesByPooledEth", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "isStakingPaused", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getEVMScriptExecutor", + values: [BytesLike] + ): string; + encodeFunctionData( + functionFragment: "setStakingLimit", + values: [BigNumberish, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "RESUME_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "finalizeUpgrade_v2", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "getRecoveryVault", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getTotalPooledEther", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "unsafeChangeDepositedValidators", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "PAUSE_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getTreasury", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "isStopped", values?: undefined): string; + encodeFunctionData( + functionFragment: "getBufferedEther", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "receiveELRewards", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getWithdrawalCredentials", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getCurrentStakeLimit", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getStakeLimitFullInfo", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferSharesFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "resumeStaking", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getFeeDistribution", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "receiveWithdrawals", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getPooledEthByShares", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "allowRecoverability", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "appId", values?: undefined): string; + encodeFunctionData(functionFragment: "getOracle", values?: undefined): string; + encodeFunctionData( + functionFragment: "eip712Domain", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getContractVersion", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getInitializationBlock", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferShares", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "getEIP712StETH", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transferToVault", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "canPerform", + values: [AddressLike, BytesLike, BigNumberish[]] + ): string; + encodeFunctionData(functionFragment: "submit", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getEVMScriptRegistry", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "deposit", + values: [BigNumberish, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getBeaconStat", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "removeStakingLimit", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "handleOracleReport", + values: [ + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish[], + BigNumberish + ] + ): string; + encodeFunctionData(functionFragment: "getFee", values?: undefined): string; + encodeFunctionData(functionFragment: "kernel", values?: undefined): string; + encodeFunctionData( + functionFragment: "getTotalShares", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "permit", + values: [ + AddressLike, + AddressLike, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "isPetrified", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getLidoLocator", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "canDeposit", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "STAKING_PAUSE_ROLE", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getDepositableEther", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "sharesOf", + values: [AddressLike] + ): string; + encodeFunctionData( + functionFragment: "pauseStaking", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getTotalELRewardsCollected", + values?: undefined + ): string; + + decodeFunctionResult(functionFragment: "resume", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "stop", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "hasInitialized", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "STAKING_CONTROL_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getSharesByPooledEth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "isStakingPaused", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getEVMScriptExecutor", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setStakingLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "RESUME_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "finalizeUpgrade_v2", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getRecoveryVault", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getTotalPooledEther", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "unsafeChangeDepositedValidators", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "PAUSE_ROLE", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getTreasury", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isStopped", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getBufferedEther", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "receiveELRewards", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getWithdrawalCredentials", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getCurrentStakeLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getStakeLimitFullInfo", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferSharesFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "resumeStaking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getFeeDistribution", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "receiveWithdrawals", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPooledEthByShares", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "allowRecoverability", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "appId", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getOracle", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "eip712Domain", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getContractVersion", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getInitializationBlock", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferShares", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getEIP712StETH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferToVault", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "canPerform", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "submit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getEVMScriptRegistry", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "deposit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getBeaconStat", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "removeStakingLimit", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "handleOracleReport", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "getFee", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "kernel", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "getTotalShares", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isPetrified", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getLidoLocator", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "canDeposit", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "STAKING_PAUSE_ROLE", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getDepositableEther", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "sharesOf", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "pauseStaking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getTotalELRewardsCollected", + data: BytesLike + ): Result; +} + +export namespace StakingPausedEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace StakingResumedEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace StakingLimitSetEvent { + export type InputTuple = [ + maxStakeLimit: BigNumberish, + stakeLimitIncreasePerBlock: BigNumberish + ]; + export type OutputTuple = [ + maxStakeLimit: bigint, + stakeLimitIncreasePerBlock: bigint + ]; + export interface OutputObject { + maxStakeLimit: bigint; + stakeLimitIncreasePerBlock: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace StakingLimitRemovedEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace CLValidatorsUpdatedEvent { + export type InputTuple = [ + reportTimestamp: BigNumberish, + preCLValidators: BigNumberish, + postCLValidators: BigNumberish + ]; + export type OutputTuple = [ + reportTimestamp: bigint, + preCLValidators: bigint, + postCLValidators: bigint + ]; + export interface OutputObject { + reportTimestamp: bigint; + preCLValidators: bigint; + postCLValidators: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace DepositedValidatorsChangedEvent { + export type InputTuple = [depositedValidators: BigNumberish]; + export type OutputTuple = [depositedValidators: bigint]; + export interface OutputObject { + depositedValidators: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ETHDistributedEvent { + export type InputTuple = [ + reportTimestamp: BigNumberish, + preCLBalance: BigNumberish, + postCLBalance: BigNumberish, + withdrawalsWithdrawn: BigNumberish, + executionLayerRewardsWithdrawn: BigNumberish, + postBufferedEther: BigNumberish + ]; + export type OutputTuple = [ + reportTimestamp: bigint, + preCLBalance: bigint, + postCLBalance: bigint, + withdrawalsWithdrawn: bigint, + executionLayerRewardsWithdrawn: bigint, + postBufferedEther: bigint + ]; + export interface OutputObject { + reportTimestamp: bigint; + preCLBalance: bigint; + postCLBalance: bigint; + withdrawalsWithdrawn: bigint; + executionLayerRewardsWithdrawn: bigint; + postBufferedEther: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TokenRebasedEvent { + export type InputTuple = [ + reportTimestamp: BigNumberish, + timeElapsed: BigNumberish, + preTotalShares: BigNumberish, + preTotalEther: BigNumberish, + postTotalShares: BigNumberish, + postTotalEther: BigNumberish, + sharesMintedAsFees: BigNumberish + ]; + export type OutputTuple = [ + reportTimestamp: bigint, + timeElapsed: bigint, + preTotalShares: bigint, + preTotalEther: bigint, + postTotalShares: bigint, + postTotalEther: bigint, + sharesMintedAsFees: bigint + ]; + export interface OutputObject { + reportTimestamp: bigint; + timeElapsed: bigint; + preTotalShares: bigint; + preTotalEther: bigint; + postTotalShares: bigint; + postTotalEther: bigint; + sharesMintedAsFees: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace LidoLocatorSetEvent { + export type InputTuple = [lidoLocator: AddressLike]; + export type OutputTuple = [lidoLocator: string]; + export interface OutputObject { + lidoLocator: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ELRewardsReceivedEvent { + export type InputTuple = [amount: BigNumberish]; + export type OutputTuple = [amount: bigint]; + export interface OutputObject { + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace WithdrawalsReceivedEvent { + export type InputTuple = [amount: BigNumberish]; + export type OutputTuple = [amount: bigint]; + export interface OutputObject { + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SubmittedEvent { + export type InputTuple = [ + sender: AddressLike, + amount: BigNumberish, + referral: AddressLike + ]; + export type OutputTuple = [sender: string, amount: bigint, referral: string]; + export interface OutputObject { + sender: string; + amount: bigint; + referral: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace UnbufferedEvent { + export type InputTuple = [amount: BigNumberish]; + export type OutputTuple = [amount: bigint]; + export interface OutputObject { + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ScriptResultEvent { + export type InputTuple = [ + executor: AddressLike, + script: BytesLike, + input: BytesLike, + returnData: BytesLike + ]; + export type OutputTuple = [ + executor: string, + script: string, + input: string, + returnData: string + ]; + export interface OutputObject { + executor: string; + script: string; + input: string; + returnData: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace RecoverToVaultEvent { + export type InputTuple = [ + vault: AddressLike, + token: AddressLike, + amount: BigNumberish + ]; + export type OutputTuple = [vault: string, token: string, amount: bigint]; + export interface OutputObject { + vault: string; + token: string; + amount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace EIP712StETHInitializedEvent { + export type InputTuple = [eip712StETH: AddressLike]; + export type OutputTuple = [eip712StETH: string]; + export interface OutputObject { + eip712StETH: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TransferSharesEvent { + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + sharesValue: BigNumberish + ]; + export type OutputTuple = [from: string, to: string, sharesValue: bigint]; + export interface OutputObject { + from: string; + to: string; + sharesValue: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace SharesBurntEvent { + export type InputTuple = [ + account: AddressLike, + preRebaseTokenAmount: BigNumberish, + postRebaseTokenAmount: BigNumberish, + sharesAmount: BigNumberish + ]; + export type OutputTuple = [ + account: string, + preRebaseTokenAmount: bigint, + postRebaseTokenAmount: bigint, + sharesAmount: bigint + ]; + export interface OutputObject { + account: string; + preRebaseTokenAmount: bigint; + postRebaseTokenAmount: bigint; + sharesAmount: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace StoppedEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ResumedEvent { + export type InputTuple = []; + export type OutputTuple = []; + export interface OutputObject {} + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TransferEvent { + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + value: BigNumberish + ]; + export type OutputTuple = [from: string, to: string, value: bigint]; + export interface OutputObject { + from: string; + to: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ApprovalEvent { + export type InputTuple = [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish + ]; + export type OutputTuple = [owner: string, spender: string, value: bigint]; + export interface OutputObject { + owner: string; + spender: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace ContractVersionSetEvent { + export type InputTuple = [version: BigNumberish]; + export type OutputTuple = [version: bigint]; + export interface OutputObject { + version: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface LidoSTETH extends BaseContract { + connect(runner?: ContractRunner | null): BaseContract; + attach(addressOrName: AddressLike): this; + deployed(): Promise; + + interface: LidoSTETHInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + resume: TypedContractMethod<[], [void], "nonpayable">; + + name: TypedContractMethod<[], [string], "view">; + + stop: TypedContractMethod<[], [void], "nonpayable">; + + hasInitialized: TypedContractMethod<[], [boolean], "view">; + + approve: TypedContractMethod< + [_spender: AddressLike, _amount: BigNumberish], + [boolean], + "nonpayable" + >; + + STAKING_CONTROL_ROLE: TypedContractMethod<[], [string], "view">; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + getSharesByPooledEth: TypedContractMethod< + [_ethAmount: BigNumberish], + [bigint], + "view" + >; + + isStakingPaused: TypedContractMethod<[], [boolean], "view">; + + transferFrom: TypedContractMethod< + [_sender: AddressLike, _recipient: AddressLike, _amount: BigNumberish], + [boolean], + "nonpayable" + >; + + getEVMScriptExecutor: TypedContractMethod< + [_script: BytesLike], + [string], + "view" + >; + + setStakingLimit: TypedContractMethod< + [_maxStakeLimit: BigNumberish, _stakeLimitIncreasePerBlock: BigNumberish], + [void], + "nonpayable" + >; + + RESUME_ROLE: TypedContractMethod<[], [string], "view">; + + finalizeUpgrade_v2: TypedContractMethod< + [_lidoLocator: AddressLike, _eip712StETH: AddressLike], + [void], + "nonpayable" + >; + + decimals: TypedContractMethod<[], [bigint], "view">; + + getRecoveryVault: TypedContractMethod<[], [string], "view">; + + DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; + + getTotalPooledEther: TypedContractMethod<[], [bigint], "view">; + + unsafeChangeDepositedValidators: TypedContractMethod< + [_newDepositedValidators: BigNumberish], + [void], + "nonpayable" + >; + + PAUSE_ROLE: TypedContractMethod<[], [string], "view">; + + increaseAllowance: TypedContractMethod< + [_spender: AddressLike, _addedValue: BigNumberish], + [boolean], + "nonpayable" + >; + + getTreasury: TypedContractMethod<[], [string], "view">; + + isStopped: TypedContractMethod<[], [boolean], "view">; + + getBufferedEther: TypedContractMethod<[], [bigint], "view">; + + initialize: TypedContractMethod< + [_lidoLocator: AddressLike, _eip712StETH: AddressLike], + [void], + "payable" + >; + + receiveELRewards: TypedContractMethod<[], [void], "payable">; + + getWithdrawalCredentials: TypedContractMethod<[], [string], "view">; + + getCurrentStakeLimit: TypedContractMethod<[], [bigint], "view">; + + getStakeLimitFullInfo: TypedContractMethod< + [], + [ + [boolean, boolean, bigint, bigint, bigint, bigint, bigint] & { + isStakingPaused: boolean; + isStakingLimitSet: boolean; + currentStakeLimit: bigint; + maxStakeLimit: bigint; + maxStakeLimitGrowthBlocks: bigint; + prevStakeLimit: bigint; + prevStakeBlockNumber: bigint; + } + ], + "view" + >; + + transferSharesFrom: TypedContractMethod< + [ + _sender: AddressLike, + _recipient: AddressLike, + _sharesAmount: BigNumberish + ], + [bigint], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[_account: AddressLike], [bigint], "view">; + + resumeStaking: TypedContractMethod<[], [void], "nonpayable">; + + getFeeDistribution: TypedContractMethod< + [], + [ + [bigint, bigint, bigint] & { + treasuryFeeBasisPoints: bigint; + insuranceFeeBasisPoints: bigint; + operatorsFeeBasisPoints: bigint; + } + ], + "view" + >; + + receiveWithdrawals: TypedContractMethod<[], [void], "payable">; + + getPooledEthByShares: TypedContractMethod< + [_sharesAmount: BigNumberish], + [bigint], + "view" + >; + + allowRecoverability: TypedContractMethod< + [token: AddressLike], + [boolean], + "view" + >; + + nonces: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + appId: TypedContractMethod<[], [string], "view">; + + getOracle: TypedContractMethod<[], [string], "view">; + + eip712Domain: TypedContractMethod< + [], + [ + [string, string, bigint, string] & { + name: string; + version: string; + chainId: bigint; + verifyingContract: string; + } + ], + "view" + >; + + getContractVersion: TypedContractMethod<[], [bigint], "view">; + + getInitializationBlock: TypedContractMethod<[], [bigint], "view">; + + transferShares: TypedContractMethod< + [_recipient: AddressLike, _sharesAmount: BigNumberish], + [bigint], + "nonpayable" + >; + + symbol: TypedContractMethod<[], [string], "view">; + + getEIP712StETH: TypedContractMethod<[], [string], "view">; + + transferToVault: TypedContractMethod< + [arg0: AddressLike], + [void], + "nonpayable" + >; + + canPerform: TypedContractMethod< + [_sender: AddressLike, _role: BytesLike, _params: BigNumberish[]], + [boolean], + "view" + >; + + submit: TypedContractMethod<[_referral: AddressLike], [bigint], "payable">; + + decreaseAllowance: TypedContractMethod< + [_spender: AddressLike, _subtractedValue: BigNumberish], + [boolean], + "nonpayable" + >; + + getEVMScriptRegistry: TypedContractMethod<[], [string], "view">; + + transfer: TypedContractMethod< + [_recipient: AddressLike, _amount: BigNumberish], + [boolean], + "nonpayable" + >; + + deposit: TypedContractMethod< + [ + _maxDepositsCount: BigNumberish, + _stakingModuleId: BigNumberish, + _depositCalldata: BytesLike + ], + [void], + "nonpayable" + >; + + UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE: TypedContractMethod< + [], + [string], + "view" + >; + + getBeaconStat: TypedContractMethod< + [], + [ + [bigint, bigint, bigint] & { + depositedValidators: bigint; + beaconValidators: bigint; + beaconBalance: bigint; + } + ], + "view" + >; + + removeStakingLimit: TypedContractMethod<[], [void], "nonpayable">; + + handleOracleReport: TypedContractMethod< + [ + _reportTimestamp: BigNumberish, + _timeElapsed: BigNumberish, + _clValidators: BigNumberish, + _clBalance: BigNumberish, + _withdrawalVaultBalance: BigNumberish, + _elRewardsVaultBalance: BigNumberish, + _sharesRequestedToBurn: BigNumberish, + _withdrawalFinalizationBatches: BigNumberish[], + _simulatedShareRate: BigNumberish + ], + [[bigint, bigint, bigint, bigint]], + "nonpayable" + >; + + getFee: TypedContractMethod<[], [bigint], "view">; + + kernel: TypedContractMethod<[], [string], "view">; + + getTotalShares: TypedContractMethod<[], [bigint], "view">; + + permit: TypedContractMethod< + [ + _owner: AddressLike, + _spender: AddressLike, + _value: BigNumberish, + _deadline: BigNumberish, + _v: BigNumberish, + _r: BytesLike, + _s: BytesLike + ], + [void], + "nonpayable" + >; + + allowance: TypedContractMethod< + [_owner: AddressLike, _spender: AddressLike], + [bigint], + "view" + >; + + isPetrified: TypedContractMethod<[], [boolean], "view">; + + getLidoLocator: TypedContractMethod<[], [string], "view">; + + canDeposit: TypedContractMethod<[], [boolean], "view">; + + STAKING_PAUSE_ROLE: TypedContractMethod<[], [string], "view">; + + getDepositableEther: TypedContractMethod<[], [bigint], "view">; + + sharesOf: TypedContractMethod<[_account: AddressLike], [bigint], "view">; + + pauseStaking: TypedContractMethod<[], [void], "nonpayable">; + + getTotalELRewardsCollected: TypedContractMethod<[], [bigint], "view">; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "resume" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "name" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "stop" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "hasInitialized" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "approve" + ): TypedContractMethod< + [_spender: AddressLike, _amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "STAKING_CONTROL_ROLE" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "totalSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getSharesByPooledEth" + ): TypedContractMethod<[_ethAmount: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "isStakingPaused" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "transferFrom" + ): TypedContractMethod< + [_sender: AddressLike, _recipient: AddressLike, _amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "getEVMScriptExecutor" + ): TypedContractMethod<[_script: BytesLike], [string], "view">; + getFunction( + nameOrSignature: "setStakingLimit" + ): TypedContractMethod< + [_maxStakeLimit: BigNumberish, _stakeLimitIncreasePerBlock: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "RESUME_ROLE" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "finalizeUpgrade_v2" + ): TypedContractMethod< + [_lidoLocator: AddressLike, _eip712StETH: AddressLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "decimals" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getRecoveryVault" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "DOMAIN_SEPARATOR" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getTotalPooledEther" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "unsafeChangeDepositedValidators" + ): TypedContractMethod< + [_newDepositedValidators: BigNumberish], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "PAUSE_ROLE" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "increaseAllowance" + ): TypedContractMethod< + [_spender: AddressLike, _addedValue: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "getTreasury" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "isStopped" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "getBufferedEther" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod< + [_lidoLocator: AddressLike, _eip712StETH: AddressLike], + [void], + "payable" + >; + getFunction( + nameOrSignature: "receiveELRewards" + ): TypedContractMethod<[], [void], "payable">; + getFunction( + nameOrSignature: "getWithdrawalCredentials" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getCurrentStakeLimit" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getStakeLimitFullInfo" + ): TypedContractMethod< + [], + [ + [boolean, boolean, bigint, bigint, bigint, bigint, bigint] & { + isStakingPaused: boolean; + isStakingLimitSet: boolean; + currentStakeLimit: bigint; + maxStakeLimit: bigint; + maxStakeLimitGrowthBlocks: bigint; + prevStakeLimit: bigint; + prevStakeBlockNumber: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "transferSharesFrom" + ): TypedContractMethod< + [ + _sender: AddressLike, + _recipient: AddressLike, + _sharesAmount: BigNumberish + ], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "balanceOf" + ): TypedContractMethod<[_account: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "resumeStaking" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "getFeeDistribution" + ): TypedContractMethod< + [], + [ + [bigint, bigint, bigint] & { + treasuryFeeBasisPoints: bigint; + insuranceFeeBasisPoints: bigint; + operatorsFeeBasisPoints: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "receiveWithdrawals" + ): TypedContractMethod<[], [void], "payable">; + getFunction( + nameOrSignature: "getPooledEthByShares" + ): TypedContractMethod<[_sharesAmount: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "allowRecoverability" + ): TypedContractMethod<[token: AddressLike], [boolean], "view">; + getFunction( + nameOrSignature: "nonces" + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "appId" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getOracle" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "eip712Domain" + ): TypedContractMethod< + [], + [ + [string, string, bigint, string] & { + name: string; + version: string; + chainId: bigint; + verifyingContract: string; + } + ], + "view" + >; + getFunction( + nameOrSignature: "getContractVersion" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "getInitializationBlock" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transferShares" + ): TypedContractMethod< + [_recipient: AddressLike, _sharesAmount: BigNumberish], + [bigint], + "nonpayable" + >; + getFunction( + nameOrSignature: "symbol" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getEIP712StETH" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "transferToVault" + ): TypedContractMethod<[arg0: AddressLike], [void], "nonpayable">; + getFunction( + nameOrSignature: "canPerform" + ): TypedContractMethod< + [_sender: AddressLike, _role: BytesLike, _params: BigNumberish[]], + [boolean], + "view" + >; + getFunction( + nameOrSignature: "submit" + ): TypedContractMethod<[_referral: AddressLike], [bigint], "payable">; + getFunction( + nameOrSignature: "decreaseAllowance" + ): TypedContractMethod< + [_spender: AddressLike, _subtractedValue: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "getEVMScriptRegistry" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "transfer" + ): TypedContractMethod< + [_recipient: AddressLike, _amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "deposit" + ): TypedContractMethod< + [ + _maxDepositsCount: BigNumberish, + _stakingModuleId: BigNumberish, + _depositCalldata: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "UNSAFE_CHANGE_DEPOSITED_VALIDATORS_ROLE" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getBeaconStat" + ): TypedContractMethod< + [], + [ + [bigint, bigint, bigint] & { + depositedValidators: bigint; + beaconValidators: bigint; + beaconBalance: bigint; + } + ], + "view" + >; + getFunction( + nameOrSignature: "removeStakingLimit" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "handleOracleReport" + ): TypedContractMethod< + [ + _reportTimestamp: BigNumberish, + _timeElapsed: BigNumberish, + _clValidators: BigNumberish, + _clBalance: BigNumberish, + _withdrawalVaultBalance: BigNumberish, + _elRewardsVaultBalance: BigNumberish, + _sharesRequestedToBurn: BigNumberish, + _withdrawalFinalizationBatches: BigNumberish[], + _simulatedShareRate: BigNumberish + ], + [[bigint, bigint, bigint, bigint]], + "nonpayable" + >; + getFunction( + nameOrSignature: "getFee" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "kernel" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getTotalShares" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "permit" + ): TypedContractMethod< + [ + _owner: AddressLike, + _spender: AddressLike, + _value: BigNumberish, + _deadline: BigNumberish, + _v: BigNumberish, + _r: BytesLike, + _s: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "allowance" + ): TypedContractMethod< + [_owner: AddressLike, _spender: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "isPetrified" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "getLidoLocator" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "canDeposit" + ): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "STAKING_PAUSE_ROLE" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "getDepositableEther" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "sharesOf" + ): TypedContractMethod<[_account: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "pauseStaking" + ): TypedContractMethod<[], [void], "nonpayable">; + getFunction( + nameOrSignature: "getTotalELRewardsCollected" + ): TypedContractMethod<[], [bigint], "view">; + + getEvent( + key: "StakingPaused" + ): TypedContractEvent< + StakingPausedEvent.InputTuple, + StakingPausedEvent.OutputTuple, + StakingPausedEvent.OutputObject + >; + getEvent( + key: "StakingResumed" + ): TypedContractEvent< + StakingResumedEvent.InputTuple, + StakingResumedEvent.OutputTuple, + StakingResumedEvent.OutputObject + >; + getEvent( + key: "StakingLimitSet" + ): TypedContractEvent< + StakingLimitSetEvent.InputTuple, + StakingLimitSetEvent.OutputTuple, + StakingLimitSetEvent.OutputObject + >; + getEvent( + key: "StakingLimitRemoved" + ): TypedContractEvent< + StakingLimitRemovedEvent.InputTuple, + StakingLimitRemovedEvent.OutputTuple, + StakingLimitRemovedEvent.OutputObject + >; + getEvent( + key: "CLValidatorsUpdated" + ): TypedContractEvent< + CLValidatorsUpdatedEvent.InputTuple, + CLValidatorsUpdatedEvent.OutputTuple, + CLValidatorsUpdatedEvent.OutputObject + >; + getEvent( + key: "DepositedValidatorsChanged" + ): TypedContractEvent< + DepositedValidatorsChangedEvent.InputTuple, + DepositedValidatorsChangedEvent.OutputTuple, + DepositedValidatorsChangedEvent.OutputObject + >; + getEvent( + key: "ETHDistributed" + ): TypedContractEvent< + ETHDistributedEvent.InputTuple, + ETHDistributedEvent.OutputTuple, + ETHDistributedEvent.OutputObject + >; + getEvent( + key: "TokenRebased" + ): TypedContractEvent< + TokenRebasedEvent.InputTuple, + TokenRebasedEvent.OutputTuple, + TokenRebasedEvent.OutputObject + >; + getEvent( + key: "LidoLocatorSet" + ): TypedContractEvent< + LidoLocatorSetEvent.InputTuple, + LidoLocatorSetEvent.OutputTuple, + LidoLocatorSetEvent.OutputObject + >; + getEvent( + key: "ELRewardsReceived" + ): TypedContractEvent< + ELRewardsReceivedEvent.InputTuple, + ELRewardsReceivedEvent.OutputTuple, + ELRewardsReceivedEvent.OutputObject + >; + getEvent( + key: "WithdrawalsReceived" + ): TypedContractEvent< + WithdrawalsReceivedEvent.InputTuple, + WithdrawalsReceivedEvent.OutputTuple, + WithdrawalsReceivedEvent.OutputObject + >; + getEvent( + key: "Submitted" + ): TypedContractEvent< + SubmittedEvent.InputTuple, + SubmittedEvent.OutputTuple, + SubmittedEvent.OutputObject + >; + getEvent( + key: "Unbuffered" + ): TypedContractEvent< + UnbufferedEvent.InputTuple, + UnbufferedEvent.OutputTuple, + UnbufferedEvent.OutputObject + >; + getEvent( + key: "ScriptResult" + ): TypedContractEvent< + ScriptResultEvent.InputTuple, + ScriptResultEvent.OutputTuple, + ScriptResultEvent.OutputObject + >; + getEvent( + key: "RecoverToVault" + ): TypedContractEvent< + RecoverToVaultEvent.InputTuple, + RecoverToVaultEvent.OutputTuple, + RecoverToVaultEvent.OutputObject + >; + getEvent( + key: "EIP712StETHInitialized" + ): TypedContractEvent< + EIP712StETHInitializedEvent.InputTuple, + EIP712StETHInitializedEvent.OutputTuple, + EIP712StETHInitializedEvent.OutputObject + >; + getEvent( + key: "TransferShares" + ): TypedContractEvent< + TransferSharesEvent.InputTuple, + TransferSharesEvent.OutputTuple, + TransferSharesEvent.OutputObject + >; + getEvent( + key: "SharesBurnt" + ): TypedContractEvent< + SharesBurntEvent.InputTuple, + SharesBurntEvent.OutputTuple, + SharesBurntEvent.OutputObject + >; + getEvent( + key: "Stopped" + ): TypedContractEvent< + StoppedEvent.InputTuple, + StoppedEvent.OutputTuple, + StoppedEvent.OutputObject + >; + getEvent( + key: "Resumed" + ): TypedContractEvent< + ResumedEvent.InputTuple, + ResumedEvent.OutputTuple, + ResumedEvent.OutputObject + >; + getEvent( + key: "Transfer" + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + getEvent( + key: "Approval" + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "ContractVersionSet" + ): TypedContractEvent< + ContractVersionSetEvent.InputTuple, + ContractVersionSetEvent.OutputTuple, + ContractVersionSetEvent.OutputObject + >; + + filters: { + "StakingPaused()": TypedContractEvent< + StakingPausedEvent.InputTuple, + StakingPausedEvent.OutputTuple, + StakingPausedEvent.OutputObject + >; + StakingPaused: TypedContractEvent< + StakingPausedEvent.InputTuple, + StakingPausedEvent.OutputTuple, + StakingPausedEvent.OutputObject + >; + + "StakingResumed()": TypedContractEvent< + StakingResumedEvent.InputTuple, + StakingResumedEvent.OutputTuple, + StakingResumedEvent.OutputObject + >; + StakingResumed: TypedContractEvent< + StakingResumedEvent.InputTuple, + StakingResumedEvent.OutputTuple, + StakingResumedEvent.OutputObject + >; + + "StakingLimitSet(uint256,uint256)": TypedContractEvent< + StakingLimitSetEvent.InputTuple, + StakingLimitSetEvent.OutputTuple, + StakingLimitSetEvent.OutputObject + >; + StakingLimitSet: TypedContractEvent< + StakingLimitSetEvent.InputTuple, + StakingLimitSetEvent.OutputTuple, + StakingLimitSetEvent.OutputObject + >; + + "StakingLimitRemoved()": TypedContractEvent< + StakingLimitRemovedEvent.InputTuple, + StakingLimitRemovedEvent.OutputTuple, + StakingLimitRemovedEvent.OutputObject + >; + StakingLimitRemoved: TypedContractEvent< + StakingLimitRemovedEvent.InputTuple, + StakingLimitRemovedEvent.OutputTuple, + StakingLimitRemovedEvent.OutputObject + >; + + "CLValidatorsUpdated(uint256,uint256,uint256)": TypedContractEvent< + CLValidatorsUpdatedEvent.InputTuple, + CLValidatorsUpdatedEvent.OutputTuple, + CLValidatorsUpdatedEvent.OutputObject + >; + CLValidatorsUpdated: TypedContractEvent< + CLValidatorsUpdatedEvent.InputTuple, + CLValidatorsUpdatedEvent.OutputTuple, + CLValidatorsUpdatedEvent.OutputObject + >; + + "DepositedValidatorsChanged(uint256)": TypedContractEvent< + DepositedValidatorsChangedEvent.InputTuple, + DepositedValidatorsChangedEvent.OutputTuple, + DepositedValidatorsChangedEvent.OutputObject + >; + DepositedValidatorsChanged: TypedContractEvent< + DepositedValidatorsChangedEvent.InputTuple, + DepositedValidatorsChangedEvent.OutputTuple, + DepositedValidatorsChangedEvent.OutputObject + >; + + "ETHDistributed(uint256,uint256,uint256,uint256,uint256,uint256)": TypedContractEvent< + ETHDistributedEvent.InputTuple, + ETHDistributedEvent.OutputTuple, + ETHDistributedEvent.OutputObject + >; + ETHDistributed: TypedContractEvent< + ETHDistributedEvent.InputTuple, + ETHDistributedEvent.OutputTuple, + ETHDistributedEvent.OutputObject + >; + + "TokenRebased(uint256,uint256,uint256,uint256,uint256,uint256,uint256)": TypedContractEvent< + TokenRebasedEvent.InputTuple, + TokenRebasedEvent.OutputTuple, + TokenRebasedEvent.OutputObject + >; + TokenRebased: TypedContractEvent< + TokenRebasedEvent.InputTuple, + TokenRebasedEvent.OutputTuple, + TokenRebasedEvent.OutputObject + >; + + "LidoLocatorSet(address)": TypedContractEvent< + LidoLocatorSetEvent.InputTuple, + LidoLocatorSetEvent.OutputTuple, + LidoLocatorSetEvent.OutputObject + >; + LidoLocatorSet: TypedContractEvent< + LidoLocatorSetEvent.InputTuple, + LidoLocatorSetEvent.OutputTuple, + LidoLocatorSetEvent.OutputObject + >; + + "ELRewardsReceived(uint256)": TypedContractEvent< + ELRewardsReceivedEvent.InputTuple, + ELRewardsReceivedEvent.OutputTuple, + ELRewardsReceivedEvent.OutputObject + >; + ELRewardsReceived: TypedContractEvent< + ELRewardsReceivedEvent.InputTuple, + ELRewardsReceivedEvent.OutputTuple, + ELRewardsReceivedEvent.OutputObject + >; + + "WithdrawalsReceived(uint256)": TypedContractEvent< + WithdrawalsReceivedEvent.InputTuple, + WithdrawalsReceivedEvent.OutputTuple, + WithdrawalsReceivedEvent.OutputObject + >; + WithdrawalsReceived: TypedContractEvent< + WithdrawalsReceivedEvent.InputTuple, + WithdrawalsReceivedEvent.OutputTuple, + WithdrawalsReceivedEvent.OutputObject + >; + + "Submitted(address,uint256,address)": TypedContractEvent< + SubmittedEvent.InputTuple, + SubmittedEvent.OutputTuple, + SubmittedEvent.OutputObject + >; + Submitted: TypedContractEvent< + SubmittedEvent.InputTuple, + SubmittedEvent.OutputTuple, + SubmittedEvent.OutputObject + >; + + "Unbuffered(uint256)": TypedContractEvent< + UnbufferedEvent.InputTuple, + UnbufferedEvent.OutputTuple, + UnbufferedEvent.OutputObject + >; + Unbuffered: TypedContractEvent< + UnbufferedEvent.InputTuple, + UnbufferedEvent.OutputTuple, + UnbufferedEvent.OutputObject + >; + + "ScriptResult(address,bytes,bytes,bytes)": TypedContractEvent< + ScriptResultEvent.InputTuple, + ScriptResultEvent.OutputTuple, + ScriptResultEvent.OutputObject + >; + ScriptResult: TypedContractEvent< + ScriptResultEvent.InputTuple, + ScriptResultEvent.OutputTuple, + ScriptResultEvent.OutputObject + >; + + "RecoverToVault(address,address,uint256)": TypedContractEvent< + RecoverToVaultEvent.InputTuple, + RecoverToVaultEvent.OutputTuple, + RecoverToVaultEvent.OutputObject + >; + RecoverToVault: TypedContractEvent< + RecoverToVaultEvent.InputTuple, + RecoverToVaultEvent.OutputTuple, + RecoverToVaultEvent.OutputObject + >; + + "EIP712StETHInitialized(address)": TypedContractEvent< + EIP712StETHInitializedEvent.InputTuple, + EIP712StETHInitializedEvent.OutputTuple, + EIP712StETHInitializedEvent.OutputObject + >; + EIP712StETHInitialized: TypedContractEvent< + EIP712StETHInitializedEvent.InputTuple, + EIP712StETHInitializedEvent.OutputTuple, + EIP712StETHInitializedEvent.OutputObject + >; + + "TransferShares(address,address,uint256)": TypedContractEvent< + TransferSharesEvent.InputTuple, + TransferSharesEvent.OutputTuple, + TransferSharesEvent.OutputObject + >; + TransferShares: TypedContractEvent< + TransferSharesEvent.InputTuple, + TransferSharesEvent.OutputTuple, + TransferSharesEvent.OutputObject + >; + + "SharesBurnt(address,uint256,uint256,uint256)": TypedContractEvent< + SharesBurntEvent.InputTuple, + SharesBurntEvent.OutputTuple, + SharesBurntEvent.OutputObject + >; + SharesBurnt: TypedContractEvent< + SharesBurntEvent.InputTuple, + SharesBurntEvent.OutputTuple, + SharesBurntEvent.OutputObject + >; + + "Stopped()": TypedContractEvent< + StoppedEvent.InputTuple, + StoppedEvent.OutputTuple, + StoppedEvent.OutputObject + >; + Stopped: TypedContractEvent< + StoppedEvent.InputTuple, + StoppedEvent.OutputTuple, + StoppedEvent.OutputObject + >; + + "Resumed()": TypedContractEvent< + ResumedEvent.InputTuple, + ResumedEvent.OutputTuple, + ResumedEvent.OutputObject + >; + Resumed: TypedContractEvent< + ResumedEvent.InputTuple, + ResumedEvent.OutputTuple, + ResumedEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "ContractVersionSet(uint256)": TypedContractEvent< + ContractVersionSetEvent.InputTuple, + ContractVersionSetEvent.OutputTuple, + ContractVersionSetEvent.OutputObject + >; + ContractVersionSet: TypedContractEvent< + ContractVersionSetEvent.InputTuple, + ContractVersionSetEvent.OutputTuple, + ContractVersionSetEvent.OutputObject + >; + }; +} diff --git a/src/typechain/lido/LidoWSTETH.ts b/src/typechain/lido/LidoWSTETH.ts new file mode 100644 index 00000000..1dccfcc4 --- /dev/null +++ b/src/typechain/lido/LidoWSTETH.ts @@ -0,0 +1,495 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "../common"; + +export interface LidoWSTETHInterface extends Interface { + getFunction( + nameOrSignature: + | "DOMAIN_SEPARATOR" + | "allowance" + | "approve" + | "balanceOf" + | "decimals" + | "decreaseAllowance" + | "getStETHByWstETH" + | "getWstETHByStETH" + | "increaseAllowance" + | "name" + | "nonces" + | "permit" + | "stETH" + | "stEthPerToken" + | "symbol" + | "tokensPerStEth" + | "totalSupply" + | "transfer" + | "transferFrom" + | "unwrap" + | "wrap" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "Approval" | "Transfer"): EventFragment; + + encodeFunctionData( + functionFragment: "DOMAIN_SEPARATOR", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "allowance", + values: [AddressLike, AddressLike] + ): string; + encodeFunctionData( + functionFragment: "approve", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "balanceOf", + values: [AddressLike] + ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; + encodeFunctionData( + functionFragment: "decreaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getStETHByWstETH", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "getWstETHByStETH", + values: [BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "permit", + values: [ + AddressLike, + AddressLike, + BigNumberish, + BigNumberish, + BigNumberish, + BytesLike, + BytesLike + ] + ): string; + encodeFunctionData(functionFragment: "stETH", values?: undefined): string; + encodeFunctionData( + functionFragment: "stEthPerToken", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "tokensPerStEth", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", + values: [AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "unwrap", + values: [BigNumberish] + ): string; + encodeFunctionData(functionFragment: "wrap", values: [BigNumberish]): string; + + decodeFunctionResult( + functionFragment: "DOMAIN_SEPARATOR", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getStETHByWstETH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getWstETHByStETH", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "stETH", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "stEthPerToken", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "tokensPerStEth", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "unwrap", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "wrap", data: BytesLike): Result; +} + +export namespace ApprovalEvent { + export type InputTuple = [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish + ]; + export type OutputTuple = [owner: string, spender: string, value: bigint]; + export interface OutputObject { + owner: string; + spender: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TransferEvent { + export type InputTuple = [ + from: AddressLike, + to: AddressLike, + value: BigNumberish + ]; + export type OutputTuple = [from: string, to: string, value: bigint]; + export interface OutputObject { + from: string; + to: string; + value: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface LidoWSTETH extends BaseContract { + connect(runner?: ContractRunner | null): BaseContract; + attach(addressOrName: AddressLike): this; + deployed(): Promise; + + interface: LidoWSTETHInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on( + event: TCEvent, + listener: TypedListener + ): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once( + event: TCEvent, + listener: TypedListener + ): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners( + event: TCEvent + ): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners( + event?: TCEvent + ): Promise; + + DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; + + allowance: TypedContractMethod< + [owner: AddressLike, spender: AddressLike], + [bigint], + "view" + >; + + approve: TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + balanceOf: TypedContractMethod<[account: AddressLike], [bigint], "view">; + + decimals: TypedContractMethod<[], [bigint], "view">; + + decreaseAllowance: TypedContractMethod< + [spender: AddressLike, subtractedValue: BigNumberish], + [boolean], + "nonpayable" + >; + + getStETHByWstETH: TypedContractMethod< + [_wstETHAmount: BigNumberish], + [bigint], + "view" + >; + + getWstETHByStETH: TypedContractMethod< + [_stETHAmount: BigNumberish], + [bigint], + "view" + >; + + increaseAllowance: TypedContractMethod< + [spender: AddressLike, addedValue: BigNumberish], + [boolean], + "nonpayable" + >; + + name: TypedContractMethod<[], [string], "view">; + + nonces: TypedContractMethod<[owner: AddressLike], [bigint], "view">; + + permit: TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + + stETH: TypedContractMethod<[], [string], "view">; + + stEthPerToken: TypedContractMethod<[], [bigint], "view">; + + symbol: TypedContractMethod<[], [string], "view">; + + tokensPerStEth: TypedContractMethod<[], [bigint], "view">; + + totalSupply: TypedContractMethod<[], [bigint], "view">; + + transfer: TypedContractMethod< + [recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + transferFrom: TypedContractMethod< + [sender: AddressLike, recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + + unwrap: TypedContractMethod< + [_wstETHAmount: BigNumberish], + [bigint], + "nonpayable" + >; + + wrap: TypedContractMethod< + [_stETHAmount: BigNumberish], + [bigint], + "nonpayable" + >; + + getFunction( + key: string | FunctionFragment + ): T; + + getFunction( + nameOrSignature: "DOMAIN_SEPARATOR" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "allowance" + ): TypedContractMethod< + [owner: AddressLike, spender: AddressLike], + [bigint], + "view" + >; + getFunction( + nameOrSignature: "approve" + ): TypedContractMethod< + [spender: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "balanceOf" + ): TypedContractMethod<[account: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "decimals" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "decreaseAllowance" + ): TypedContractMethod< + [spender: AddressLike, subtractedValue: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "getStETHByWstETH" + ): TypedContractMethod<[_wstETHAmount: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "getWstETHByStETH" + ): TypedContractMethod<[_stETHAmount: BigNumberish], [bigint], "view">; + getFunction( + nameOrSignature: "increaseAllowance" + ): TypedContractMethod< + [spender: AddressLike, addedValue: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "name" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "nonces" + ): TypedContractMethod<[owner: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "permit" + ): TypedContractMethod< + [ + owner: AddressLike, + spender: AddressLike, + value: BigNumberish, + deadline: BigNumberish, + v: BigNumberish, + r: BytesLike, + s: BytesLike + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "stETH" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "stEthPerToken" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "symbol" + ): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "tokensPerStEth" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "totalSupply" + ): TypedContractMethod<[], [bigint], "view">; + getFunction( + nameOrSignature: "transfer" + ): TypedContractMethod< + [recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferFrom" + ): TypedContractMethod< + [sender: AddressLike, recipient: AddressLike, amount: BigNumberish], + [boolean], + "nonpayable" + >; + getFunction( + nameOrSignature: "unwrap" + ): TypedContractMethod<[_wstETHAmount: BigNumberish], [bigint], "nonpayable">; + getFunction( + nameOrSignature: "wrap" + ): TypedContractMethod<[_stETHAmount: BigNumberish], [bigint], "nonpayable">; + + getEvent( + key: "Approval" + ): TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + getEvent( + key: "Transfer" + ): TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + + filters: { + "Approval(address,address,uint256)": TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + Approval: TypedContractEvent< + ApprovalEvent.InputTuple, + ApprovalEvent.OutputTuple, + ApprovalEvent.OutputObject + >; + + "Transfer(address,address,uint256)": TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + Transfer: TypedContractEvent< + TransferEvent.InputTuple, + TransferEvent.OutputTuple, + TransferEvent.OutputObject + >; + }; +} diff --git a/src/typechain/lido/index.ts b/src/typechain/lido/index.ts new file mode 100644 index 00000000..e6a7d304 --- /dev/null +++ b/src/typechain/lido/index.ts @@ -0,0 +1,5 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { LidoSTETH } from "./LidoSTETH"; +export type { LidoWSTETH } from "./LidoWSTETH"; diff --git a/yarn.lock b/yarn.lock index 376d55be..50dd65a6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2402,15 +2402,13 @@ resolved "https://registry.yarnpkg.com/@railgun-community/poseidon-hash-wasm/-/poseidon-hash-wasm-1.0.1.tgz#bfd3b3f915391a59486d8c9d632069f029e152d6" integrity sha512-zDAbMu095ZjMqsKIoyOnuKR4Zofnqqx4eTCtnA6qYglnexX5cadxItvJa3ozhDDTmFkDGAidDssQ7Pzl3wwLDA== -"@railgun-community/shared-models@7.5.0", "@railgun-community/shared-models@^7.5.0": - version "7.5.0" - resolved "https://registry.yarnpkg.com/@railgun-community/shared-models/-/shared-models-7.5.0.tgz#d36d73740e32dbd5c21b2864e8c3db96e1241cb3" - integrity sha512-npSFFzSq2nSCLseEBZmLwJlZ4hMJArzEeM/DpqAAyxaTfznSHvpPIKmvEWorXVGjG+6xB7AY01TPGOq+3XHdcA== +"@railgun-community/shared-models@git+https://github.com/Railgun-Community/shared-models.git#mattgle/ink-integration": + version "7.5.2" + resolved "git+https://github.com/Railgun-Community/shared-models.git#3c8547562e1d6ccc2c0fbb9dd0c93ef807de0964" -"@railgun-community/wallet@10.3.3": +"@railgun-community/wallet@git+https://github.com/Railgun-Community/wallet.git#mattgle/ink-integration": version "10.3.3" - resolved "https://registry.yarnpkg.com/@railgun-community/wallet/-/wallet-10.3.3.tgz#cef885628b76b3c547a0016f298a2e5752fb7bbe" - integrity sha512-dsQV7sjso7mhE15HvJliLEMLsuvUMN5wDt6hSP7nm8S+n6hsBx6tSzc5JAI7nPsi1UVDIW/f96pqMRRPRPgYxw== + resolved "git+https://github.com/Railgun-Community/wallet.git#6b68a73c2be39fed2984e303c92d096b6e5aa222" dependencies: "@graphql-mesh/cache-localforage" "^0.7.20" "@graphql-mesh/cross-helpers" "^0.3.4" @@ -2424,7 +2422,7 @@ "@graphql-mesh/utils" "^0.43.22" "@noble/ed25519" "^1.7.1" "@railgun-community/engine" "9.3.1" - "@railgun-community/shared-models" "7.5.0" + "@railgun-community/shared-models" "git+https://github.com/Railgun-Community/shared-models.git#mattgle/ink-integration" "@whatwg-node/fetch" "^0.8.4" assert "2.0.0" axios "1.7.2"