Giter Site home page Giter Site logo

pcaversaccio / snekmate Goto Github PK

View Code? Open in Web Editor NEW
479.0 9.0 51.0 2.1 MB

State-of-the-art, highly opinionated, hyper-optimised, and secure 🐍Vyper smart contract building blocks.

License: GNU Affero General Public License v3.0

Vyper 32.06% Solidity 67.32% JavaScript 0.59% Python 0.03%
ethereum library smart-contracts vyper vyper-contracts evm security

snekmate's Introduction

🐍 snekmate

πŸ•΅οΈβ€β™‚οΈ Test smart contracts License: AGPL-3.0-only npm package PyPI package

State-of-the-art, highly opinionated, hyper-optimised, and secure 🐍Vyper smart contract building blocks.

Warning

This is experimental software and is provided on an "as is" and "as available" basis. We do not give any warranties and will not be liable for any losses incurred through any use of this code base.

πŸ“œ Contracts

src
└── snekmate
    β”œβ”€β”€ auth
    β”‚   β”œβ”€β”€ Ownable β€” "Owner-Based Access Control Functions"
    β”‚   β”œβ”€β”€ Ownable2Step β€” "2-Step Ownership Transfer Functions"
    β”‚   β”œβ”€β”€ AccessControl β€” "Multi-Role-Based Access Control Functions"
    β”‚   └── interfaces
    β”‚       └── IAccessControl β€” "AccessControl Interface Definition"
    β”œβ”€β”€ extensions
    β”‚   β”œβ”€β”€ ERC2981 β€” "ERC-721 and ERC-1155 Compatible ERC-2981 Reference Implementation"
    β”‚   β”œβ”€β”€ ERC4626 β€” "Modern and Gas-Efficient ERC-4626 Tokenised Vault Implementation"
    β”‚   └── interfaces
    β”‚       └── IERC2981 β€” "EIP-2981 Interface Definition"
    β”œβ”€β”€ governance
    β”‚   └── TimelockController β€” "Multi-Role-Based Timelock Controller Reference Implementation"
    β”œβ”€β”€ tokens
    β”‚   β”œβ”€β”€ ERC20 β€” "Modern and Gas-Efficient ERC-20 + EIP-2612 Implementation"
    β”‚   β”œβ”€β”€ ERC721 β€” "Modern and Gas-Efficient ERC-721 + EIP-4494 Implementation"
    β”‚   β”œβ”€β”€ ERC1155 β€” "Modern and Gas-Efficient ERC-1155 Implementation"
    β”‚   └── interfaces
    β”‚       β”œβ”€β”€ IERC20Permit β€” "EIP-2612 Interface Definition"
    β”‚       β”œβ”€β”€ IERC721Enumerable β€” "EIP-721 Optional Enumeration Interface Definition"
    β”‚       β”œβ”€β”€ IERC721Metadata β€” "EIP-721 Optional Metadata Interface Definition"
    β”‚       β”œβ”€β”€ IERC721Permit β€” "EIP-4494 Interface Definition"
    β”‚       β”œβ”€β”€ IERC721Receiver β€” "EIP-721 Token Receiver Interface Definition"
    β”‚       β”œβ”€β”€ IERC1155 β€” "EIP-1155 Interface Definition"
    β”‚       β”œβ”€β”€ IERC1155MetadataURI β€” "EIP-1155 Optional Metadata Interface Definition"
    β”‚       β”œβ”€β”€ IERC1155Receiver β€” "EIP-1155 Token Receiver Interface Definition"
    β”‚       └── IERC4906 β€” "EIP-4906 Interface Definition"
    └── utils
        β”œβ”€β”€ Base64 β€” "Base64 Encoding and Decoding Functions"
        β”œβ”€β”€ BatchDistributor β€” "Batch Sending Both Native and ERC-20 Tokens"
        β”œβ”€β”€ CreateAddress β€” "`CREATE` EVM Opcode Utility Function for Address Calculation"
        β”œβ”€β”€ Create2Address β€” "`CREATE2` EVM Opcode Utility Functions for Address Calculations"
        β”œβ”€β”€ ECDSA β€” "Elliptic Curve Digital Signature Algorithm (ECDSA) Functions"
        β”œβ”€β”€ SignatureChecker β€” "ECDSA and EIP-1271 Signature Verification Functions"
        β”œβ”€β”€ EIP712DomainSeparator β€” "EIP-712 Domain Separator"
        β”œβ”€β”€ Math β€” "Standard Mathematical Utility Functions"
        β”œβ”€β”€ MerkleProofVerification β€” "Merkle Tree Proof Verification Functions"
        β”œβ”€β”€ Multicall β€” "Multicall Functions"
        └── interfaces
            └── IERC5267 β€” "EIP-5267 Interface Definition"

