Skip to main content

WstETHReferralStaker

WstETHReferralStaker is a utility contract that allows users to stake ETH into the Lido protocol with referral address, then automatically wrap the received stETH into wstETH and transfer it back to the user in a single transaction.

Audit

In progress

Upgradability

This contract is not upgradable.

Methods

stakeETH

Stake ETH with referral address.

function stakeETH(address _referral) external payable returns (uint256)

Parameters

Parameter NameTypeDescription
_referraladdressReferral address for Lido's referral program.

Returns

Amount of wstETH user receives after wrap.

Interfaces

IWstETH

FunctionDescription
wrap(uint256 _stETHAmount) external returns (uint256)Wraps _stETHAmount of stETH into wstETH and returns the amount of wstETH minted. More here
stETH() external view returns (address)Returns the underlying stETH token address.

IStETH

FunctionDescription
submit(address _referral) external payable returns (uint256)Stakes ETH, optionally credits a referral, and mints stETH shares for the caller; returns the number of shares minted. More here
function getTotalShares() external view returns (uint256)Returns the total amount of shares in existence. More here
function getTotalPooledEther() external view returns (uint256)Returns the entire amount of ether controlled by the protocol. More here