• Stars
    star
    193
  • Rank 199,510 (Top 4 %)
  • Language
    Solidity
  • License
    BSD 3-Clause "New...
  • Created almost 3 years ago
  • Updated 8 months ago

Reviews

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

Repository Details

ClonesWithImmutableArgs

Enables creating clone contracts with immutable arguments.

The immutable arguments are stored in the code region of the created proxy contract, and whenever the proxy is called, it reads the arguments into memory, and then appends them to the calldata of the delegate call to the implementation contract. The implementation contract can thus read the arguments straight from calldata.

By doing so, the gas cost of creating parametrizable clones is reduced, since there's no need to store the parameters in storage, which you need to do with EIP-1167. The cost of using such clones is also reduced, since storage loads are replaced with calldata reading, which is far cheaper.

In other word, if you know you are not gonna need parametrization and just want exact copies, then you can keep using EIP-1167, otherwise, clones-with-immutables is cheaper.

Usage

Clone factory contracts should use the ClonesWithImmutableArgs library. ClonesWithImmutableArgs.clone() is the main function for creating clones.

Contracts intended to be cloned should inherit from Clone to get access to the helper functions for reading immutable args.

To see an example usage of the library, check out ExampleClone and ExampleCloneFactory.

Installation

To install with DappTools:

dapp install wighawag/clones-with-immutable-args

To install with Foundry:

forge install wighawag/clones-with-immutable-args

To install with Hardhat:

npm i -D clones-with-immutable-args

Local development

This project uses Foundry as the development framework.

Dependencies

make update

Compilation

make build

Testing

make test

More Repositories

1

hardhat-deploy

hardhat deployment plugin
TypeScript
1,043
star
2

template-ethereum-contracts

Template to develop ethereum smart contracts
TypeScript
430
star
3

jolly-roger

Build and Deploy for Eternity. Jolly Roger is a production-ready template for decentralised applications.
TypeScript
192
star
4

tutorial-hardhat-deploy

Tutorial for hardhat + hardhat-deploy
TypeScript
173
star
5

forge-deploy

Rust
111
star
6

eip721-subgraph

JavaScript
78
star
7

hardhat-deploy-ethers

TypeScript
64
star
8

forge-exec

Execute programs from forge with an open 2-way communication channel between both
Solidity
56
star
9

openfl-stage3d

Stage3D API for openfl
Haxe
52
star
10

bleeps

Bleeps, The First Truly onchain sounds
TypeScript
25
star
11

mandalas

TypeScript
24
star
12

hardhat-preprocessor

An hardhat plugin to pre-process contract source code before compilation
TypeScript
24
star
13

stratagems

Stratagems is an Autonomous World where players are actual gods. They are literaly the one creating the world.
TypeScript
23
star
14

sveltejs-adapter-ipfs

JavaScript
21
star
15

rocketh

A tool to test and deploy ethereum smart contract
TypeScript
17
star
16

singleton-1776-meta-transaction

A Singleton MetaTx Processor using EIP-1776 that support all ERC20 tokens
JavaScript
17
star
17

erc721-lease

A contract to manage lease of NFT
Solidity
16
star
18

spriter

Spriter runtime for Haxe with 0 allocation for hxcpp
Haxe
15
star
19

khage

KHAGE stands for KHA Graphical Extension. It is a set of class/macro to make use of graphics in a sane and safe way
Haxe
15
star
20

web3w

TypeScript
14
star
21

hardhat-deploy-tenderly

plugin for hardhat that push hardhat-deploy's deployments to tenderly
TypeScript
14
star
22

embed-art

Embed your NFT art anywhere, generate preview for oldschool platforms
TypeScript
14
star
23

gcusage

haxe lib to gather gc usage via code. Also serve as live doc on how haxe/hxcpp deal with allocation for various types
Haxe
14
star
24

hxcpp-test

C++
11
star
25

transfer-gateway

Solidity
11
star
26

hardhat-deploy-test-uniswap

Solidity
10
star
27

blockies-nft

TypeScript
10
star
28

antarctica

TypeScript
10
star
29

hardhat-deploy-ts-test

A test of buidler + buidler-deploy using typescript
TypeScript
9
star
30

stage3d-glsl

Lib to deal with glsl on top of flash stage3d api
Haxe
9
star
31

spriterkha

kha renderer for spriter runtime
Haxe
9
star
32

solidity-kit

Solidity
8
star
33

fuzd

time-lock encrypted commit + reveal system using drand
TypeScript
8
star
34

loot-for-everyone

TypeScript
7
star
35

kit

A set of lib and tools to make cross platform games
Haxe
7
star
36

vending-machine

simple-nft-sale
TypeScript
7
star
37

hardhat-deploy-test-diamond

TypeScript
7
star
38

