Skip to content

🐍 snekmate v0.0.3

Compare
Choose a tag to compare
@pcaversaccio pcaversaccio released this 12 Oct 10:17
· 197 commits to main since this release
ebd8038

🫡 Summary

🐻Bear markets are made for building and you know what, the 🐍sneeek is shipping today 🔥! You might have heard that Vyper shipped version 0.3.10 eight days ago. But you might not know that the latest Vyper version is a heavily performance-oriented version that, among other things, generates selector tables that now offer O(1) performance 🤯 (see PR #3496). And so that you can take advantage of the latest improvements, I ship 🐍 snekmate version 0.0.3 today targeting the latest Vyper version!

Important: The default EVM version since Vyper version 0.3.8 is set to shanghai (i.e. the EVM includes the PUSH0 instruction).

👇 Below you find the detailed code changes and the full CHANGELOG. Don't stop. Push harder. Keep going.

💥 New Features

♻️ Refactoring

  • Extensions
    • ERC4626:
      • Remove the non-standard increase_allowance and decrease_allowance functions. (#160)
      • Optimise the method used to factor powers of two out of the denominator in _mul_div. (#162)
  • Tokens
    • ERC20:
      • Optimise the set_minter function to save one SLOAD. (#154)
      • Remove the non-standard increase_allowance and decrease_allowance functions. (#160)
    • ERC721: Optimise the set_minter function to save one SLOAD. (#154)
    • ERC1155: Optimise the set_minter function to save one SLOAD. (#154)
  • Utility Functions
    • Math: Optimise the method used to factor powers of two out of the denominator in mul_div. (#153)
  • Vyper Contract Deployer
    • VyperDeployer: If you want to leverage 🐍 snekmate's VyperDeployer contract for your own testing, ensure that you compile the Vyper contracts with the same EVM version as configured in your foundry.toml file. The VyperDeployer contract offers two overloaded deployContract functions that allow the configuration of the target EVM version. Please note that since Vyper version 0.3.8 the default EVM version is set to shanghai. (#161)

🥢 Test Coverage

❗️ Breaking Change

  • All 🐍 snekmate contracts now target the Vyper version 0.3.10 (#164). It is strongly recommended to upgrade accordingly your local Vyper version prior to using the 🐍 snekmate contracts. Important: The default EVM version since Vyper version 0.3.8 is set to shanghai (i.e. the EVM includes the PUSH0 instruction). If you intend to deploy on an EVM chain with no PUSH0 support, you must compile the 🐍 snekmate contracts with the --evm-version paris option; e.g. vyper --evm-version paris utils/Math.vy, or add the # pragma evm-version paris directive to the 🐍 snekmate contracts:
# pragma version ^0.3.10
# pragma evm-version paris
# pragma optimize gas
"""
@title Modern and Gas-Efficient ERC-20 + EIP-2612 Implementation
...
"""


# @dev We import and implement the `ERC20` interface,
# which is a built-in interface of the Vyper compiler.
from vyper.interfaces import ERC20
implements: ERC20
...

The # pragma optimize directive has also been added in Vyper version 0.3.10 (see PR #3493). Please refer to here to learn more about the different options none, codesize, and gas (default).

🙏🏽 New Contributors

👀 Full Changelog

v0.0.2...v0.0.3