πŸŽ› Installation

Important

🐍 snekmate uses a ZeroVer-based versioning scheme. This means 🐍 snekmate's major version will never exceed the first and most important number in computing: zero.

We offer three convenient ways to install the 🐍 snekmate contracts:

1️⃣ Foundry

You can install 🐍 snekmate via submodules using Foundry with:

forge install pcaversaccio/snekmate

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.

2️⃣ PyPI

You can install 🐍 snekmate from PyPI with:

pip install snekmate

You can use pip install snekmate -t . to install the contracts directly into the current working directory!

3️⃣ npm

You can install 🐍 snekmate from npm with:

npm install --save-dev snekmate

Or if you are using Yarn:

yarn add --dev snekmate

In case you are using pnpm, invoke:

pnpm add --save-dev snekmate

Caution

It is possible to install the latest versions of main or any other branch locally via pip install git+https://github.com/pcaversaccio/snekmate.git@<branch> or forge install pcaversaccio/snekmate && forge update. Each branch, including the main branch, must be understood as a development branch that should be avoided in favour of tagged releases. The release process includes security measures that the repository branches do not guarantee.

πŸ‘©πŸΌβ€βš–οΈ Tests

This repository contains Foundry-based unit tests, property-based tests (i.e. fuzzing), and invariant tests for all contracts, if applicable. All tests are run as part of the CI pipeline test-contracts.

Note

An invariant is a property of a program that should always hold true. Fuzzing is a way of checking whether the invariant is falsifiable.

Contract Unit Tests Property-Based Tests Invariant Tests
Ownable βœ… βœ… βœ…
Ownable2Step βœ… βœ… βœ…
AccessControl βœ… βœ… βœ…
ERC2981 βœ… βœ… βœ…
ERC4626 βœ… βœ… βœ…
TimelockController βœ… βœ… βœ…
ERC20 βœ… βœ… βœ…
ERC721 βœ… βœ… βœ…
ERC1155 βœ… βœ… βœ…
Base64 βœ… ❌ ❌
BatchDistributor βœ… βœ… βœ…
CreateAddress βœ… βœ… ❌
Create2Address βœ… βœ… ❌
ECDSA βœ… βœ… ❌
SignatureChecker βœ… βœ… ❌
EIP712DomainSeparator βœ… βœ… ❌
Math βœ… βœ… ❌
MerkleProofVerification βœ… βœ… ❌
Multicall βœ… ❌ ❌

βœ… Test Type Implemented   ❌ Test Type Not Implemented

πŸ™πŸΌ Acknowledgements

This repository is inspired by or directly modified from many sources, primarily:

🫑 Contributing

🐍 snekmate only exists thanks to its contributors. There are many ways to get involved and contribute to our high-quality and secure smart contracts. Check out our Contribution Guidelines!

πŸ’Έ Donation

I am a strong advocate of the open-source and free software paradigm. However, if you feel my work deserves a donation, you can send it to this address: 0xe9Fa0c8B5d7F79DeC36D3F448B1Ac4cEdedE4e69. I can pledge that I will use this money to help fix more existing challenges in the Ethereum ecosystem 🀝.

πŸ’’ Disclaimer

snekmate's People

Contributors

bout3fiddy avatar cairoeth avatar charles-cooper avatar controlcpluscontrolv avatar dependabot[bot] avatar el-ku avatar engn33r avatar hrik2001 avatar jaglinux avatar jtriley-eth avatar mattsse avatar omnifient avatar pcaversaccio avatar renovate[bot] avatar yamenmerhi avatar zhouxianyuan avatar zobront avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snekmate's Issues

πŸ’₯ Implement `deployBlueprint` Function in `VyperDeployer` Utility Function

Describe the desired feature:

