VyperContract
Description
A contract instance.
Internal and external contract functions are available as methods on VyperContract instances.
Methods
- eval
- deployer
- marshal_to_python
- stack_trace
- trace_source
- get_logs
- decode_log
- inject_function
- storage_introspection - Access storage, immutables, and constants
- function_calls - Special parameters for function calls (simulate, value, gas, sender)
Properties
_storage- Access storage variables with automatic decoding_immutables- Access immutable values_constants- Access contract constantsaddress- The deployed address of the contractcreated_from- Address that deployed this contract
Examples
>>> import boa
>>> src = """
... @external
... def main():
... pass
...
... @internal
... def foo() -> uint256:
... return 123
... """
>>> contract = boa.loads_partial(src, name="Foo").deploy()
>>> type(contract.main)
<class 'boa.vyper.contract.VyperFunction'>
>>> type(contract.internal.foo)
<class 'boa.vyper.contract.VyperInternalFunction'>
>>> contract.internal.foo()
123