Gas Bank¶
Overview¶
The gas bank is used to hold ETH on behalf of users that interact with actions. Actions require ETH to pay for the gas cost of the action. When an action is registered by a user, an amount of ETH is taken from them and sent to the gas bank for that user. Then, as that users actions are executed, the ETH cost of each action is sent to the keeper to refund them for the execution.
The amount of ETH that is sent to the gas bank is estimated_gas_cost_per_action_execution * amount_of_executions_expected_for_user
.
Once a user has had all of their actions executed, the remainder of the unused ETH is sent back to the user.
Some functions exist for users to manage their gas bank balance.
-
GasBank.depositFor(address account) external
Deposit ETH into the gas bank for the given account.
account
: The account to deposit ETH into.
-
GasBank.withdrawFrom(address account, uint256 amount) external
Withdraw ETH from the gas bank for the given account.
account
: The account to withdraw ETH from.amount
: The amount of ETH to withdraw.
-
GasBank.withdrawUnused(address account) external
Withdraws amount not required by any action.
account
: The account to withdraw ETH from.