-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupFactory.ts
149 lines (125 loc) · 49.2 KB
/
setupFactory.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
import { ethers } from "ethers";
import { getProvider, getWallet, setupWallet } from "./lib";
const KEYLESS_ADDRESS = "0x4c8D290a1B368ac4728d83a9e8321fC3af2b39b1"
const KEYLESS_PRESIGNED = "0xf87e8085174876e800830186a08080ad601f80600e600039806000f350fe60003681823780368234f58015156014578182fd5b80825250506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222"
const KEYLESS_DEPLOYER = "0x7A0D94F55792C434d74a40883C6ed8545E406D12"
const INEFFICIENT_PAYLOAD = "0x608060405234801561001057600080fd5b50610833806100206000396000f3fe60806040526004361061003f5760003560e01c806308508b8f1461004457806364e030871461009857806385cf97ab14610138578063a49a7c90146101bc575b600080fd5b34801561005057600080fd5b506100846004803603602081101561006757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ec565b604080519115158252519081900360200190f35b61010f600480360360408110156100ae57600080fd5b813591908101906040810160208201356401000000008111156100d057600080fd5b8201836020820111156100e257600080fd5b8035906020019184600183028401116401000000008311171561010457600080fd5b509092509050610217565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561014457600080fd5b5061010f6004803603604081101561015b57600080fd5b8135919081019060408101602082013564010000000081111561017d57600080fd5b82018360208201111561018f57600080fd5b803590602001918460018302840111640100000000831117156101b157600080fd5b509092509050610592565b3480156101c857600080fd5b5061010f600480360360408110156101df57600080fd5b508035906020013561069e565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460ff1690565b600083606081901c33148061024c57507fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008116155b6102a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001806107746045913960600191505060405180910390fd5b606084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604051855195965090943094508b93508692506020918201918291908401908083835b6020831061033557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016102f8565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260408051929094018281037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00183528085528251928201929092207fff000000000000000000000000000000000000000000000000000000000000008383015260609890981b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602183015260358201969096526055808201979097528251808203909701875260750182525084519484019490942073ffffffffffffffffffffffffffffffffffffffff81166000908152938490529390922054929350505060ff16156104a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f815260200180610735603f913960400191505060405180910390fd5b81602001825188818334f5955050508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461053a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001806107b96046913960600191505060405180910390fd5b50505073ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790559392505050565b6000308484846040516020018083838082843760408051919093018181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001825280845281516020928301207fff000000000000000000000000000000000000000000000000000000000000008383015260609990991b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166021820152603581019790975260558088019890985282518088039098018852607590960182525085519585019590952073ffffffffffffffffffffffffffffffffffffffff81166000908152948590529490932054939450505060ff909116159050610697575060005b9392505050565b604080517fff000000000000000000000000000000000000000000000000000000000000006020808301919091523060601b6021830152603582018590526055808301859052835180840390910181526075909201835281519181019190912073ffffffffffffffffffffffffffffffffffffffff81166000908152918290529190205460ff161561072e575060005b9291505056fe496e76616c696420636f6e7472616374206372656174696f6e202d20636f6e74726163742068617320616c7265616479206265656e206465706c6f7965642e496e76616c69642073616c74202d206669727374203230206279746573206f66207468652073616c74206d757374206d617463682063616c6c696e6720616464726573732e4661696c656420746f206465706c6f7920636f6e7472616374207573696e672070726f76696465642073616c7420616e6420696e697469616c697a6174696f6e20636f64652ea265627a7a723058202bdc55310d97c4088f18acf04253db593f0914059f0c781a9df3624dcef0d1cf64736f6c634300050a0032"
const INEFFICIENT_ADDRESS = "0xcfA3A7637547094fF06246817a35B8333C315196"
const IMMUTABLE_PAYLOAD = "0x64e030870000000000000000000000000000000000000000f4b0218f13a6440a6f02000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000853608060405234801561001057600080fd5b50610833806100206000396000f3fe60806040526004361061003f5760003560e01c806308508b8f1461004457806364e030871461009857806385cf97ab14610138578063a49a7c90146101bc575b600080fd5b34801561005057600080fd5b506100846004803603602081101561006757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166101ec565b604080519115158252519081900360200190f35b61010f600480360360408110156100ae57600080fd5b813591908101906040810160208201356401000000008111156100d057600080fd5b8201836020820111156100e257600080fd5b8035906020019184600183028401116401000000008311171561010457600080fd5b509092509050610217565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561014457600080fd5b5061010f6004803603604081101561015b57600080fd5b8135919081019060408101602082013564010000000081111561017d57600080fd5b82018360208201111561018f57600080fd5b803590602001918460018302840111640100000000831117156101b157600080fd5b509092509050610592565b3480156101c857600080fd5b5061010f600480360360408110156101df57600080fd5b508035906020013561069e565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460ff1690565b600083606081901c33148061024c57507fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008116155b6102a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260458152602001806107746045913960600191505060405180910390fd5b606084848080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604051855195965090943094508b93508692506020918201918291908401908083835b6020831061033557805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe090920191602091820191016102f8565b51815160209384036101000a7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018019909216911617905260408051929094018281037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe00183528085528251928201929092207fff000000000000000000000000000000000000000000000000000000000000008383015260609890981b7fffffffffffffffffffffffffffffffffffffffff00000000000000000000000016602183015260358201969096526055808201979097528251808203909701875260750182525084519484019490942073ffffffffffffffffffffffffffffffffffffffff81166000908152938490529390922054929350505060ff16156104a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603f815260200180610735603f913960400191505060405180910390fd5b81602001825188818334f5955050508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461053a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001806107b96046913960600191505060405180910390fd5b50505073ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790559392505050565b6000308484846040516020018083838082843760408051919093018181037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001825280845281516020928301207fff000000000000000000000000000000000000000000000000000000000000008383015260609990991b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166021820152603581019790975260558088019890985282518088039098018852607590960182525085519585019590952073ffffffffffffffffffffffffffffffffffffffff81166000908152948590529490932054939450505060ff909116159050610697575060005b9392505050565b604080517fff000000000000000000000000000000000000000000000000000000000000006020808301919091523060601b6021830152603582018590526055808301859052835180840390910181526075909201835281519181019190912073ffffffffffffffffffffffffffffffffffffffff81166000908152918290529190205460ff161561072e575060005b9291505056fe496e76616c696420636f6e7472616374206372656174696f6e202d20636f6e74726163742068617320616c7265616479206265656e206465706c6f7965642e496e76616c69642073616c74202d206669727374203230206279746573206f66207468652073616c74206d757374206d617463682063616c6c696e6720616464726573732e4661696c656420746f206465706c6f7920636f6e7472616374207573696e672070726f76696465642073616c7420616e6420696e697469616c697a6174696f6e20636f64652ea265627a7a723058202bdc55310d97c4088f18acf04253db593f0914059f0c781a9df3624dcef0d1cf64736f6c634300050a003200000000000000000000000000"
const IMMUTABLE_ADDRESS = "0x0000000000ffe8b47b3e2130213b802212439497"
const SCHEMA_REGISTRY_PAYLOAD = "0x608060405234801561001057600080fd5b50610790806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806360d7a27814610046578063a2ea7c6e1461006c578063ffa1ad741461008c575b600080fd5b6100596100543660046103e6565b6100d5565b6040519081526020015b60405180910390f35b61007f61007a366004610498565b61027e565b6040516100639190610501565b6100c86040518060400160405280600481526020017f302e32370000000000000000000000000000000000000000000000000000000081525081565b604051610063919061055a565b60008060405180608001604052806000801b81526020018573ffffffffffffffffffffffffffffffffffffffff168152602001841515815260200187878080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250939094525092935091506101579050826103a6565b600081815260208190526040902054909150156101a0576040517f23369fa600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80825260008181526020818152604091829020845181559084015160018201805493860151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090941673ffffffffffffffffffffffffffffffffffffffff90921691909117929092179091556060830151839190600282019061023c9082610645565b50506040513381528291507f7d917fcbc9a29a9705ff9936ffa599500e4fd902e4486bae317414fe967b307c9060200160405180910390a29695505050505050565b604080516080810182526000808252602082018190529181019190915260608082015260008281526020818152604091829020825160808101845281548152600182015473ffffffffffffffffffffffffffffffffffffffff8116938201939093527401000000000000000000000000000000000000000090920460ff1615159282019290925260028201805491929160608401919061031d906105a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610349906105a3565b80156103965780601f1061036b57610100808354040283529160200191610396565b820191906000526020600020905b81548152906001019060200180831161037957829003601f168201915b5050505050815250509050919050565b60008160600151826020015183604001516040516020016103c993929190610705565b604051602081830303815290604052805190602001209050919050565b600080600080606085870312156103fc57600080fd5b843567ffffffffffffffff8082111561041457600080fd5b818701915087601f83011261042857600080fd5b81358181111561043757600080fd5b88602082850101111561044957600080fd5b6020928301965094505085013573ffffffffffffffffffffffffffffffffffffffff8116811461047857600080fd5b91506040850135801515811461048d57600080fd5b939692955090935050565b6000602082840312156104aa57600080fd5b5035919050565b60005b838110156104cc5781810151838201526020016104b4565b50506000910152565b600081518084526104ed8160208601602086016104b1565b601f01601f19169290920160200192915050565b602081528151602082015273ffffffffffffffffffffffffffffffffffffffff60208301511660408201526040820151151560608201526000606083015160808084015261055260a08401826104d5565b949350505050565b60208152600061056d60208301846104d5565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600181811c908216806105b757607f821691505b6020821081036105f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b601f82111561064057600081815260208120601f850160051c8101602086101561061d5750805b601f850160051c820191505b8181101561063c57828155600101610629565b5050505b505050565b815167ffffffffffffffff81111561065f5761065f610574565b6106738161066d84546105a3565b846105f6565b602080601f8311600181146106a857600084156106905750858301515b600019600386901b1c1916600185901b17855561063c565b600085815260208120601f198616915b828110156106d7578886015182559484019460019091019084016106b8565b50858210156106f55787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600084516107178184602089016104b1565b60609490941b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169190930190815290151560f81b60148201526015019291505056fea26469706673582212201f735fc8708fdbc0157048d7bc47d7dcff71d3e09f109e45c0db4b3866b4b74b64736f6c63430008130033"
const SCHEMA_REGISTRY_SALT = "0x00000000000000000000000000000000000000006e0d1a9cc41f04db9e3656b8"
const SCHEMA_REGISTRY_ADDRESS = "0x0000000000b15ee366c4fe5a24c50dda4cda8660"
const EAS_PAYLOAD = "0x6101606040523480156200001257600080fd5b5060405162003dc638038062003dc683398101604081905262000035916200015b565b604080518082018252600381526245415360e81b6020808301918252835180850185526004815263302e323760e01b81830152835190922060e08190527f2be123d7d25e2a214dd01de409c0c206b6a5cf2b3b7b0350b53cba0d658819926101008190524660a081815287517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818701819052818a01959095526060810193909352608080840192909252308382018190528851808503909201825260c09384019098528051940193909320909252939052610120929092529060006200011d838262000232565b5050506001600160a01b03811662000148576040516311a1e69760e01b815260040160405180910390fd5b6001600160a01b031661014052620002fe565b6000602082840312156200016e57600080fd5b81516001600160a01b03811681146200018657600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001b857607f821691505b602082108103620001d957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200022d57600081815260208120601f850160051c81016020861015620002085750805b601f850160051c820191505b81811015620002295782815560010162000214565b5050505b505050565b81516001600160401b038111156200024e576200024e6200018d565b62000266816200025f8454620001a3565b84620001df565b602080601f8311600181146200029e5760008415620002855750858301515b600019600386901b1c1916600185901b17855562000229565b600085815260208120601f198616915b82811015620002cf57888601518255948401946001909101908401620002ae565b5085821015620002ee5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e051610100516101205161014051613a5f620003676000396000818161049e01528181611172015261185f015260006120d401526000612123015260006120fe0152600061205701526000612081015260006120ab0152613a5f6000f3fe6080604052600436106101805760003560e01c8063b83010d3116100d6578063e57a6b1b1161007f578063f10b5cc811610059578063f10b5cc814610484578063f17325e7146104c8578063ffa1ad74146104db57600080fd5b8063e57a6b1b1461043c578063e71ff3651461044f578063ed24911d1461046f57600080fd5b8063e13458fc116100b0578063e13458fc146103d7578063e30bb563146103ea578063e45d03f91461042957600080fd5b8063b83010d31461034d578063cf190f3414610380578063d45c4435146103a057600080fd5b80634692626711610138578063831e05a111610112578063831e05a1146102c0578063a3112a64146102d3578063b469318d1461030057600080fd5b806346926267146102785780634cb7e9e51461028d5780634d003070146102a057600080fd5b806317d7de7c1161016957806317d7de7c146102005780632d0335ab1461022257806344adc90e1461025857600080fd5b806312b11a171461018557806313893f61146101c7575b600080fd5b34801561019157600080fd5b507fdbfdf8dc2b135c26253e00d5b6cbe6f20457e003fd526d97cea183883570de615b6040519081526020015b60405180910390f35b3480156101d357600080fd5b506101e76101e2366004612c17565b610524565b60405167ffffffffffffffff90911681526020016101be565b34801561020c57600080fd5b50610215610569565b6040516101be9190612ca9565b34801561022e57600080fd5b506101b461023d366004612ce8565b6001600160a01b031660009081526001602052604090205490565b61026b610266366004612c17565b6105fb565b6040516101be9190612d05565b61028b610286366004612d49565b61070e565b005b61028b61029b366004612c17565b610792565b3480156102ac57600080fd5b506101e76102bb366004612d61565b610856565b61026b6102ce366004612c17565b610863565b3480156102df57600080fd5b506102f36102ee366004612d61565b610a83565b6040516101be9190612e47565b34801561030c57600080fd5b506101e761031b366004612e5a565b6001600160a01b03919091166000908152600460209081526040808320938352929052205467ffffffffffffffff1690565b34801561035957600080fd5b507fa98d02348410c9c76735e0d0bb1396f4015ac2bb9615f9c2611d19d7a8a996506101b4565b34801561038c57600080fd5b506101e761039b366004612d61565b610c35565b3480156103ac57600080fd5b506101e76103bb366004612d61565b60009081526003602052604090205467ffffffffffffffff1690565b6101b46103e5366004612e86565b610c43565b3480156103f657600080fd5b50610419610405366004612d61565b600090815260026020526040902054151590565b60405190151581526020016101be565b61028b610437366004612c17565b610d28565b61028b61044a366004612ec1565b610e72565b34801561045b57600080fd5b506101e761046a366004612c17565b610f17565b34801561047b57600080fd5b506101b4610f4f565b34801561049057600080fd5b506040516001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001681526020016101be565b6101b46104d6366004612ed3565b610f5e565b3480156104e757600080fd5b506102156040518060400160405280600481526020017f302e32370000000000000000000000000000000000000000000000000000000081525081565b60004282825b8181101561055d576105553387878481811061054857610548612f0e565b9050602002013585610ffe565b60010161052a565b50909150505b92915050565b60606000805461057890612f24565b80601f01602080910402602001604051908101604052809291908181526020018280546105a490612f24565b80156105f15780601f106105c6576101008083540402835291602001916105f1565b820191906000526020600020905b8154815290600101906020018083116105d457829003601f168201915b5050505050905090565b606060008267ffffffffffffffff81111561061857610618612f58565b60405190808252806020026020018201604052801561064b57816020015b60608152602001906001900390816106365790505b509050600034815b858110156106f957600019860181143688888481811061067557610675612f0e565b90506020028101906106879190612f6e565b905060006106ae823561069d6020850185612fac565b6106a6916131cb565b3388876110cc565b80519091506106bd908661323f565b945080602001518785815181106106d6576106d6612f0e565b602002602001018190525080602001515186019550836001019350505050610653565b506107048383611756565b9695505050505050565b604080516001808252818301909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081610725579050509050610760368390038301602084016132af565b8160008151811061077357610773612f0e565b602090810291909101015261078d82358233346001611823565b505050565b3460005b828110156108505760001983018114368585848181106107b8576107b8612f0e565b90506020028101906107ca9190612f6e565b905061083781356107de60208401846132cb565b808060200260200160405190810160405280939291908181526020016000905b8282101561082a5761081b604083028601368190038101906132af565b815260200190600101906107fe565b5050505050338786611823565b610841908561323f565b93508260010192505050610796565b50505050565b6000426105638382611dc3565b606060008267ffffffffffffffff81111561088057610880612f58565b6040519080825280602002602001820160405280156108b357816020015b606081526020019060019003908161089e5790505b509050600034815b858110156106f95760001986018114368888848181106108dd576108dd612f0e565b90506020028101906108ef9190613315565b90503660006109016020840184612fac565b9092509050801580610921575061091b6040840184613349565b82141590505b15610958576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610a0d57610a0560405180608001604052808660000135815260200185858581811061098d5761098d612f0e565b905060200281019061099f9190613392565b6109a8906133c6565b81526020016109ba6040880188613349565b858181106109ca576109ca612f0e565b9050606002018036038101906109e0919061343d565b81526020016109f56080880160608901612ce8565b6001600160a01b03169052611e6e565b60010161095b565b506000610a368435610a1f84866131cb565b610a2f6080880160608901612ce8565b8a896110cc565b8051909150610a45908861323f565b96508060200151898781518110610a5e57610a5e612f0e565b60200260200101819052508060200151518801975085600101955050505050506108bb565b604080516101408101825260008082526020820181905291810182905260608082018390526080820183905260a0820183905260c0820183905260e08201839052610100820192909252610120810191909152600082815260026020818152604092839020835161014081018552815481526001820154928101929092529182015467ffffffffffffffff808216948301949094526801000000000000000081048416606083015270010000000000000000000000000000000090049092166080830152600381015460a083015260048101546001600160a01b0390811660c0840152600582015490811660e084015274010000000000000000000000000000000000000000900460ff16151561010083015260068101805461012084019190610bac90612f24565b80601f0160208091040260200160405190810160405280929190818152602001828054610bd890612f24565b8015610c255780601f10610bfa57610100808354040283529160200191610c25565b820191906000526020600020905b815481529060010190602001808311610c0857829003601f168201915b5050505050815250509050919050565b600042610563338483610ffe565b6000610c56610c5183613459565b611e6e565b604080516001808252818301909252600091816020015b6040805160c081018252600080825260208083018290529282018190526060808301829052608083015260a08201528252600019909201910181610c6d579050509050610cbd6020840184613392565b610cc6906133c6565b81600081518110610cd957610cd9612f0e565b6020908102919091010152610d02833582610cfa60c0870160a08801612ce8565b3460016110cc565b60200151600081518110610d1857610d18612f0e565b6020026020010151915050919050565b3460005b8281101561085057600019830181146000858584818110610d4f57610d4f612f0e565b9050602002810190610d619190613315565b610d6a9061353e565b60208101518051919250901580610d875750816040015151815114155b15610dbe576040517f947d5a8400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b8151811015610e4257610e3a604051806080016040528085600001518152602001848481518110610df457610df4612f0e565b6020026020010151815260200185604001518481518110610e1757610e17612f0e565b6020026020010151815260200185606001516001600160a01b0316815250611fc9565b600101610dc1565b50610e5882600001518284606001518887611823565b610e62908661323f565b9450836001019350505050610d2c565b610e89610e843683900383018361361d565b611fc9565b604080516001808252818301909252600091816020015b6040805180820190915260008082526020820152815260200190600190039081610ea0579050509050610edb368390038301602084016132af565b81600081518110610eee57610eee612f0e565b602090810291909101015261078d823582610f0f60e0860160c08701612ce8565b346001611823565b60004282825b8181101561055d57610f47868683818110610f3a57610f3a612f0e565b9050602002013584611dc3565b600101610f1d565b6000610f5961204a565b905090565b604080516001808252818301909252600091829190816020015b6040805160c081018252600080825260208083018290529282018190526060808301829052608083015260a08201528252600019909201910181610f78579050509050610fc86020840184613392565b610fd1906133c6565b81600081518110610fe457610fe4612f0e565b6020908102919091010152610d02833582333460016110cc565b6001600160a01b0383166000908152600460209081526040808320858452918290529091205467ffffffffffffffff1615611065576040517fec9d6eeb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600083815260208290526040808220805467ffffffffffffffff191667ffffffffffffffff86169081179091559051909185916001600160a01b038816917f92a1f7a41a7c585a8b09e25b195e225b1d43248daca46b0faf9e0792777a222991a450505050565b60408051808201909152600081526060602082015284516040805180820190915260008152606060208201528167ffffffffffffffff81111561111157611111612f58565b60405190808252806020026020018201604052801561113a578160200160208202803683370190505b5060208201526040517fa2ea7c6e000000000000000000000000000000000000000000000000000000008152600481018990526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a2ea7c6e90602401600060405180830381865afa1580156111c1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111e99190810190613679565b805190915061120b57604051635f9bd90760e11b815260040160405180910390fd5b60008367ffffffffffffffff81111561122657611226612f58565b6040519080825280602002602001820160405280156112a757816020015b60408051610140810182526000808252602080830182905292820181905260608083018290526080830182905260a0830182905260c0830182905260e0830182905261010083019190915261012082015282526000199092019101816112445790505b50905060008467ffffffffffffffff8111156112c5576112c5612f58565b6040519080825280602002602001820160405280156112ee578160200160208202803683370190505b50905060005b858110156117355760008b828151811061131057611310612f0e565b60200260200101519050600067ffffffffffffffff16816020015167ffffffffffffffff161415801561135b57504267ffffffffffffffff16816020015167ffffffffffffffff1611155b15611392576040517f08e8b93700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84604001511580156113a5575080604001515b156113dc576040517f157bd4c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040518061014001604052806000801b81526020018f81526020016114004290565b67ffffffffffffffff168152602001836020015167ffffffffffffffff168152602001600067ffffffffffffffff1681526020018360600151815260200183600001516001600160a01b031681526020018d6001600160a01b0316815260200183604001511515815260200183608001518152509050600080600090505b6114888382612171565b600081815260026020526040902054909250156114a75760010161147e565b818352600082815260026020818152604092839020865181559086015160018201559185015190820180546060870151608088015167ffffffffffffffff908116700100000000000000000000000000000000027fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff92821668010000000000000000027fffffffffffffffffffffffffffffffff000000000000000000000000000000009094169190951617919091171691909117905560a0840151600382015560c08401516004820180546001600160a01b039283167fffffffffffffffffffffffff000000000000000000000000000000000000000090911617905560e0850151600583018054610100880151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090911692909316919091179190911790556101208401518491906006820190611619908261379f565b505050606084015115611670576060840151600090815260026020526040902054611670576040517fc5723b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8287868151811061168357611683612f0e565b60200260200101819052508360a001518686815181106116a5576116a5612f0e565b60200260200101818152505081896020015186815181106116c8576116c8612f0e565b6020026020010181815250508f8e6001600160a01b031685600001516001600160a01b03167f8bf46bf4cfd674fa735a3d63ec1c9ad4153f033c290341f3a588b75685141b358560405161171e91815260200190565b60405180910390a4846001019450505050506112f4565b5061174583838360008c8c6121d0565b845250919998505050505050505050565b606060008267ffffffffffffffff81111561177357611773612f58565b60405190808252806020026020018201604052801561179c578160200160208202803683370190505b5090506000805b855181101561055d5760008682815181106117c0576117c0612f0e565b6020026020010151905060005b8151811015611819578181815181106117e8576117e8612f0e565b602002602001015185858151811061180257611802612f0e565b6020908102919091010152600193840193016117cd565b50506001016117a3565b6040517fa2ea7c6e0000000000000000000000000000000000000000000000000000000081526004810186905260009081906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a2ea7c6e90602401600060405180830381865afa1580156118a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526118ce9190810190613679565b80519091506118f057604051635f9bd90760e11b815260040160405180910390fd5b855160008167ffffffffffffffff81111561190d5761190d612f58565b60405190808252806020026020018201604052801561198e57816020015b60408051610140810182526000808252602080830182905292820181905260608083018290526080830182905260a0830182905260c0830182905260e08301829052610100830191909152610120820152825260001990920191018161192b5790505b50905060008267ffffffffffffffff8111156119ac576119ac612f58565b6040519080825280602002602001820160405280156119d5578160200160208202803683370190505b50905060005b83811015611da55760008a82815181106119f7576119f7612f0e565b6020908102919091018101518051600090815260029092526040909120805491925090611a50576040517fc5723b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8c816001015414611a7457604051635f9bd90760e11b815260040160405180910390fd5b60058101546001600160a01b038c8116911614611abd576040517f4ca8886700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600581015474010000000000000000000000000000000000000000900460ff16611b13576040517f157bd4c300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002810154700100000000000000000000000000000000900467ffffffffffffffff1615611b6d576040517f905e710700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b426002820180547fffffffffffffffff0000000000000000ffffffffffffffffffffffffffffffff811670010000000000000000000000000000000067ffffffffffffffff948516810291821793849055604080516101408101825287548152600188015460208201529386169286169290921791830191909152680100000000000000008304841660608301529091049091166080820152600382015460a082015260048201546001600160a01b0390811660c0830152600583015490811660e083015274010000000000000000000000000000000000000000900460ff1615156101008201526006820180548391610120840191611c6c90612f24565b80601f0160208091040260200160405190810160405280929190818152602001828054611c9890612f24565b8015611ce55780601f10611cba57610100808354040283529160200191611ce5565b820191906000526020600020905b815481529060010190602001808311611cc857829003601f168201915b505050505081525050858481518110611d0057611d00612f0e565b60200260200101819052508160200151848481518110611d2257611d22612f0e565b60200260200101818152505080600101548b6001600160a01b03168260040160009054906101000a90046001600160a01b03166001600160a01b03167ff930a6e2523c9cc298691873087a740550b8fc85a0680830414c148ed927f6158560000151604051611d9391815260200190565b60405180910390a450506001016119db565b50611db584838360018b8b6121d0565b9a9950505050505050505050565b60008281526003602052604090205467ffffffffffffffff1615611e13576040517f2e26794600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260036020526040808220805467ffffffffffffffff191667ffffffffffffffff85169081179091559051909184917f5aafceeb1c7ad58e4a84898bdee37c02c0fc46e7d24e6b60e8209449f183459f9190a35050565b6020808201516040808401516060808601516001600160a01b031660009081526001808752848220805491820190558751865187890151878901519589015160808a01518051908c01209851999a979994989597611f5a97611f3f977fdbfdf8dc2b135c26253e00d5b6cbe6f20457e003fd526d97cea183883570de619791939290918c910197885260208801969096526001600160a01b0394909416604087015267ffffffffffffffff9290921660608601521515608085015260a084015260c083015260e08201526101000190565b60405160208183030381529060405280519060200120612544565b905084606001516001600160a01b0316611f8282856000015186602001518760400151612557565b6001600160a01b031614611fc2576040517f8baa579f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6020818101516040808401516060808601516001600160a01b031660009081526001808752848220805491820190558751865186517fa98d02348410c9c76735e0d0bb1396f4015ac2bb9615f9c2611d19d7a8a9965099810199909952958801529186019390935260808501819052929390929190611f5a9060a001611f3f565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156120a357507f000000000000000000000000000000000000000000000000000000000000000046145b156120cd57507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b60208083015160c084015160e0850151604080870151606088015161010089015160a08a01516101208b015194516000996121b299989796918c910161385f565b60405160208183030381529060405280519060200120905092915050565b845160009060018190036122285761222088886000815181106121f5576121f5612f0e565b60200260200101518860008151811061221057612210612f0e565b602002602001015188888861257f565b915050610704565b60208801516001600160a01b0381166122945760005b828110156122885787818151811061225857612258612f0e565b602002602001015160001461228057604051631574f9f360e01b815260040160405180910390fd5b60010161223e565b50600092505050610704565b6000805b838110156123985760008982815181106122b4576122b4612f0e565b602002602001015190508060001415801561232e5750836001600160a01b031663ce46e0466040518163ffffffff1660e01b8152600401602060405180830381865afa158015612308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061232c919061393d565b155b1561234c57604051631574f9f360e01b815260040160405180910390fd5b87811115612386576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b96879003969190910190600101612298565b508615612466576040517f88e5b2d90000000000000000000000000000000000000000000000000000000081526001600160a01b038316906388e5b2d99083906123e8908d908d9060040161395a565b60206040518083038185885af1158015612406573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061242b919061393d565b612461576040517fbf2f3a8b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612528565b6040517f91db0b7e0000000000000000000000000000000000000000000000000000000081526001600160a01b038316906391db0b7e9083906124af908d908d9060040161395a565b60206040518083038185885af11580156124cd573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906124f2919061393d565b612528576040517fe8bee83900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8415612537576125378661282f565b9998505050505050505050565b600061056361255161204a565b83612842565b600080600061256887878787612884565b9150915061257581612948565b5095945050505050565b60208601516000906001600160a01b0381166125be5785156125b457604051631574f9f360e01b815260040160405180910390fd5b6000915050610704565b851580159061262c5750806001600160a01b031663ce46e0466040518163ffffffff1660e01b8152600401602060405180830381865afa158015612606573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061262a919061393d565b155b1561264a57604051631574f9f360e01b815260040160405180910390fd5b83861115612684576040517f1101129400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b85840393508415612754576040517fe49617e10000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063e49617e19088906126d6908b90600401612e47565b60206040518083038185885af11580156126f4573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612719919061393d565b61274f576040517fccf3bb2700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612814565b6040517fe60c35050000000000000000000000000000000000000000000000000000000081526001600160a01b0382169063e60c350590889061279b908b90600401612e47565b60206040518083038185885af11580156127b9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906127de919061393d565b612814576040517fbd8ba84d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8215612823576128238461282f565b50939695505050505050565b801561283f5761283f3382612ab2565b50565b6040517f1901000000000000000000000000000000000000000000000000000000000000602082015260228101839052604281018290526000906062016121b2565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156128bb575060009050600361293f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561290f573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166129385760006001925092505061293f565b9150600090505b94509492505050565b600081600481111561295c5761295c613a13565b036129645750565b600181600481111561297857612978613a13565b036129ca5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e6174757265000000000000000060448201526064015b60405180910390fd5b60028160048111156129de576129de613a13565b03612a2b5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e6774680060448201526064016129c1565b6003816004811115612a3f57612a3f613a13565b0361283f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f756500000000000000000000000000000000000000000000000000000000000060648201526084016129c1565b80471015612b025760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016129c1565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612b4f576040519150601f19603f3d011682016040523d82523d6000602084013e612b54565b606091505b505090508061078d5760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016129c1565b60008083601f840112612bdd57600080fd5b50813567ffffffffffffffff811115612bf557600080fd5b6020830191508360208260051b8501011115612c1057600080fd5b9250929050565b60008060208385031215612c2a57600080fd5b823567ffffffffffffffff811115612c4157600080fd5b612c4d85828601612bcb565b90969095509350505050565b60005b83811015612c74578181015183820152602001612c5c565b50506000910152565b60008151808452612c95816020860160208601612c59565b601f01601f19169290920160200192915050565b602081526000612cbc6020830184612c7d565b9392505050565b6001600160a01b038116811461283f57600080fd5b8035612ce381612cc3565b919050565b600060208284031215612cfa57600080fd5b8135612cbc81612cc3565b6020808252825182820181905260009190848201906040850190845b81811015612d3d57835183529284019291840191600101612d21565b50909695505050505050565b600060608284031215612d5b57600080fd5b50919050565b600060208284031215612d7357600080fd5b5035919050565b600061014082518452602083015160208501526040830151612da8604086018267ffffffffffffffff169052565b506060830151612dc4606086018267ffffffffffffffff169052565b506080830151612de0608086018267ffffffffffffffff169052565b5060a083015160a085015260c0830151612e0560c08601826001600160a01b03169052565b5060e0830151612e2060e08601826001600160a01b03169052565b50610100838101511515908501526101208084015181860183905261070483870182612c7d565b602081526000612cbc6020830184612d7a565b60008060408385031215612e6d57600080fd5b8235612e7881612cc3565b946020939093013593505050565b600060208284031215612e9857600080fd5b813567ffffffffffffffff811115612eaf57600080fd5b820160c08185031215612cbc57600080fd5b600060e08284031215612d5b57600080fd5b600060208284031215612ee557600080fd5b813567ffffffffffffffff811115612efc57600080fd5b820160408185031215612cbc57600080fd5b634e487b7160e01b600052603260045260246000fd5b600181811c90821680612f3857607f821691505b602082108103612d5b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112612fa257600080fd5b9190910192915050565b6000808335601e19843603018112612fc357600080fd5b83018035915067ffffffffffffffff821115612fde57600080fd5b6020019150600581901b3603821315612c1057600080fd5b60405160c0810167ffffffffffffffff8111828210171561301957613019612f58565b60405290565b6040516080810167ffffffffffffffff8111828210171561301957613019612f58565b604051601f8201601f1916810167ffffffffffffffff8111828210171561306b5761306b612f58565b604052919050565b600067ffffffffffffffff82111561308d5761308d612f58565b5060051b60200190565b801515811461283f57600080fd5b8035612ce381613097565b600067ffffffffffffffff8211156130ca576130ca612f58565b50601f01601f191660200190565b600082601f8301126130e957600080fd5b81356130fc6130f7826130b0565b613042565b81815284602083860101111561311157600080fd5b816020850160208301376000918101602001919091529392505050565b600060c0828403121561314057600080fd5b613148612ff6565b9050813561315581612cc3565b8152602082013567ffffffffffffffff808216821461317357600080fd5b816020840152613185604085016130a5565b60408401526060840135606084015260808401359150808211156131a857600080fd5b506131b5848285016130d8565b60808301525060a082013560a082015292915050565b60006131d96130f784613073565b80848252602080830192508560051b8501368111156131f757600080fd5b855b8181101561323357803567ffffffffffffffff8111156132195760008081fd5b61322536828a0161312e565b8652509382019382016131f9565b50919695505050505050565b8181038181111561056357634e487b7160e01b600052601160045260246000fd5b60006040828403121561327257600080fd5b6040516040810181811067ffffffffffffffff8211171561329557613295612f58565b604052823581526020928301359281019290925250919050565b6000604082840312156132c157600080fd5b612cbc8383613260565b6000808335601e198436030181126132e257600080fd5b83018035915067ffffffffffffffff8211156132fd57600080fd5b6020019150600681901b3603821315612c1057600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112612fa257600080fd5b6000808335601e1984360301811261336057600080fd5b83018035915067ffffffffffffffff82111561337b57600080fd5b6020019150606081023603821315612c1057600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff41833603018112612fa257600080fd5b6000610563368361312e565b6000606082840312156133e457600080fd5b6040516060810181811067ffffffffffffffff8211171561340757613407612f58565b604052905080823560ff8116811461341e57600080fd5b8082525060208301356020820152604083013560408201525092915050565b60006060828403121561344f57600080fd5b612cbc83836133d2565b600060c0823603121561346b57600080fd5b61347361301f565b82358152602083013567ffffffffffffffff81111561349157600080fd5b61349d3682860161312e565b6020830152506134b036604085016133d2565b604082015260a08301356134c381612cc3565b606082015292915050565b600082601f8301126134df57600080fd5b813560206134ef6130f783613073565b8281526060928302850182019282820191908785111561350e57600080fd5b8387015b858110156135315761352489826133d2565b8452928401928101613512565b5090979650505050505050565b60006080823603121561355057600080fd5b61355861301f565b8235815260208084013567ffffffffffffffff8082111561357857600080fd5b9085019036601f83011261358b57600080fd5b81356135996130f782613073565b81815260069190911b830184019084810190368311156135b857600080fd5b938501935b828510156135e1576135cf3686613260565b825285820191506040850194506135bd565b808688015250505060408601359250808311156135fd57600080fd5b505061360b368286016134ce565b6040830152506134c360608401612cd8565b600060e0828403121561362f57600080fd5b61363761301f565b823581526136488460208501613260565b602082015261365a84606085016133d2565b604082015260c083013561366d81612cc3565b60608201529392505050565b6000602080838503121561368c57600080fd5b825167ffffffffffffffff808211156136a457600080fd5b90840190608082870312156136b857600080fd5b6136c061301f565b82518152838301516136d181612cc3565b8185015260408301516136e381613097565b60408201526060830151828111156136fa57600080fd5b80840193505086601f84011261370f57600080fd5b8251915061371f6130f7836130b0565b828152878584860101111561373357600080fd5b61374283868301878701612c59565b60608201529695505050505050565b601f82111561078d57600081815260208120601f850160051c810160208610156137785750805b601f850160051c820191505b8181101561379757828155600101613784565b505050505050565b815167ffffffffffffffff8111156137b9576137b9612f58565b6137cd816137c78454612f24565b84613751565b602080601f83116001811461380257600084156137ea5750858301515b600019600386901b1c1916600185901b178555613797565b600085815260208120601f198616915b8281101561383157888601518255948401946001909101908401613812565b508582101561384f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b89815260007fffffffffffffffffffffffffffffffffffffffff000000000000000000000000808b60601b166020840152808a60601b166034840152507fffffffffffffffff000000000000000000000000000000000000000000000000808960c01b166048840152808860c01b1660508401525085151560f81b605883015284605983015283516138f8816079850160208801612c59565b80830190507fffffffff000000000000000000000000000000000000000000000000000000008460e01b166079820152607d81019150509a9950505050505050505050565b60006020828403121561394f57600080fd5b8151612cbc81613097565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b838110156139cf577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa08887030185526139bd868351612d7a565b95509382019390820190600101613983565b50508584038187015286518085528782019482019350915060005b82811015613a06578451845293810193928101926001016139ea565b5091979650505050505050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122012b4a0fa4c11177f5db567d4327af1b613c86812c5a104f49d3eb9cf75c517ba64736f6c634300081300330000000000000000000000000000000000b15ee366c4fe5a24c50dda4cda8660"
const EAS_SALT = "0x0000000000000000000000000000000000000000003c0d51de38427703137508"
const EAS_ADDRESS = "0x0000000000eF4a4904F35dA8B65D1fB39D451Fbd"
async function main() {
// Retrieve command line arguments
const args: string[] = process.argv.slice(2);
const chainName: string = args[0]
setupWallet(chainName, process.env.FACTORY_KEY || process.env.DEPLOYER_KEY)
const wallet = getWallet()
const provider = getProvider()
const chainId = (await provider.getNetwork()).chainId
console.log(chainId)
// Auto-calculate the gas price
const gasPrice = await provider.getGasPrice();
console.log(gasPrice)
let nonce = (await wallet.getTransactionCount()) + 1;
console.log(nonce)
if (!args[1] || args[1] == 'FACTORY') {
const balance = await provider.getBalance(KEYLESS_ADDRESS);
console.log(balance)
if (balance.toString() == "0") {
// Transfer 0.01 ETH to that address
let tx = {
to: KEYLESS_ADDRESS,
value: ethers.utils.parseEther("0.1")
}
const signedTransaction = await wallet.sendTransaction(tx);
console.log('Transfer ETH to keyless deployer:', signedTransaction.hash);
}
const keylessDeployerResponse = await provider.sendTransaction(KEYLESS_PRESIGNED);
console.log('KEYLESS_CREATE2_DEPLOYER:', keylessDeployerResponse.hash);
// Deploy INEFFICIENT_IMMUTABLE_CREATE2_FACTORY
{
const gasLimit = 2000000
const rawTransaction = {
nonce: '0x'+nonce.toString(16), // Nonce of the sender's address
gasPrice, // Gas price (adjust as needed)
gasLimit: '0x'+gasLimit.toString(16), // Gas limit (adjust as needed)
to: KEYLESS_DEPLOYER, // Contract address
value: '0x0', // Amount of Ether to send (0 for contract interactions)
data: INEFFICIENT_PAYLOAD, // Encoded contract function data
chainId,
};
const signedTransaction = await wallet.signTransaction(rawTransaction);
const transactionResponse = await provider.sendTransaction(signedTransaction);
console.log('INEFFICIENT_IMMUTABLE_CREATE2_FACTORY:', transactionResponse.hash);
nonce++
}
// Deploy IMMUTABLE_CREATE2_FACTORY
{
const gasLimit = 2000000
const rawTransaction = {
nonce: '0x'+nonce.toString(16), // Nonce of the sender's address
gasPrice, // Gas price (adjust as needed)
gasLimit: '0x'+gasLimit.toString(16), // Gas limit (adjust as needed)
to: INEFFICIENT_ADDRESS, // Contract address
value: '0x0', // Amount of Ether to send (0 for contract interactions)
data: IMMUTABLE_PAYLOAD, // Encoded contract function data
chainId,
};
const signedTransaction = await wallet.signTransaction(rawTransaction);
const transactionResponse = await provider.sendTransaction(signedTransaction);
console.log('IMMUTABLE_CREATE2_FACTORY:', transactionResponse.hash);
nonce++
}
}
if (!args[1] || args[1] == 'EAS') {
// Deploy SCHEMA_REGISTRY
{
const gasLimit = 2000000
const rawTransaction = {
nonce: '0x'+nonce.toString(16), // Nonce of the sender's address
gasPrice, // Gas price (adjust as needed)
gasLimit: '0x'+gasLimit.toString(16), // Gas limit (adjust as needed)
to: IMMUTABLE_ADDRESS, // Contract address
value: '0x0', // Amount of Ether to send (0 for contract interactions)
data: '0x64e03087' + ethers.utils.defaultAbiCoder.encode(
['bytes32', 'bytes'],
[SCHEMA_REGISTRY_SALT, SCHEMA_REGISTRY_PAYLOAD],
).substring(2), // Encoded contract function data
chainId,
};
const signedTransaction = await wallet.signTransaction(rawTransaction);
const transactionResponse = await provider.sendTransaction(signedTransaction);
console.log('SCHEMA_REGISTRY:', transactionResponse.hash);
nonce++
}
// Deploy EAS
{
const gasLimit = 6000000
const rawTransaction = {
nonce: '0x'+nonce.toString(16), // Nonce of the sender's address
gasPrice, // Gas price (adjust as needed)
gasLimit: '0x'+gasLimit.toString(16), // Gas limit (adjust as needed)
to: IMMUTABLE_ADDRESS, // Contract address
value: '0x0', // Amount of Ether to send (0 for contract interactions)
data: '0x64e03087' + ethers.utils.defaultAbiCoder.encode(
['bytes32', 'bytes'],
[EAS_SALT, EAS_PAYLOAD],
).substring(2), // Encoded contract function data
chainId,
};
const signedTransaction = await wallet.signTransaction(rawTransaction);
const transactionResponse = await provider.sendTransaction(signedTransaction);
console.log('EAS:', transactionResponse.hash);
nonce++
}
}
}
main().then(() => process.exit(0)).catch(err => {
console.error(err)
process.exit(1)
})