Skip to content

Conversation

pcaversaccio
Copy link
Owner

@pcaversaccio pcaversaccio commented May 5, 2025

πŸ•“ Changelog

Vyper has recently introduced the new raw_create built-in function via PR #4204, enabling direct contract creations using the EVM opcodes CREATE and CREATE2. In response, this PR adds CREATE, CREATE2, and CREATE3-based (i.e. without an initcode factor) utility functions to the corresponding module contracts in 🐍 snekmate. Please note that the current upper limit for the contract creation code is set to 8_192 bytes ($2^{13}$).

from snekmate.utils import create as c1
from snekmate.utils import create2 as c2
from snekmate.utils import create3 as c3


@external
@payable
def deploy_create(init_code: Bytes[8_192]) -> address:
    return c1._deploy_create(init_code)


@external
@payable
def deploy_create2(salt: bytes32, init_code: Bytes[8_192]) -> address:
    return c2._deploy_create2(salt, init_code)


@external
@payable
def deploy_create3(salt: bytes32, init_code: Bytes[8_192]) -> address:
    return c3._deploy_create3(salt, init_code)

⚠️ Breaking Changes

To improve clarity and maintain consistent naming conventions, the following name changes are included in this PR:

  • create_address.vy β†’ create.vy`
    • _compute_address_rlp_self β†’ _compute_create_address_self
    • _compute_address_rlp β†’ _compute_create_address
    • _convert_keccak256_2_address β†’ _convert_keccak256_to_address
  • create2_address.vy β†’ create2.vy
    • _compute_address_self β†’ _compute_create2_address_self
    • _compute_address β†’ _compute_create2_address

These name changes are not backward-compatible and may require code updates in downstream projects.

Furthermore, Solidity has released its latest version v0.8.30. This PR updates the Solidity test files to align with this new version (we keep evm_version = "cancun").

🐢 Cute Animal Picture

Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio self-assigned this May 5, 2025
@pcaversaccio pcaversaccio added feature πŸ’₯ New feature or request refactor/cleanup ♻️ Code refactorings and cleanups labels May 5, 2025
@pcaversaccio pcaversaccio added this to the 0.1.2 milestone May 5, 2025
pcaversaccio and others added 18 commits May 6, 2025 11:07
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio marked this pull request as ready for review May 12, 2025 16:12
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio added the dependencies πŸ” Pull requests that update a dependency file label May 15, 2025
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
@pcaversaccio pcaversaccio added the documentation πŸ“– Improvements or additions to documentation label May 15, 2025
@pcaversaccio pcaversaccio merged commit 07cab1d into main May 15, 2025
13 of 15 checks passed
@pcaversaccio pcaversaccio deleted the feat/create-deployment-functions branch May 15, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies πŸ” Pull requests that update a dependency file documentation πŸ“– Improvements or additions to documentation feature πŸ’₯ New feature or request refactor/cleanup ♻️ Code refactorings and cleanups
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant