Comment on page
Pool
StakeWise Pool smart contract details.
The Pool contract is an entry point for deposits into the StakeWise Permissioned Pool. This contract stores ETH collected from the users before it is sent to the ETH2 Validator Registration Contract.
Interactions with the Pool contract are limited only to the addresses included in the WhiteListManager contract.

By calling the
stake
function in the Pool contract, the user will add ether to the Permissioned Pool. The contract will mint psETH
(permissioned staked ETH) tokens 1 to 1 with the deposited amount of ETH. For example, if the user deposited 10 ether, they would get 10 psETH
that represents the amount of ETH they staked in the StakeWise Permissioned Pool.The user's address must be included in the
whitelistedAccounts
list contained in the WhiteListManager contract in order to call the stake
function and receive psETH
tokens. The call will fail if the caller's address or the token recipient's address have not been added to the whitelistedAccounts
list. There are variations of the
stake
function available in the contract, such as:
stakeWithPartner
- allows to continuously reward apartner
address with a portion of the revenue generated from the user.
stakeWithPartnerOnBehalf
- allows to continuously reward apartner
address with a portion of the revenue generated from the user, while setting arecipient
address that is different from the caller address.
stakeWithReferrerOnBehalf
- allows to reward areferrer
address with a pre-agreed lump-sum payment, while setting arecipient
address that is different from the caller address.
While the functionality explained below has been included in the contract, for the purposes of a smoother customer experience
minActivatingDeposit
& pendingValidatorsLimit
variables have been set to their upper limit. In other words,
psETH
tokens are expected to be minted immediately upon staking at all times.The timing of minting
psETH
for the user depends on several parameters: - the value of
minActivatingDeposit
variable, set by the Admin role usingsetMinActivatingDeposit
function in the Pool contract; - the value of
pendingValidatorsLimit
variable, calculated based on the proportion of pending validators relative to the total number of validators, set by the Admin role usingsetPendingValidatorsLimit
function in the Pool contract.
If the amount of ETH staked by the user is lower than
minActivatingDeposit
, the psETH
tokens will be minted for the user immediately. If the amount of ETH staked by the user is higher than
minActivatingDeposit
, but the total number of pending validators as a result of the user's deposit is lower than pendingValidatorsLimit
, the psETH
tokens will be minted for the user immediately. Else, the user will be required to wait until the validators that contain their stake have been activated to receive the
psETH
tokens. To receive the tokens, the user will need to call the activate
or activateMultiple
functions. 
When there is 32 ETH or more collected in the Pool contract, users with an
Oracle
role can register a new validator. Oracles
are automated entities that run off-chain and listen to the Pool's events. As soon as there is enough ETH collected, the following sequence of events occurs:- 1.
Oracles
will submit a vote containing the next deposit data (previously registered by theOperators
) to the Oracles contract for aggregation & consensus. - 2.
- 3.Upon successful approval of submitted information, PoolValidators contract will call the
registerValidator
function in the Pool contract to register the validator by sending ether and the verified deposit data to the ETH2 Validator Registration Contract.
It is also possible to create multiple validators in one batch if there is enough ether collected.
Note that the StakeWise Permissioned Pool uses its own withdrawal credentials, which point to a PoolEscrow contract (i.e. an ETH1 address) and remain the same for every Pool's validator.
Last modified 1yr ago