• Stars
    star
    244
  • Rank 160,036 (Top 4 %)
  • Language
    Solidity
  • License
    MIT License
  • Created over 2 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Helper smart contract to make easier and safer usage of the `CREATE2` EVM opcode.

CREATE2 Deployer

Test smart contracts License: MIT

Helper smart contract to make easier and safer usage of the CREATE2 Ethereum Virtual Machine (EVM) opcode. CREATE2 can be used to compute in advance the address where a smart contract will be deployed, which allows for interesting new mechanisms known as counterfactual interactions.

A very fancy meme

Unit Tests

Since Hardhat implements great features for Solidity debugging like Solidity stack traces, console.log, and explicit error messages when transactions fail, we leverage Hardhat for testing:

npm run test

Test Coverage

This project repository implements a test coverage plugin. Simply run:

npm run coverage

The written tests available in the file Create2Deployer.test.ts achieve a test coverage of 100%:

--------------------------------|----------|----------|----------|----------|----------------|
File                            |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
--------------------------------|----------|----------|----------|----------|----------------|
 contracts\                     |      100 |      100 |      100 |      100 |                |
  Create2Deployer.sol           |      100 |      100 |      100 |      100 |                |
  Create2DeployerDeprecated.sol |      100 |      100 |      100 |      100 |                |
--------------------------------|----------|----------|----------|----------|----------------|
All files                       |      100 |      100 |      100 |      100 |                |
--------------------------------|----------|----------|----------|----------|----------------|

Important: A test coverage of 100% does not mean that there are no vulnerabilities. What really counts is the quality and spectrum of the tests themselves.

Deployments Create2Deployer

Footnotes

  1. Please refer to this issue why the contract Create2Deployer was not deployed on the Base mainnet.

More Repositories

1

reentrancy-attacks

A chronological and (hopefully) complete list of reentrancy attacks to date.
1,178
star
2

snekmate

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

xdeployer

Hardhat plugin to deploy your smart contracts across multiple EVM chains with the same deterministic address.
Solidity
399
star
4

createx

Factory smart contract to make easier and safer usage of the `CREATE` and `CREATE2` EVM opcodes as well as of `CREATE3`-based (i.e. without an initcode factor) contract creations.
Solidity
208
star
5

hardhat-project-template-ts

A fully-fledged Hardhat project template based on TypeScript.
TypeScript
186
star
6

malleable-signatures

This repository implements a simplified PoC that demonstrates how signature malleability attacks using compact signatures can be executed.
Solidity
103
star
7

ecdsa-nonce-reuse-attack

This repository implements a Python function that recovers the private key from two different signatures that use the same random nonce during signature generation.
Python
73
star
8

tornado-cash-exploit

This repository implements a simplified PoC that showcases how a contract can morph. A similar approach was used as part of the governance attack on Tornado Cash in May 2023.
Solidity
44
star
9

metatx

A smart contract to enable ERC-20 token meta-transactions on Ethereum.
JavaScript
43
star
10

escrow-contract

A simple multilateral escrow smart contract for ETH and ERC-20 tokens governed by Cobie.
TypeScript
36
star
11

raw-tx

Two scripts to generate and execute a signed raw transaction with ethers.
TypeScript
26
star
12

torn-detector

Detect if a contract has been deployed in the latest (or predefined) block from an address that was previously funded through Tornado.Cash.
TypeScript
22
star
13

meth

The moment you Rust, you should look for your Mojo 🔥.
20
star
14

solidity-games

A repository for Solidity-based smart contract games.
Solidity
19
star
15

batch-distributor

Helper smart contract for batch sending both native and ERC-20 tokens.
TypeScript
18
star
16

create-util

Helper smart contract to make easier and safer usage of the `CREATE` EVM opcode.
TypeScript
18
star
17

p256-verifier-vyper

P256 (a.k.a. secp256r1 elliptic curve) signature verification 🐍Vyper contract.
Vyper
17
star
18

ethereum-key-generation-python

Generating Ethereum addresses in Python.
Python
13
star
19

mnemonic-to-private-key

A JavaScript script that converts the mnemonic phrase into a wallet private key using the ethers.js library.
JavaScript
13
star
20

fork-testing-evm-compatibility

This repository implements a simple fork test on Optimism that proves that the EVM behaviour of the forked chain is not identically replicated locally.
Solidity
12
star
21

pcaversaccio

My public profile.
11
star
22

erc20-permit-upgradeable

Permit-enabled, upgradeable ERC20 smart contract template.
TypeScript
11
star
23

tornado-cash-ether-withdrawal-decipherer

Deciphering the ether transactions in the Tornado.Cash withdrawals.
JavaScript
7
star
24

bitsquatting

Helper script for generating permutations of an ENS domain that differ by 1-bit from the original domain.
Python
7
star
25

mass-key-generation

A repository for mass public-private key generation (Bitcoin & Ethereum).
Java
6
star
26

ethereum-key-generation

A repository that shows how to generate a private / public key pair using web3.js or HD wallets.
JavaScript
5
star
27

erc20-oz-sdk

How to deploy an ERC20 smart contract using OpenZeppelin SDK and write a TokenExchange smart contract.
Solidity
4
star
28

tokenbridge-helium-ethereum

A tokenbridge between the Helium blockchain (native network) and the Ethereum blockchain (foreign network).
4
star
29

chainlink-price-feed

Retrieve the ETH/USD price feed from Chainlink's oracle using Infura.
JavaScript
4
star
30

connection-vscode-to-google-colab-gpus

A step-by-step guide to connecting the local Visual Studio Code to Google Colab's GPU runtime.
4
star
31

zksync-vyper-sandbox

A sandbox environment for zkSync Era Vyper compiler testing.
TypeScript
3
star
32

configurations

Monorepo for my personal configurations.
Shell
2
star
33

pool-viewer

Similar to an ETH2 block explorer, but focused only on recent data.
2
star
34

porini-community-token-contract

This is Porini's ERC-20 smart contract, whose tokens can activate communities to support conservation activities and learn about blockchain technology.
JavaScript
2
star
35

pcaversaccio.github.io

My personal website.
HTML
2
star
36

impact-dollar-token-contract

This is Impact Dollar's ERC-20 smart contract, whose tokens can deliver a demonstrable contribution to conservation and protected areas through digital collectibles.
JavaScript
2
star
37

payfoot-token-contract

This is PayFoot's ERC-20 smart contract, whose tokens are used as stablecoins in their ecosystem.
JavaScript
2
star
38

startfeld-token-contract

This is Startfeld's ERC-20 smart contract, whose tokens are used as vouchers in their ecosystem.
JavaScript
2
star
39

randao-distribution

Empirical distribution of the randomness beacon (=RANDAO) provided by the Beacon chain.
Python
2
star
40

saentis-gulden-token-contract

This is Säntis Gulden's ERC-20 smart contract, whose tokens are used as vouchers in their ecosystem.
JavaScript
1
star
41

block-explorer-swissdlt

A block explorer for the Swiss DLT blockchain.
TypeScript
1
star
42

interface-solc-test

Solidity
1
star
43

ath-erc20-token

Smart contract of the Alethena (ATH) token.
1
star