It would be convenient that the VyperDeployer.sol implemented an easy way of deploying blueprint contracts. In fact, 0xKitsune has a nice function implementing it.

Code example that solves the feature:

    /**
     * @dev Compiles a blueprint Vyper contract and returns the address that
     * the contract was deployed to.
     * If the deployment fails, an error is thrown.
     * @param path The directory path of the Vyper contract.
     * For example, the path of "utils" is "src/utils/".
     * @param fileName The file name of the Vyper contract.
     * For example, the file name for "ECDSA.vy" is "ECDSA".
     * @return deployedAddress The address that the contract was deployed to.
     */
    function deployBlueprint(
        string memory path,
        string memory fileName
    ) public returns (address) {
        /**
         * @dev Create a list of strings with the commands necessary
         * to compile Vyper contracts.
         */
        string[] memory cmds = new string[](4);
        cmds[0] = "vyper";
        cmds[1] = "-f";
        cmds[2] = "blueprint_bytecode";
        cmds[3] = string.concat(path, fileName, ".vy");

        /**
         * @dev Compile the Vyper contract and return the bytecode.
         */
        bytes memory bytecode = cheatCodes.ffi(cmds);

        /**
         * @notice prepend needed items for Blueprint EIP 
         * See https://eips.ethereum.org/EIPS/eip-5202 for more details
         */ 
        bytes memory eip_5202_bytecode = bytes.concat(
            hex"fe", // EIP_5202_EXECUTION_HALT_BYTE
            hex"71", // EIP_5202_BLUEPRINT_IDENTIFIER_BYTE
            hex"00", // EIP_5202_VERSION_BYTE
            bytecode
        );

        bytes2 len = bytes2(uint16(eip_5202_bytecode.length));

        /**
         * @notice prepend the deploy preamble
         */
        bytes memory deployBytecode = bytes.concat(
            hex"61",             // DEPLOY_PREAMBLE_INITIAL_BYTE
            len,                 // DEPLOY_PREAMBLE_BYTE_LENGTH
            hex"3d81600a3d39f3", // DEPLOY_PREABLE_POST_LENGTH_BYTES
            eip_5202_bytecode
        );

        /**
         * @dev Deploy the bytecode with the `CREATE` instruction.
         */
        address deployedAddress;
        deployedAddress = deploy(0, deployBytecode);

        /**
         * @dev Check that the deployment was successful.
         */
        if (deployedAddress == address(0)) revert DeploymentFailed(self);

        /**
         * @dev Return the address that the contract was deployed to.
         */
        return deployedAddress;
    }

πŸ’₯ Implement Ternary Operator

In the new Vyper version 0.3.8, the ternary operator has been implemented (see here):

@external
def hello(a: uint256, b: uint256) -> uint256:
    return a if a < b else b

We should assess the full code base, where a ternary operator could be beneficial.

πŸ”’ Disallow Address Poisoning in `ERC20`

I open this issue to track whether we should implement that zero transferFrom calls should be reverted. The implementation would look like this:

@internal
def _spend_allowance(owner: address, spender: address, amount: uint256):
    current_allowance: uint256 = self.allowance[owner][spender]
    if (current_allowance != max_value(uint256)):
        assert current_allowance >= max(amount, 1), "ERC20: insufficient allowance"
        self._approve(owner, spender, unsafe_sub(current_allowance, amount))

The reason why we should at least discuss it is that zero transferFrom calls can be invoked by anyone and allow for a certain type of phishing, see e.g. here.

πŸ”’ Revert in EIP-1271 `SignatureChecker`

Describe the issue:

What this issue is about ?

Looking at the current implementation of is_valid_ERC1271_signature_now(..), we can see that the return value is always checked to be the magic value in order to return true, otherwise, the function should return false.

This is the same behavior implemented in OpenZeppelin's SignatureChecker library.

The only difference is that in the current implementation in vyper, if you call is_valid_ERC1271_signature_now(..) on a contract that doesn't implement isValidSignature(..) it will revert the call.

