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

Parameters

NameTypeDescription
targetAddressaddressundefined

ethBalances(address)

Solidity

function ethBalances(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

initialize(address,address,address)

Solidity

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

Parameters

NameTypeDescription
_orchestratoraddressundefined
_stratRegistryaddressundefined
_vaultRegistryaddressundefined

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

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.

returnGas(address,uint256)

Solidity

function returnGas(address targetAddress, uint256 originalGas) external nonpayable
Details

should only ever be called by the orchestrator. Is onlyOrchestrator. This and setAsideGas are used to pull gas from the vault for strategy executions.

Parameters

NameTypeDescription
targetAddressaddressis address actions were performed on
originalGasuint256is gas passed in to the action execution order. Used to calculate gas used in the execution.

setAsideGas(address)

Solidity

function setAsideGas(address _targetAddress) external nonpayable returns (uint256)
Details

a function that calls setAsideGas MUST call returnGas! TODO: make this into a flashloan type thing? Have it simply call the orchestrator and then continue with the function?

Parameters

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

Returns

NameTypeDescription
_0uint256uint256 gasAvailable (representing amount of gas available per Method).

strategyRegistry()

Solidity

function strategyRegistry() external view returns (contract IStrategyRegistry)

Returns

NameTypeDescription
_0contract IStrategyRegistryundefined

transactionsRemaining(address,uint256)

Solidity

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

Parameters

NameTypeDescription
targetAddressaddressundefined
gasCostEstimateuint256represents best guess of gas cost going forwards

Returns

NameTypeDescription
_0uint256transactions remaining, assuming max gas is used in each Method

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)

Solidity

function withdraw(uint256 amount) external nonpayable
Details

withdraws eth from vault

Parameters

NameTypeDescription
amountuint256undefined

Events

AdminChanged

Solidity

event AdminChanged(address previousAdmin, address newAdmin)

Parameters

NameTypeDescription
previousAdminaddressundefined
newAdminaddressundefined

BeaconUpgraded

Solidity

event BeaconUpgraded(address indexed beacon)

Parameters

NameTypeDescription
beacon indexedaddressundefined

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

deposited

Solidity

event deposited(address origin, address target, uint256 amount)

Parameters

NameTypeDescription
originaddressundefined
targetaddressundefined
amountuint256undefined

etherUsed

Solidity

event etherUsed(address account, uint256 amount)

Parameters

NameTypeDescription
accountaddressundefined
amountuint256undefined

withdrawn

Solidity

event withdrawn(address account, uint256 amount)

Parameters

NameTypeDescription
accountaddressundefined
amountuint256undefined