From aa88f2daa2f304a3d2831dfa55dc3823b8dfa6a0 Mon Sep 17 00:00:00 2001 From: Prithvish Baidya Date: Sat, 7 Dec 2024 13:44:45 +0530 Subject: [PATCH] deploy contract on base sepolia --- .../Deploy.s.sol/84532/run-1733558607.json | 53 +++++++ .../Deploy.s.sol/84532/run-1733559212.json | 53 +++++++ .../Deploy.s.sol/84532/run-latest.json | 53 +++++++ packages/foundry/contracts/ZKRailBase.sol | 4 +- packages/foundry/foundry.toml | 51 ++----- packages/foundry/script/Deploy.s.sol | 39 ++++-- packages/foundry/script/DeployHelpers.s.sol | 127 ----------------- .../foundry/script/DeployYourContract.s.sol | 17 --- packages/foundry/script/VerifyAll.s.sol | 131 ------------------ 9 files changed, 203 insertions(+), 325 deletions(-) create mode 100644 packages/foundry/broadcast/Deploy.s.sol/84532/run-1733558607.json create mode 100644 packages/foundry/broadcast/Deploy.s.sol/84532/run-1733559212.json create mode 100644 packages/foundry/broadcast/Deploy.s.sol/84532/run-latest.json delete mode 100644 packages/foundry/script/DeployHelpers.s.sol delete mode 100644 packages/foundry/script/DeployYourContract.s.sol delete mode 100644 packages/foundry/script/VerifyAll.s.sol diff --git a/packages/foundry/broadcast/Deploy.s.sol/84532/run-1733558607.json b/packages/foundry/broadcast/Deploy.s.sol/84532/run-1733558607.json new file mode 100644 index 0000000..ca7677e --- /dev/null +++ b/packages/foundry/broadcast/Deploy.s.sol/84532/run-1733558607.json @@ -0,0 +1,53 @@ +{ + "transactions": [ + { + "hash": "0xfb7fcad3133912b4a34efcc80b89d14ab0a1f5fd20cfb1ebcd0d05905c685183", + "transactionType": "CREATE2", + "contractName": null, + "contractAddress": "0xf47aaf6b5bc8fe575f276e40fdae2dc9b6d89bb5", + "function": null, + "arguments": null, + "transaction": { + "from": "0xdef013e1c10cc2b4baa652f60b7c7c9f833075d0", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x3e20c", + "value": "0x0", + "input": "0xff0000000000000000000000000000000000000000000000000000000000000000d7ef45b2507b65cb5519019c89da6219f1d7d208644abe8ecf46a10f3a58fefd610160604052346101265760405161001860408261012b565b600681526020810190651692d4985a5b60d21b82526040519161003c60408461012b565b600183526020830191603160f81b835261005581610164565b6101205261006284610326565b61014052519020918260e05251902080610100524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a081526100cb60c08261012b565b5190206080523060c052604051611b9090816104c582396080518161192a015260a051816119e7015260c051816118f4015260e051816119790152610100518161199f01526101205181610e3f01526101405181610e680152f35b600080fd5b601f909101601f19168101906001600160401b0382119082101761014e57604052565b634e487b7160e01b600052604160045260246000fd5b908151602081106000146101fc575090601f8151116101a0576020815191015160208210610190571790565b6000198260200360031b1b161790565b6040519063305a27a960e01b8252602060048301528181519182602483015260005b8381106101e45750508160006044809484010152601f80199101168101030190fd5b602082820181015160448784010152859350016101c2565b6001600160401b03811161014e57600054600181811c9116801561031c575b602082101461030657601f81116102d1575b50602092601f821160011461026d5792819293600092610262575b50508160011b916000199060031b1c19161760005560ff90565b015190503880610248565b601f1982169360008052806000209160005b8681106102b957508360019596106102a0575b505050811b0160005560ff90565b015160001960f88460031b161c19169055388080610292565b9192602060018192868501518155019401920161027f565b60008052601f6020600020910160051c810190601f830160051c015b8181106102fa575061022d565b600081556001016102ed565b634e487b7160e01b600052602260045260246000fd5b90607f169061021b565b908151602081106000146103ae575090601f815111610352576020815191015160208210610190571790565b6040519063305a27a960e01b8252602060048301528181519182602483015260005b8381106103965750508160006044809484010152601f80199101168101030190fd5b60208282018101516044878401015285935001610374565b6001600160401b03811161014e57600154600181811c911680156104ba575b602082101461030657601f8111610484575b50602092601f821160011461041f5792819293600092610414575b50508160011b916000199060031b1c19161760015560ff90565b0151905038806103fa565b601f198216936001600052806000209160005b86811061046c5750836001959610610453575b505050811b0160015560ff90565b015160001960f88460031b161c19169055388080610445565b91926020600181928685015181550194019201610432565b6001600052601f6020600020910160051c810190601f830160051c015b8181106104ae57506103df565b600081556001016104a1565b90607f16906103cd56fe6080604052600436101561001257600080fd5b60003560e01c80630254f3921461119f5780632a7559ad14611021578063540ef46114610fed5780635afb31c814610fc157806375c7050914610f2357806384b0196e14610e265780638ed0e37d14610deb5780638ffafd0c1461067f578063924c9e7214610653578063987757dd1461050b578063b082a274146104d0578063b4257b9a14610357578063bd07f3c914610326578063d8da5b2b146103005763d8ef508d146100c157600080fd5b346102fb5760403660031901126102fb5760043560243567ffffffffffffffff81116102fb576100f59036906004016113b4565b505080600052600260205260406000209080600052600460205261011f60406000205415156115a6565b80600052600360205261013a60ff604060002054161561146b565b80600052600460205260406000205461012c81018082116102aa5742106102c0576202a30081018091116102aa5742101561026e576000818152600560205260409020546001600160a01b0316916101938315156115a6565b82330361021f57806101c36101ae60056101df9401546115e9565b600483015486906001600160a01b0316611603565b60068101546007909101549084906001600160a01b0316611603565b8060005260036020526040600020600160ff198254161790557f40fa46a0f0868890a59cbb2de69a0fbe24e336329925b215cac7fe18e84767c2600080a3005b60405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206d616b65722063616e207265736f6c766520776974682070726f6f6044820152603360f91b6064820152608490fd5b60405162461bcd60e51b8152602060048201526014602482015273141c9bdbd9881dda5b991bddc8195e1c1a5c995960621b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b81526020600482015260136024820152722a37b79032b0b9363c903337b910383937b7b360691b6044820152606490fd5b600080fd5b346102fb5760203660031901126102fb57602061031e6004356115e9565b604051908152f35b346102fb5760203660031901126102fb576004356000526003602052602060ff604060002054166040519015158152f35b346102fb5760203660031901126102fb57600435600060c060405161037b8161120a565b82815260405161038a81611226565b606081526060602082015283604082015260208201528260408201528260608201528260808201528260a08201520152806000526002602052604060002081600052600360205260ff6040600020541691600052600460205260406000205490604051916103f78361120a565b8154835261040760018301611308565b936020840194855260018060a01b0360048401541692604085019384526005810154906060860191825260018060a01b036006820154166080870190815260078201549160a08801928352600860018060a01b03910154169260c0880193845261048d604051998a9960608b525160608b01525160e060808b01526101408a019061137f565b96516001600160a01b0390811660a08a0152905160c08901529051811660e088015290516101008701529051166101208501521515602084015260408301520390f35b346102fb5760003660031901126102fb5760206040517f1468475ec693620e078de60b230b69f8316434c04e2277c318a725830318d72b8152f35b346102fb5760203660031901126102fb57600435600081815260026020526040902060088101546001600160a01b031690338290036106165782600052600360205261055f60ff604060002054161561146b565b6000838152600560205260409020546001600160a01b03166105828115156115a6565b60058201546032810290808204603214901517156102aa5760048301546105d4946105ba9260649004916001600160a01b0316611603565b6006820154600790920154916001600160a01b0316611603565b8060005260036020526040600020600160ff1982541617905533907f16a82196722dee8c3133e9a254d354ecd82df1ae49081db3270b4a8bb4382604600080a3005b60405162461bcd60e51b81526020600482015260156024820152744f6e6c792074616b65722063616e20736574746c6560581b6044820152606490fd5b346102fb5760203660031901126102fb5760043560005260046020526020604060002054604051908152f35b346102fb5760403660031901126102fb5760043567ffffffffffffffff81116102fb57806004019060e060031982360301126102fb5760243567ffffffffffffffff81116102fb576106d59036906004016113b4565b9260c48301926001600160a01b036106ec85611529565b163303610da657813592836000526004602052604060002054610d615761089194602483019161071c838661153d565b6107306107298280611552565b3691611643565b6020815191012090604061074a6107296020840184611552565b602081519101209181519260208401947f1468475ec693620e078de60b230b69f8316434c04e2277c318a725830318d72b8652838501526060840152013560808201526080815261079c60a082611242565b5190209161088860448601996108826107b48c611529565b9460428b60648b01359860848c019860a46107ce8b611529565b9d01359c6107db8a611529565b916040519360208501957f7ced3993fcde6944cc4de21b2b9367f2ce6ea9972cbef31bbb1671cb9d29c0e387526040860152606085015260018060a01b031660808401528b60a084015260018060a01b031660c08301528c60e083015260018060a01b0316610100820152610100815261085761012082611242565b5190206108626118f1565b906040519161190160f01b83526002830152602282015220923691611643565b90611a0d565b90999199611a49565b6001600160a01b038816978815610d28578561090c9189600052600560205260406000208b6bffffffffffffffffffffffff60a01b8254161790556108f36108d8876115e9565b6001600160a01b036108e98f611529565b163090339061168a565b30906001600160a01b0361090687611529565b1661168a565b8660005260026020526040600020908782556001820161092c868961153d565b906109378280611552565b9067ffffffffffffffff8211610c4e57819061095384546111d0565b601f8111610cd5575b50600090601f8311600114610c6f57600092610c64575b50508160011b916000199060031b1c19161790555b600283016109996020830183611552565b9067ffffffffffffffff8211610c4e576109b383546111d0565b601f8111610c06575b50600090601f8311600114610b705793610a8b93837f982c454c7eadeac52cca70807d29ec7fa0ab50878c2f4515a9084676975ca7d19d9c9b9a99989794604094600898600092610b65575b50508160011b916000199060031b1c19161790555b01356003850155610a2d8d611529565b6004850180546001600160a01b0319166001600160a01b0390921691909117905560058401869055610a5e85611529565b6006850180546001600160a01b0319166001600160a01b0390921691909117905560078401889055611529565b91019060018060a01b03166bffffffffffffffffffffffff60a01b82541617905586600052600460205242604060002055610b31610ad2610acc858861153d565b80611552565b969094610b23610b10610b0a6040610b02610afa610af0878961153d565b6020810190611552565b96909761153d565b01359e611529565b95611529565b966040519960e08b5260e08b0191611585565b9188830360208a0152611585565b60408601999099526001600160a01b03908116606086015260808501919091521660a083015260c0820152339481900390a4005b013590503880610a08565b8382526020822091601f198416815b818110610bee5750846040947f982c454c7eadeac52cca70807d29ec7fa0ab50878c2f4515a9084676975ca7d19f9e9d9c9b9a999694610a8b989460089a9660019510610bd4575b505050811b019055610a1d565b0135600019600384901b60f8161c19169055388080610bc7565b91936020600181928787013581550195019201610b7f565b836000526020600020601f840160051c81019160208510610c44575b601f0160051c01905b818110610c3857506109bc565b60008155600101610c2b565b9091508190610c22565b634e487b7160e01b600052604160045260246000fd5b013590508e80610973565b84825260208220925090601f198416815b818110610cbd5750908460019594939210610ca3575b505050811b019055610988565b0135600019600384901b60f8161c191690558e8080610c96565b91936020600181928787013581550195019201610c80565b909150836000526020600020601f840160051c81019160208510610d1e575b90601f859493920160051c01905b818110610d0f575061095c565b60008155849350600101610d02565b9091508190610cf4565b60405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606490fd5b60405162461bcd60e51b815260206004820152601860248201527f496e74656e7420616c726561647920636f6d6d697474656400000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601e60248201527f4f6e6c7920696e74656e742063726561746f722063616e20636f6d6d697400006044820152606490fd5b346102fb5760003660031901126102fb5760206040517f7ced3993fcde6944cc4de21b2b9367f2ce6ea9972cbef31bbb1671cb9d29c0e38152f35b346102fb5760003660031901126102fb57610ec5610e637f0000000000000000000000000000000000000000000000000000000000000000611735565b610e8c7f0000000000000000000000000000000000000000000000000000000000000000611837565b6020610ed360405192610e9f8385611242565b600084526000368137604051958695600f60f81b875260e08588015260e087019061133e565b90858203604087015261133e565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610f0c57505050500390f35b835185528695509381019392810192600101610efd565b346102fb5760203660031901126102fb57600435600052600260205260406000208054610f5260018301611308565b600483015460058401546006850154600786015460089096015460405195865260e060208701819052959687966001600160a01b0395861696928616959194939091169291610fa39188019061137f565b9460408701526060860152608085015260a084015260c08301520390f35b346102fb5760203660031901126102fb576040610fdf6004356114a9565b825191151582526020820152f35b346102fb5760203660031901126102fb576004356000526005602052602060018060a01b0360406000205416604051908152f35b346102fb5760203660031901126102fb5760043560008181526002602052604090206008810180546001600160a01b031691338390036111615783600052600360205261107660ff604060002054161561146b565b8360005260046020526040600020546202a30081018091116102aa574210611124576110c26110e2936110ac60058401546115e9565b60048401549091906001600160a01b0316611603565b60068101549154600790910154916001600160a01b039182169116611603565b8060005260036020526040600020600160ff1982541617905533907fb0da478e7a30218f2beadf504e14493c318640d667e4e2871e9d201227153ac5600080a3005b60405162461bcd60e51b8152602060048201526015602482015274151bdbc819585c9b1e48199bdc881d1a5b595bdd5d605a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152601660248201527513db9b1e481d185ad95c8818d85b881d1a5b595bdd5d60521b6044820152606490fd5b346102fb5760203660031901126102fb57604060ff6111bf6004356113e2565b835191151582529091166020820152f35b90600182811c92168015611200575b60208310146111ea57565b634e487b7160e01b600052602260045260246000fd5b91607f16916111df565b60e0810190811067ffffffffffffffff821117610c4e57604052565b6060810190811067ffffffffffffffff821117610c4e57604052565b90601f8019910116810190811067ffffffffffffffff821117610c4e57604052565b9060405191826000825492611278846111d0565b80845293600181169081156112e6575060011461129f575b5061129d92500383611242565b565b90506000929192526020600020906000915b8183106112ca57505090602061129d9282010138611290565b60209193508060019154838589010152019101909184926112b1565b90506020925061129d94915060ff191682840152151560051b82010138611290565b9060405161131581611226565b60406002829461132481611264565b845261133260018201611264565b60208501520154910152565b919082519283825260005b84811061136a575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201611349565b906040806113ab611399855160608652606086019061133e565b6020860151858203602087015261133e565b93015191015290565b9181601f840112156102fb5782359167ffffffffffffffff83116102fb57602083818601950101116102fb57565b806000526004602052604060002054156114625780600052600360205260ff6040600020541661145957600052600460205260406000205461012c81018082116102aa574210611450576202a30081018091116102aa5742101561144857600190600090565b600090600490565b50600090600390565b50600090600290565b50600090600190565b1561147257565b60405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cd95d1d1b1959608a1b6044820152606490fd5b806000526004602052604060002054158015611511575b611508576000526004602052604060002054906202a3008201918281116102aa57824210156114fe574290036202a300019182116102aa5760009190565b5060019150600090565b50600090600090565b5080600052600360205260ff604060002054166114c0565b356001600160a01b03811681036102fb5790565b903590605e19813603018212156102fb570190565b903590601e19813603018212156102fb570180359067ffffffffffffffff82116102fb576020019181360383136102fb57565b908060209392818452848401376000828201840152601f01601f1916010190565b156115ad57565b60405162461bcd60e51b8152602060048201526014602482015273125b9d195b9d081b9bdd0818dbdb5b5a5d1d195960621b6044820152606490fd5b6096810290808204609614901517156102aa576064900490565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261129d9161163e606483611242565b6116ce565b92919267ffffffffffffffff8211610c4e576040519161166d601f8201601f191660200184611242565b8294818452818301116102fb578281602093846000960137010152565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261129d9161163e608483611242565b906000602091828151910182855af115611729576000513d61172057506001600160a01b0381163b155b6116ff5750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156116f8565b6040513d6000823e3d90fd5b60ff811461177f5760ff811690601f821161176e5760408051926117598285611242565b6020808552840191601f190136833783525290565b632cd44ac360e21b60005260046000fd5b5060405160008160005491611793836111d0565b808352926001811690811561181857506001146117ba575b6117b792500382611242565b90565b50600080805290917f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8183106117fc5750509060206117b7928201016117ab565b60209193508060019154838588010152019101909183926117e4565b602092506117b794915060ff191682840152151560051b8201016117ab565b60ff811461185b5760ff811690601f821161176e5760408051926117598285611242565b5060405160015481600061186e836111d0565b80835292600181169081156118185750600114611891576117b792500382611242565b506001600090815290917fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8183106118d55750509060206117b7928201016117ab565b60209193508060019154838588010152019101909183926118bd565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614806119e4575b1561194c577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526119de60c082611242565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611923565b8151919060418303611a3e57611a3792506020820151906060604084015193015160001a90611ad1565b9192909190565b505060009160029190565b9190916004811015611abb5780611a5f57509050565b600060018203611a7a5763f645eedf60e01b60005260046000fd5b5060028103611a98578263fce698f760e01b60005260045260246000fd5b9091600360009214611aa8575050565b6335e2f38360e21b825260045260249150fd5b634e487b7160e01b600052602160045260246000fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611b4e579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa15611729576000516001600160a01b03811615611b425790600090600090565b50600090600190600090565b5050506000916003919056fea2646970667358221220f620445ddc00495eafae500fd583f395a003d5ac422759a822cffb68bdb574e364736f6c634300081a0033", + "nonce": "0x3", + "chainId": "0x14a34" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x14c9ac", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xfb7fcad3133912b4a34efcc80b89d14ab0a1f5fd20cfb1ebcd0d05905c685183", + "transactionIndex": "0x8", + "blockHash": "0x101948375253fee3acff05668cdaf61282e4a913c1acb536325d5216a6688bdb", + "blockNumber": "0x1205137", + "gasUsed": "0x2d1b5", + "effectiveGasPrice": "0x450", + "from": "0xdef013e1c10cc2b4baa652f60b7c7c9f833075d0", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": "0xf47aaf6b5bc8fe575f276e40fdae2dc9b6d89bb5", + "l1BaseFeeScalar": "0x44d", + "l1BlobBaseFee": "0x1", + "l1BlobBaseFeeScalar": "0xa118b", + "l1Fee": "0x1d01231ad0", + "l1GasPrice": "0x59f63efe", + "l1GasUsed": "0x124d4" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1733558607, + "chain": 84532, + "commit": "5c7a5d1" +} \ No newline at end of file diff --git a/packages/foundry/broadcast/Deploy.s.sol/84532/run-1733559212.json b/packages/foundry/broadcast/Deploy.s.sol/84532/run-1733559212.json new file mode 100644 index 0000000..d142fb5 --- /dev/null +++ b/packages/foundry/broadcast/Deploy.s.sol/84532/run-1733559212.json @@ -0,0 +1,53 @@ +{ + "transactions": [ + { + "hash": "0x84282298d95a3c7ffca16e764265bda57eb1b20c7de23817da6d30c57aa4a32e", + "transactionType": "CREATE2", + "contractName": "ZKRailUPI", + "contractAddress": "0x887a72abf9395b0a45dca391901ccd71243cd1b3", + "function": null, + "arguments": null, + "transaction": { + "from": "0xdef013e1c10cc2b4baa652f60b7c7c9f833075d0", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x21ac24", + "value": "0x0", + "input": "0x0000000000000000000000000000000000000000000000000000000000001234610160604052346101265760405161001860408261012b565b600681526020810190651692d4985a5b60d21b82526040519161003c60408461012b565b600183526020830191603160f81b835261005581610164565b6101205261006284610326565b61014052519020918260e05251902080610100524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a081526100cb60c08261012b565b5190206080523060c052604051611b9090816104c582396080518161192a015260a051816119e7015260c051816118f4015260e051816119790152610100518161199f01526101205181610e3f01526101405181610e680152f35b600080fd5b601f909101601f19168101906001600160401b0382119082101761014e57604052565b634e487b7160e01b600052604160045260246000fd5b908151602081106000146101fc575090601f8151116101a0576020815191015160208210610190571790565b6000198260200360031b1b161790565b6040519063305a27a960e01b8252602060048301528181519182602483015260005b8381106101e45750508160006044809484010152601f80199101168101030190fd5b602082820181015160448784010152859350016101c2565b6001600160401b03811161014e57600054600181811c9116801561031c575b602082101461030657601f81116102d1575b50602092601f821160011461026d5792819293600092610262575b50508160011b916000199060031b1c19161760005560ff90565b015190503880610248565b601f1982169360008052806000209160005b8681106102b957508360019596106102a0575b505050811b0160005560ff90565b015160001960f88460031b161c19169055388080610292565b9192602060018192868501518155019401920161027f565b60008052601f6020600020910160051c810190601f830160051c015b8181106102fa575061022d565b600081556001016102ed565b634e487b7160e01b600052602260045260246000fd5b90607f169061021b565b908151602081106000146103ae575090601f815111610352576020815191015160208210610190571790565b6040519063305a27a960e01b8252602060048301528181519182602483015260005b8381106103965750508160006044809484010152601f80199101168101030190fd5b60208282018101516044878401015285935001610374565b6001600160401b03811161014e57600154600181811c911680156104ba575b602082101461030657601f8111610484575b50602092601f821160011461041f5792819293600092610414575b50508160011b916000199060031b1c19161760015560ff90565b0151905038806103fa565b601f198216936001600052806000209160005b86811061046c5750836001959610610453575b505050811b0160015560ff90565b015160001960f88460031b161c19169055388080610445565b91926020600181928685015181550194019201610432565b6001600052601f6020600020910160051c810190601f830160051c015b8181106104ae57506103df565b600081556001016104a1565b90607f16906103cd56fe6080604052600436101561001257600080fd5b60003560e01c80630254f3921461119f5780632a7559ad14611021578063540ef46114610fed5780635afb31c814610fc157806375c7050914610f2357806384b0196e14610e265780638ed0e37d14610deb5780638ffafd0c1461067f578063924c9e7214610653578063987757dd1461050b578063b082a274146104d0578063b4257b9a14610357578063bd07f3c914610326578063d8da5b2b146103005763d8ef508d146100c157600080fd5b346102fb5760403660031901126102fb5760043560243567ffffffffffffffff81116102fb576100f59036906004016113b4565b505080600052600260205260406000209080600052600460205261011f60406000205415156115a6565b80600052600360205261013a60ff604060002054161561146b565b80600052600460205260406000205461012c81018082116102aa5742106102c0576202a30081018091116102aa5742101561026e576000818152600560205260409020546001600160a01b0316916101938315156115a6565b82330361021f57806101c36101ae60056101df9401546115e9565b600483015486906001600160a01b0316611603565b60068101546007909101549084906001600160a01b0316611603565b8060005260036020526040600020600160ff198254161790557f40fa46a0f0868890a59cbb2de69a0fbe24e336329925b215cac7fe18e84767c2600080a3005b60405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206d616b65722063616e207265736f6c766520776974682070726f6f6044820152603360f91b6064820152608490fd5b60405162461bcd60e51b8152602060048201526014602482015273141c9bdbd9881dda5b991bddc8195e1c1a5c995960621b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b81526020600482015260136024820152722a37b79032b0b9363c903337b910383937b7b360691b6044820152606490fd5b600080fd5b346102fb5760203660031901126102fb57602061031e6004356115e9565b604051908152f35b346102fb5760203660031901126102fb576004356000526003602052602060ff604060002054166040519015158152f35b346102fb5760203660031901126102fb57600435600060c060405161037b8161120a565b82815260405161038a81611226565b606081526060602082015283604082015260208201528260408201528260608201528260808201528260a08201520152806000526002602052604060002081600052600360205260ff6040600020541691600052600460205260406000205490604051916103f78361120a565b8154835261040760018301611308565b936020840194855260018060a01b0360048401541692604085019384526005810154906060860191825260018060a01b036006820154166080870190815260078201549160a08801928352600860018060a01b03910154169260c0880193845261048d604051998a9960608b525160608b01525160e060808b01526101408a019061137f565b96516001600160a01b0390811660a08a0152905160c08901529051811660e088015290516101008701529051166101208501521515602084015260408301520390f35b346102fb5760003660031901126102fb5760206040517f1468475ec693620e078de60b230b69f8316434c04e2277c318a725830318d72b8152f35b346102fb5760203660031901126102fb57600435600081815260026020526040902060088101546001600160a01b031690338290036106165782600052600360205261055f60ff604060002054161561146b565b6000838152600560205260409020546001600160a01b03166105828115156115a6565b60058201546032810290808204603214901517156102aa5760048301546105d4946105ba9260649004916001600160a01b0316611603565b6006820154600790920154916001600160a01b0316611603565b8060005260036020526040600020600160ff1982541617905533907f16a82196722dee8c3133e9a254d354ecd82df1ae49081db3270b4a8bb4382604600080a3005b60405162461bcd60e51b81526020600482015260156024820152744f6e6c792074616b65722063616e20736574746c6560581b6044820152606490fd5b346102fb5760203660031901126102fb5760043560005260046020526020604060002054604051908152f35b346102fb5760403660031901126102fb5760043567ffffffffffffffff81116102fb57806004019060e060031982360301126102fb5760243567ffffffffffffffff81116102fb576106d59036906004016113b4565b9260c48301926001600160a01b036106ec85611529565b163303610da657813592836000526004602052604060002054610d615761089194602483019161071c838661153d565b6107306107298280611552565b3691611643565b6020815191012090604061074a6107296020840184611552565b602081519101209181519260208401947f1468475ec693620e078de60b230b69f8316434c04e2277c318a725830318d72b8652838501526060840152013560808201526080815261079c60a082611242565b5190209161088860448601996108826107b48c611529565b9460428b60648b01359860848c019860a46107ce8b611529565b9d01359c6107db8a611529565b916040519360208501957f7ced3993fcde6944cc4de21b2b9367f2ce6ea9972cbef31bbb1671cb9d29c0e387526040860152606085015260018060a01b031660808401528b60a084015260018060a01b031660c08301528c60e083015260018060a01b0316610100820152610100815261085761012082611242565b5190206108626118f1565b906040519161190160f01b83526002830152602282015220923691611643565b90611a0d565b90999199611a49565b6001600160a01b038816978815610d28578561090c9189600052600560205260406000208b6bffffffffffffffffffffffff60a01b8254161790556108f36108d8876115e9565b6001600160a01b036108e98f611529565b163090339061168a565b30906001600160a01b0361090687611529565b1661168a565b8660005260026020526040600020908782556001820161092c868961153d565b906109378280611552565b9067ffffffffffffffff8211610c4e57819061095384546111d0565b601f8111610cd5575b50600090601f8311600114610c6f57600092610c64575b50508160011b916000199060031b1c19161790555b600283016109996020830183611552565b9067ffffffffffffffff8211610c4e576109b383546111d0565b601f8111610c06575b50600090601f8311600114610b705793610a8b93837f982c454c7eadeac52cca70807d29ec7fa0ab50878c2f4515a9084676975ca7d19d9c9b9a99989794604094600898600092610b65575b50508160011b916000199060031b1c19161790555b01356003850155610a2d8d611529565b6004850180546001600160a01b0319166001600160a01b0390921691909117905560058401869055610a5e85611529565b6006850180546001600160a01b0319166001600160a01b0390921691909117905560078401889055611529565b91019060018060a01b03166bffffffffffffffffffffffff60a01b82541617905586600052600460205242604060002055610b31610ad2610acc858861153d565b80611552565b969094610b23610b10610b0a6040610b02610afa610af0878961153d565b6020810190611552565b96909761153d565b01359e611529565b95611529565b966040519960e08b5260e08b0191611585565b9188830360208a0152611585565b60408601999099526001600160a01b03908116606086015260808501919091521660a083015260c0820152339481900390a4005b013590503880610a08565b8382526020822091601f198416815b818110610bee5750846040947f982c454c7eadeac52cca70807d29ec7fa0ab50878c2f4515a9084676975ca7d19f9e9d9c9b9a999694610a8b989460089a9660019510610bd4575b505050811b019055610a1d565b0135600019600384901b60f8161c19169055388080610bc7565b91936020600181928787013581550195019201610b7f565b836000526020600020601f840160051c81019160208510610c44575b601f0160051c01905b818110610c3857506109bc565b60008155600101610c2b565b9091508190610c22565b634e487b7160e01b600052604160045260246000fd5b013590508e80610973565b84825260208220925090601f198416815b818110610cbd5750908460019594939210610ca3575b505050811b019055610988565b0135600019600384901b60f8161c191690558e8080610c96565b91936020600181928787013581550195019201610c80565b909150836000526020600020601f840160051c81019160208510610d1e575b90601f859493920160051c01905b818110610d0f575061095c565b60008155849350600101610d02565b9091508190610cf4565b60405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606490fd5b60405162461bcd60e51b815260206004820152601860248201527f496e74656e7420616c726561647920636f6d6d697474656400000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601e60248201527f4f6e6c7920696e74656e742063726561746f722063616e20636f6d6d697400006044820152606490fd5b346102fb5760003660031901126102fb5760206040517f7ced3993fcde6944cc4de21b2b9367f2ce6ea9972cbef31bbb1671cb9d29c0e38152f35b346102fb5760003660031901126102fb57610ec5610e637f0000000000000000000000000000000000000000000000000000000000000000611735565b610e8c7f0000000000000000000000000000000000000000000000000000000000000000611837565b6020610ed360405192610e9f8385611242565b600084526000368137604051958695600f60f81b875260e08588015260e087019061133e565b90858203604087015261133e565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610f0c57505050500390f35b835185528695509381019392810192600101610efd565b346102fb5760203660031901126102fb57600435600052600260205260406000208054610f5260018301611308565b600483015460058401546006850154600786015460089096015460405195865260e060208701819052959687966001600160a01b0395861696928616959194939091169291610fa39188019061137f565b9460408701526060860152608085015260a084015260c08301520390f35b346102fb5760203660031901126102fb576040610fdf6004356114a9565b825191151582526020820152f35b346102fb5760203660031901126102fb576004356000526005602052602060018060a01b0360406000205416604051908152f35b346102fb5760203660031901126102fb5760043560008181526002602052604090206008810180546001600160a01b031691338390036111615783600052600360205261107660ff604060002054161561146b565b8360005260046020526040600020546202a30081018091116102aa574210611124576110c26110e2936110ac60058401546115e9565b60048401549091906001600160a01b0316611603565b60068101549154600790910154916001600160a01b039182169116611603565b8060005260036020526040600020600160ff1982541617905533907fb0da478e7a30218f2beadf504e14493c318640d667e4e2871e9d201227153ac5600080a3005b60405162461bcd60e51b8152602060048201526015602482015274151bdbc819585c9b1e48199bdc881d1a5b595bdd5d605a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152601660248201527513db9b1e481d185ad95c8818d85b881d1a5b595bdd5d60521b6044820152606490fd5b346102fb5760203660031901126102fb57604060ff6111bf6004356113e2565b835191151582529091166020820152f35b90600182811c92168015611200575b60208310146111ea57565b634e487b7160e01b600052602260045260246000fd5b91607f16916111df565b60e0810190811067ffffffffffffffff821117610c4e57604052565b6060810190811067ffffffffffffffff821117610c4e57604052565b90601f8019910116810190811067ffffffffffffffff821117610c4e57604052565b9060405191826000825492611278846111d0565b80845293600181169081156112e6575060011461129f575b5061129d92500383611242565b565b90506000929192526020600020906000915b8183106112ca57505090602061129d9282010138611290565b60209193508060019154838589010152019101909184926112b1565b90506020925061129d94915060ff191682840152151560051b82010138611290565b9060405161131581611226565b60406002829461132481611264565b845261133260018201611264565b60208501520154910152565b919082519283825260005b84811061136a575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201611349565b906040806113ab611399855160608652606086019061133e565b6020860151858203602087015261133e565b93015191015290565b9181601f840112156102fb5782359167ffffffffffffffff83116102fb57602083818601950101116102fb57565b806000526004602052604060002054156114625780600052600360205260ff6040600020541661145957600052600460205260406000205461012c81018082116102aa574210611450576202a30081018091116102aa5742101561144857600190600090565b600090600490565b50600090600390565b50600090600290565b50600090600190565b1561147257565b60405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cd95d1d1b1959608a1b6044820152606490fd5b806000526004602052604060002054158015611511575b611508576000526004602052604060002054906202a3008201918281116102aa57824210156114fe574290036202a300019182116102aa5760009190565b5060019150600090565b50600090600090565b5080600052600360205260ff604060002054166114c0565b356001600160a01b03811681036102fb5790565b903590605e19813603018212156102fb570190565b903590601e19813603018212156102fb570180359067ffffffffffffffff82116102fb576020019181360383136102fb57565b908060209392818452848401376000828201840152601f01601f1916010190565b156115ad57565b60405162461bcd60e51b8152602060048201526014602482015273125b9d195b9d081b9bdd0818dbdb5b5a5d1d195960621b6044820152606490fd5b6096810290808204609614901517156102aa576064900490565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261129d9161163e606483611242565b6116ce565b92919267ffffffffffffffff8211610c4e576040519161166d601f8201601f191660200184611242565b8294818452818301116102fb578281602093846000960137010152565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261129d9161163e608483611242565b906000602091828151910182855af115611729576000513d61172057506001600160a01b0381163b155b6116ff5750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156116f8565b6040513d6000823e3d90fd5b60ff811461177f5760ff811690601f821161176e5760408051926117598285611242565b6020808552840191601f190136833783525290565b632cd44ac360e21b60005260046000fd5b5060405160008160005491611793836111d0565b808352926001811690811561181857506001146117ba575b6117b792500382611242565b90565b50600080805290917f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8183106117fc5750509060206117b7928201016117ab565b60209193508060019154838588010152019101909183926117e4565b602092506117b794915060ff191682840152151560051b8201016117ab565b60ff811461185b5760ff811690601f821161176e5760408051926117598285611242565b5060405160015481600061186e836111d0565b80835292600181169081156118185750600114611891576117b792500382611242565b506001600090815290917fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8183106118d55750509060206117b7928201016117ab565b60209193508060019154838588010152019101909183926118bd565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614806119e4575b1561194c577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526119de60c082611242565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611923565b8151919060418303611a3e57611a3792506020820151906060604084015193015160001a90611ad1565b9192909190565b505060009160029190565b9190916004811015611abb5780611a5f57509050565b600060018203611a7a5763f645eedf60e01b60005260046000fd5b5060028103611a98578263fce698f760e01b60005260045260246000fd5b9091600360009214611aa8575050565b6335e2f38360e21b825260045260249150fd5b634e487b7160e01b600052602160045260246000fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611b4e579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa15611729576000516001600160a01b03811615611b425790600090600090565b50600090600190600090565b5050506000916003919056fea2646970667358221220f620445ddc00495eafae500fd583f395a003d5ac422759a822cffb68bdb574e364736f6c634300081a0033", + "nonce": "0x4", + "chainId": "0x14a34" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x5a2317", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x84282298d95a3c7ffca16e764265bda57eb1b20c7de23817da6d30c57aa4a32e", + "transactionIndex": "0x7", + "blockHash": "0x43bab0e99a8ab8493ad4bb8b3feadb25583166f801c46a10c76658bc3994f9e1", + "blockNumber": "0x120525d", + "gasUsed": "0x1862da", + "effectiveGasPrice": "0xd6bd", + "from": "0xdef013e1c10cc2b4baa652f60b7c7c9f833075d0", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": "0x887a72abf9395b0a45dca391901ccd71243cd1b3", + "l1BaseFeeScalar": "0x44d", + "l1BlobBaseFee": "0x1", + "l1BlobBaseFeeScalar": "0xa118b", + "l1Fee": "0x1e5bd4d01a", + "l1GasPrice": "0x5eafbb3e", + "l1GasUsed": "0x12336" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1733559212, + "chain": 84532, + "commit": "5c7a5d1" +} \ No newline at end of file diff --git a/packages/foundry/broadcast/Deploy.s.sol/84532/run-latest.json b/packages/foundry/broadcast/Deploy.s.sol/84532/run-latest.json new file mode 100644 index 0000000..d142fb5 --- /dev/null +++ b/packages/foundry/broadcast/Deploy.s.sol/84532/run-latest.json @@ -0,0 +1,53 @@ +{ + "transactions": [ + { + "hash": "0x84282298d95a3c7ffca16e764265bda57eb1b20c7de23817da6d30c57aa4a32e", + "transactionType": "CREATE2", + "contractName": "ZKRailUPI", + "contractAddress": "0x887a72abf9395b0a45dca391901ccd71243cd1b3", + "function": null, + "arguments": null, + "transaction": { + "from": "0xdef013e1c10cc2b4baa652f60b7c7c9f833075d0", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x21ac24", + "value": "0x0", + "input": "0x0000000000000000000000000000000000000000000000000000000000001234610160604052346101265760405161001860408261012b565b600681526020810190651692d4985a5b60d21b82526040519161003c60408461012b565b600183526020830191603160f81b835261005581610164565b6101205261006284610326565b61014052519020918260e05251902080610100524660a0526040519060208201927f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f8452604083015260608201524660808201523060a082015260a081526100cb60c08261012b565b5190206080523060c052604051611b9090816104c582396080518161192a015260a051816119e7015260c051816118f4015260e051816119790152610100518161199f01526101205181610e3f01526101405181610e680152f35b600080fd5b601f909101601f19168101906001600160401b0382119082101761014e57604052565b634e487b7160e01b600052604160045260246000fd5b908151602081106000146101fc575090601f8151116101a0576020815191015160208210610190571790565b6000198260200360031b1b161790565b6040519063305a27a960e01b8252602060048301528181519182602483015260005b8381106101e45750508160006044809484010152601f80199101168101030190fd5b602082820181015160448784010152859350016101c2565b6001600160401b03811161014e57600054600181811c9116801561031c575b602082101461030657601f81116102d1575b50602092601f821160011461026d5792819293600092610262575b50508160011b916000199060031b1c19161760005560ff90565b015190503880610248565b601f1982169360008052806000209160005b8681106102b957508360019596106102a0575b505050811b0160005560ff90565b015160001960f88460031b161c19169055388080610292565b9192602060018192868501518155019401920161027f565b60008052601f6020600020910160051c810190601f830160051c015b8181106102fa575061022d565b600081556001016102ed565b634e487b7160e01b600052602260045260246000fd5b90607f169061021b565b908151602081106000146103ae575090601f815111610352576020815191015160208210610190571790565b6040519063305a27a960e01b8252602060048301528181519182602483015260005b8381106103965750508160006044809484010152601f80199101168101030190fd5b60208282018101516044878401015285935001610374565b6001600160401b03811161014e57600154600181811c911680156104ba575b602082101461030657601f8111610484575b50602092601f821160011461041f5792819293600092610414575b50508160011b916000199060031b1c19161760015560ff90565b0151905038806103fa565b601f198216936001600052806000209160005b86811061046c5750836001959610610453575b505050811b0160015560ff90565b015160001960f88460031b161c19169055388080610445565b91926020600181928685015181550194019201610432565b6001600052601f6020600020910160051c810190601f830160051c015b8181106104ae57506103df565b600081556001016104a1565b90607f16906103cd56fe6080604052600436101561001257600080fd5b60003560e01c80630254f3921461119f5780632a7559ad14611021578063540ef46114610fed5780635afb31c814610fc157806375c7050914610f2357806384b0196e14610e265780638ed0e37d14610deb5780638ffafd0c1461067f578063924c9e7214610653578063987757dd1461050b578063b082a274146104d0578063b4257b9a14610357578063bd07f3c914610326578063d8da5b2b146103005763d8ef508d146100c157600080fd5b346102fb5760403660031901126102fb5760043560243567ffffffffffffffff81116102fb576100f59036906004016113b4565b505080600052600260205260406000209080600052600460205261011f60406000205415156115a6565b80600052600360205261013a60ff604060002054161561146b565b80600052600460205260406000205461012c81018082116102aa5742106102c0576202a30081018091116102aa5742101561026e576000818152600560205260409020546001600160a01b0316916101938315156115a6565b82330361021f57806101c36101ae60056101df9401546115e9565b600483015486906001600160a01b0316611603565b60068101546007909101549084906001600160a01b0316611603565b8060005260036020526040600020600160ff198254161790557f40fa46a0f0868890a59cbb2de69a0fbe24e336329925b215cac7fe18e84767c2600080a3005b60405162461bcd60e51b815260206004820152602160248201527f4f6e6c79206d616b65722063616e207265736f6c766520776974682070726f6f6044820152603360f91b6064820152608490fd5b60405162461bcd60e51b8152602060048201526014602482015273141c9bdbd9881dda5b991bddc8195e1c1a5c995960621b6044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b60405162461bcd60e51b81526020600482015260136024820152722a37b79032b0b9363c903337b910383937b7b360691b6044820152606490fd5b600080fd5b346102fb5760203660031901126102fb57602061031e6004356115e9565b604051908152f35b346102fb5760203660031901126102fb576004356000526003602052602060ff604060002054166040519015158152f35b346102fb5760203660031901126102fb57600435600060c060405161037b8161120a565b82815260405161038a81611226565b606081526060602082015283604082015260208201528260408201528260608201528260808201528260a08201520152806000526002602052604060002081600052600360205260ff6040600020541691600052600460205260406000205490604051916103f78361120a565b8154835261040760018301611308565b936020840194855260018060a01b0360048401541692604085019384526005810154906060860191825260018060a01b036006820154166080870190815260078201549160a08801928352600860018060a01b03910154169260c0880193845261048d604051998a9960608b525160608b01525160e060808b01526101408a019061137f565b96516001600160a01b0390811660a08a0152905160c08901529051811660e088015290516101008701529051166101208501521515602084015260408301520390f35b346102fb5760003660031901126102fb5760206040517f1468475ec693620e078de60b230b69f8316434c04e2277c318a725830318d72b8152f35b346102fb5760203660031901126102fb57600435600081815260026020526040902060088101546001600160a01b031690338290036106165782600052600360205261055f60ff604060002054161561146b565b6000838152600560205260409020546001600160a01b03166105828115156115a6565b60058201546032810290808204603214901517156102aa5760048301546105d4946105ba9260649004916001600160a01b0316611603565b6006820154600790920154916001600160a01b0316611603565b8060005260036020526040600020600160ff1982541617905533907f16a82196722dee8c3133e9a254d354ecd82df1ae49081db3270b4a8bb4382604600080a3005b60405162461bcd60e51b81526020600482015260156024820152744f6e6c792074616b65722063616e20736574746c6560581b6044820152606490fd5b346102fb5760203660031901126102fb5760043560005260046020526020604060002054604051908152f35b346102fb5760403660031901126102fb5760043567ffffffffffffffff81116102fb57806004019060e060031982360301126102fb5760243567ffffffffffffffff81116102fb576106d59036906004016113b4565b9260c48301926001600160a01b036106ec85611529565b163303610da657813592836000526004602052604060002054610d615761089194602483019161071c838661153d565b6107306107298280611552565b3691611643565b6020815191012090604061074a6107296020840184611552565b602081519101209181519260208401947f1468475ec693620e078de60b230b69f8316434c04e2277c318a725830318d72b8652838501526060840152013560808201526080815261079c60a082611242565b5190209161088860448601996108826107b48c611529565b9460428b60648b01359860848c019860a46107ce8b611529565b9d01359c6107db8a611529565b916040519360208501957f7ced3993fcde6944cc4de21b2b9367f2ce6ea9972cbef31bbb1671cb9d29c0e387526040860152606085015260018060a01b031660808401528b60a084015260018060a01b031660c08301528c60e083015260018060a01b0316610100820152610100815261085761012082611242565b5190206108626118f1565b906040519161190160f01b83526002830152602282015220923691611643565b90611a0d565b90999199611a49565b6001600160a01b038816978815610d28578561090c9189600052600560205260406000208b6bffffffffffffffffffffffff60a01b8254161790556108f36108d8876115e9565b6001600160a01b036108e98f611529565b163090339061168a565b30906001600160a01b0361090687611529565b1661168a565b8660005260026020526040600020908782556001820161092c868961153d565b906109378280611552565b9067ffffffffffffffff8211610c4e57819061095384546111d0565b601f8111610cd5575b50600090601f8311600114610c6f57600092610c64575b50508160011b916000199060031b1c19161790555b600283016109996020830183611552565b9067ffffffffffffffff8211610c4e576109b383546111d0565b601f8111610c06575b50600090601f8311600114610b705793610a8b93837f982c454c7eadeac52cca70807d29ec7fa0ab50878c2f4515a9084676975ca7d19d9c9b9a99989794604094600898600092610b65575b50508160011b916000199060031b1c19161790555b01356003850155610a2d8d611529565b6004850180546001600160a01b0319166001600160a01b0390921691909117905560058401869055610a5e85611529565b6006850180546001600160a01b0319166001600160a01b0390921691909117905560078401889055611529565b91019060018060a01b03166bffffffffffffffffffffffff60a01b82541617905586600052600460205242604060002055610b31610ad2610acc858861153d565b80611552565b969094610b23610b10610b0a6040610b02610afa610af0878961153d565b6020810190611552565b96909761153d565b01359e611529565b95611529565b966040519960e08b5260e08b0191611585565b9188830360208a0152611585565b60408601999099526001600160a01b03908116606086015260808501919091521660a083015260c0820152339481900390a4005b013590503880610a08565b8382526020822091601f198416815b818110610bee5750846040947f982c454c7eadeac52cca70807d29ec7fa0ab50878c2f4515a9084676975ca7d19f9e9d9c9b9a999694610a8b989460089a9660019510610bd4575b505050811b019055610a1d565b0135600019600384901b60f8161c19169055388080610bc7565b91936020600181928787013581550195019201610b7f565b836000526020600020601f840160051c81019160208510610c44575b601f0160051c01905b818110610c3857506109bc565b60008155600101610c2b565b9091508190610c22565b634e487b7160e01b600052604160045260246000fd5b013590508e80610973565b84825260208220925090601f198416815b818110610cbd5750908460019594939210610ca3575b505050811b019055610988565b0135600019600384901b60f8161c191690558e8080610c96565b91936020600181928787013581550195019201610c80565b909150836000526020600020601f840160051c81019160208510610d1e575b90601f859493920160051c01905b818110610d0f575061095c565b60008155849350600101610d02565b9091508190610cf4565b60405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b6044820152606490fd5b60405162461bcd60e51b815260206004820152601860248201527f496e74656e7420616c726561647920636f6d6d697474656400000000000000006044820152606490fd5b60405162461bcd60e51b815260206004820152601e60248201527f4f6e6c7920696e74656e742063726561746f722063616e20636f6d6d697400006044820152606490fd5b346102fb5760003660031901126102fb5760206040517f7ced3993fcde6944cc4de21b2b9367f2ce6ea9972cbef31bbb1671cb9d29c0e38152f35b346102fb5760003660031901126102fb57610ec5610e637f0000000000000000000000000000000000000000000000000000000000000000611735565b610e8c7f0000000000000000000000000000000000000000000000000000000000000000611837565b6020610ed360405192610e9f8385611242565b600084526000368137604051958695600f60f81b875260e08588015260e087019061133e565b90858203604087015261133e565b466060850152306080850152600060a085015283810360c085015281808451928381520193019160005b828110610f0c57505050500390f35b835185528695509381019392810192600101610efd565b346102fb5760203660031901126102fb57600435600052600260205260406000208054610f5260018301611308565b600483015460058401546006850154600786015460089096015460405195865260e060208701819052959687966001600160a01b0395861696928616959194939091169291610fa39188019061137f565b9460408701526060860152608085015260a084015260c08301520390f35b346102fb5760203660031901126102fb576040610fdf6004356114a9565b825191151582526020820152f35b346102fb5760203660031901126102fb576004356000526005602052602060018060a01b0360406000205416604051908152f35b346102fb5760203660031901126102fb5760043560008181526002602052604090206008810180546001600160a01b031691338390036111615783600052600360205261107660ff604060002054161561146b565b8360005260046020526040600020546202a30081018091116102aa574210611124576110c26110e2936110ac60058401546115e9565b60048401549091906001600160a01b0316611603565b60068101549154600790910154916001600160a01b039182169116611603565b8060005260036020526040600020600160ff1982541617905533907fb0da478e7a30218f2beadf504e14493c318640d667e4e2871e9d201227153ac5600080a3005b60405162461bcd60e51b8152602060048201526015602482015274151bdbc819585c9b1e48199bdc881d1a5b595bdd5d605a1b6044820152606490fd5b60405162461bcd60e51b815260206004820152601660248201527513db9b1e481d185ad95c8818d85b881d1a5b595bdd5d60521b6044820152606490fd5b346102fb5760203660031901126102fb57604060ff6111bf6004356113e2565b835191151582529091166020820152f35b90600182811c92168015611200575b60208310146111ea57565b634e487b7160e01b600052602260045260246000fd5b91607f16916111df565b60e0810190811067ffffffffffffffff821117610c4e57604052565b6060810190811067ffffffffffffffff821117610c4e57604052565b90601f8019910116810190811067ffffffffffffffff821117610c4e57604052565b9060405191826000825492611278846111d0565b80845293600181169081156112e6575060011461129f575b5061129d92500383611242565b565b90506000929192526020600020906000915b8183106112ca57505090602061129d9282010138611290565b60209193508060019154838589010152019101909184926112b1565b90506020925061129d94915060ff191682840152151560051b82010138611290565b9060405161131581611226565b60406002829461132481611264565b845261133260018201611264565b60208501520154910152565b919082519283825260005b84811061136a575050826000602080949584010152601f8019910116010190565b80602080928401015182828601015201611349565b906040806113ab611399855160608652606086019061133e565b6020860151858203602087015261133e565b93015191015290565b9181601f840112156102fb5782359167ffffffffffffffff83116102fb57602083818601950101116102fb57565b806000526004602052604060002054156114625780600052600360205260ff6040600020541661145957600052600460205260406000205461012c81018082116102aa574210611450576202a30081018091116102aa5742101561144857600190600090565b600090600490565b50600090600390565b50600090600290565b50600090600190565b1561147257565b60405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e481cd95d1d1b1959608a1b6044820152606490fd5b806000526004602052604060002054158015611511575b611508576000526004602052604060002054906202a3008201918281116102aa57824210156114fe574290036202a300019182116102aa5760009190565b5060019150600090565b50600090600090565b5080600052600360205260ff604060002054166114c0565b356001600160a01b03811681036102fb5790565b903590605e19813603018212156102fb570190565b903590601e19813603018212156102fb570180359067ffffffffffffffff82116102fb576020019181360383136102fb57565b908060209392818452848401376000828201840152601f01601f1916010190565b156115ad57565b60405162461bcd60e51b8152602060048201526014602482015273125b9d195b9d081b9bdd0818dbdb5b5a5d1d195960621b6044820152606490fd5b6096810290808204609614901517156102aa576064900490565b60405163a9059cbb60e01b60208201526001600160a01b03909216602483015260448083019390935291815261129d9161163e606483611242565b6116ce565b92919267ffffffffffffffff8211610c4e576040519161166d601f8201601f191660200184611242565b8294818452818301116102fb578281602093846000960137010152565b6040516323b872dd60e01b60208201526001600160a01b03928316602482015292909116604483015260648083019390935291815261129d9161163e608483611242565b906000602091828151910182855af115611729576000513d61172057506001600160a01b0381163b155b6116ff5750565b635274afe760e01b60009081526001600160a01b0391909116600452602490fd5b600114156116f8565b6040513d6000823e3d90fd5b60ff811461177f5760ff811690601f821161176e5760408051926117598285611242565b6020808552840191601f190136833783525290565b632cd44ac360e21b60005260046000fd5b5060405160008160005491611793836111d0565b808352926001811690811561181857506001146117ba575b6117b792500382611242565b90565b50600080805290917f290decd9548b62a8d60345a988386fc84ba6bc95484008f6362f93160ef3e5635b8183106117fc5750509060206117b7928201016117ab565b60209193508060019154838588010152019101909183926117e4565b602092506117b794915060ff191682840152151560051b8201016117ab565b60ff811461185b5760ff811690601f821161176e5760408051926117598285611242565b5060405160015481600061186e836111d0565b80835292600181169081156118185750600114611891576117b792500382611242565b506001600090815290917fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b8183106118d55750509060206117b7928201016117ab565b60209193508060019154838588010152019101909183926118bd565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031614806119e4575b1561194c577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a081526119de60c082611242565b51902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611923565b8151919060418303611a3e57611a3792506020820151906060604084015193015160001a90611ad1565b9192909190565b505060009160029190565b9190916004811015611abb5780611a5f57509050565b600060018203611a7a5763f645eedf60e01b60005260046000fd5b5060028103611a98578263fce698f760e01b60005260045260246000fd5b9091600360009214611aa8575050565b6335e2f38360e21b825260045260249150fd5b634e487b7160e01b600052602160045260246000fd5b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611b4e579160209360809260ff60009560405194855216868401526040830152606082015282805260015afa15611729576000516001600160a01b03811615611b425790600090600090565b50600090600190600090565b5050506000916003919056fea2646970667358221220f620445ddc00495eafae500fd583f395a003d5ac422759a822cffb68bdb574e364736f6c634300081a0033", + "nonce": "0x4", + "chainId": "0x14a34" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x5a2317", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x84282298d95a3c7ffca16e764265bda57eb1b20c7de23817da6d30c57aa4a32e", + "transactionIndex": "0x7", + "blockHash": "0x43bab0e99a8ab8493ad4bb8b3feadb25583166f801c46a10c76658bc3994f9e1", + "blockNumber": "0x120525d", + "gasUsed": "0x1862da", + "effectiveGasPrice": "0xd6bd", + "from": "0xdef013e1c10cc2b4baa652f60b7c7c9f833075d0", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": "0x887a72abf9395b0a45dca391901ccd71243cd1b3", + "l1BaseFeeScalar": "0x44d", + "l1BlobBaseFee": "0x1", + "l1BlobBaseFeeScalar": "0xa118b", + "l1Fee": "0x1e5bd4d01a", + "l1GasPrice": "0x5eafbb3e", + "l1GasUsed": "0x12336" + } + ], + "libraries": [], + "pending": [], + "returns": {}, + "timestamp": 1733559212, + "chain": 84532, + "commit": "5c7a5d1" +} \ No newline at end of file diff --git a/packages/foundry/contracts/ZKRailBase.sol b/packages/foundry/contracts/ZKRailBase.sol index dc54e91..7f21bb3 100644 --- a/packages/foundry/contracts/ZKRailBase.sol +++ b/packages/foundry/contracts/ZKRailBase.sol @@ -61,12 +61,14 @@ abstract contract ZKRailBase is IZKRail, EIP712 { function _hashIntentSolution( IntentSolution calldata solution ) internal pure returns (bytes32) { + bytes32 intentHash = _hashIntent(solution.intent); + return keccak256( abi.encode( INTENT_SOLUTION_TYPEHASH, solution.intentId, - _hashIntent(solution.intent), + intentHash, solution.paymentToken, solution.paymentAmount, solution.bondToken, diff --git a/packages/foundry/foundry.toml b/packages/foundry/foundry.toml index bd4de06..8378c2d 100644 --- a/packages/foundry/foundry.toml +++ b/packages/foundry/foundry.toml @@ -1,43 +1,20 @@ [profile.default] -src = 'contracts' -out = 'out' -libs = ['lib'] -fs_permissions = [{ access = "read-write", path = "./"}] +src = "src" +out = "out" +libs = ["lib"] +via_ir = true # Add this +optimizer = true # Make sure optimizer is on +optimizer_runs = 200 -[rpc_endpoints] -default_network = "http://127.0.0.1:8545" -localhost = "http://127.0.0.1:8545" -mainnet = "https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_API_KEY}" -sepolia = "https://eth-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -arbitrum = "https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -arbitrumSepolia = "https://arb-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -optimism = "https://opt-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -optimismSepolia = "https://opt-sepolia.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -polygon = "https://polygon-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -polygonMumbai = "https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}" -polygonZkEvm = "https://zkevm-rpc.com" -polygonZkEvmTestnet = "https://rpc.public.zkevm-test.net" -gnosis = "https://rpc.gnosischain.com" -chiado = "https://rpc.chiadochain.net" -base = "https://mainnet.base.org" -baseSepolia = "https://sepolia.base.org" -scrollSepolia = "https://sepolia-rpc.scroll.io" -scroll = "https://rpc.scroll.io" -pgn = "https://rpc.publicgoods.network" -pgnTestnet = "https://sepolia.publicgoods.network" +[rpc_endpoints] +amoy = "https://80002.rpc.thirdweb.com" +base_sepolia = "https://84532.rpc.thirdweb.com" +bsc_testnet = "https://97.rpc.thirdweb.com" [etherscan] -polygonMumbai = { key = "${ETHERSCAN_API_KEY}" } -sepolia = { key = "${ETHERSCAN_API_KEY}" } - - -[fmt] -multiline_func_header = "params_first" -line_length = 80 -tab_width = 2 -quote_style = "double" -bracket_spacing = true -int_types = "long" +amoy = { key = "${POLYGONSCAN_KEY}" } +base_sepolia = { key = "${BASESCAN_KEY}" } +bsc_testnet = { key = "${BSCSCAN_KEY}" } -# See more config options https://github.com/foundry-rs/foundry/tree/master/config +# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/packages/foundry/script/Deploy.s.sol b/packages/foundry/script/Deploy.s.sol index 8ca40a3..b64aad9 100644 --- a/packages/foundry/script/Deploy.s.sol +++ b/packages/foundry/script/Deploy.s.sol @@ -1,16 +1,31 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; +pragma solidity ^0.8.20; -import "./DeployHelpers.s.sol"; -import { DeployYourContract } from "./DeployYourContract.s.sol"; +import "forge-std/Script.sol"; +import "../contracts/rails/ZKRailUPI.sol"; +import "@openzeppelin/contracts/utils/Create2.sol"; -contract DeployScript is ScaffoldETHDeploy { - function run() external { - DeployYourContract deployYourContract = new DeployYourContract(); - deployYourContract.run(); +contract DeployZKRail is Script { + bytes32 public constant SALT = bytes32(uint256(0x1234)); + // OpenZeppelin's Create2 Deployer address (same on all chains) + address constant CREATE2_DEPLOYER = + 0x4e59b44847b379578588920cA78FbF26c0B4956C; - // deploy more contracts here - // DeployMyContract deployMyContract = new DeployMyContract(); - // deployMyContract.run(); - } + function run() external { + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); + vm.startBroadcast(deployerPrivateKey); + + // Compute the deployment address + bytes memory creationCode = type(ZKRailUPI).creationCode; + address computedAddress = Create2.computeAddress( + SALT, + keccak256(creationCode), + CREATE2_DEPLOYER + ); + console.log("Computed deployment address:", computedAddress); + + address token = Create2.deploy(0, SALT, creationCode); + require(token == computedAddress, "Deployment address mismatch"); + + vm.stopBroadcast(); + } } diff --git a/packages/foundry/script/DeployHelpers.s.sol b/packages/foundry/script/DeployHelpers.s.sol deleted file mode 100644 index d8bacf6..0000000 --- a/packages/foundry/script/DeployHelpers.s.sol +++ /dev/null @@ -1,127 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import { Script, console } from "forge-std/Script.sol"; -import { Vm } from "forge-std/Vm.sol"; - -contract ScaffoldETHDeploy is Script { - error InvalidChain(); - error DeployerHasNoBalance(); - error InvalidPrivateKey(string); - - event AnvilSetBalance(address account, uint256 amount); - event FailedAnvilRequest(); - - struct Deployment { - string name; - address addr; - } - - string root; - string path; - Deployment[] public deployments; - uint256 constant ANVIL_BASE_BALANCE = 10000 ether; - - /// @notice The deployer address for every run - address deployer; - - /// @notice Use this modifier on your run() function on your deploy scripts - modifier ScaffoldEthDeployerRunner() { - deployer = _startBroadcast(); - if (deployer == address(0)) { - revert InvalidPrivateKey("Invalid private key"); - } - _; - _stopBroadcast(); - exportDeployments(); - } - - function _startBroadcast() internal returns (address) { - vm.startBroadcast(); - (, address _deployer,) = vm.readCallers(); - - if (block.chainid == 31337 && _deployer.balance == 0) { - try this.anvil_setBalance(_deployer, ANVIL_BASE_BALANCE) { - emit AnvilSetBalance(_deployer, ANVIL_BASE_BALANCE); - } catch { - emit FailedAnvilRequest(); - } - } - return _deployer; - } - - function _stopBroadcast() internal { - vm.stopBroadcast(); - } - - function exportDeployments() internal { - // fetch already existing contracts - root = vm.projectRoot(); - path = string.concat(root, "/deployments/"); - string memory chainIdStr = vm.toString(block.chainid); - path = string.concat(path, string.concat(chainIdStr, ".json")); - - string memory jsonWrite; - - uint256 len = deployments.length; - - for (uint256 i = 0; i < len; i++) { - vm.serializeString( - jsonWrite, vm.toString(deployments[i].addr), deployments[i].name - ); - } - - string memory chainName; - - try this.getChain() returns (Chain memory chain) { - chainName = chain.name; - } catch { - chainName = findChainName(); - } - jsonWrite = vm.serializeString(jsonWrite, "networkName", chainName); - vm.writeJson(jsonWrite, path); - } - - function getChain() public returns (Chain memory) { - return getChain(block.chainid); - } - - function anvil_setBalance(address addr, uint256 amount) public { - string memory addressString = vm.toString(addr); - string memory amountString = vm.toString(amount); - string memory requestPayload = string.concat( - '{"method":"anvil_setBalance","params":["', - addressString, - '","', - amountString, - '"],"id":1,"jsonrpc":"2.0"}' - ); - - string[] memory inputs = new string[](8); - inputs[0] = "curl"; - inputs[1] = "-X"; - inputs[2] = "POST"; - inputs[3] = "http://localhost:8545"; - inputs[4] = "-H"; - inputs[5] = "Content-Type: application/json"; - inputs[6] = "--data"; - inputs[7] = requestPayload; - - vm.ffi(inputs); - } - - function findChainName() public returns (string memory) { - uint256 thisChainId = block.chainid; - string[2][] memory allRpcUrls = vm.rpcUrls(); - for (uint256 i = 0; i < allRpcUrls.length; i++) { - try vm.createSelectFork(allRpcUrls[i][1]) { - if (block.chainid == thisChainId) { - return allRpcUrls[i][0]; - } - } catch { - continue; - } - } - revert InvalidChain(); - } -} diff --git a/packages/foundry/script/DeployYourContract.s.sol b/packages/foundry/script/DeployYourContract.s.sol deleted file mode 100644 index 547ed87..0000000 --- a/packages/foundry/script/DeployYourContract.s.sol +++ /dev/null @@ -1,17 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import "../contracts/YourContract.sol"; -import "./DeployHelpers.s.sol"; - -contract DeployYourContract is ScaffoldETHDeploy { - // use `deployer` from `ScaffoldETHDeploy` - function run() external ScaffoldEthDeployerRunner { - YourContract yourContract = new YourContract(deployer); - console.logString( - string.concat( - "YourContract deployed at: ", vm.toString(address(yourContract)) - ) - ); - } -} diff --git a/packages/foundry/script/VerifyAll.s.sol b/packages/foundry/script/VerifyAll.s.sol deleted file mode 100644 index 2b307a0..0000000 --- a/packages/foundry/script/VerifyAll.s.sol +++ /dev/null @@ -1,131 +0,0 @@ -//SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import "forge-std/Script.sol"; -import "forge-std/Vm.sol"; -import "solidity-bytes-utils/BytesLib.sol"; - -/** - * @dev Temp Vm implementation - * @notice calls the tryffi function on the Vm contract - * @notice will be deleted once the forge/std is updated - */ -struct FfiResult { - int32 exit_code; - bytes stdout; - bytes stderr; -} - -interface tempVm { - function tryFfi(string[] calldata) external returns (FfiResult memory); -} - -contract VerifyAll is Script { - uint96 currTransactionIdx; - - function run() external { - string memory root = vm.projectRoot(); - string memory path = string.concat( - root, - "/broadcast/Deploy.s.sol/", - vm.toString(block.chainid), - "/run-latest.json" - ); - string memory content = vm.readFile(path); - - while (this.nextTransaction(content)) { - _verifyIfContractDeployment(content); - currTransactionIdx++; - } - } - - function _verifyIfContractDeployment(string memory content) internal { - string memory txType = abi.decode( - vm.parseJson(content, searchStr(currTransactionIdx, "transactionType")), - (string) - ); - if (keccak256(bytes(txType)) == keccak256(bytes("CREATE"))) { - _verifyContract(content); - } - } - - function _verifyContract(string memory content) internal { - string memory contractName = abi.decode( - vm.parseJson(content, searchStr(currTransactionIdx, "contractName")), - (string) - ); - address contractAddr = abi.decode( - vm.parseJson(content, searchStr(currTransactionIdx, "contractAddress")), - (address) - ); - bytes memory deployedBytecode = abi.decode( - vm.parseJson(content, searchStr(currTransactionIdx, "transaction.input")), - (bytes) - ); - bytes memory compiledBytecode = abi.decode( - vm.parseJson(_getCompiledBytecode(contractName), ".bytecode.object"), - (bytes) - ); - bytes memory constructorArgs = BytesLib.slice( - deployedBytecode, - compiledBytecode.length, - deployedBytecode.length - compiledBytecode.length - ); - - string[] memory inputs = new string[](9); - inputs[0] = "forge"; - inputs[1] = "verify-contract"; - inputs[2] = vm.toString(contractAddr); - inputs[3] = contractName; - inputs[4] = "--chain"; - inputs[5] = vm.toString(block.chainid); - inputs[6] = "--constructor-args"; - inputs[7] = vm.toString(constructorArgs); - inputs[8] = "--watch"; - - FfiResult memory f = tempVm(address(vm)).tryFfi(inputs); - - if (f.stderr.length != 0) { - console.logString( - string.concat( - "Submitting verification for contract: ", vm.toString(contractAddr) - ) - ); - console.logString(string(f.stderr)); - } else { - console.logString(string(f.stdout)); - } - return; - } - - function nextTransaction(string memory content) external view returns (bool) { - try this.getTransactionFromRaw(content, currTransactionIdx) { - return true; - } catch { - return false; - } - } - - function _getCompiledBytecode( - string memory contractName - ) internal view returns (string memory compiledBytecode) { - string memory root = vm.projectRoot(); - string memory path = - string.concat(root, "/out/", contractName, ".sol/", contractName, ".json"); - compiledBytecode = vm.readFile(path); - } - - function getTransactionFromRaw( - string memory content, - uint96 idx - ) external pure { - abi.decode(vm.parseJson(content, searchStr(idx, "hash")), (bytes32)); - } - - function searchStr( - uint96 idx, - string memory searchKey - ) internal pure returns (string memory) { - return string.concat(".transactions[", vm.toString(idx), "].", searchKey); - } -}