@@ -169,7 +169,7 @@ A wrapper class around py-evm which provides a "contract-centric" API. More deta
169169
170170## ` execute_code `
171171
172- !!! function "` boa.env.execute_code() -> bytes ` "
172+ !!! function "` boa.env.execute_code() -> ComputationAPI ` "
173173
174174 **Description**
175175
@@ -191,7 +191,17 @@ A wrapper class around py-evm which provides a "contract-centric" API. More deta
191191
192192 **Returns**
193193
194- The return value from the top-level call.
194+ A `ComputationAPI` object containing the execution result. Key attributes include:
195+ - `output`: The return data as bytes
196+ - `is_error`: Boolean indicating if the execution failed
197+ - `error`: The exception if execution failed
198+ - `gas_used`: Amount of gas consumed
199+
200+ ---
201+
202+ **Note**
203+
204+ Unlike `raw_call`, this method returns the computation object directly without raising exceptions on errors.
195205
196206---
197207
@@ -524,12 +534,11 @@ A wrapper class around py-evm which provides a "contract-centric" API. More deta
524534
525535## ` raw_call `
526536
527- !!! function "` boa.env.raw_call(to_address) -> bytes ` "
537+ !!! function "` boa.env.raw_call(to_address) -> ComputationAPI ` "
528538
529539 **Description**
530540
531- TODO too many details this should go in the explain section
532- Simple wrapper around `execute_code`, to execute as if the contract is being called from an EOA.
541+ Execute a call to a contract address, simulating an EOA transaction.
533542
534543 ---
535544
@@ -540,12 +549,32 @@ A wrapper class around py-evm which provides a "contract-centric" API. More deta
540549 - `gas`: The gas limit provided for the execution (a.k.a. `msg.gas`).
541550 - `value`: The ether value to attach to the execution (a.k.a `msg.value`).
542551 - `data`: The data to attach to the execution (a.k.a. `msg.data`).
552+ - `simulate`: If True, the call is executed in a context that is rolled back after execution.
543553
544554 ---
545555
546556 **Returns**
547557
548- The return value from the top-level call.
558+ A `ComputationAPI` object containing the execution result. Key attributes include:
559+ - `output`: The return data as bytes
560+ - `is_error`: Boolean indicating if the execution failed
561+ - `error`: The exception if execution failed
562+ - `gas_used`: Amount of gas consumed
563+
564+ ---
565+
566+ **Important**
567+
568+ Unlike `execute_code`, if the computation fails (`is_error` is True), this method raises the error as an exception.
569+
570+ ---
571+
572+ **Example**
573+
574+ ```python
575+ >>> computation = boa.env.raw_call(contract_address, data=b"\x00\x00\x00\x00")
576+ >>> print(computation.output.hex())
577+ ```
549578
550579---
551580
0 commit comments