GasVault.sol
vault for storing gas for each strategy. Nodes must still pay gas cost to call, but execution costs will come out of the gas account.
Methods
deposit(address)
function deposit(address targetAddress) external payable
Deposit more eth to be used in jobs. Can only be withdrawn by governance and the given vault, so in most cases these funds are unretrievable.
Parameters
Name | Type | Description |
---|---|---|
targetAddress | address | address of the recipient of these gas funds |
ethBalances(address)
Mapping from vault address to gasInfo
function ethBalances(address) external view returns (uint256)
Parameters
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
gasAvailableForTransaction(address)
function gasAvailableForTransaction(address _targetAddress) external view returns (uint256)
Orchestrator calls this function in order to reimburse tx.origin for method gas. First it checks that all parameters are correct (gas price isn't too high), And then it returns as much gas as is available to use in the transaction. Note that this function will revert if the gas price is too high for the strategy. This should be checked by the keeper beforehand.
Parameters
Name | Type | Description |
---|---|---|
_targetAddress | address | Address actions will be performed on, and address paying gas for those actions. |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | gasAvailable (representing amount of gas available per Method). |
initialize(address,address,address)
function initialize(address _orchestrator, address _stratRegistry, address _vaultRegistry) external nonpayable
Permanently sets related addresses
Parameters
Name | Type | Description |
---|---|---|
_orchestrator | address | Address of the orchestrator contract |
_stratRegistry | address | Address of the strategy registry contract |
_vaultRegistry | address | Address of the vault registry contract |
orchestrator()
function orchestrator() external view returns (contract IOrchestrator)
Returns
Name | Type | Description |
---|---|---|
_0 | contract IOrchestrator | undefined |
owner()
function owner() external view returns (address)
Returns the address of the current owner.
Returns
Name | Type | Description |
---|---|---|
_0 | address | undefined |
reimburseGas(address,uint256,bytes32)
function reimburseGas(address targetAddress, uint256 originalGas, bytes32 jobHash) external nonpayable
Note that keepers still have to pull their gas from the GasVault in order to truly be reimbursed--until then the ETH is just sitting in the GasVault.
Parameters
Name | Type | Description |
---|---|---|
targetAddress | address | The address which the action was performed upon. The reimbursement will come from its gas fund. |
originalGas | uint256 | How much gas there was at the start of the action (before any action was called) |
jobHash | bytes32 | The hash of the job which was performed. All vaults other than DynamicJobs can only have one job, so in this case jobHash will just be actionHash. |
renounceOwnership()
function renounceOwnership() external nonpayable
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
strategyRegistry()
function strategyRegistry() external view returns (contract IStrategyRegistry)
Returns
Name | Type | Description |
---|---|---|
_0 | contract IStrategyRegistry | undefined |
transactionsRemaining(address,uint256)
function transactionsRemaining(address targetAddress, uint256 highGasEstimate) external view returns (uint256)
Parameters
Name | Type | Description |
---|---|---|
targetAddress | address | The address of the vault in question |
highGasEstimate | uint256 | An estimate of the highest reasonable gas price which a transaction will cost, in terms of wei. In other words, given a bad gas price, how many more times can a strategy be run. |
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | transactions Remaining, assuming upper limit estimate of gas price is used for the transaction |
transferOwnership(address)
function transferOwnership(address newOwner) external nonpayable
Transfers ownership of the contract to a new account (newOwner
). Can only be called by the current owner.
Parameters
Name | Type | Description |
---|---|---|
newOwner | address | undefined |
upgradeTo(address)
function upgradeTo(address newImplementation) external nonpayable
Upgrade the implementation of the proxy to newImplementation
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | undefined |
upgradeToAndCall(address,bytes)
function upgradeToAndCall(address newImplementation, bytes data) external payable
Upgrade the implementation of the proxy to newImplementation
, and subsequently execute the function call encoded in data
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
Name | Type | Description |
---|---|---|
newImplementation | address | undefined |
data | bytes | undefined |
vaultRegistry()
function vaultRegistry() external view returns (contract IVaultRegistry)
Returns
Name | Type | Description |
---|---|---|
_0 | contract IVaultRegistry | undefined |
withdraw(uint256,address)
function withdraw(uint256 amount, address payable to) external nonpayable
Normal withdraw function, normally used by keepers
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount to withdraw |
to | address payable | Address to send the ether to |
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
Name | Type | Description |
---|---|---|
previousAdmin | address | undefined |
newAdmin | address | undefined |
BeaconUpgraded
event BeaconUpgraded(address indexed beacon)
Parameters
Name | Type | Description |
---|---|---|
beacon indexed | address | undefined |
Deposited
event Deposited(address indexed origin, address indexed target, uint256 amount)
Parameters
Name | Type | Description |
---|---|---|
origin indexed | address | undefined |
target indexed | address | undefined |
amount | uint256 | undefined |
EtherUsed
event EtherUsed(address indexed account, uint256 amount, bytes32 jobHash)
Parameters
Name | Type | Description |
---|---|---|
account indexed | address | undefined |
amount | uint256 | undefined |
jobHash | bytes32 | undefined |
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Parameters
Name | Type | Description |
---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
Upgraded
event Upgraded(address indexed implementation)
Parameters
Name | Type | Description |
---|---|---|
implementation indexed | address | undefined |
Withdrawn
event Withdrawn(address indexed targetAddress, address indexed to, uint256 amount)
Parameters
Name | Type | Description |
---|---|---|
targetAddress indexed | address | undefined |
to indexed | address | undefined |
amount | uint256 | undefined |