diff --git a/cairo_zero/tests/src/kakarot/accounts/test_account_contract.py b/cairo_zero/tests/src/kakarot/accounts/test_account_contract.py index ac3e65cf2..3cb7272db 100644 --- a/cairo_zero/tests/src/kakarot/accounts/test_account_contract.py +++ b/cairo_zero/tests/src/kakarot/accounts/test_account_contract.py @@ -14,7 +14,7 @@ get_storage_var_address, ) -from kakarot_scripts.constants import ARACHNID_PROXY_DEPLOYER, ARACHNID_PROXY_SIGNED_TX +from kakarot_scripts.data.pre_eip155_txs import PRE_EIP155_TX from kakarot_scripts.utils.uint256 import int_to_uint256 from tests.utils.constants import CHAIN_ID, TRANSACTIONS from tests.utils.errors import cairo_error @@ -344,9 +344,11 @@ def test_should_raise_with_signature_values_not_in_range( chain_id=CHAIN_ID, ) - @SyscallHandler.patch("Account_evm_address", int(ARACHNID_PROXY_DEPLOYER, 16)) + @SyscallHandler.patch( + "Account_evm_address", int(PRE_EIP155_TX["ArachnidProxy"]["deployer"], 16) + ) def test_should_raise_unauthorized_pre_eip155_tx(self, cairo_run): - rlp_decoded = rlp.decode(ARACHNID_PROXY_SIGNED_TX) + rlp_decoded = rlp.decode(PRE_EIP155_TX["ArachnidProxy"]["signed_tx"]) v, r, s = rlp_decoded[-3:] signature = [ *int_to_uint256(int.from_bytes(r, "big")), @@ -400,7 +402,7 @@ def test_should_raise_invalid_signature_for_invalid_chain_id_when_tx_type0_not_p lambda _, __: [1, 0x68656C6C6F, 1, 1], # hello ) def test_pass_authorized_pre_eip155_transaction(self, cairo_run): - rlp_decoded = rlp.decode(ARACHNID_PROXY_SIGNED_TX) + rlp_decoded = rlp.decode(PRE_EIP155_TX["ArachnidProxy"]["signed_tx"]) v, r, s = rlp_decoded[-3:] signature = [ *int_to_uint256(int.from_bytes(r, "big")), @@ -416,7 +418,8 @@ def test_pass_authorized_pre_eip155_transaction(self, cairo_run): with ( SyscallHandler.patch( - "Account_evm_address", int(ARACHNID_PROXY_DEPLOYER, 16) + "Account_evm_address", + int(PRE_EIP155_TX["ArachnidProxy"]["deployer"], 16), ), SyscallHandler.patch( "Account_authorized_message_hashes", tx_hash_low, tx_hash_high, 0x1 diff --git a/kakarot_scripts/constants.py b/kakarot_scripts/constants.py index ebe2f43d0..0160df0fa 100644 --- a/kakarot_scripts/constants.py +++ b/kakarot_scripts/constants.py @@ -252,9 +252,6 @@ class ChainId(IntEnum): BUILD_DIR.mkdir(exist_ok=True, parents=True) BUILD_DIR_SSJ = BUILD_DIR / "ssj" -DATA_DIR = Path("kakarot_scripts") / "data" - - DEPLOYMENTS_DIR = Path("deployments") / NETWORK["name"] DEPLOYMENTS_DIR.mkdir(exist_ok=True, parents=True) @@ -293,20 +290,6 @@ class ChainId(IntEnum): "UniversalLibraryCaller", ] -# PRE-EIP155 TX -MULTICALL3_DEPLOYER = "0x05f32b3cc3888453ff71b01135b34ff8e41263f2" -MULTICALL3_SIGNED_TX = bytes.fromhex( - json.loads((DATA_DIR / "signed_txs.json").read_text())["multicall3"] -) -ARACHNID_PROXY_DEPLOYER = "0x3fab184622dc19b6109349b94811493bf2a45362" -ARACHNID_PROXY_SIGNED_TX = bytes.fromhex( - json.loads((DATA_DIR / "signed_txs.json").read_text())["arachnid"] -) -CREATEX_DEPLOYER = "0xeD456e05CaAb11d66C4c797dD6c1D6f9A7F352b5" -CREATEX_SIGNED_TX = bytes.fromhex( - json.loads((DATA_DIR / "signed_txs.json").read_text())["createx"] -) - prefix = NETWORK["name"].upper().replace("-", "_") EVM_PRIVATE_KEY = os.getenv(f"{prefix}_EVM_PRIVATE_KEY") if EVM_PRIVATE_KEY is None: diff --git a/kakarot_scripts/data/pre_eip155_txs.py b/kakarot_scripts/data/pre_eip155_txs.py new file mode 100644 index 000000000..cba640e17 --- /dev/null +++ b/kakarot_scripts/data/pre_eip155_txs.py @@ -0,0 +1,26 @@ +PRE_EIP155_TX = { + "Multicall3": { + "deployer": "0x05f32b3cc3888453ff71b01135b34ff8e41263f2", + "signed_tx": bytes.fromhex( + "f90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086" + ), + "address": "0xcA11bde05977b3631167028862bE2a173976CA11", + "required_eth": 0.1, + }, + "ArachnidProxy": { + "deployer": "0x3fab184622dc19b6109349b94811493bf2a45362", + "signed_tx": bytes.fromhex( + "f8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222" + ), + "address": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "required_eth": 0.1, + }, + "CreateX": { + "deployer": "0xeD456e05CaAb11d66C4c797dD6c1D6f9A7F352b5", + "signed_tx": bytes.fromhex( + "f92f698085174876e800832dc6c08080b92f1660a06040523060805234801561001457600080fd5b50608051612e3e6100d860003960008181610603015281816107050152818161082b015281816108d50152818161127f01528181611375015281816113e00152818161141f015281816114a7015281816115b3015281816117d20152818161183d0152818161187c0152818161190401528181611ac501528181611c7801528181611ce301528181611d2201528181611daa01528181611fe901528181612206015281816122f20152818161244d015281816124a601526125820152612e3e6000f3fe60806040526004361061018a5760003560e01c806381503da1116100d6578063d323826a1161007f578063e96deee411610059578063e96deee414610395578063f5745aba146103a8578063f9664498146103bb57600080fd5b8063d323826a1461034f578063ddda0acb1461036f578063e437252a1461038257600080fd5b80639c36a286116100b05780639c36a28614610316578063a7db93f214610329578063c3fe107b1461033c57600080fd5b806381503da1146102d0578063890c283b146102e357806398e810771461030357600080fd5b80632f990e3f116101385780636cec2536116101125780636cec25361461027d57806374637a7a1461029d5780637f565360146102bd57600080fd5b80632f990e3f1461023757806331a7c8c81461024a57806342d654fc1461025d57600080fd5b806327fe18221161016957806327fe1822146101f15780632852527a1461020457806328ddd0461461021757600080fd5b8062d84acb1461018f57806326307668146101cb57806326a32fc7146101de575b600080fd5b6101a261019d366004612915565b6103ce565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6101a26101d9366004612994565b6103e6565b6101a26101ec3660046129db565b610452565b6101a26101ff3660046129db565b6104de565b6101a2610212366004612a39565b610539565b34801561022357600080fd5b506101a2610232366004612a90565b6106fe565b6101a2610245366004612aa9565b61072a565b6101a2610258366004612aa9565b6107bb565b34801561026957600080fd5b506101a2610278366004612b1e565b6107c9565b34801561028957600080fd5b506101a2610298366004612a90565b610823565b3480156102a957600080fd5b506101a26102b8366004612b4a565b61084f565b6101a26102cb3660046129db565b611162565b6101a26102de366004612b74565b6111e8565b3480156102ef57600080fd5b506101a26102fe366004612bac565b611276565b6101a2610311366004612bce565b6112a3565b6101a2610324366004612994565b611505565b6101a2610337366004612c49565b6116f1565b6101a261034a366004612aa9565b611964565b34801561035b57600080fd5b506101a261036a366004612cd9565b6119ed565b6101a261037d366004612c49565b611a17565b6101a2610390366004612bce565b611e0c565b6101a26103a3366004612915565b611e95565b6101a26103b6366004612bce565b611ea4565b6101a26103c9366004612b74565b611f2d565b60006103dd8585858533611a17565b95945050505050565b6000806103f2846120db565b90508083516020850134f59150610408826123d3565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a35092915050565b60006104d86104d260408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b836103e6565b92915050565b600081516020830134f090506104f3816123d3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a2919050565b600080610545856120db565b905060008460601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f593505073ffffffffffffffffffffffffffffffffffffffff8316610635576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201526024015b60405180910390fd5b604051829073ffffffffffffffffffffffffffffffffffffffff8516907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a36000808473ffffffffffffffffffffffffffffffffffffffff1634876040516106a19190612d29565b60006040518083038185875af1925050503d80600081146106de576040519150601f19603f3d011682016040523d82523d6000602084013e6106e3565b606091505b50915091506106f382828961247d565b505050509392505050565b60006104d87f00000000000000000000000000000000000000000000000000000000000000008361084f565b60006107b36107aa60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b85858533611a17565b949350505050565b60006107b3848484336112a3565b60006040518260005260ff600b53836020527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f6040526055600b20601452806040525061d694600052600160345350506017601e20919050565b60006104d8827f00000000000000000000000000000000000000000000000000000000000000006107c9565b600060607f9400000000000000000000000000000000000000000000000000000000000000610887600167ffffffffffffffff612d45565b67ffffffffffffffff16841115610902576040517f3c55ab3b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b836000036109c7576040517fd60000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f800000000000000000000000000000000000000000000000000000000000000060368201526037015b6040516020818303038152906040529150611152565b607f8411610a60576040517fd60000000000000000000000000000000000000000000000000000000000000060208201527fff0000000000000000000000000000000000000000000000000000000000000080831660218301527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b16602283015260f886901b1660368201526037016109b1565b60ff8411610b1f576040517fd70000000000000000000000000000000000000000000000000000000000000060208201527fff0000000000000000000000000000000000000000000000000000000000000080831660218301527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b1660228301527f8100000000000000000000000000000000000000000000000000000000000000603683015260f886901b1660378201526038016109b1565b61ffff8411610bff576040517fd80000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f820000000000000000000000000000000000000000000000000000000000000060368201527fffff00000000000000000000000000000000000000000000000000000000000060f086901b1660378201526039016109b1565b62ffffff8411610ce0576040517fd90000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f830000000000000000000000000000000000000000000000000000000000000060368201527fffffff000000000000000000000000000000000000000000000000000000000060e886901b166037820152603a016109b1565b63ffffffff8411610dc2576040517fda0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f840000000000000000000000000000000000000000000000000000000000000060368201527fffffffff0000000000000000000000000000000000000000000000000000000060e086901b166037820152603b016109b1565b64ffffffffff8411610ea5576040517fdb0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f850000000000000000000000000000000000000000000000000000000000000060368201527fffffffffff00000000000000000000000000000000000000000000000000000060d886901b166037820152603c016109b1565b65ffffffffffff8411610f89576040517fdc0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f860000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffff000000000000000000000000000000000000000000000000000060d086901b166037820152603d016109b1565b66ffffffffffffff841161106e576040517fdd0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f870000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffffff0000000000000000000000000000000000000000000000000060c886901b166037820152603e016109b1565b6040517fde0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f880000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffffffff00000000000000000000000000000000000000000000000060c086901b166037820152603f0160405160208183030381529060405291505b5080516020909101209392505050565b60006104d86111e260408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b83611505565b600061126f61126860408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b8484610539565b9392505050565b600061126f83837f00000000000000000000000000000000000000000000000000000000000000006119ed565b60008451602086018451f090506112b9816123d3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a26000808273ffffffffffffffffffffffffffffffffffffffff168560200151876040516113279190612d29565b60006040518083038185875af1925050503d8060008114611364576040519150601f19603f3d011682016040523d82523d6000602084013e611369565b606091505b5091509150816113c9577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001631156114fb578373ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d8060008114611495576040519150601f19603f3d011682016040523d82523d6000602084013e61149a565b606091505b509092509050816114fb577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b5050949350505050565b600080611511846120db565b905060006040518060400160405280601081526020017f67363d3d37363d34f03d5260086018f30000000000000000000000000000000081525090506000828251602084016000f5905073ffffffffffffffffffffffffffffffffffffffff81166115e0576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b604051839073ffffffffffffffffffffffffffffffffffffffff8316907f2feea65dd4e9f9cbd86b74b7734210c59a1b2981b5b137bd0ee3e208200c906790600090a361162c83610823565b935060008173ffffffffffffffffffffffffffffffffffffffff1634876040516116569190612d29565b60006040518083038185875af1925050503d8060008114611693576040519150601f19603f3d011682016040523d82523d6000602084013e611698565b606091505b505090506116a681866124ff565b60405173ffffffffffffffffffffffffffffffffffffffff8616907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a25050505092915050565b6000806116fd876120db565b9050808651602088018651f59150611714826123d3565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a36000808373ffffffffffffffffffffffffffffffffffffffff168660200151886040516117849190612d29565b60006040518083038185875af1925050503d80600081146117c1576040519150601f19603f3d011682016040523d82523d6000602084013e6117c6565b606091505b509150915081611826577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163115611958578473ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d80600081146118f2576040519150601f19603f3d011682016040523d82523d6000602084013e6118f7565b606091505b50909250905081611958577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b50505095945050505050565b60006107b36119e460408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b858585336116f1565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080611a23876120db565b905060006040518060400160405280601081526020017f67363d3d37363d34f03d5260086018f30000000000000000000000000000000081525090506000828251602084016000f5905073ffffffffffffffffffffffffffffffffffffffff8116611af2576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b604051839073ffffffffffffffffffffffffffffffffffffffff8316907f2feea65dd4e9f9cbd86b74b7734210c59a1b2981b5b137bd0ee3e208200c906790600090a3611b3e83610823565b935060008173ffffffffffffffffffffffffffffffffffffffff1687600001518a604051611b6c9190612d29565b60006040518083038185875af1925050503d8060008114611ba9576040519150601f19603f3d011682016040523d82523d6000602084013e611bae565b606091505b50509050611bbc81866124ff565b60405173ffffffffffffffffffffffffffffffffffffffff8616907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a260608573ffffffffffffffffffffffffffffffffffffffff1688602001518a604051611c299190612d29565b60006040518083038185875af1925050503d8060008114611c66576040519150601f19603f3d011682016040523d82523d6000602084013e611c6b565b606091505b50909250905081611ccc577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163115611dfe578673ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d8060008114611d98576040519150601f19603f3d011682016040523d82523d6000602084013e611d9d565b606091505b50909250905081611dfe577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b505050505095945050505050565b60006103dd611e8c60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b868686866116f1565b60006103dd85858585336116f1565b60006103dd611f2460408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b86868686611a17565b6000808360601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f092505073ffffffffffffffffffffffffffffffffffffffff8216612016576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b60405173ffffffffffffffffffffffffffffffffffffffff8316907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a26000808373ffffffffffffffffffffffffffffffffffffffff1634866040516120809190612d29565b60006040518083038185875af1925050503d80600081146120bd576040519150601f19603f3d011682016040523d82523d6000602084013e6120c2565b606091505b50915091506120d282828861247d565b50505092915050565b60008060006120e9846125b3565b9092509050600082600281111561210257612102612e02565b1480156121205750600081600281111561211e5761211e612e02565b145b1561215e57604080513360208201524691810191909152606081018590526080016040516020818303038152906040528051906020012092506123cc565b600082600281111561217257612172612e02565b1480156121905750600181600281111561218e5761218e612e02565b145b156121b0576121a9338560009182526020526040902090565b92506123cc565b60008260028111156121c4576121c4612e02565b03612233576040517f13b3a2a100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b600182600281111561224757612247612e02565b1480156122655750600081600281111561226357612263612e02565b145b1561227e576121a9468560009182526020526040902090565b600182600281111561229257612292612e02565b1480156122b0575060028160028111156122ae576122ae612e02565b145b1561231f576040517f13b3a2a100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b61239a60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b84036123a657836123c9565b604080516020810186905201604051602081830303815290604052805190602001205b92505b5050919050565b73ffffffffffffffffffffffffffffffffffffffff8116158061240b575073ffffffffffffffffffffffffffffffffffffffff81163b155b1561247a576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b50565b82158061249f575073ffffffffffffffffffffffffffffffffffffffff81163b155b156124fa577f0000000000000000000000000000000000000000000000000000000000000000826040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b505050565b811580612520575073ffffffffffffffffffffffffffffffffffffffff8116155b80612540575073ffffffffffffffffffffffffffffffffffffffff81163b155b156125af576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b5050565b600080606083901c3314801561261057508260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000145b1561262057506000905080915091565b606083901c3314801561265a57507fff00000000000000000000000000000000000000000000000000000000000000601484901a60f81b16155b1561266b5750600090506001915091565b33606084901c036126825750600090506002915091565b606083901c1580156126db57508260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000145b156126ec5750600190506000915091565b606083901c15801561272557507fff00000000000000000000000000000000000000000000000000000000000000601484901a60f81b16155b1561273557506001905080915091565b606083901c61274a5750600190506002915091565b8260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000036127a55750600290506000915091565b8260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166000036127e15750600290506001915091565b506002905080915091565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261282c57600080fd5b813567ffffffffffffffff80821115612847576128476127ec565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561288d5761288d6127ec565b816040528381528660208588010111156128a657600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000604082840312156128d857600080fd5b6040516040810181811067ffffffffffffffff821117156128fb576128fb6127ec565b604052823581526020928301359281019290925250919050565b60008060008060a0858703121561292b57600080fd5b84359350602085013567ffffffffffffffff8082111561294a57600080fd5b6129568883890161281b565b9450604087013591508082111561296c57600080fd5b506129798782880161281b565b92505061298986606087016128c6565b905092959194509250565b600080604083850312156129a757600080fd5b82359150602083013567ffffffffffffffff8111156129c557600080fd5b6129d18582860161281b565b9150509250929050565b6000602082840312156129ed57600080fd5b813567ffffffffffffffff811115612a0457600080fd5b6107b38482850161281b565b803573ffffffffffffffffffffffffffffffffffffffff81168114612a3457600080fd5b919050565b600080600060608486031215612a4e57600080fd5b83359250612a5e60208501612a10565b9150604084013567ffffffffffffffff811115612a7a57600080fd5b612a868682870161281b565b9150509250925092565b600060208284031215612aa257600080fd5b5035919050565b600080600060808486031215612abe57600080fd5b833567ffffffffffffffff80821115612ad657600080fd5b612ae28783880161281b565b94506020860135915080821115612af857600080fd5b50612b058682870161281b565b925050612b1585604086016128c6565b90509250925092565b60008060408385031215612b3157600080fd5b82359150612b4160208401612a10565b90509250929050565b60008060408385031215612b5d57600080fd5b612b6683612a10565b946020939093013593505050565b60008060408385031215612b8757600080fd5b612b9083612a10565b9150602083013567ffffffffffffffff8111156129c557600080fd5b60008060408385031215612bbf57600080fd5b50508035926020909101359150565b60008060008060a08587031215612be457600080fd5b843567ffffffffffffffff80821115612bfc57600080fd5b612c088883890161281b565b95506020870135915080821115612c1e57600080fd5b50612c2b8782880161281b565b935050612c3b86604087016128c6565b915061298960808601612a10565b600080600080600060c08688031215612c6157600080fd5b85359450602086013567ffffffffffffffff80821115612c8057600080fd5b612c8c89838a0161281b565b95506040880135915080821115612ca257600080fd5b50612caf8882890161281b565b935050612cbf87606088016128c6565b9150612ccd60a08701612a10565b90509295509295909350565b600080600060608486031215612cee57600080fd5b8335925060208401359150612b1560408501612a10565b60005b83811015612d20578181015183820152602001612d08565b50506000910152565b60008251612d3b818460208701612d05565b9190910192915050565b67ffffffffffffffff828116828216039080821115612d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b73ffffffffffffffffffffffffffffffffffffffff831681526040602082015260008251806040840152612dcf816060850160208701612d05565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c6343000817000a1ca005f70bf8a1493291468f36ef23b05eb3a4f1807f6b4022942a4104b7537bfc36a029528c0c29546c81e7d78b0277ef87031541bdc96427b246ecedb6d74cd3ed62" + ), + "address": "0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed", + "required_eth": 0.3, + }, +} diff --git a/kakarot_scripts/data/signed_txs.json b/kakarot_scripts/data/signed_txs.json deleted file mode 100644 index 69ca746c1..000000000 --- a/kakarot_scripts/data/signed_txs.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "arachnid": "f8a58085174876e800830186a08080b853604580600e600039806000f350fe7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe03601600081602082378035828234f58015156039578182fd5b8082525050506014600cf31ba02222222222222222222222222222222222222222222222222222222222222222a02222222222222222222222222222222222222222222222222222222222222222", - "multicall3": "f90f538085174876e800830f42408080b90f00608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea2646970667358221220bb2b5c71a328032f97c676ae39a1ec2148d3e5d6f73d95e9b17910152d61f16264736f6c634300080c00331ca0edce47092c0f398cebf3ffc267f05c8e7076e3b89445e0fe50f6332273d4569ba01b0b9d000e19b24c5869b0fc3b22b0d6fa47cd63316875cbbd577d76e6fde086", - "createx": "f92f698085174876e800832dc6c08080b92f1660a06040523060805234801561001457600080fd5b50608051612e3e6100d860003960008181610603015281816107050152818161082b015281816108d50152818161127f01528181611375015281816113e00152818161141f015281816114a7015281816115b3015281816117d20152818161183d0152818161187c0152818161190401528181611ac501528181611c7801528181611ce301528181611d2201528181611daa01528181611fe901528181612206015281816122f20152818161244d015281816124a601526125820152612e3e6000f3fe60806040526004361061018a5760003560e01c806381503da1116100d6578063d323826a1161007f578063e96deee411610059578063e96deee414610395578063f5745aba146103a8578063f9664498146103bb57600080fd5b8063d323826a1461034f578063ddda0acb1461036f578063e437252a1461038257600080fd5b80639c36a286116100b05780639c36a28614610316578063a7db93f214610329578063c3fe107b1461033c57600080fd5b806381503da1146102d0578063890c283b146102e357806398e810771461030357600080fd5b80632f990e3f116101385780636cec2536116101125780636cec25361461027d57806374637a7a1461029d5780637f565360146102bd57600080fd5b80632f990e3f1461023757806331a7c8c81461024a57806342d654fc1461025d57600080fd5b806327fe18221161016957806327fe1822146101f15780632852527a1461020457806328ddd0461461021757600080fd5b8062d84acb1461018f57806326307668146101cb57806326a32fc7146101de575b600080fd5b6101a261019d366004612915565b6103ce565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6101a26101d9366004612994565b6103e6565b6101a26101ec3660046129db565b610452565b6101a26101ff3660046129db565b6104de565b6101a2610212366004612a39565b610539565b34801561022357600080fd5b506101a2610232366004612a90565b6106fe565b6101a2610245366004612aa9565b61072a565b6101a2610258366004612aa9565b6107bb565b34801561026957600080fd5b506101a2610278366004612b1e565b6107c9565b34801561028957600080fd5b506101a2610298366004612a90565b610823565b3480156102a957600080fd5b506101a26102b8366004612b4a565b61084f565b6101a26102cb3660046129db565b611162565b6101a26102de366004612b74565b6111e8565b3480156102ef57600080fd5b506101a26102fe366004612bac565b611276565b6101a2610311366004612bce565b6112a3565b6101a2610324366004612994565b611505565b6101a2610337366004612c49565b6116f1565b6101a261034a366004612aa9565b611964565b34801561035b57600080fd5b506101a261036a366004612cd9565b6119ed565b6101a261037d366004612c49565b611a17565b6101a2610390366004612bce565b611e0c565b6101a26103a3366004612915565b611e95565b6101a26103b6366004612bce565b611ea4565b6101a26103c9366004612b74565b611f2d565b60006103dd8585858533611a17565b95945050505050565b6000806103f2846120db565b90508083516020850134f59150610408826123d3565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a35092915050565b60006104d86104d260408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b836103e6565b92915050565b600081516020830134f090506104f3816123d3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a2919050565b600080610545856120db565b905060008460601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f593505073ffffffffffffffffffffffffffffffffffffffff8316610635576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001660048201526024015b60405180910390fd5b604051829073ffffffffffffffffffffffffffffffffffffffff8516907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a36000808473ffffffffffffffffffffffffffffffffffffffff1634876040516106a19190612d29565b60006040518083038185875af1925050503d80600081146106de576040519150601f19603f3d011682016040523d82523d6000602084013e6106e3565b606091505b50915091506106f382828961247d565b505050509392505050565b60006104d87f00000000000000000000000000000000000000000000000000000000000000008361084f565b60006107b36107aa60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b85858533611a17565b949350505050565b60006107b3848484336112a3565b60006040518260005260ff600b53836020527f21c35dbe1b344a2488cf3321d6ce542f8e9f305544ff09e4993a62319a497c1f6040526055600b20601452806040525061d694600052600160345350506017601e20919050565b60006104d8827f00000000000000000000000000000000000000000000000000000000000000006107c9565b600060607f9400000000000000000000000000000000000000000000000000000000000000610887600167ffffffffffffffff612d45565b67ffffffffffffffff16841115610902576040517f3c55ab3b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b836000036109c7576040517fd60000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f800000000000000000000000000000000000000000000000000000000000000060368201526037015b6040516020818303038152906040529150611152565b607f8411610a60576040517fd60000000000000000000000000000000000000000000000000000000000000060208201527fff0000000000000000000000000000000000000000000000000000000000000080831660218301527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b16602283015260f886901b1660368201526037016109b1565b60ff8411610b1f576040517fd70000000000000000000000000000000000000000000000000000000000000060208201527fff0000000000000000000000000000000000000000000000000000000000000080831660218301527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606088901b1660228301527f8100000000000000000000000000000000000000000000000000000000000000603683015260f886901b1660378201526038016109b1565b61ffff8411610bff576040517fd80000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f820000000000000000000000000000000000000000000000000000000000000060368201527fffff00000000000000000000000000000000000000000000000000000000000060f086901b1660378201526039016109b1565b62ffffff8411610ce0576040517fd90000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f830000000000000000000000000000000000000000000000000000000000000060368201527fffffff000000000000000000000000000000000000000000000000000000000060e886901b166037820152603a016109b1565b63ffffffff8411610dc2576040517fda0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f840000000000000000000000000000000000000000000000000000000000000060368201527fffffffff0000000000000000000000000000000000000000000000000000000060e086901b166037820152603b016109b1565b64ffffffffff8411610ea5576040517fdb0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f850000000000000000000000000000000000000000000000000000000000000060368201527fffffffffff00000000000000000000000000000000000000000000000000000060d886901b166037820152603c016109b1565b65ffffffffffff8411610f89576040517fdc0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f860000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffff000000000000000000000000000000000000000000000000000060d086901b166037820152603d016109b1565b66ffffffffffffff841161106e576040517fdd0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f870000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffffff0000000000000000000000000000000000000000000000000060c886901b166037820152603e016109b1565b6040517fde0000000000000000000000000000000000000000000000000000000000000060208201527fff00000000000000000000000000000000000000000000000000000000000000821660218201527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1660228201527f880000000000000000000000000000000000000000000000000000000000000060368201527fffffffffffffffff00000000000000000000000000000000000000000000000060c086901b166037820152603f0160405160208183030381529060405291505b5080516020909101209392505050565b60006104d86111e260408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b83611505565b600061126f61126860408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b8484610539565b9392505050565b600061126f83837f00000000000000000000000000000000000000000000000000000000000000006119ed565b60008451602086018451f090506112b9816123d3565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a26000808273ffffffffffffffffffffffffffffffffffffffff168560200151876040516113279190612d29565b60006040518083038185875af1925050503d8060008114611364576040519150601f19603f3d011682016040523d82523d6000602084013e611369565b606091505b5091509150816113c9577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001631156114fb578373ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d8060008114611495576040519150601f19603f3d011682016040523d82523d6000602084013e61149a565b606091505b509092509050816114fb577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b5050949350505050565b600080611511846120db565b905060006040518060400160405280601081526020017f67363d3d37363d34f03d5260086018f30000000000000000000000000000000081525090506000828251602084016000f5905073ffffffffffffffffffffffffffffffffffffffff81166115e0576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b604051839073ffffffffffffffffffffffffffffffffffffffff8316907f2feea65dd4e9f9cbd86b74b7734210c59a1b2981b5b137bd0ee3e208200c906790600090a361162c83610823565b935060008173ffffffffffffffffffffffffffffffffffffffff1634876040516116569190612d29565b60006040518083038185875af1925050503d8060008114611693576040519150601f19603f3d011682016040523d82523d6000602084013e611698565b606091505b505090506116a681866124ff565b60405173ffffffffffffffffffffffffffffffffffffffff8616907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a25050505092915050565b6000806116fd876120db565b9050808651602088018651f59150611714826123d3565b604051819073ffffffffffffffffffffffffffffffffffffffff8416907fb8fda7e00c6b06a2b54e58521bc5894fee35f1090e5a3bb6390bfe2b98b497f790600090a36000808373ffffffffffffffffffffffffffffffffffffffff168660200151886040516117849190612d29565b60006040518083038185875af1925050503d80600081146117c1576040519150601f19603f3d011682016040523d82523d6000602084013e6117c6565b606091505b509150915081611826577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163115611958578473ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d80600081146118f2576040519150601f19603f3d011682016040523d82523d6000602084013e6118f7565b606091505b50909250905081611958577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b50505095945050505050565b60006107b36119e460408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b858585336116f1565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b600080611a23876120db565b905060006040518060400160405280601081526020017f67363d3d37363d34f03d5260086018f30000000000000000000000000000000081525090506000828251602084016000f5905073ffffffffffffffffffffffffffffffffffffffff8116611af2576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b604051839073ffffffffffffffffffffffffffffffffffffffff8316907f2feea65dd4e9f9cbd86b74b7734210c59a1b2981b5b137bd0ee3e208200c906790600090a3611b3e83610823565b935060008173ffffffffffffffffffffffffffffffffffffffff1687600001518a604051611b6c9190612d29565b60006040518083038185875af1925050503d8060008114611ba9576040519150601f19603f3d011682016040523d82523d6000602084013e611bae565b606091505b50509050611bbc81866124ff565b60405173ffffffffffffffffffffffffffffffffffffffff8616907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a260608573ffffffffffffffffffffffffffffffffffffffff1688602001518a604051611c299190612d29565b60006040518083038185875af1925050503d8060008114611c66576040519150601f19603f3d011682016040523d82523d6000602084013e611c6b565b606091505b50909250905081611ccc577f0000000000000000000000000000000000000000000000000000000000000000816040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163115611dfe578673ffffffffffffffffffffffffffffffffffffffff167f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163160405160006040518083038185875af1925050503d8060008114611d98576040519150601f19603f3d011682016040523d82523d6000602084013e611d9d565b606091505b50909250905081611dfe577f0000000000000000000000000000000000000000000000000000000000000000816040517fc2b3f44500000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b505050505095945050505050565b60006103dd611e8c60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b868686866116f1565b60006103dd85858585336116f1565b60006103dd611f2460408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b86868686611a17565b6000808360601b90506040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f092505073ffffffffffffffffffffffffffffffffffffffff8216612016576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b60405173ffffffffffffffffffffffffffffffffffffffff8316907f4db17dd5e4732fb6da34a148104a592783ca119a1e7bb8829eba6cbadef0b51190600090a26000808373ffffffffffffffffffffffffffffffffffffffff1634866040516120809190612d29565b60006040518083038185875af1925050503d80600081146120bd576040519150601f19603f3d011682016040523d82523d6000602084013e6120c2565b606091505b50915091506120d282828861247d565b50505092915050565b60008060006120e9846125b3565b9092509050600082600281111561210257612102612e02565b1480156121205750600081600281111561211e5761211e612e02565b145b1561215e57604080513360208201524691810191909152606081018590526080016040516020818303038152906040528051906020012092506123cc565b600082600281111561217257612172612e02565b1480156121905750600181600281111561218e5761218e612e02565b145b156121b0576121a9338560009182526020526040902090565b92506123cc565b60008260028111156121c4576121c4612e02565b03612233576040517f13b3a2a100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b600182600281111561224757612247612e02565b1480156122655750600081600281111561226357612263612e02565b145b1561227e576121a9468560009182526020526040902090565b600182600281111561229257612292612e02565b1480156122b0575060028160028111156122ae576122ae612e02565b145b1561231f576040517f13b3a2a100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b61239a60408051437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101406020830152419282019290925260608101919091524260808201524460a08201524660c08201523360e08201526000906101000160405160208183030381529060405280519060200120905090565b84036123a657836123c9565b604080516020810186905201604051602081830303815290604052805190602001205b92505b5050919050565b73ffffffffffffffffffffffffffffffffffffffff8116158061240b575073ffffffffffffffffffffffffffffffffffffffff81163b155b1561247a576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b50565b82158061249f575073ffffffffffffffffffffffffffffffffffffffff81163b155b156124fa577f0000000000000000000000000000000000000000000000000000000000000000826040517fa57ca23900000000000000000000000000000000000000000000000000000000815260040161062c929190612d94565b505050565b811580612520575073ffffffffffffffffffffffffffffffffffffffff8116155b80612540575073ffffffffffffffffffffffffffffffffffffffff81163b155b156125af576040517fc05cee7a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016600482015260240161062c565b5050565b600080606083901c3314801561261057508260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000145b1561262057506000905080915091565b606083901c3314801561265a57507fff00000000000000000000000000000000000000000000000000000000000000601484901a60f81b16155b1561266b5750600090506001915091565b33606084901c036126825750600090506002915091565b606083901c1580156126db57508260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000145b156126ec5750600190506000915091565b606083901c15801561272557507fff00000000000000000000000000000000000000000000000000000000000000601484901a60f81b16155b1561273557506001905080915091565b606083901c61274a5750600190506002915091565b8260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f0100000000000000000000000000000000000000000000000000000000000000036127a55750600290506000915091565b8260141a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166000036127e15750600290506001915091565b506002905080915091565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f83011261282c57600080fd5b813567ffffffffffffffff80821115612847576128476127ec565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561288d5761288d6127ec565b816040528381528660208588010111156128a657600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000604082840312156128d857600080fd5b6040516040810181811067ffffffffffffffff821117156128fb576128fb6127ec565b604052823581526020928301359281019290925250919050565b60008060008060a0858703121561292b57600080fd5b84359350602085013567ffffffffffffffff8082111561294a57600080fd5b6129568883890161281b565b9450604087013591508082111561296c57600080fd5b506129798782880161281b565b92505061298986606087016128c6565b905092959194509250565b600080604083850312156129a757600080fd5b82359150602083013567ffffffffffffffff8111156129c557600080fd5b6129d18582860161281b565b9150509250929050565b6000602082840312156129ed57600080fd5b813567ffffffffffffffff811115612a0457600080fd5b6107b38482850161281b565b803573ffffffffffffffffffffffffffffffffffffffff81168114612a3457600080fd5b919050565b600080600060608486031215612a4e57600080fd5b83359250612a5e60208501612a10565b9150604084013567ffffffffffffffff811115612a7a57600080fd5b612a868682870161281b565b9150509250925092565b600060208284031215612aa257600080fd5b5035919050565b600080600060808486031215612abe57600080fd5b833567ffffffffffffffff80821115612ad657600080fd5b612ae28783880161281b565b94506020860135915080821115612af857600080fd5b50612b058682870161281b565b925050612b1585604086016128c6565b90509250925092565b60008060408385031215612b3157600080fd5b82359150612b4160208401612a10565b90509250929050565b60008060408385031215612b5d57600080fd5b612b6683612a10565b946020939093013593505050565b60008060408385031215612b8757600080fd5b612b9083612a10565b9150602083013567ffffffffffffffff8111156129c557600080fd5b60008060408385031215612bbf57600080fd5b50508035926020909101359150565b60008060008060a08587031215612be457600080fd5b843567ffffffffffffffff80821115612bfc57600080fd5b612c088883890161281b565b95506020870135915080821115612c1e57600080fd5b50612c2b8782880161281b565b935050612c3b86604087016128c6565b915061298960808601612a10565b600080600080600060c08688031215612c6157600080fd5b85359450602086013567ffffffffffffffff80821115612c8057600080fd5b612c8c89838a0161281b565b95506040880135915080821115612ca257600080fd5b50612caf8882890161281b565b935050612cbf87606088016128c6565b9150612ccd60a08701612a10565b90509295509295909350565b600080600060608486031215612cee57600080fd5b8335925060208401359150612b1560408501612a10565b60005b83811015612d20578181015183820152602001612d08565b50506000910152565b60008251612d3b818460208701612d05565b9190910192915050565b67ffffffffffffffff828116828216039080821115612d8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5092915050565b73ffffffffffffffffffffffffffffffffffffffff831681526040602082015260008251806040840152612dcf816060850160208701612d05565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea164736f6c6343000817000a1ca005f70bf8a1493291468f36ef23b05eb3a4f1807f6b4022942a4104b7537bfc36a029528c0c29546c81e7d78b0277ef87031541bdc96427b246ecedb6d74cd3ed62" -} diff --git a/kakarot_scripts/deploy_kakarot.py b/kakarot_scripts/deploy_kakarot.py deleted file mode 100644 index d87e85abf..000000000 --- a/kakarot_scripts/deploy_kakarot.py +++ /dev/null @@ -1,329 +0,0 @@ -# %% Imports -import logging - -from eth_abi.exceptions import InsufficientDataBytes -from eth_utils.address import to_checksum_address -from uvloop import run -from web3.exceptions import ContractLogicError - -from kakarot_scripts.constants import ( - ARACHNID_PROXY_DEPLOYER, - ARACHNID_PROXY_SIGNED_TX, - BLOCK_GAS_LIMIT, - COINBASE, - CREATEX_DEPLOYER, - CREATEX_SIGNED_TX, - DECLARED_CONTRACTS, - DEFAULT_GAS_PRICE, - ETH_TOKEN_ADDRESS, - EVM_ADDRESS, - MULTICALL3_DEPLOYER, - MULTICALL3_SIGNED_TX, - NETWORK, - RPC_CLIENT, - STRK_TOKEN_ADDRESS, - NetworkType, -) -from kakarot_scripts.utils.kakarot import deploy as deploy_evm -from kakarot_scripts.utils.kakarot import ( - deploy_and_fund_evm_address, - deploy_with_presigned_tx, -) -from kakarot_scripts.utils.kakarot import dump_deployments as dump_evm_deployments -from kakarot_scripts.utils.kakarot import get_deployments as get_evm_deployments -from kakarot_scripts.utils.l1 import ( - deploy_on_l1, - dump_l1_addresses, - get_l1_addresses, - get_l1_contract, -) -from kakarot_scripts.utils.starknet import call, declare -from kakarot_scripts.utils.starknet import deploy as deploy_starknet -from kakarot_scripts.utils.starknet import ( - dump_declarations, - dump_deployments, - execute_calls, - get_balance, - get_declarations, -) -from kakarot_scripts.utils.starknet import get_deployments as get_starknet_deployments -from kakarot_scripts.utils.starknet import ( - get_starknet_account, - invoke, - register_lazy_account, - remove_lazy_account, -) - -logging.basicConfig() -logger = logging.getLogger(__name__) -logger.setLevel(logging.INFO) - - -# %% Main -async def main(): - # %% Declarations - account = await get_starknet_account() - register_lazy_account(account.address) - logger.info(f"ℹ️ Using account 0x{account.address:064x} as deployer") - balance_pref = await get_balance(account.address) - - class_hash = {contract: await declare(contract) for contract in DECLARED_CONTRACTS} - dump_declarations(class_hash) - - # %% Starknet Deployments - class_hash = get_declarations() - starknet_deployments = get_starknet_deployments() - - if NETWORK["type"] is not NetworkType.PROD: - starknet_deployments["EVM"] = await deploy_starknet( - "EVM", - account.address, # owner - ETH_TOKEN_ADDRESS, # native_token_address_ - class_hash["account_contract"], # account_contract_class_hash_ - class_hash["uninitialized_account"], # uninitialized_account_class_hash_ - class_hash["Cairo1Helpers"], - BLOCK_GAS_LIMIT, - ) - await invoke( - "EVM", - "set_coinbase", - COINBASE, - address=starknet_deployments["EVM"], - ) - starknet_deployments["Counter"] = await deploy_starknet("Counter") - starknet_deployments["MockPragmaOracle"] = await deploy_starknet( - "MockPragmaOracle" - ) - starknet_deployments["UniversalLibraryCaller"] = await deploy_starknet( - "UniversalLibraryCaller" - ) - starknet_deployments["BenchmarkCairoCalls"] = await deploy_starknet( - "BenchmarkCairoCalls" - ) - - # Deploy or upgrade Kakarot - if starknet_deployments.get("kakarot") and NETWORK["type"] is not NetworkType.DEV: - logger.info("ℹ️ Kakarot already deployed, checking version.") - deployed_class_hash = await RPC_CLIENT.get_class_hash_at( - starknet_deployments["kakarot"] - ) - if deployed_class_hash != class_hash["kakarot"]: - await invoke("kakarot", "upgrade", class_hash["kakarot"]) - await invoke( - "kakarot", - "set_account_contract_class_hash", - class_hash["account_contract"], - ) - await invoke( - "kakarot", - "set_cairo1_helpers_class_hash", - class_hash["Cairo1Helpers"], - ) - else: - logger.info("✅ Kakarot already up to date.") - else: - starknet_deployments["kakarot"] = await deploy_starknet( - "kakarot", - account.address, # owner - ETH_TOKEN_ADDRESS, # native_token_address_ - class_hash["account_contract"], # account_contract_class_hash_ - class_hash["uninitialized_account"], # uninitialized_account_class_hash_ - class_hash["Cairo1Helpers"], - BLOCK_GAS_LIMIT, - ) - await invoke( - "kakarot", - "set_base_fee", - DEFAULT_GAS_PRICE, - address=starknet_deployments["kakarot"], - ) - - dump_deployments(starknet_deployments) - - # %% L1 - starknet_deployments = get_starknet_deployments() - l1_addresses = get_l1_addresses() - - l1_kakarot_messaging = get_l1_contract( - "L1L2Messaging", - "L1KakarotMessaging", - address=l1_addresses.get("L1KakarotMessaging"), - ) - l1_kakarot_messaging_registered_address = None - try: - l1_kakarot_messaging_registered_address = l1_kakarot_messaging.kakarotAddress() - except (ContractLogicError, InsufficientDataBytes): - pass - - if l1_kakarot_messaging_registered_address != starknet_deployments["kakarot"]: - if NETWORK["type"] == NetworkType.DEV: - starknet_core = deploy_on_l1("Starknet", "StarknetMessagingLocal") - l1_addresses.update({"StarknetCore": starknet_core.address}) - else: - if "StarknetCore" not in l1_addresses: - raise ValueError("StarknetCore missing in L1 addresses") - - l1_kakarot_messaging = deploy_on_l1( - "L1L2Messaging", - "L1KakarotMessaging", - l1_addresses["StarknetCore"], - starknet_deployments["kakarot"], - ) - l1_addresses.update({"L1KakarotMessaging": l1_kakarot_messaging.address}) - - dump_l1_addresses(l1_addresses) - - # %% Pre-EIP155 deployments, done only once and don't need an account - # Kakarot needs to be deployed for the remaining calls to be executed - await execute_calls() - remove_lazy_account(account.address) - await deploy_with_presigned_tx( - MULTICALL3_DEPLOYER, - MULTICALL3_SIGNED_TX, - name="Multicall3", - max_fee=int(0.1e18), - ) - await deploy_with_presigned_tx( - ARACHNID_PROXY_DEPLOYER, - ARACHNID_PROXY_SIGNED_TX, - name="Arachnid Proxy", - max_fee=int(0.1e18), - ) - await deploy_with_presigned_tx( - CREATEX_DEPLOYER, - CREATEX_SIGNED_TX, - amount=0.3, - name="CreateX", - max_fee=int(0.2e18), - ) - register_lazy_account(account.address) - - # %% EVM Deployments - if not EVM_ADDRESS: - logger.info("ℹ️ No EVM address provided, skipping EVM deployments") - return - - logger.info(f"ℹ️ Using account {EVM_ADDRESS} as deployer") - - await deploy_and_fund_evm_address( - EVM_ADDRESS, amount=100 if NETWORK["type"] is NetworkType.DEV else 0.01 - ) - - starknet_deployments = get_starknet_deployments() - evm_deployments = get_evm_deployments() - - # %% Tokens deployments - for ( - contract_app, - contract_name, - deployed_name, - cairo_precompile, - *deployment_args, - ) in [ - ("WETH", "WETH9", "WETH9", False), - ( - "CairoPrecompiles", - "DualVmToken", - "KakarotETH", - True, - starknet_deployments["kakarot"], - ETH_TOKEN_ADDRESS, - ), - ( - "CairoPrecompiles", - "DualVmToken", - "KakarotSTRK", - True, - starknet_deployments["kakarot"], - STRK_TOKEN_ADDRESS, - ), - ]: - deployment = evm_deployments.get(deployed_name) - if deployment is not None: - token_starknet_address = ( - await call("kakarot", "get_starknet_address", deployment["address"]) - ).starknet_address - if deployment["starknet_address"] == token_starknet_address: - logger.info(f"✅ {deployed_name} already deployed, skipping") - continue - - token = await deploy_evm(contract_app, contract_name, *deployment_args) - evm_deployments[deployed_name] = { - "address": int(token.address, 16), - "starknet_address": token.starknet_address, - } - if cairo_precompile: - await invoke( - "kakarot", - "set_authorized_cairo_precompile_caller", - int(token.address, 16), - 1, - ) - - # %% Messaging - deployment = evm_deployments.get("L2KakarotMessaging") - starknet_address = None - if deployment is not None: - starknet_address = ( - await call("kakarot", "get_starknet_address", deployment["address"]) - ).starknet_address - - if deployment is None or deployment["starknet_address"] != starknet_address: - l2_kakarot_messaging = await deploy_evm("L1L2Messaging", "L2KakarotMessaging") - await invoke( - "kakarot", - "set_authorized_cairo_precompile_caller", - int(l2_kakarot_messaging.address, 16), - 1, - ) - evm_deployments["L2KakarotMessaging"] = { - "address": int(l2_kakarot_messaging.address, 16), - "starknet_address": l2_kakarot_messaging.starknet_address, - } - - l1_messaging_contract_address = ( - await call("kakarot", "get_l1_messaging_contract_address") - ).l1_messaging_contract_address - if l1_messaging_contract_address != int(l1_kakarot_messaging.address, 16): - await invoke( - "kakarot", - "set_l1_messaging_contract_address", - int(l1_kakarot_messaging.address, 16), - ) - - # %% Coinbase - coinbase = (await call("kakarot", "get_coinbase")).coinbase - if evm_deployments.get("Coinbase", {}).get("address") != coinbase: - contract = await deploy_evm( - "Kakarot", - "Coinbase", - to_checksum_address(f'{evm_deployments["KakarotETH"]["address"]:040x}'), - ) - evm_deployments["Coinbase"] = { - "address": int(contract.address, 16), - "starknet_address": contract.starknet_address, - } - await invoke("kakarot", "set_coinbase", int(contract.address, 16)) - - # %% Tear down - await execute_calls() - dump_evm_deployments(evm_deployments) - balance_after = await get_balance(account.address) - logger.info( - f"ℹ💰 Deployer balance changed from {balance_pref / 1e18} to {balance_after / 1e18} ETH" - ) - - coinbase = (await call("kakarot", "get_coinbase")).coinbase - if coinbase == 0: - logger.error("❌ Coinbase is set to 0, all transaction fees will be lost") - else: - logger.info(f"✅ Coinbase set to: 0x{coinbase:040x}") - - -# %% Run -def main_sync(): - run(main()) - - -if __name__ == "__main__": - main_sync() diff --git a/kakarot_scripts/deployment/declarations.py b/kakarot_scripts/deployment/declarations.py new file mode 100644 index 000000000..2f9bb5bdb --- /dev/null +++ b/kakarot_scripts/deployment/declarations.py @@ -0,0 +1,22 @@ +# %% Imports +from uvloop import run + +from kakarot_scripts.constants import DECLARED_CONTRACTS +from kakarot_scripts.utils.starknet import declare, dump_declarations + + +# %% +async def declare_contracts(): + # %% Declare + class_hash = {contract: await declare(contract) for contract in DECLARED_CONTRACTS} + dump_declarations(class_hash) + + +# %% Run +def main_sync(): + run(declare_contracts()) + + +# %% +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/deployment/evm_deployments.py b/kakarot_scripts/deployment/evm_deployments.py new file mode 100644 index 000000000..669190bec --- /dev/null +++ b/kakarot_scripts/deployment/evm_deployments.py @@ -0,0 +1,125 @@ +# %% Imports +import logging + +from eth_utils.address import to_checksum_address +from uvloop import run + +from kakarot_scripts.constants import ( + ETH_TOKEN_ADDRESS, + EVM_ADDRESS, + NETWORK, + RPC_CLIENT, + STRK_TOKEN_ADDRESS, + NetworkType, +) +from kakarot_scripts.utils.kakarot import deploy as deploy_evm +from kakarot_scripts.utils.kakarot import deploy_and_fund_evm_address +from kakarot_scripts.utils.kakarot import dump_deployments as dump_evm_deployments +from kakarot_scripts.utils.kakarot import get_deployments as get_evm_deployments +from kakarot_scripts.utils.starknet import call, execute_calls +from kakarot_scripts.utils.starknet import get_deployments as get_starknet_deployments +from kakarot_scripts.utils.starknet import invoke + +logger = logging.getLogger(__name__) + + +# %% +async def deploy_evm_contracts(): + # %% Deployments + logger.info(f"ℹ️ Using account {EVM_ADDRESS} as deployer") + + await deploy_and_fund_evm_address( + EVM_ADDRESS, amount=100 if NETWORK["type"] is NetworkType.DEV else 0.01 + ) + + starknet_deployments = get_starknet_deployments() + evm_deployments = get_evm_deployments() + + # %% Tokens + for ( + contract_app, + contract_name, + deployed_name, + cairo_precompile, + *deployment_args, + ) in [ + ("WETH", "WETH9", "WETH9", False), + ( + "CairoPrecompiles", + "DualVmToken", + "KakarotETH", + True, + starknet_deployments["kakarot"], + ETH_TOKEN_ADDRESS, + ), + ( + "CairoPrecompiles", + "DualVmToken", + "KakarotSTRK", + True, + starknet_deployments["kakarot"], + STRK_TOKEN_ADDRESS, + ), + ]: + deployment = evm_deployments.get(deployed_name) + if deployment is not None: + token_starknet_address = ( + await call("kakarot", "get_starknet_address", deployment["address"]) + ).starknet_address + if deployment["starknet_address"] == token_starknet_address: + logger.info(f"✅ {deployed_name} already deployed, skipping") + continue + + token = await deploy_evm(contract_app, contract_name, *deployment_args) + evm_deployments[deployed_name] = { + "address": int(token.address, 16), + "starknet_address": token.starknet_address, + } + if cairo_precompile: + await invoke( + "kakarot", + "set_authorized_cairo_precompile_caller", + int(token.address, 16), + 1, + ) + + # %% Coinbase + coinbase = (await call("kakarot", "get_coinbase")).coinbase + if evm_deployments.get("Coinbase", {}).get("address") != coinbase: + contract = await deploy_evm( + "Kakarot", + "Coinbase", + to_checksum_address(f'{evm_deployments["KakarotETH"]["address"]:040x}'), + ) + evm_deployments["Coinbase"] = { + "address": int(contract.address, 16), + "starknet_address": contract.starknet_address, + } + await invoke("kakarot", "set_coinbase", int(contract.address, 16)) + + # %% Tear down + dump_evm_deployments(evm_deployments) + + +# %% Run +async def main(): + try: + await RPC_CLIENT.get_class_hash_at(get_starknet_deployments()["kakarot"]) + except Exception: + logger.error("❌ Kakarot is not deployed, exiting...") + return + + if not EVM_ADDRESS: + logger.warn("⚠️ No EVM address provided, skipping EVM deployments") + return + + await deploy_evm_contracts() + await execute_calls() + + +def main_sync(): + run(main()) + + +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/deployment/kakarot_deployment.py b/kakarot_scripts/deployment/kakarot_deployment.py new file mode 100644 index 000000000..c786ece8a --- /dev/null +++ b/kakarot_scripts/deployment/kakarot_deployment.py @@ -0,0 +1,94 @@ +# %% Imports +import logging + +from uvloop import run + +from kakarot_scripts.constants import ( + BLOCK_GAS_LIMIT, + DEFAULT_GAS_PRICE, + ETH_TOKEN_ADDRESS, + NETWORK, + RPC_CLIENT, + NetworkType, +) +from kakarot_scripts.utils.starknet import deploy as deploy_starknet +from kakarot_scripts.utils.starknet import ( + dump_deployments, + execute_calls, + get_declarations, + get_deployments, + get_starknet_account, + invoke, + register_lazy_account, + remove_lazy_account, +) + +logger = logging.getLogger(__name__) + + +# %% +async def deploy_or_upgrade_kakarot(owner): + # %% Load data + class_hash = get_declarations() + starknet_deployments = get_deployments() + + # Deploy or upgrade Kakarot + if starknet_deployments.get("kakarot") and NETWORK["type"] is not NetworkType.DEV: + logger.info("ℹ️ Kakarot already deployed, checking version.") + deployed_class_hash = await RPC_CLIENT.get_class_hash_at( + starknet_deployments["kakarot"] + ) + if deployed_class_hash != class_hash["kakarot"]: + await invoke("kakarot", "upgrade", class_hash["kakarot"]) + await invoke( + "kakarot", + "set_account_contract_class_hash", + class_hash["account_contract"], + ) + await invoke( + "kakarot", + "set_cairo1_helpers_class_hash", + class_hash["Cairo1Helpers"], + ) + else: + logger.info("✅ Kakarot already up to date.") + else: + starknet_deployments["kakarot"] = await deploy_starknet( + "kakarot", + owner.address, # owner + ETH_TOKEN_ADDRESS, # native_token_address_ + class_hash["account_contract"], # account_contract_class_hash_ + class_hash["uninitialized_account"], # uninitialized_account_class_hash_ + class_hash["Cairo1Helpers"], + BLOCK_GAS_LIMIT, + ) + await invoke( + "kakarot", + "set_base_fee", + DEFAULT_GAS_PRICE, + address=starknet_deployments["kakarot"], + ) + + dump_deployments(starknet_deployments) + + +# %% Run +async def main(): + try: + await RPC_CLIENT.get_class_by_hash(get_declarations()["kakarot"]) + except Exception: + logger.error("❌ Kakarot is not declared, exiting...") + return + account = await get_starknet_account() + register_lazy_account(account.address) + await deploy_or_upgrade_kakarot(account) + await execute_calls() + remove_lazy_account(account.address) + + +def main_sync(): + run(main()) + + +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/deployment/main.py b/kakarot_scripts/deployment/main.py new file mode 100644 index 000000000..3ddd81ca7 --- /dev/null +++ b/kakarot_scripts/deployment/main.py @@ -0,0 +1,90 @@ +# %% Imports +import logging + +from uvloop import run + +from kakarot_scripts.deployment.declarations import declare_contracts +from kakarot_scripts.deployment.evm_deployments import deploy_evm_contracts +from kakarot_scripts.deployment.kakarot_deployment import deploy_or_upgrade_kakarot +from kakarot_scripts.deployment.messaging_deployments import ( + deploy_l1_messaging_contracts, + deploy_l2_messaging_contracts, +) +from kakarot_scripts.deployment.pre_eip155_deployments import ( + deploy_pre_eip155_contracts, + deploy_pre_eip155_senders, + whitelist_pre_eip155_txs, +) +from kakarot_scripts.deployment.starknet_deployments import deploy_starknet_contracts +from kakarot_scripts.utils.starknet import ( + call, + execute_calls, + get_balance, + get_starknet_account, + register_lazy_account, + remove_lazy_account, +) + +logging.basicConfig() +logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) +# %% + + +async def main(): + + # %% Account initialization + account = await get_starknet_account() + register_lazy_account(account.address) + logger.info(f"ℹ️ Using account 0x{account.address:064x} as deployer") + balance_before = await get_balance(account.address) + + # %% Declarations + await declare_contracts() + + # %% Starknet Deployments + await deploy_starknet_contracts(account) + await deploy_or_upgrade_kakarot(account) + await execute_calls() + + # %% EVM Deployments + await deploy_pre_eip155_senders() + await deploy_evm_contracts() + await execute_calls() + + await whitelist_pre_eip155_txs() + await execute_calls() + + # Must be sequential + remove_lazy_account(account.address) + # Needs whitelist tx to be executed first + await deploy_pre_eip155_contracts() + + # %% Messaging + await deploy_l1_messaging_contracts() + await deploy_l2_messaging_contracts() + + # %% Tear down + balance_after = await get_balance(account.address) + logger.info( + f"ℹ️ Deployer balance changed from {balance_before / 1e18} to {balance_after / 1e18} ETH" + ) + + coinbase = (await call("kakarot", "get_coinbase")).coinbase + if coinbase == 0: + logger.error("❌ Coinbase is set to 0, all transaction fees will be lost") + else: + logger.info(f"✅ Coinbase set to: 0x{coinbase:040x}") + + +# %% + + +def main_sync(): + run(main()) + + +# %% + +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/deployment/messaging_deployments.py b/kakarot_scripts/deployment/messaging_deployments.py new file mode 100644 index 000000000..76921ea13 --- /dev/null +++ b/kakarot_scripts/deployment/messaging_deployments.py @@ -0,0 +1,115 @@ +# %% Imports +import logging + +from eth_abi.exceptions import InsufficientDataBytes +from uvloop import run +from web3.exceptions import ContractLogicError + +from kakarot_scripts.constants import NETWORK, RPC_CLIENT, NetworkType +from kakarot_scripts.utils.kakarot import deploy as deploy_evm +from kakarot_scripts.utils.kakarot import dump_deployments as dump_evm_deployments +from kakarot_scripts.utils.kakarot import get_deployments as get_evm_deployments +from kakarot_scripts.utils.l1 import ( + deploy_on_l1, + dump_l1_addresses, + get_l1_addresses, + get_l1_contract, +) +from kakarot_scripts.utils.starknet import call +from kakarot_scripts.utils.starknet import get_deployments as get_starknet_deployments +from kakarot_scripts.utils.starknet import invoke + +logger = logging.getLogger(__name__) + + +# %% +async def deploy_l1_messaging_contracts(): + # %% L1 + starknet_deployments = get_starknet_deployments() + l1_addresses = get_l1_addresses() + + l1_kakarot_messaging = get_l1_contract( + "L1L2Messaging", + "L1KakarotMessaging", + address=l1_addresses.get("L1KakarotMessaging"), + ) + l1_kakarot_messaging_registered_address = None + try: + l1_kakarot_messaging_registered_address = l1_kakarot_messaging.kakarotAddress() + except (ContractLogicError, InsufficientDataBytes): + pass + + if l1_kakarot_messaging_registered_address != starknet_deployments["kakarot"]: + if NETWORK["type"] == NetworkType.DEV: + starknet_core = deploy_on_l1("Starknet", "StarknetMessagingLocal") + l1_addresses.update({"StarknetCore": starknet_core.address}) + else: + if "StarknetCore" not in l1_addresses: + raise ValueError("StarknetCore missing in L1 addresses") + + l1_kakarot_messaging = deploy_on_l1( + "L1L2Messaging", + "L1KakarotMessaging", + l1_addresses["StarknetCore"], + starknet_deployments["kakarot"], + ) + l1_addresses.update({"L1KakarotMessaging": l1_kakarot_messaging.address}) + + dump_l1_addresses(l1_addresses) + + +async def deploy_l2_messaging_contracts(): + # %% Messaging + evm_deployments = get_evm_deployments() + l1_kakarot_messaging_address = get_l1_addresses()["L1KakarotMessaging"] + deployment = evm_deployments.get("L2KakarotMessaging") + starknet_address = None + if deployment is not None: + starknet_address = ( + await call("kakarot", "get_starknet_address", deployment["address"]) + ).starknet_address + + if deployment is None or deployment["starknet_address"] != starknet_address: + l2_kakarot_messaging = await deploy_evm("L1L2Messaging", "L2KakarotMessaging") + await invoke( + "kakarot", + "set_authorized_cairo_precompile_caller", + int(l2_kakarot_messaging.address, 16), + 1, + ) + evm_deployments["L2KakarotMessaging"] = { + "address": int(l2_kakarot_messaging.address, 16), + "starknet_address": l2_kakarot_messaging.starknet_address, + } + + l1_messaging_contract_address = ( + await call("kakarot", "get_l1_messaging_contract_address") + ).l1_messaging_contract_address + if l1_messaging_contract_address != int(l1_kakarot_messaging_address, 16): + await invoke( + "kakarot", + "set_l1_messaging_contract_address", + int(l1_kakarot_messaging_address, 16), + ) + + dump_evm_deployments(evm_deployments) + + +# %% Run +async def main(): + try: + await RPC_CLIENT.get_class_hash_at(get_starknet_deployments()["kakarot"]) + except Exception: + logger.error("❌ Kakarot is not deployed, exiting...") + return + await deploy_l1_messaging_contracts() + await deploy_l2_messaging_contracts() + + +def main_sync(): + run(main()) + + +# %% +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/deployment/pre_eip155_deployments.py b/kakarot_scripts/deployment/pre_eip155_deployments.py new file mode 100644 index 000000000..fb6deeaa8 --- /dev/null +++ b/kakarot_scripts/deployment/pre_eip155_deployments.py @@ -0,0 +1,82 @@ +# %% Imports +from asyncio.log import logger + +from uvloop import run + +from kakarot_scripts.constants import RPC_CLIENT +from kakarot_scripts.data.pre_eip155_txs import PRE_EIP155_TX +from kakarot_scripts.utils.kakarot import deploy_pre_eip155_sender +from kakarot_scripts.utils.kakarot import dump_deployments as dump_evm_deployments +from kakarot_scripts.utils.kakarot import get_deployments as get_evm_deployments +from kakarot_scripts.utils.kakarot import ( + get_starknet_address, + send_pre_eip155_transaction, + whitelist_pre_eip155_tx, +) +from kakarot_scripts.utils.starknet import execute_calls +from kakarot_scripts.utils.starknet import get_deployments as get_starknet_deployments +from kakarot_scripts.utils.starknet import ( + get_starknet_account, + register_lazy_account, + remove_lazy_account, +) + +# %% + + +async def deploy_pre_eip155_senders(): + # %% Deployers + for contract_name in PRE_EIP155_TX.keys(): + await deploy_pre_eip155_sender(contract_name) + # %% + + +async def whitelist_pre_eip155_txs(): + # %% Whitelist + for contract_name in PRE_EIP155_TX.keys(): + await whitelist_pre_eip155_tx(contract_name) + # %% + + +async def deploy_pre_eip155_contracts(): + # %% Contracts + evm_deployments = get_evm_deployments() + + for contract_name in PRE_EIP155_TX.keys(): + await send_pre_eip155_transaction(contract_name, max_fee=int(0.2e18)) + deployed_address = int(PRE_EIP155_TX[contract_name]["address"], 16) + evm_deployments[contract_name] = { + "address": deployed_address, + "starknet_address": await get_starknet_address(deployed_address), + } + + dump_evm_deployments(evm_deployments) + + +# %% Run +async def main(): + try: + await RPC_CLIENT.get_class_hash_at(get_starknet_deployments()["kakarot"]) + except Exception: + logger.error("❌ Kakarot is not deployed, exiting...") + return + + account = await get_starknet_account() + register_lazy_account(account.address) + await deploy_pre_eip155_senders() + await execute_calls() + await whitelist_pre_eip155_txs() + await execute_calls() + remove_lazy_account(account.address) + + # Must be sequential + await deploy_pre_eip155_contracts() + + +def main_sync(): + run(main()) + + +# %% +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/deployment/starknet_deployments.py b/kakarot_scripts/deployment/starknet_deployments.py new file mode 100644 index 000000000..aa551f0dd --- /dev/null +++ b/kakarot_scripts/deployment/starknet_deployments.py @@ -0,0 +1,87 @@ +# %% Imports +import logging + +from uvloop import run + +from kakarot_scripts.constants import ( + BLOCK_GAS_LIMIT, + COINBASE, + ETH_TOKEN_ADDRESS, + NETWORK, + RPC_CLIENT, + NetworkType, +) +from kakarot_scripts.utils.starknet import deploy as deploy_starknet +from kakarot_scripts.utils.starknet import ( + dump_deployments, + execute_calls, + get_declarations, + get_deployments, + get_starknet_account, + invoke, + register_lazy_account, + remove_lazy_account, +) + +logger = logging.getLogger(__name__) + + +# %% +async def deploy_starknet_contracts(account): + + # %% Deployments + class_hash = get_declarations() + starknet_deployments = get_deployments() + + if NETWORK["type"] is not NetworkType.PROD: + starknet_deployments["EVM"] = await deploy_starknet( + "EVM", + account.address, + ETH_TOKEN_ADDRESS, + class_hash["account_contract"], + class_hash["uninitialized_account"], + class_hash["Cairo1Helpers"], + BLOCK_GAS_LIMIT, + ) + await invoke( + "EVM", + "set_coinbase", + COINBASE, + address=starknet_deployments["EVM"], + ) + starknet_deployments["Counter"] = await deploy_starknet("Counter") + starknet_deployments["MockPragmaOracle"] = await deploy_starknet( + "MockPragmaOracle" + ) + starknet_deployments["UniversalLibraryCaller"] = await deploy_starknet( + "UniversalLibraryCaller" + ) + starknet_deployments["BenchmarkCairoCalls"] = await deploy_starknet( + "BenchmarkCairoCalls" + ) + + dump_deployments(starknet_deployments) + # %% + return starknet_deployments + + +# %% Run +def main_sync(): + run(main()) + + +async def main(): + try: + await RPC_CLIENT.get_class_by_hash(get_declarations()["kakarot"]) + except Exception: + logger.error("❌ Classes were not declared, exiting...") + return + account = await get_starknet_account() + register_lazy_account(account.address) + await deploy_starknet_contracts(account) + await execute_calls() + remove_lazy_account(account.address) + + +if __name__ == "__main__": + main_sync() diff --git a/kakarot_scripts/utils/kakarot.py b/kakarot_scripts/utils/kakarot.py index 08d743603..95a295d92 100644 --- a/kakarot_scripts/utils/kakarot.py +++ b/kakarot_scripts/utils/kakarot.py @@ -41,7 +41,9 @@ WEB3, ChainId, ) +from kakarot_scripts.data.pre_eip155_txs import PRE_EIP155_TX from kakarot_scripts.utils.starknet import _max_fee +from kakarot_scripts.utils.starknet import call from kakarot_scripts.utils.starknet import call as _call_starknet from kakarot_scripts.utils.starknet import fund_address as _fund_starknet_address from kakarot_scripts.utils.starknet import get_balance @@ -465,22 +467,39 @@ async def get_eoa(private_key=None, amount=0) -> Account: ) -async def send_pre_eip155_transaction( - evm_address: str, - starknet_address: Union[int, str], - signed_tx: bytes, - max_fee: Optional[int] = None, -): +async def whitelist_pre_eip155_tx(name: str): + signed_tx = PRE_EIP155_TX[name]["signed_tx"] + deployer_evm_address = PRE_EIP155_TX[name]["deployer"] + should_deploy = PRE_EIP155_TX[name].get("should_deploy", False) + if not should_deploy: + return + + # Inline get_msg_hash and get_unsigned_encoded_tx_data rlp_decoded = rlp.decode(signed_tx) - v, r, s = rlp_decoded[-3:] unsigned_tx_data = rlp_decoded[:-3] unsigned_encoded_tx = rlp.encode(unsigned_tx_data) msg_hash = int.from_bytes(keccak(unsigned_encoded_tx), "big") await _invoke_starknet( - "kakarot", "set_authorized_pre_eip155_tx", int(evm_address, 16), msg_hash + "kakarot", + "set_authorized_pre_eip155_tx", + int(deployer_evm_address, 16), + msg_hash, ) + +async def send_pre_eip155_transaction(name: str, max_fee: Optional[int] = None): + """ + Transaction must be whitelisted first. + """ + signed_tx = PRE_EIP155_TX[name]["signed_tx"] + deployer_evm_address = PRE_EIP155_TX[name]["deployer"] + deployer_starknet_address = await get_starknet_address(deployer_evm_address) + should_deploy = PRE_EIP155_TX[name].get("deployer", False) + if not should_deploy: + logger.info(f"ℹ️ {name} is already deployed, skipping") + return + if WEB3.is_connected(): tx_hash = WEB3.eth.send_raw_transaction(signed_tx) receipt = WEB3.eth.wait_for_transaction_receipt( @@ -489,13 +508,19 @@ async def send_pre_eip155_transaction( return receipt, [], receipt.status, receipt.gasUsed sender_account = Account( - address=starknet_address, + address=deployer_starknet_address, client=RPC_CLIENT, chain=ChainId.starknet_chain_id, # Keypair not required for already signed txs key_pair=KeyPair(int(0x10), 0x20), ) + # Inline get_signature + rlp_decoded = rlp.decode(signed_tx) + unsigned_tx_data = rlp_decoded[:-3] + unsigned_encoded_tx = rlp.encode(unsigned_tx_data) + v, r, s = rlp_decoded[-3:] + return await send_starknet_transaction( evm_account=sender_account, signature_r=int.from_bytes(r, "big"), @@ -517,11 +542,24 @@ async def eth_get_code(address: Union[int, str]): ) -async def eth_get_transaction_count(address: Union[int, str]): - starknet_address = await get_starknet_address(address) - return ( - await _call_starknet("account_contract", "get_nonce", address=starknet_address) - ).nonce +async def eth_get_transaction_count(evm_address): + starknet_address = ( + await call("kakarot", "get_starknet_address", int(evm_address, 16)) + ).starknet_address + try: + nonce = ( + await call("kakarot", "eth_get_transaction_count", int(evm_address, 16)) + ).tx_count + except Exception as e: + if ( + f"Requested contract address 0x{starknet_address:064x} is not deployed" + in str(e.data) + ): + nonce = 0 + else: + raise e + + return nonce async def eth_balance_of(address: Union[int, str]): @@ -747,29 +785,25 @@ async def store_bytecode(bytecode: Union[str, bytes], **kwargs): return evm_address -async def deploy_with_presigned_tx( - deployer_evm_address: str, signed_tx: bytes, amount=0.1, name="", max_fee=None -): - deployer_starknet_address = await deploy_and_fund_evm_address( - deployer_evm_address, amount - ) - nonce = ( - await _call_starknet( - "account_contract", "get_nonce", address=deployer_starknet_address - ) - ).nonce - if nonce != 0: +async def deploy_pre_eip155_sender(name: str) -> bool: + tx_instance = PRE_EIP155_TX[name] + deployer_evm_address = tx_instance["deployer"] + amount = tx_instance["required_eth"] + signed_tx = tx_instance["signed_tx"] + rlp_decoded = rlp.decode(signed_tx) + unsigned_tx_data = rlp_decoded[:-3] + tx_nonce = int.from_bytes(unsigned_tx_data[0], "big") + + # check the nonce of the deployer for an early return if it's not 0. + # Either the nonce is 0, or the account is already deployed. + nonce = await eth_get_transaction_count(deployer_evm_address) + if nonce != tx_nonce: logger.info( f"ℹ️ Nonce for {deployer_evm_address} is not 0 ({nonce}), skipping transaction" ) return - response = await send_pre_eip155_transaction( - deployer_evm_address, deployer_starknet_address, signed_tx, max_fee - ) + # Deploy and fund deployer to enable the authorization callback when calling set_authorized_pre_eip155_tx + await deploy_and_fund_evm_address(deployer_evm_address, amount) - receipt, response, success, gas_used = response - deployed_address = response[1] - logger.info(f"✅ {name} Deployed at: 0x{deployed_address:040x}") - deployed_starknet_address = await get_starknet_address(deployed_address) - return {"address": deployed_address, "starknet_address": deployed_starknet_address} + tx_instance["should_deploy"] = True diff --git a/kakarot_scripts/utils/starknet.py b/kakarot_scripts/utils/starknet.py index 26fdc3672..05172fec1 100644 --- a/kakarot_scripts/utils/starknet.py +++ b/kakarot_scripts/utils/starknet.py @@ -531,7 +531,7 @@ def register_lazy_account(account_address): def remove_lazy_account(account_address): - del _lazy_execute[account_address] + _lazy_execute.pop(account_address, None) def register_multisig_account(account_address): diff --git a/pyproject.toml b/pyproject.toml index 3f0220ef1..d61e3e883 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ dependencies = [ [project.scripts] compile = "kakarot_scripts.compile_kakarot:main" -deploy = "kakarot_scripts.deploy_kakarot:main_sync" +deploy = "kakarot_scripts.deployment.main:main_sync" ef_tests = "kakarot_scripts.ef_tests.fetch:generate_tests" [tool.uv.sources]