Coder Social home page Coder Social logo

pcaversaccio / createx Goto Github PK

View Code? Open in Web Editor NEW
243.0 6.0 14.0 1.44 MB

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.

Home Page: https://createx.rocks

License: GNU Affero General Public License v3.0

Solidity 82.20% JavaScript 0.47% TypeScript 16.49% CSS 0.84%
create create2 create3 deployment factory-contract solidity ethereum

createx's Introduction

Hi there πŸ‘‹ I'm Pascal

Linktree

About me πŸ’―

  • πŸ”­ I'm currently working on what's next.
  • πŸ”§ My day (and sometimes night) job is to help safeguard the Ethereum ecosystem.
  • βž• Previously, I founded DAITA Technologies, a Swiss-based startup specialising in transforming raw data into AI-ready data sets at scale, and Alethena, a company pioneering Ethereum-based tokenised shares and their trading via an automated market maker in Switzerland.
  • πŸŽ“ I hold a Master's degree in Quantitative Finance from the Swiss Federal Institute of Technology Zurich (ETH Zurich).
  • ❀️ Generally, I'm truly passionate about Machine/Deep Learning, Computer Vision, Ethereum Smart Contracts, Bitcoin, and OSS Engineering.
  • πŸ“« How to reach me: [email protected].
  • 🌱 I'm currently learning not to go insane – broadly speaking.
  • πŸ’¬ Ask me about anything – maybe I can help you; most likely not.
  • ⚑ Fun fact: It took less code to send a man to the moon than to run a smartphone.

πŸ’» OSes

Debian Ubuntu Windows

🎯 Skills

⌨️ Programming languages

JavaScript Python Solidity TypeScript

πŸŽ› Frameworks and runtime environments

Angular Node.js PyTorch TensorFlow

πŸ—ƒ Package, dependency, and environment management

Conda npm pnpm Yarn

πŸ›  Toolings, platforms, infrastructure providers, and libraries

AWS Cloudflare Git Postman

NumPy OpenCV SciPy

πŸ“¦ npm packages

  • xdeployer – A Hardhat plugin to deploy your smart contracts across multiple Ethereum Virtual Machine (EVM) chains with the same deterministic address.

πŸ“š Smart contract libraries

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

😎 Miscellaneous

πŸ’° Funding

Bitcoin Ethereum Stripe

πŸ”Ž Some stats

Pascal's GitHub Stats

Top Langs

Visitors

createx's People

Contributors

dependabot[bot] avatar mds1 avatar pcaversaccio avatar renovate[bot] 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

createx's Issues

♻️ Use String Numbers for `assert` Statements

Fixes #14 (comment). Example:

assertEq(newContract, computedAddress, "100");
assertNotEq(newContract, zeroAddress, "200");
assertNotEq(newContract.code.length, 0, "300");
assertEq(newContract.balance, 0, "400");
assertEq(ERC20Mock(computedAddress).name(), arg1, "500");
assertEq(ERC20Mock(computedAddress).symbol(), arg2, "600");
assertEq(ERC20Mock(computedAddress).balanceOf(arg3), arg4, "700");

Clarification request - PK management of CreateX deployer

CreateX is awesome contract to ensure having the same address on the different EVM chains.

It is assumed that CreateX will be deployed on the future / not yet rolled out EVM chains.

In order to satisfy this assumption following risks shall be addressed:

  • risk of loss of deployer's PK (this would result into impossibility to deploy to the new chains having replay protection )

  • risk of leakage of deployer's PK (this could result in frontrunning the CreateX deployment transaction)

Can you please address these risks and describe mitigations here / into README?

πŸ’₯ Build `CreateXCrunch`

Describe the desired feature:

To mine efficient (e.g. 0x00000000XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) or opinionated (0xba5edXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXba5ed) Ethereum addresses for the deployed contract address, we should build a Rust or C++-based tooling that is powered by GPU support using OpenCL features. CPU support can also be part of it.

Related issues:

Possible specification

~$ createxcrunch -h
usage: createxcrunch [-h] [-V] [-f factory_address] [-pdp permissioned_deploy_protection] [-c caller_address] [-crp crosschain_redeploy_protection] [-z minimum_leading_zeros] [-m matching_pattern] [-o output_path] input_file [path_to_JSON_file]

positional argument:
  input_file              Contract creation code as JSON file.

generic program information:
  -h, --help              Show this help message and exit.
  -V, --version           Show program's version number and exit.

