The Common Account
The common account is controlled by the chain owner defined in the chain root contract.
This account is used to store funds collected by fees, or sent to the chain's L1 address, or to invalid contracts (this way the funds are not permanently lost).
harvest
The harvest
entry point allows the chain owner to move all funds available in the common account to their own L2
account.
Parameters
ParamForceMinimumBaseTokens
: The amount of base tokens to leave in the common account (default: 3000).
- Solo
- Solo (Schema)
- Rust (Schema)
- Go (Schema)
req := solo.NewCallParams(accounts.Contract.Name, accounts.FuncHarvest.Name)
_, err := chain.PostRequestSync(req.WithMaxAffordableGasBudget(), wallet)
require.NoError(t, err)
h := coreaccounts.ScFuncs.Harvest(ctx.Sign(wallet))
h.Func.Post()
require.NoError(t, ctx.Err)
let h = coreaccounts::ScFuncs::harvest(ctx);
h.func.post();
h := coreaccounts.ScFuncs.Harvest(ctx)
h.Func.Post(chainID)