vyper icon indicating copy to clipboard operation
vyper copied to clipboard

Support `kwarg` `revert_on_failure: bool = True` for contract creation built-in functions

Open pcaversaccio opened this issue 1 year ago • 0 comments

The 3 built-ins for contract creation:

  • create_minimal_proxy_to(target: address, ...)
  • create_copy_of(target: address, ...)
  • create_from_blueprint(target: address, ...)

currently always revert if the contract creation fails. This might not be desirable for all use cases. Thus I would like to propose to add the same kwarg revert_on_failure: bool = True as in raw_call to all 3 built-in functions above.

Specifications

create_minimal_proxy_to(target: address, value: uint256 = 0, revert_on_failure: bool = True[, salt: bytes32])→ address
create_copy_of(target: address, value: uint256 = 0, revert_on_failure: bool = True[, salt: bytes32])→ address
create_from_blueprint(target: address, *args, value: uint256 = 0, raw_args: bool = False, code_offset: int = 0, revert_on_failure: bool = True[, salt: bytes32])→ address

pcaversaccio avatar Jan 23 '24 17:01 pcaversaccio