salt crunching configuration options:
  -f, --factory           Set the factory address. (Optional, defaults to `0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed`).
  -pdp, --permissioned    Set a permissioned deploy protection. (Optional, defaults to `false`).
  -c, --caller            Set the caller address in checksummed hex format. Required if `pdp = true`, otherwise input will be ignored.
  -crp, --crosschain      Set a cross-chain redeploy protection. (Optional, defaults to `false`).
  -z, --zeros             Minimum number of leading zeros. Example: `-z 4`. Cannot be used in combination with `-m`. (Optional, defaults to `0`).
  -m, --matching          Matching pattern for the contract address. Example: `-m ba5edXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXba5ed`. Cannot be used in combination with `-z`. (Optional, defaults to random pattern).

general output control:
  -o, --output            Set the output path for the results.

πŸ’₯ Discussion: Comments on Current Version

Comments on the current version, which is commit bbbd299:

  • 1. Can't tell what the guard modifier is just from it's name, maybe something like preventCrossChainRedeploy but that's verbose. (#4)
  • 2. For the goal mentioned in the guard modifier comments, you only need to hash with chain ID, not with msg.sender. I'd suggest removing msg.sender for that reason. (#4)
  • 3. onlyMsgSender modifier: Wondering if this is better than hashing with msg.sender? Trying to think of tradeoffs. I know 0age uses this approach in his factory, but hashing might be more consistent (#4)
  • 4. Any objections to shortening the name to CreateX? Feels catchier which I think is good for helping people rally around it. Also means the interface that devs will use can be ICreateX which is shorter (#2)
  • 5. Regarding (bool refunded,) = msg.sender.call{value: balance}("") lines (#4):
    • If deployer is a one-time key (e.g. nick's method) this can result in struck funds
    • Cost to send the ETH may be greater than the amount being sent
    • Given above, I'd suggest removing this to keep the logic simpler, and we can add claim or skim methods something to claim any stray ETH/tokens
  • 6. Regarding (bool success,) = implementation.call{value: msg.value}(abi.encodeWithSignature("initializer()")) lines
    • 6.1 The data to pass here should be an inputβ€”we don't know what the sig will be and often it needs inputs, so we shouldn't hardcode initializer() as the sig (#4)
    • 6.2 We're calling it on the implementation but should be calling it on the newly deployed proxy (#4)
  • 7. deployCreate2(initCode): maybe include block.difficulty/prevrandao there also? (#4)
  • 8. Missing methods (#4):
    • 8.1 The create2 section is missing methods that have onlyMsgSender without guard. Sample use case: I want the same address on all chains, but don't want others to be able to deploy (#4)
    • 8.2 Similarly the create3 section is missing versions with only the guard no onlyMsgSender modifier. Sample use case: I want the same address on all chains and anyone should be able to deploy it (#4)
    • 8.3 We should make sure each deployment opcode (create/create2/create3) supports any combination of modifiers (none, guard, onlyMsgSender, both) (#4)
  • 9. Pretty sure all input bytes will be copied to memory anyway when solidity prepares the call, so changing calldata params to memory should be a bit cheaper/smaller bytecode (#3)
  • 10. What's your plan for formatting? I see // prettier-ignore comments but no package.json with prettier as a dep. I'd just use forge fmt here and define the config in foundry.toml to remove the need for a dep (#3)
  • 11. Similar question on linting, I see the // solhint-disable comments but no dep. Personally I think we can remove those also (#3)

⚑️ Gas Reports Summary for `CreateX`

Context

Gas reports for CreateX:

forge test --gas-report

I get the impression that the forge gas reports are not so reliable in profiling the gas costs for CreateX (some numbers are just blatantly wrong).

Summary Runtime Costs

image

Source.

My personal opinion is that we should not use a via_ir = true configuration due to the following reasons:

  • Deployment costs should not matter (via_ir wins here),
  • The new pipeline doesn't offer any huge gas savings (I always use the default optimiser steps dhfoDgvulfnTUtnIf),
  • Block explorer verification will be easier by not using via_ir since otherwise you must upload a standard JSON input file as Etherscan and Blockscout don't allow in the UI to configure the optimiser settings.

βž› My personal opinion is to choose optimizer_runs = 6_942_000 since optimizer_runs = 10_000_000 doesn't offer any additional significant gas savings & because of the meme factor πŸ˜„.

Option 1

Configuration:

  • optimizer = true
  • optimizer_runs = 6_942_000
  • via_ir = false
| src/CreateX.sol:CreateX contract                                    |                 |                     |                     |                     |         |
|---------------------------------------------------------------------|-----------------|---------------------|---------------------|---------------------|---------|
| Deployment Cost                                                     | Deployment Size |                     |                     |                     |         |
| 2370524                                                             | 12054           |                     |                     |                     |         |
| Function Name                                                       | min             | avg                 | median              | max                 | # calls |
| computeCreate2Address(bytes32,bytes32)                              | 559             | 559                 | 559                 | 559                 | 1       |
| computeCreate2Address(bytes32,bytes32,address)                      | 580             | 580                 | 580                 | 580                 | 37      |
| computeCreate3Address(bytes32)                                      | 551             | 551                 | 551                 | 551                 | 1       |
| computeCreate3Address(bytes32,address)                              | 648             | 648                 | 648                 | 648                 | 13      |
| computeCreateAddress(address,uint256)                               | 582             | 907                 | 918                 | 1011                | 9       |
| computeCreateAddress(uint256)                                       | 539             | 739                 | 739                 | 940                 | 2       |
| deployCreate                                                        | 32866           | 4468696730258534196 | 4468696730258690252 | 8937393460516723417 | 4       |
| deployCreate2(bytes)                                                | 34455           | 1787478692103751147 | 672889              | 8937393460516702614 | 5       |
| deployCreate2(bytes32,bytes)                                        | 34228           | 2234348365129359616 | 353432              | 8937393460516697372 | 4       |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256))                 | 35063           | 893739346052220707  | 683843              | 8937393460516689843 | 10      |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256),address)         | 35154           | 893739346052222859  | 683936              | 8937393460516689730 | 10      |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 1883            | 1117174182564938042 | 681904              | 8937393460516721268 | 8       |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 2787            | 1489565576753136221 | 685888              | 8937393460516690343 | 6       |
| deployCreate2Clone(address,bytes)                                   | 48537           | 1787478692103388783 | 74846               | 8937393460516690542 | 5       |
| deployCreate2Clone(bytes32,address,bytes)                           | 48413           | 1787478692103389766 | 77011               | 8937393460516692031 | 5       |
| deployCreate3(bytes)                                                | 77062           | 3790412405130131143 | 724440              | 8937393460516392418 | 7       |
| deployCreate3(bytes32,bytes)                                        | 1254            | 4433785037053310919 | 4398873343848424821 | 8937393460516392781 | 4       |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256))                 | 45706           | 1477928345684875189 | 735349              | 8937393460516361104 | 12      |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256),address)         | 45664           | 1477928345684879200 | 735462              | 8937393460516361934 | 12      |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 2712            | 2533591449744862282 | 732319              | 8937393460516362238 | 7       |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 2787            | 2412080621446464731 | 732329              | 8937393460516362773 | 11      |
| deployCreateAndInit(bytes,bytes,(uint256,uint256))                  | 33399           | 1117174182564945483 | 679699              | 8937393460516702624 | 8       |
| deployCreateAndInit(bytes,bytes,(uint256,uint256),address)          | 33602           | 1489565576753248846 | 684813              | 8937393460516702481 | 6       |
| deployCreateClone                                                   | 53260           | 2979131153505611705 | 75423               | 8937393460516706433 | 3       |

Option 2

Configuration:

  • optimizer = true
  • optimizer_runs = 10_000_000
  • via_ir = false
| src/CreateX.sol:CreateX contract                                    |                 |                     |                     |                     |         |
|---------------------------------------------------------------------|-----------------|---------------------|---------------------|---------------------|---------|
| Deployment Cost                                                     | Deployment Size |                     |                     |                     |         |
| 2370524                                                             | 12054           |                     |                     |                     |         |
| Function Name                                                       | min             | avg                 | median              | max                 | # calls |
| computeCreate2Address(bytes32,bytes32)                              | 559             | 559                 | 559                 | 559                 | 1       |
| computeCreate2Address(bytes32,bytes32,address)                      | 580             | 580                 | 580                 | 580                 | 43      |
| computeCreate3Address(bytes32)                                      | 551             | 551                 | 551                 | 551                 | 1       |
| computeCreate3Address(bytes32,address)                              | 648             | 648                 | 648                 | 648                 | 17      |
| computeCreateAddress(address,uint256)                               | 582             | 908                 | 964                 | 1011                | 9       |
| computeCreateAddress(uint256)                                       | 539             | 763                 | 763                 | 987                 | 2       |
| deployCreate                                                        | 32866           | 4468696730258534060 | 4468696730258690281 | 8937393460516722812 | 4       |
| deployCreate2(bytes)                                                | 34455           | 1787478692103749828 | 672889              | 8937393460516696018 | 5       |
| deployCreate2(bytes32,bytes)                                        | 2101            | 3574957384206698057 | 34248               | 8937393460516722935 | 5       |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256))                 | 35063           | 893739346052218787  | 683843              | 8937393460516690742 | 10      |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256),address)         | 35154           | 893739346052223528  | 683936              | 8937393460516689718 | 10      |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 34138           | 1276770494359928442 | 683559              | 8937393460516691677 | 7       |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 1961            | 1489565576753130647 | 685878              | 8937393460516689238 | 6       |
| deployCreate2Clone(address,bytes)                                   | 55145           | 2234348365129223652 | 74846               | 8937393460516689771 | 4       |
| deployCreate2Clone(bytes32,address,bytes)                           | 1367            | 1489565576752828240 | 75322               | 8937393460516692169 | 6       |
| deployCreate3(bytes)                                                | 77062           | 3790412405130131095 | 724440              | 8937393460516392256 | 7       |
| deployCreate3(bytes32,bytes)                                        | 76801           | 4422147805985031721 | 4398873343848423992 | 8937393460516392754 | 6       |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256))                 | 45553           | 1477928345684875038 | 735349              | 8937393460516361197 | 12      |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256),address)         | 77746           | 1612285468019864591 | 735462              | 8937393460516361028 | 11      |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 2699            | 1773514014821628288 | 734785              | 8937393460516364250 | 10      |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 1961            | 993043717835569402  | 734413              | 8937393460516361887 | 9       |
| deployCreateAndInit(bytes,bytes,(uint256,uint256))                  | 33399           | 2234348365129531318 | 684741              | 8937393460516721014 | 8       |
| deployCreateAndInit(bytes,bytes,(uint256,uint256),address)          | 33602           | 1489565576753250245 | 684813              | 8937393460516704174 | 6       |
| deployCreateClone                                                   | 46560           | 1489565576752829119 | 49949               | 8937393460516706274 | 6       |

