Skip to main content

GasVault.sol

Details

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)

Solidity

function deposit(address targetAddress) external payable
Details

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

NameTypeDescription
targetAddressaddressaddress of the recipient of these gas funds

ethBalances(address)

Mapping from vault address to gasInfo

Solidity

function ethBalances(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

gasAvailableForTransaction(address)

Solidity

function gasAvailableForTransaction(address _targetAddress) external view returns (uint256)
Details

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

NameTypeDescription
_targetAddressaddressAddress actions will be performed on, and address paying gas for those actions.

Returns

NameTypeDescription
_0uint256gasAvailable (representing amount of gas available per Method).

initialize(address,address,address)

Solidity

function initialize(address _orchestrator, address _stratRegistry, address _vaultRegistry) external nonpayable
Details

Permanently sets related addresses

Parameters

NameTypeDescription
_orchestratoraddressAddress of the orchestrator contract
_stratRegistryaddressAddress of the strategy registry contract
_vaultRegistryaddressAddress of the vault registry contract

orchestrator()

Solidity

function orchestrator() external view returns (contract IOrchestrator)

Returns

NameTypeDescription
_0contract IOrchestratorundefined

owner()

Solidity

function owner() external view returns (address)
Details

Returns the address of the current owner.

Returns

NameTypeDescription
_0addressundefined

reimburseGas(address,uint256,bytes32)

Solidity

function reimburseGas(address targetAddress, uint256 originalGas, bytes32 jobHash) external nonpayable
Details

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

NameTypeDescription
targetAddressaddressThe address which the action was performed upon. The reimbursement will come from its gas fund.
originalGasuint256How much gas there was at the start of the action (before any action was called)
jobHashbytes32The 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()

Solidity

function renounceOwnership() external nonpayable
Details

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()

Solidity

function strategyRegistry() external view returns (contract IStrategyRegistry)

Returns

NameTypeDescription
_0contract IStrategyRegistryundefined

transactionsRemaining(address,uint256)

Solidity

function transactionsRemaining(address targetAddress, uint256 highGasEstimate) external view returns (uint256)

Parameters

NameTypeDescription
targetAddressaddressThe address of the vault in question
highGasEstimateuint256An 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

NameTypeDescription
_0uint256transactions Remaining, assuming upper limit estimate of gas price is used for the transaction

transferOwnership(address)

Solidity

function transferOwnership(address newOwner) external nonpayable
Details

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

Parameters

NameTypeDescription
newOwneraddressundefined

upgradeTo(address)

Solidity

function upgradeTo(address newImplementation) external nonpayable
Details

Upgrade the implementation of the proxy to newImplementation. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined

upgradeToAndCall(address,bytes)

Solidity

function upgradeToAndCall(address newImplementation, bytes data) external payable
Details

Upgrade the implementation of the proxy to newImplementation, and subsequently execute the function call encoded in data. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.

Parameters

NameTypeDescription
newImplementationaddressundefined
databytesundefined

vaultRegistry()

Solidity

function vaultRegistry() external view returns (contract IVaultRegistry)

Returns

NameTypeDescription
_0contract IVaultRegistryundefined

withdraw(uint256,address)

Solidity

function withdraw(uint256 amount, address payable to) external nonpayable
Details

Normal withdraw function, normally used by keepers

Parameters

NameTypeDescription
amountuint256The amount to withdraw
toaddress payableAddress to send the ether to

Events

AdminChanged

Solidity

event AdminChanged(address previousAdmin, address newAdmin)

Parameters

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

BeaconUpgraded

Solidity

event BeaconUpgraded(address indexed beacon)

Parameters

NameTypeDescription
beacon indexedaddressundefined

Deposited

Solidity

event Deposited(address indexed origin, address indexed target, uint256 amount)

Parameters

NameTypeDescription
origin indexedaddressundefined
target indexedaddressundefined
amountuint256undefined

EtherUsed

Solidity

event EtherUsed(address indexed account, uint256 amount, bytes32 jobHash)

Parameters

NameTypeDescription
account indexedaddressundefined
amountuint256undefined
jobHashbytes32undefined

OwnershipTransferred

Solidity

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Parameters

NameTypeDescription
previousOwner indexedaddressundefined
newOwner indexedaddressundefined

Upgraded

Solidity

event Upgraded(address indexed implementation)

Parameters

NameTypeDescription
implementation indexedaddressundefined

Withdrawn

Solidity

event Withdrawn(address indexed targetAddress, address indexed to, uint256 amount)

Parameters

NameTypeDescription
targetAddress indexedaddressundefined
to indexedaddressundefined
amountuint256undefined