EnzymeVaultTransaction

Documentation for eth_defi.enzyme.vault_controlled_wallet.EnzymeVaultTransaction Python class.

class EnzymeVaultTransaction[source]

Describing a transaction Enzyme vault performs.

  • This structure contains inputs needed to perform a vault transaction

  • Unlike regular transcation, Enzyme vault transactions need information about expected inbound and outbound assets in the transaction

  • Multiple vault contract calls could be packed into a single transaction, but we do not support it ATM

Note

TODO: kwargs support missing

Attributes summary

contract

The contract this transaction si for

function

Which smart contract we are calling

gas_limit

How much gas the hot wallet can spend on this tx

asset_deltas

If this transaction results to changes in the vault balance it must be listed here.

args

Unnamed arguments for this Solidity function.

incoming_assets

min_incoming_assets_amounts

spend_asset_amounts

spend_assets

Methods summary

__init__(contract, function, gas_limit[, ...])

as_json_friendly_dict()

Return human-readable, JSON'able, output for this transaction.

encode_payload()

Get the data payload in Solidity's ABI encodePacked format

contract: web3.contract.contract.Contract

The contract this transaction si for

function: web3.contract.contract.ContractFunction

Which smart contract we are calling

ContractFunction must be bound to its args, have function.args and/or function.kwargs set.

gas_limit: int

How much gas the hot wallet can spend on this tx

asset_deltas: List[eth_defi.tx.AssetDelta]

If this transaction results to changes in the vault balance it must be listed here.

This will check that any trade will

  • Give you the expected assets

  • Give you the expected slippage tolerance

  • Tells the vault what is the amount of the payment we make for a trade

property args: List[Any]

Unnamed arguments for this Solidity function.

encode_payload()[source]

Get the data payload in Solidity’s ABI encodePacked format

Return type

hexbytes.main.HexBytes

as_json_friendly_dict()[source]

Return human-readable, JSON’able, output for this transaction.

Return type

dict

__init__(contract, function, gas_limit, asset_deltas=<factory>)
Parameters
  • contract (web3.contract.contract.Contract) –

  • function (web3.contract.contract.ContractFunction) –

  • gas_limit (int) –

  • asset_deltas (List[eth_defi.tx.AssetDelta]) –

Return type

None