Option 3

Configuration:

  • optimizer = true
  • optimizer_runs = 6_942_000
  • via_ir = true

β˜ οΈπŸ’€
image

| src/CreateX.sol:CreateX contract                                    |                 |                     |                     |                     |         |
|---------------------------------------------------------------------|-----------------|---------------------|---------------------|---------------------|---------|
| Deployment Cost                                                     | Deployment Size |                     |                     |                     |         |
| 1860013                                                             | 9428            |                     |                     |                     |         |
| Function Name                                                       | min             | avg                 | median              | max                 | # calls |
| computeCreate2Address(bytes32,bytes32)                              | 623             | 623                 | 623                 | 623                 | 1       |
| computeCreate2Address(bytes32,bytes32,address)                      | 770             | 770                 | 770                 | 770                 | 42      |
| computeCreate3Address(bytes32)                                      | 571             | 571                 | 571                 | 571                 | 1       |
| computeCreate3Address(bytes32,address)                              | 607             | 607                 | 607                 | 607                 | 15      |
| computeCreateAddress(address,uint256)                               | 500             | 833                 | 840                 | 956                 | 9       |
| computeCreateAddress(uint256)                                       | 350             | 520                 | 520                 | 690                 | 2       |
| deployCreate                                                        | 32838           | 2234348365129382625 | 393851              | 8937393460516709962 | 4       |
| deployCreate2(bytes)                                                | 34256           | 1787478692103800627 | 757523              | 8937393460516696311 | 5       |
| deployCreate2(bytes32,bytes)                                        | 33336           | 4468696730258552594 | 4468696730258727279 | 8937393460516722482 | 4       |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256))                 | 35056           | 744782788376911022  | 767015              | 8937393460516689916 | 12      |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256),address)         | 35178           | 812490314592995098  | 768254              | 8937393460516690131 | 11      |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 2239            | 1117174182564976152 | 767692              | 8937393460516690333 | 8       |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 35033           | 1489565576753306014 | 771309              | 8937393460516690212 | 6       |
| deployCreate2Clone(address,bytes)                                   | 54904           | 2234348365129223361 | 74491               | 8937393460516689558 | 4       |
| deployCreate2Clone(bytes32,address,bytes)                           | 53945           | 2234348365129224383 | 76584               | 8937393460516690422 | 4       |
| deployCreate3(bytes)                                                | 76910           | 3790412405130160460 | 799837              | 8937393460516371615 | 7       |
| deployCreate3(bytes32,bytes)                                        | 77005           | 4422147805985053801 | 4398873343848462424 | 8937393460516372836 | 6       |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256))                 | 77401           | 1612285468019912131 | 810018              | 8937393460516341162 | 11      |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256),address)         | 45644           | 1477928345684928134 | 810408              | 8937393460516341280 | 12      |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 1780            | 2216892518526867853 | 808577              | 8937393460516342214 | 8       |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 2239            | 1612285468019698086 | 809416              | 8937393460516341585 | 11      |
| deployCreateAndInit(bytes,bytes,(uint256,uint256))                  | 33532           | 1489565576753305759 | 768900              | 8937393460516702944 | 6       |
| deployCreateAndInit(bytes,bytes,(uint256,uint256),address)          | 33611           | 1117174182564986586 | 760989              | 8937393460516703673 | 8       |
| deployCreateClone                                                   | 53326           | 2979131153505611625 | 75391               | 8937393460516706158 | 3       |