conquest-eth-player-handbook

Conquest's Player's Handbook, Everything a player needs to know to play conquest.eth
7
star
39

universal-forwarder

The only meta transaction forwarder you need
Solidity
7
star
40

the-bleep-machine

Onchain algorithmic Music
JavaScript
6
star
41

template-on-chain-art

TypeScript
6
star
42

template-foundry

A basic template that uses foundry-rs/forge and forge-deploy to deploy and test ethereum smart contracts
Solidity
6
star
43

vitest-solidity-coverage

TypeScript
6
star
44

docker-compose-blockchain-setup

A docker-compose setup for local blockchain with blockscout
JavaScript
6
star
45

Yoga

Yoga aims to be a tool like maven for Haxe with at first the functionality of dependency management and project setup.
Haxe
5
star
46

bomber-woman

TypeScript
5
star
47

cosmos

A Type safe Entity Component System with minimum overhead + optional Types
Haxe
5
star
48

mystery-box

CSS
5
star
49

yakuza-revenge

Solidity
5
star
50

viem-chai-matchers

TypeScript
5
star
51

hardhat-deploy-ethers-old

buidler plugin for ethers v5
TypeScript
5
star
52

eip-2585

EIP-2585 Minimal Native Meta transaction Forwarder
JavaScript
4
star
53

fungible-bonding-curve

fungible-bonding-curve
Solidity
4
star
54

svelte-wallet

JavaScript
4
star
55

catacombs

TypeScript
4
star
56

missiv

TypeScript
3
star
57

multi-165

Solidity
3
star
58

mixingloom-profiler

A profiler injected at runtime through MixingLoom and as3commons bytecode
ActionScript
3
star
59

duel-in-the-dark

TypeScript
3
star
60

ethereum_gas

Solidity
3
star
61

redstone-composability-hackathon

Solidity
3
star
62

gsn-playground

JavaScript
3
star
63

OpenFLStage3DTest

A test app for openfl stage3d
Haxe
3
star
64

hardhat-vitest-demo

hardhat + vitest
TypeScript
3
star
65

wighawag-game-utils

Game library code that is here temporarely waiting for a better place
Haxe
3
star
66

ethereum-lan-node

A node for LAN network
JavaScript
3
star
67

conquest-website

Svelte
3
star
68

vitalik-secret

A world scale puzzle
Solidity
2
star
69

template-hardhat-plugin

TypeScript
2
star
70

forge-deploy-proxy

Solidity
2
star
71

web3-html-provider

A provider that use an html iframe / popup to allow user to authorize transaction without having to enable CORS on ethereum nodes
HTML
2
star
72

js13k-on-chain

HTML
2
star
73

imagesheet

spritesheet lib for kha
Haxe
2
star
74

web3w-walletconnect-v2-loader

wallet connect v2 module for web3w
TypeScript
2
star
75

the_eternal_dungeon

JavaScript
2
star
76

glsl2agal-lib

simple wrapper to glsl2agal project to generatre a swf usable by NME for converting glsl to agal at runtime
ActionScript
2
star
77

conquest-basic-spaceship-market

TypeScript
2
star
78

ethereum-contracts-test-suite

A suite of test for your smart contracts
TypeScript
2
star
79

VirtualThread

Green Thread implementation in actionscript
ActionScript
2
star
80

javelin

A Tool to manage your haxelib library (update,test,build,install,deploy) using haxelib.json (a superset)
Haxe
2
star
81

template-ethereum-contracts-test

Solidity
2
star
82

spriter_test

test project for spriter runtime and kha renderer
Haxe
2
star
83

contract-tester

Solidity
2
star
84

bleeps-code

repo for the Bleeps
2
star
85

use-stores

React Hooks for Observable / Svelte Stores
TypeScript
2
star
86

ethereum-indexer

ethereum-indexer
TypeScript
2
star
87

chai-ethers

Chai Matchers for ethers type (copied from @ethereum-waffle/chai but without dependencies on ganache-core, etc...)
TypeScript
2
star
88

event-processor-eip721

TypeScript
1
star
89

forge-exec-ipc-server-js

forge-exec-ipc-server-js
TypeScript
1
star
90

ethereum-indexer-snapshots

1
star
91

web3-connection-viem

TypeScript
1
star
92

files

1
star
93

sratagems-wars

A game built on top of Stratagems
TypeScript
1
star
94

yooloot

JavaScript
1
star
95

jolly-roger-web

TypeScript
1
star
96

foam-svelte-kit

JavaScript
1
star
97

sveltore

svelte store package (copied from svelte)
TypeScript
1
star
98

wighawag-view

Entity Views used for game
Haxe
1
star
99

lootxp

Loot XP
TypeScript
1
star
100

hardhat-deploy-doc

1
star