π snekmate v0.1.1
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββ
βββββββββββββββββββββ
βββββββββββββββββββββ
βββββββββββββββββββββ
βββββββββββββββββββββ
βββββββββββββββββββββ
It's been a while since the last module release, but now π snekmate version 0.1.1 is here, optimised for the latest πVyper release 0.4.1:
pip install vyper snekmateThis release is primarily focused on refining contract code structure, expanding test coverage, and introducing the new pausable feature:
# pragma version ~=0.4.1
from ethereum.ercs import IERC20
from ethereum.ercs import IERC20Detailed
from snekmate.auth import ownable
from snekmate.tokens import erc20
from snekmate.utils import pausable
initializes: ownable
initializes: erc20[ownable := ownable]
initializes: pausable
implements: IERC20
implements: IERC20Detailed
exports: (
erc20.owner,
erc20.transfer_ownership,
erc20.renounce_ownership,
erc20.totalSupply,
erc20.balanceOf,
erc20.approve,
erc20.allowance,
erc20.IERC20Detailed,
erc20.mint,
erc20.set_minter,
pausable.paused,
)
@deploy
def __init__():
ownable.__init__()
erc20.__init__("Vyper", "VY", 18, "Vyper", "1")
pausable.__init__()
@external
def transfer(to: address, amount: uint256) -> bool:
pausable._require_not_paused()
erc20._transfer(msg.sender, to, amount)
return True
@external
def transferFrom(owner: address, to: address, amount: uint256) -> bool:
pausable._require_not_paused()
erc20._spend_allowance(owner, msg.sender, amount)
erc20._transfer(owner, to, amount)
return True
@external
def pause():
ownable._check_owner()
pausable._pause()
@external
def unpause():
ownable._check_owner()
pausable._unpause()I deployed and verified the contract on Sepolia at
0x19dD047ecA50C037e848fbc5Fb4c875Bfc35A4D5.
π Below are the detailed code changes, π snekmate's new contributors, and the full CHANGELOG. Keep pushing with persistence. Exceed your limits. Forge ahead with confidence.
π₯ New Features
β»οΈ Refactoring
- Authentication
ownable: Use keyword arguments for event instantiation. (#280)ownable_2step: Use keyword arguments for event instantiation. (#280)access_control:
- Extensions
- Governance
timelock_controller: Use keyword arguments for event instantiation. (#280)
- Tokens
- Utility Functions
base64: Use native hex stringx"..."literals. (#283)message_hash_utils: Use native hex stringx"..."literals. (#283)eip712_domain_separator:math: Use mutableinternalfunction parameters. (#267)multicall: OptimiseBatch-basedforloops. (#287)
π₯’ Test Coverage
-
All π snekmate contract tests, i.e. unit tests, stateless and stateful fuzzing tests (including Echidna), and Halmos-based symbolic tests, are now also run against the experimental Venom backend. (#268)
-
Tokens