IMO, this should be changed to match the OpenZeppelin behavior, where in case of revert (The signer doesn't implement isValidSignature(..) nor have the default function) it should return false.

Because the whole purpose of having a utility function like this is to abstract the checks that need to be done after an isValidSignature(..) call. The person implementing this function just uses it to know whether the signature was valid or invalid and shouldn't expect a revert.

Let me know what do you think.

Code example to reproduce the issue:

This code snippet:

return_data: Bytes[32] = \
        raw_call(signer, _abi_encode(hash, signature, method_id=IERC1271_ISVALIDSIGNATURE_SELECTOR), max_outsize=32, is_static_call=True)
    return ((len(return_data) == 32) and (convert(return_data, bytes32) == convert(IERC1271_ISVALIDSIGNATURE_SELECTOR, bytes32)))

Needs to be changed to something like this: add the revert_on_failure flag, and in the return line add that it should be a success and ..

success: bool = False
    response: Bytes[32] = b""
    success, response = \
    raw_call(signer, _abi_encode(hash, signature, method_id=IERC1271_ISVALIDSIGNATURE_SELECTOR), max_outsize=32, is_static_call=True, revert_on_failure=False)
    return (success and (len(response) == 32) and (convert(response, bytes32) == convert(IERC1271_ISVALIDSIGNATURE_SELECTOR, bytes32)))

Version:

0.3.7+commit.6020b8b

Relevant log output:

No response

♻️ Refactor Shift Operators

In the new Vyper version 0.3.8, the commonly-know shift operators x << y and x >> y have been enabled and the currently existing operator shift has been deprecated from version 0.3.8 onwards.

A couple of comments for the sake of documentation:

  • x can be uint256 OR int256.
  • For logical shifting x must be uint256 whilst for arithmetic shift operations x must be int256.
  • A right shift x >> y for negative x is rounded down (towards negative infinity).
  • A runtime overflow always returns 0 and not anything else. This contradicts the intuition we have from unchecked arithmetic where everything wraps and starts all over again from 0 but can have any uint256 result. What I mean by that is:
@external
@pure
def foo(x: uint8, y: uint8) -> uint8:
    return unsafe_add(x, y)

ExampleContract.foo(255, 255) will result in 254 and not 0.

♻️ Reorder `README` Sequence

The README sequence should look like this:

src
β”œβ”€ auth
β”‚  β”œβ”€ Ownable β€” "Owner-Based Access Control Functions"
β”‚  β”œβ”€ Ownable2Step β€” "2-Step Ownership Transfer Functions"
β”‚  β”œβ”€ AccessControl β€” "Multi-Role-Based Access Control Functions"
β”œβ”€ extensions
β”‚  β”œβ”€ ERC4626 β€” "ERC-4626 Tokenised Vault Implementation (TBD)"
β”œβ”€ tokens
β”‚  β”œβ”€ ERC20 β€” "Modern and Gas-Efficient ERC-20 + EIP-2612 Implementation"
β”‚  β”œβ”€ ERC721 β€” "Modern and Gas-Efficient ERC-721 + EIP-4494 Implementation"
β”‚  β”œβ”€ ERC1155 β€” "Modern and Gas-Efficient ERC-1155 Implementation (TBD)"
β”œβ”€ utils
   β”œβ”€ Base64 β€” "Base64 Encoding and Decoding Functions"
   β”œβ”€ BatchDistributor β€” "Batch Sending Both Native and ERC-20 Tokens"
   β”œβ”€ CreateAddress β€” "`CREATE` EVM Opcode Utility Function for Address Calculation"
   β”œβ”€ Create2Address β€” "`CREATE2` EVM Opcode Utility Functions for Address Calculations"
   β”œβ”€ ECDSA β€” "Elliptic Curve Digital Signature Algorithm (ECDSA) Functions"
   β”œβ”€ SignatureChecker β€” "ECDSA and EIP-1271 Signature Verification Function"
   β”œβ”€ EIP712DomainSeparator β€” "EIP-712 Domain Separator"
   β”œβ”€ MerkleProofVerification β€” "Merkle Tree Proof Verification Functions"
   β”œβ”€ Multicall β€” "Multicall Functions"

🫑 Release Version `0.0.1`

  • Final review of the repository & push a final gas snapshot
  • Add "Installation" to README; add npm and PyPI markdown badges; add release date to CHANGELOG
  • Prepare package.json
  • Prepare PyPI release
  • Make Test PyPI release
  • Publish GitHub release
  • Publish npm release
  • Publish PyPI release
  • Close milestone 0.0.1

πŸ“– Add `CHANGELOG`

Once we have got the first major release ready, we should consider adding a CHANGELOG file that tracks the changes.

πŸ’₯ Add Strict ERC-1271 Signature Checking for `SignatureChecker`

What this issue is about?

Motivation

In the current SignatureChecker, there is support to check if a signature is valid with the is_valid_signature_now(..) function that checks the following:

  • If the hash and signature recover an address that is the same as the signer, it returns true.
  • When it's not the case, it calls is_valid_signature(..) on the signer assuming it's a contract.

What would be a great addition to the library is to have another internal function that checks if a signature is valid with ERC1271 only. So calling is_valid_signature(..) directly on the signer implementing ERC1271.

This function will be useful for functions that want to interact only with wallets such as argent, gnosis, etc .. and check the signature only via ERC1271.

Then this function can be re-used in is_valid_signature_now(..).

Details

Developers can interact with other smart contract wallets by calling is_valid_signature(..) function directly. Still, they need to handle the return value, so the new function can be a wrapper named is_valid_ERC1271_signature_now(address,bytes32,bytes[65]) that calls is_valid_signature(..) on the address with the hash and the signature and don't revert if the function doesn't exist and return true or false, depending if the function returns the isValidSignature.selector. Exactly like what the code does in the second part of the is_valid_signature_now(..) function.

If you find this addition relevant, I can work on creating the new function (splitting the is_valid_signature_now(..) function into a new one).

Code example that solves the feature:

It would be mostly taking this part of the function to a new function (is_valid_ERC1271_signature_now(..)) that can be re-used in is_valid_signature_now(..)

# Second check: EIP-1271 case.
    return_data: Bytes[32] = \
        raw_call(signer, _abi_encode(hash, signature, method_id=IERC1271_ISVALIDSIGNATURE_SELECTOR), max_outsize=32, is_static_call=True)
    return ((len(return_data) == 32) and (convert(return_data, bytes32) == convert(IERC1271_ISVALIDSIGNATURE_SELECTOR, bytes32)))

♻️ Change `memory` to `calldata` in Solidity Test Interfaces

Currently, multiple Solidity-based test interfaces contain some functions where the function input parameters contain the data location memory instead of calldata. However, Vyper does not allow for memory location of the input parameters. So we need to refactor this. This poses no security risk, however, in the unit tests since the unit tests are run against the Vyper bytecode.

πŸ› Failed Signature Recovery in `ECDSA`

Describe the issue:

I'm working on some signature verification code in Vyper and consistently failing to recover the correct signer address when using ECDSA.vy's recover_sig function.

I have deployed ECDSA.vy to goerli at 0xAdf31a3b9B9DD0486199A1029BEb8bA4Cc86e5E4

Here are the inputs I am using:

cast keccak 1234 outputs 0x387a8233c96e1fc0ad5e284353276177af2186e7afa85296f106336e376669f7

I now want to sign this hash, and use ECDSA.vy to recover the address used to sign.

I am using wagmi.sh's components to generate a signature on my frontend. I input the above hash into the frontend widget, then sign, and the frontend widget recovers my signature as expected after I confirm and sign with my wallet (screenshot attached). You can access this same widget here

frontend screenshot

I then take the signature provided to me by the widget and call:

In [6]: e.recover_sig("0x387a8233c96e1fc0ad5e284353276177af2186e7afa85296f106336e376669f7", "0x042f669e124b91b5c975d3bc329618373ee0bc666c6412891ff6d85e7e0cf7ae4f9630450253ac55784fc534c655ff2e3743e04df2a5035728ecede196a379311c")
Out[6]: '0xbA3De837Da49408AD799d6B7ffD40a013B7214FB'

I was able to run forge test --match-contract ECDSA successfully, and the tests pass, but this failing example here is so minimal that I have no idea what else to try.

Code example to reproduce the issue:

see ECDSA.vy

Version:

0.3.7+commit.6020b8b

Relevant log output:

No response

πŸ’₯ `ERC-2981` (NFT Royalty Standard) Implementation

@victor-ego proposes to implement ERC-2981 (NFT royalty standard) for 🐍 snekmate's ERC721 contract.

This issue is opened to gather the discussion around whether such an implementation is of a value-add.

Personally, I have the following view:

  • EIP-2981 only defines a way to show/signal royalty information BUT does not enforce the payment actually. Thus, you're actually relying on marketplaces to voluntarily pay the royalties. Also, I got the feeling that this standard is not yet widely supported (still an open issue on OpenSea: ProjectOpenSea/opensea-js#482). So am not sure about the overall value-add and acceptance.

Let me know your thoughts.

πŸ’₯ Version `0x00` of EIP-191 in ECDSA Library Implementation

Describe the desired feature:

🧐 Motivation

In the current ECDSA library, there is support to construct a message to sign according to the EIP191 Standard with the following:

  • The version 0x45 (E) with to_eth_signed_message_hash(..) function
  • The version 0x01 with the to_typed_data_hash(..) function.
    But we are missing the 0x00 version.

Screen Shot 2022-10-19 at 10 17 27 PM

πŸ“ Details

Version0x00 version is not that used because people are misusing the standard, they are using the 0x45 version for everything: signing messages for off-chain verification, for smart contract execution based on signatures, which is dangerous.

As people could be easily tricked into signing a normal message, thinking it is for login purposes, and then end up having execution based on this signature, so we should have a different mechanism, then different handling for execution based on signatures, and that's why we should make people use the 0x00 version for this case. + some projects are starting to use it like xenium and the lsp-smart-contracts.

I am suggesting adding a new function to_data_with_intended_validator or to_data_with_intended_validator_hash to be compatible with the version 0x00 taking 2 parameters, <address validator> and <bytes dataToSign>.

A library that supports the case: EIP-191 Signer.
The Opened issue in OpenZeppelin: Implement 0x00 version of EIP191 in ECDSA Library

If you're okay with it I am happy to open the PR, otherwise, you can close the issue πŸ˜„

Code example that solves the feature:

@external
@pure
def to_data_with_intended_validator(validator: address, data_to_sign: Bytes[1024]=b"") -> bytes32:
    """
    @dev Returns an intended validator signed data according to 
    0x00 version of EIP-191.
    @param validator The address validating the signature
    @param struct_hash The data passed to be signed
    @return bytes32 The 32-byte intended validator signed data.
    """
    return keccak256(concat(b"\x19\x00", validator, data_to_sign))

πŸ’₯ EIP-2098 Implementation

In light of the recent malleability issue raised by OpenZeppelin, we need to think about how to implement or patch it. In any case, anyone that uses signatures should not use them as identifiers. In the current version, I have put a warning comment that describes the potential security risk of the function recover_sig.

πŸ” Upgrade to Vyper Version `0.3.10`

There will be a new Vyper version 0.3.10 released in around 2 weeks. We will need to upgrade all 🐍 snekmate contracts since the new version will entail various performance improvements and security patches (see, e.g., here).

Current release candidates:

Update

Released via https://github.com/vyperlang/vyper/releases/tag/v0.3.10.

πŸ’₯ ERC-1271 Signatures

Implement a signature verification helper that can be used instead of ECDSA.recover_sig to seamlessly support both ECDSA signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like Argent and Gnosis Safe.

πŸ“– Official Style Guide

🐍 snekmate does not currently have an official style guide for contributors to follow. Once we've implemented the ERC-1155 and ERC-4626 contracts and done a little cleanup, we should focus on the official style guide that needs to be followed. Importantly, it should be easily verifiable and enforceable via GitHub actions. There is an unofficial Vyper formatter called mamushi (fork of the popular Black formatter) that we should also investigate.

πŸ” Upgrade to Vyper Version `0.3.9`

There will be a new Vyper version 0.3.8 released in around 4 weeks. We will need to upgrade all 🐍 snekmate contracts since the new version will entail various bug fixes and security patches (see, e.g., here).

♻️ Remove `increase_allowance` and `decrease_allowance` from `ERC20` and `ERC4626`

See OpenZeppelin/openzeppelin-contracts#4583. We should remove the functions increase_allowance and decrease_allowance from the ERC20 and ERC4626 contracts as they only solve an imaginary problem and could be used to bypass spending restrictions in smart contract wallets. The reason I added it firsthand was to be consistent with the OpenZeppelin/Solady implementations to avoid any confusion. The PR that implements this change requires a CHANGELOG entry.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.