Option 4

Configuration:

  • optimizer = true
  • optimizer_runs = 10_000_000
  • via_ir = true

β˜ οΈπŸ’€
image

| src/CreateX.sol:CreateX contract                                    |                 |                     |                     |                     |         |
|---------------------------------------------------------------------|-----------------|---------------------|---------------------|---------------------|---------|
| Deployment Cost                                                     | Deployment Size |                     |                     |                     |         |
| 1860013                                                             | 9428            |                     |                     |                     |         |
| Function Name                                                       | min             | avg                 | median              | max                 | # calls |
| computeCreate2Address(bytes32,bytes32)                              | 623             | 623                 | 623                 | 623                 | 1       |
| computeCreate2Address(bytes32,bytes32,address)                      | 770             | 770                 | 770                 | 770                 | 41      |
| computeCreate3Address(bytes32)                                      | 571             | 571                 | 571                 | 571                 | 1       |
| computeCreate3Address(bytes32,address)                              | 607             | 607                 | 607                 | 607                 | 15      |
| computeCreateAddress(address,uint256)                               | 500             | 816                 | 840                 | 955                 | 9       |
| computeCreateAddress(uint256)                                       | 350             | 520                 | 520                 | 690                 | 2       |
| deployCreate                                                        | 32838           | 2979131153505832505 | 754858              | 8937393460516709820 | 3       |
| deployCreate2(bytes)                                                | 34256           | 1787478692103800716 | 757523              | 8937393460516696759 | 5       |
| deployCreate2(bytes32,bytes)                                        | 2129            | 4468696730258363881 | 4468696730258365250 | 8937393460516722895 | 4       |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256))                 | 35087           | 812490314592992551  | 768150              | 8937393460516690644 | 11      |
| deployCreate2AndInit(bytes,bytes,(uint256,uint256),address)         | 35276           | 893739346052291025  | 768254              | 8937393460516689488 | 10      |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 3118            | 1986087435670725602 | 767440              | 8937393460516720825 | 9       |
| deployCreate2AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 3062            | 993043717835623063  | 767371              | 8937393460516691473 | 9       |
| deployCreate2Clone(address,bytes)                                   | 48211           | 1489565576752831652 | 64697               | 8937393460516689582 | 6       |
| deployCreate2Clone(bytes32,address,bytes)                           | 47882           | 1787478692103389438 | 76506               | 8937393460516691581 | 5       |
| deployCreate3(bytes)                                                | 76910           | 4416329190450909174 | 4398873343848462089 | 8937393460516370947 | 8       |
| deployCreate3(bytes32,bytes)                                        | 76863           | 4422147805985053576 | 4398873343848462122 | 8937393460516371785 | 6       |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256))                 | 70701           | 1612285468019911552 | 810018              | 8937393460516341258 | 11      |
| deployCreate3AndInit(bytes,bytes,(uint256,uint256),address)         | 77791           | 1612285468019917388 | 810408              | 8937393460516340412 | 11      |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256))         | 1780            | 812490314592701599  | 45081               | 8937393460516341757 | 11      |
| deployCreate3AndInit(bytes32,bytes,bytes,(uint256,uint256),address) | 3131            | 2216892518526881854 | 812739              | 8937393460516342081 | 8       |
| deployCreateAndInit(bytes,bytes,(uint256,uint256))                  | 33532           | 1489565576753304705 | 768900              | 8937393460516703320 | 6       |
| deployCreateAndInit(bytes,bytes,(uint256,uint256),address)          | 33599           | 1276770494359981812 | 765475              | 8937393460516704003 | 7       |
| deployCreateClone                                                   | 53326           | 2979131153505611556 | 75391               | 8937393460516705953 | 3       |

πŸ’₯ Create Dune Dashboard to Track Usage Metrics

Describe the desired feature:

It would be nice to see stats per chain, and aggregated across all chains (that Dune supports), such as:

  1. Total deployments,
  2. Count of CREATE vs. CREATE2 vs. CREAT3 deployments,
  3. Count of regular vs. EIP-1167 deployments,
  4. Counts of each non-view method calls.

Open to other ideas for metrics too.

πŸ“‹ Unit and Fuzzing Tests

Functions

public Functions

CREATE

  • function deployCreate(bytes) payable returns (address) (assigned: @pcaversaccio, PR: #14)
  • function deployCreateAndInit(bytes,bytes,tuple(uint256,uint256)) payable returns (address) (assigned: @pcaversaccio, PR: #14)
  • function deployCreateAndInit(bytes,bytes,tuple(uint256,uint256),address) payable returns (address) (assigned: @pcaversaccio, PR: #14)
  • function deployCreateClone(address,bytes) payable returns (address) (address)` (assigned: @pcaversaccio, PR: #14)
  • function computeCreateAddress(uint256) view returns (address) (address)` (assigned: @pcaversaccio, PR: #14)
  • function computeCreateAddress(address,uint256) view returns (address) (address)` (assigned: @pcaversaccio, PR: #14)

CREATE2

  • function deployCreate2(bytes32,bytes) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2(bytes) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2AndInit(bytes32,bytes,bytes,tuple(uint256,uint256),address) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2AndInit(bytes,bytes,tuple(uint256,uint256)) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2AndInit(bytes,bytes,tuple(uint256,uint256),address) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2AndInit(bytes32,bytes,bytes,tuple(uint256,uint256)) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2Clone(bytes32,address,bytes) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function deployCreate2Clone(address,bytes) payable returns (address) (assigned: @pcaversaccio, PR: #17)
  • function computeCreate2Address(bytes32,bytes32) view returns (address) (assigned: @pcaversaccio, PR: #17)
  • function computeCreate2Address(bytes32,bytes32,address) pure returns (address) (assigned: @pcaversaccio, PR: #17)

CREATE3

  • function computeCreate3Address(bytes32,address) pure returns (address) (assigned: @pcaversaccio, PR: #18)
  • function computeCreate3Address(bytes32) view returns (address) (assigned: @pcaversaccio, PR: #18)
  • function deployCreate3(bytes) payable returns (address) (assigned: @pcaversaccio, PR: #18)
  • function deployCreate3(bytes32,bytes) payable returns (address) (assigned: @pcaversaccio, PR: #18)
  • function deployCreate3AndInit(bytes32,bytes,bytes,tuple(uint256,uint256)) payable returns (address) (assigned: @pcaversaccio, PR: #18)
  • function deployCreate3AndInit(bytes,bytes,tuple(uint256,uint256)) payable returns (address) (assigned: @pcaversaccio, PR: #18)
  • function deployCreate3AndInit(bytes32,bytes,bytes,tuple(uint256,uint256),address) payable returns (address) (assigned: @pcaversaccio, PR: #18)
  • function deployCreate3AndInit(bytes,bytes,tuple(uint256,uint256),address) payable returns (address) (assigned: @pcaversaccio, PR: #18)

internal Functions

  • function _guard(bytes32) view returns (bytes32) (assigned: @pcaversaccio, PR: #13)
  • function _parseSalt(bytes32) view returns (SenderBytes,RedeployProtectionFlag) (assigned: @pcaversaccio, PR: #11)
  • function _efficientHash(bytes32,bytes32) pure returns (bytes32) (assigned: @mds1, PR: #9)
  • function _generateSalt() view returns (bytes32) (assigned: @mds1, PR: #9)
  • function _requireSuccessfulContractCreation(address) view (assigned: @mds1, PR: #9)
  • function _requireSuccessfulContractCreation(bool,address) view (assigned: @mds1, PR: #9)
  • function _requireSuccessfulContractInitialisation(bool,bytes,address) view (assigned: @pcaversaccio, PR: #11)

Each function is considered tested if all unit and fuzz tests have been added.

  • I would like to propose one statefulFuzz (a.k.a. invariant) test (assigned: @pcaversaccio, PR: #17):
function statefulFuzz_NoEtherBalance() public {
    assertEq(createXAddr.balance, 0);
}

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.