From 7d8e679cc8c3905871f7451c07e38293ed685278 Mon Sep 17 00:00:00 2001 From: Brock Smedley <2791467+zeroXbrock@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:24:20 -0800 Subject: [PATCH 1/5] replce EOA swaps with unicheat --- scenarios/univ2ConfigTest.toml | 77 ++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 21 deletions(-) diff --git a/scenarios/univ2ConfigTest.toml b/scenarios/univ2ConfigTest.toml index 977d899..f1a4364 100644 --- a/scenarios/univ2ConfigTest.toml +++ b/scenarios/univ2ConfigTest.toml @@ -29,6 +29,11 @@ from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" # requires {univ2Factory} and {weth} bytecode = "0x60c06040523480156200001157600080fd5b506040516200573e3803806200573e833981810160405260408110156200003757600080fd5b5080516020909101516001600160601b0319606092831b8116608052911b1660a05260805160601c60a05160601c6155b762000187600039806101ac5280610e5d5280610e985280610fd5528061129852806116f252806118d65280611e1e5280611fa252806120725280612179528061232c52806123c15280612673528061271a52806127ef52806128f452806129dc5280612a5d52806130ec5280613422528061347852806134ac528061352d528061374752806138f7528061398c5250806110c752806111c5528061136b52806113a4528061154f52806117e452806118b45280611aa1528061225f528061240052806125a95280612a9c5280612ddf5280613071528061309a52806130ca52806132a75280613456528061382d52806139cb528061444a528061448d52806147ed52806149ce5280614f49528061502a52806150aa52506155b76000f3fe60806040526004361061018f5760003560e01c80638803dbee116100d6578063c45a01551161007f578063e8e3370011610059578063e8e3370014610c71578063f305d71914610cfe578063fb3bdb4114610d51576101d5565b8063c45a015514610b25578063d06ca61f14610b3a578063ded9382a14610bf1576101d5565b8063af2979eb116100b0578063af2979eb146109c8578063b6f9de9514610a28578063baa2abde14610abb576101d5565b80638803dbee146108af578063ad5c464814610954578063ad615dec14610992576101d5565b80634a25d94a11610138578063791ac94711610112578063791ac947146107415780637ff36ab5146107e657806385f8c25914610879576101d5565b80634a25d94a146105775780635b0d59841461061c5780635c11d7951461069c576101d5565b80631f00ca74116101695780631f00ca74146103905780632195995c1461044757806338ed1739146104d2576101d5565b806302751cec146101da578063054d50d41461025357806318cbafe51461029b576101d5565b366101d5573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146101d357fe5b005b600080fd5b3480156101e657600080fd5b5061023a600480360360c08110156101fd57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a00135610de4565b6040805192835260208301919091528051918290030190f35b34801561025f57600080fd5b506102896004803603606081101561027657600080fd5b5080359060208101359060400135610f37565b60408051918252519081900360200190f35b3480156102a757600080fd5b50610340600480360360a08110156102be57600080fd5b8135916020810135918101906060810160408201356401000000008111156102e557600080fd5b8201836020820111156102f757600080fd5b8035906020019184602083028401116401000000008311171561031957600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135610f4c565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561037c578181015183820152602001610364565b505050509050019250505060405180910390f35b34801561039c57600080fd5b50610340600480360360408110156103b357600080fd5b813591908101906040810160208201356401000000008111156103d557600080fd5b8201836020820111156103e757600080fd5b8035906020019184602083028401116401000000008311171561040957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611364945050505050565b34801561045357600080fd5b5061023a600480360361016081101561046b57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359091169060c08101359060e081013515159060ff610100820135169061012081013590610140013561139a565b3480156104de57600080fd5b50610340600480360360a08110156104f557600080fd5b81359160208101359181019060608101604082013564010000000081111561051c57600080fd5b82018360208201111561052e57600080fd5b8035906020019184602083028401116401000000008311171561055057600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356114d8565b34801561058357600080fd5b50610340600480360360a081101561059a57600080fd5b8135916020810135918101906060810160408201356401000000008111156105c157600080fd5b8201836020820111156105d357600080fd5b803590602001918460208302840111640100000000831117156105f557600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135611669565b34801561062857600080fd5b50610289600480360361014081101561064057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e082013516906101008101359061012001356118ac565b3480156106a857600080fd5b506101d3600480360360a08110156106bf57600080fd5b8135916020810135918101906060810160408201356401000000008111156106e657600080fd5b8201836020820111156106f857600080fd5b8035906020019184602083028401116401000000008311171561071a57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356119fe565b34801561074d57600080fd5b506101d3600480360360a081101561076457600080fd5b81359160208101359181019060608101604082013564010000000081111561078b57600080fd5b82018360208201111561079d57600080fd5b803590602001918460208302840111640100000000831117156107bf57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135611d97565b610340600480360360808110156107fc57600080fd5b8135919081019060408101602082013564010000000081111561081e57600080fd5b82018360208201111561083057600080fd5b8035906020019184602083028401116401000000008311171561085257600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612105565b34801561088557600080fd5b506102896004803603606081101561089c57600080fd5b5080359060208101359060400135612525565b3480156108bb57600080fd5b50610340600480360360a08110156108d257600080fd5b8135916020810135918101906060810160408201356401000000008111156108f957600080fd5b82018360208201111561090b57600080fd5b8035906020019184602083028401116401000000008311171561092d57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612532565b34801561096057600080fd5b50610969612671565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561099e57600080fd5b50610289600480360360608110156109b557600080fd5b5080359060208101359060400135612695565b3480156109d457600080fd5b50610289600480360360c08110156109eb57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a001356126a2565b6101d360048036036080811015610a3e57600080fd5b81359190810190604081016020820135640100000000811115610a6057600080fd5b820183602082011115610a7257600080fd5b80359060200191846020830284011164010000000083111715610a9457600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff8135169060200135612882565b348015610ac757600080fd5b5061023a600480360360e0811015610ade57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359091169060c00135612d65565b348015610b3157600080fd5b5061096961306f565b348015610b4657600080fd5b5061034060048036036040811015610b5d57600080fd5b81359190810190604081016020820135640100000000811115610b7f57600080fd5b820183602082011115610b9157600080fd5b80359060200191846020830284011164010000000083111715610bb357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550613093945050505050565b348015610bfd57600080fd5b5061023a6004803603610140811015610c1557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a08101359060c081013515159060ff60e082013516906101008101359061012001356130c0565b348015610c7d57600080fd5b50610ce06004803603610100811015610c9557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160408201359160608101359160808201359160a08101359160c0820135169060e00135613218565b60408051938452602084019290925282820152519081900360600190f35b610ce0600480360360c0811015610d1457600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135916040820135916060810135916080820135169060a001356133a7565b61034060048036036080811015610d6757600080fd5b81359190810190604081016020820135640100000000811115610d8957600080fd5b820183602082011115610d9b57600080fd5b80359060200191846020830284011164010000000083111715610dbd57600080fd5b919350915073ffffffffffffffffffffffffffffffffffffffff81351690602001356136d3565b6000808242811015610e5757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b610e86897f00000000000000000000000000000000000000000000000000000000000000008a8a8a308a612d65565b9093509150610e96898685613b22565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610f0957600080fd5b505af1158015610f1d573d6000803e3d6000fd5b50505050610f2b8583613cff565b50965096945050505050565b6000610f44848484613e3c565b949350505050565b60608142811015610fbe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001686867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811061102357fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6111207f000000000000000000000000000000000000000000000000000000000000000089888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b9150868260018451038151811061113357fe5b60200260200101511015611192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b611257868660008181106111a257fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff163361123d7f00000000000000000000000000000000000000000000000000000000000000008a8a60008181106111f157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168b8b600181811061121b57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166140c6565b8560008151811061124a57fe5b60200260200101516141b1565b61129682878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250614381915050565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836001855103815181106112e257fe5b60200260200101516040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561132057600080fd5b505af1158015611334573d6000803e3d6000fd5b50505050611359848360018551038151811061134c57fe5b6020026020010151613cff565b509695505050505050565b60606113917f00000000000000000000000000000000000000000000000000000000000000008484614608565b90505b92915050565b60008060006113ca7f00000000000000000000000000000000000000000000000000000000000000008f8f6140c6565b90506000876113d9578c6113fb565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c48101889052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b15801561149757600080fd5b505af11580156114ab573d6000803e3d6000fd5b505050506114be8f8f8f8f8f8f8f612d65565b809450819550505050509b509b9950505050505050505050565b6060814281101561154a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6115a87f000000000000000000000000000000000000000000000000000000000000000089888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b915086826001845103815181106115bb57fe5b6020026020010151101561161a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b61162a868660008181106111a257fe5b61135982878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b606081428110156116db57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001686867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff810181811061174057fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117df57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b61183d7f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150868260008151811061184d57fe5b60200260200101511115611192576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b6000806118fa7f00000000000000000000000000000000000000000000000000000000000000008d7f00000000000000000000000000000000000000000000000000000000000000006140c6565b9050600086611909578b61192b565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018b905260ff8916608482015260a4810188905260c48101879052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b1580156119c757600080fd5b505af11580156119db573d6000803e3d6000fd5b505050506119ed8d8d8d8d8d8d6126a2565b9d9c50505050505050505050505050565b8042811015611a6e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b611afd85856000818110611a7e57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1633611af77f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff168a8a600181811061121b57fe5b8a6141b1565b600085857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611b2d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611bc657600080fd5b505afa158015611bda573d6000803e3d6000fd5b505050506040513d6020811015611bf057600080fd5b50516040805160208881028281018201909352888252929350611c32929091899189918291850190849080828437600092019190915250889250614796915050565b86611d368288887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611c6557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b505afa158015611d12573d6000803e3d6000fd5b505050506040513d6020811015611d2857600080fd5b50519063ffffffff614b2916565b1015611d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b5050505050505050565b8042811015611e0757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001685857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110611e6c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f0b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b611f1b85856000818110611a7e57fe5b611f59858580806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250309250614796915050565b604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009173ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b158015611fe957600080fd5b505afa158015611ffd573d6000803e3d6000fd5b505050506040513d602081101561201357600080fd5b5051905086811015612070576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156120e357600080fd5b505af11580156120f7573d6000803e3d6000fd5b50505050611d8d8482613cff565b6060814281101561217757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16868660008181106121bb57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461225a57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6122b87f000000000000000000000000000000000000000000000000000000000000000034888880806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250613f6092505050565b915086826001845103815181106122cb57fe5b6020026020010151101561232a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615508602b913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061237357fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b1580156123a657600080fd5b505af11580156123ba573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb61242c7f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b8460008151811061243957fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156124aa57600080fd5b505af11580156124be573d6000803e3d6000fd5b505050506040513d60208110156124d457600080fd5b50516124dc57fe5b61251b82878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b5095945050505050565b6000610f44848484614b9b565b606081428110156125a457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6126027f00000000000000000000000000000000000000000000000000000000000000008988888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150868260008151811061261257fe5b6020026020010151111561161a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b6000610f44848484614cbf565b6000814281101561271457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b612743887f00000000000000000000000000000000000000000000000000000000000000008989893089612d65565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290519194506127ed92508a91879173ffffffffffffffffffffffffffffffffffffffff8416916370a0823191602480820192602092909190829003018186803b1580156127bc57600080fd5b505afa1580156127d0573d6000803e3d6000fd5b505050506040513d60208110156127e657600080fd5b5051613b22565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561286057600080fd5b505af1158015612874573d6000803e3d6000fd5b505050506113598483613cff565b80428110156128f257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168585600081811061293657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129d557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b60003490507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b158015612a4257600080fd5b505af1158015612a56573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb612ac87f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612b3257600080fd5b505af1158015612b46573d6000803e3d6000fd5b505050506040513d6020811015612b5c57600080fd5b5051612b6457fe5b600086867fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110612b9457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612c2d57600080fd5b505afa158015612c41573d6000803e3d6000fd5b505050506040513d6020811015612c5757600080fd5b50516040805160208981028281018201909352898252929350612c999290918a918a918291850190849080828437600092019190915250899250614796915050565b87611d368289897fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8101818110612ccc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231896040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b6000808242811015612dd857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b6000612e057f00000000000000000000000000000000000000000000000000000000000000008c8c6140c6565b604080517f23b872dd00000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff831660248201819052604482018d9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015612e8657600080fd5b505af1158015612e9a573d6000803e3d6000fd5b505050506040513d6020811015612eb057600080fd5b5050604080517f89afcb4400000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015282516000938493928616926389afcb44926024808301939282900301818787803b158015612f2357600080fd5b505af1158015612f37573d6000803e3d6000fd5b505050506040513d6040811015612f4d57600080fd5b50805160209091015190925090506000612f678e8e614d9f565b5090508073ffffffffffffffffffffffffffffffffffffffff168e73ffffffffffffffffffffffffffffffffffffffff1614612fa4578183612fa7565b82825b90975095508a871015613005576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154bf6026913960400191505060405180910390fd5b8986101561305e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154256026913960400191505060405180910390fd5b505050505097509795505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60606113917f00000000000000000000000000000000000000000000000000000000000000008484613f60565b60008060006131107f00000000000000000000000000000000000000000000000000000000000000008e7f00000000000000000000000000000000000000000000000000000000000000006140c6565b905060008761311f578c613141565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff5b604080517fd505accf00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101839052606481018c905260ff8a16608482015260a4810189905260c48101889052905191925073ffffffffffffffffffffffffffffffffffffffff84169163d505accf9160e48082019260009290919082900301818387803b1580156131dd57600080fd5b505af11580156131f1573d6000803e3d6000fd5b505050506132038e8e8e8e8e8e610de4565b909f909e509c50505050505050505050505050565b6000806000834281101561328d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61329b8c8c8c8c8c8c614ef2565b909450925060006132cd7f00000000000000000000000000000000000000000000000000000000000000008e8e6140c6565b90506132db8d3383886141b1565b6132e78c3383876141b1565b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561336657600080fd5b505af115801561337a573d6000803e3d6000fd5b505050506040513d602081101561339057600080fd5b5051949d939c50939a509198505050505050505050565b6000806000834281101561341c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b61344a8a7f00000000000000000000000000000000000000000000000000000000000000008b348c8c614ef2565b9094509250600061349c7f00000000000000000000000000000000000000000000000000000000000000008c7f00000000000000000000000000000000000000000000000000000000000000006140c6565b90506134aa8b3383886141b1565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db0856040518263ffffffff1660e01b81526004016000604051808303818588803b15801561351257600080fd5b505af1158015613526573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156135d257600080fd5b505af11580156135e6573d6000803e3d6000fd5b505050506040513d60208110156135fc57600080fd5b505161360457fe5b8073ffffffffffffffffffffffffffffffffffffffff16636a627842886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561368357600080fd5b505af1158015613697573d6000803e3d6000fd5b505050506040513d60208110156136ad57600080fd5b50519250348410156136c5576136c533853403613cff565b505096509650969350505050565b6060814281101561374557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f556e69737761705632526f757465723a20455850495245440000000000000000604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff168686600081811061378957fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461382857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f556e69737761705632526f757465723a20494e56414c49445f50415448000000604482015290519081900360640190fd5b6138867f00000000000000000000000000000000000000000000000000000000000000008888888080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061460892505050565b9150348260008151811061389657fe5b602002602001015111156138f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260278152602001806154986027913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663d0e30db08360008151811061393e57fe5b60200260200101516040518263ffffffff1660e01b81526004016000604051808303818588803b15801561397157600080fd5b505af1158015613985573d6000803e3d6000fd5b50505050507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6139f77f000000000000000000000000000000000000000000000000000000000000000089896000818110611acd57fe5b84600081518110613a0457fe5b60200260200101516040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015613a7557600080fd5b505af1158015613a89573d6000803e3d6000fd5b505050506040513d6020811015613a9f57600080fd5b5051613aa757fe5b613ae682878780806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250899250614381915050565b81600081518110613af357fe5b602002602001015134111561251b5761251b3383600081518110613b1357fe5b60200260200101513403613cff565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000178152925182516000946060949389169392918291908083835b60208310613bf857805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613bbb565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613c5a576040519150601f19603f3d011682016040523d82523d6000602084013e613c5f565b606091505b5091509150818015613c8d575080511580613c8d5750808060200190516020811015613c8a57600080fd5b50515b613cf857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5472616e7366657248656c7065723a205452414e534645525f4641494c454400604482015290519081900360640190fd5b5050505050565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff84169083906040518082805190602001908083835b60208310613d7657805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101613d39565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114613dd8576040519150601f19603f3d011682016040523d82523d6000602084013e613ddd565b606091505b5050905080613e37576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806154e56023913960400191505060405180910390fd5b505050565b6000808411613e96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180615557602b913960400191505060405180910390fd5b600083118015613ea65750600082115b613efb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b6000613f0f856103e563ffffffff6151f316565b90506000613f23828563ffffffff6151f316565b90506000613f4983613f3d886103e863ffffffff6151f316565b9063ffffffff61527916565b9050808281613f5457fe5b04979650505050505050565b6060600282511015613fd357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff81118015613feb57600080fd5b50604051908082528060200260200182016040528015614015578160200160208202803683370190505b509050828160008151811061402657fe5b60200260200101818152505060005b60018351038110156140be576000806140788786858151811061405457fe5b602002602001015187866001018151811061406b57fe5b60200260200101516152eb565b9150915061409a84848151811061408b57fe5b60200260200101518383613e3c565b8484600101815181106140a957fe5b60209081029190910101525050600101614035565b509392505050565b60008060006140d58585614d9f565b604080517fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501207fff0000000000000000000000000000000000000000000000000000000000000060688401529a90941b9093166069840152607d8301989098527f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017815292518251600094606094938a169392918291908083835b6020831061428f57805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101614252565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146142f1576040519150601f19603f3d011682016040523d82523d6000602084013e6142f6565b606091505b5091509150818015614324575080511580614324575080806020019051602081101561432157600080fd5b50515b614379576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806155336024913960400191505060405180910390fd5b505050505050565b60005b60018351038110156146025760008084838151811061439f57fe5b60200260200101518584600101815181106143b657fe5b60200260200101519150915060006143ce8383614d9f565b50905060008785600101815181106143e257fe5b602002602001015190506000808373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461442a5782600061442e565b6000835b91509150600060028a510388106144455788614486565b6144867f0000000000000000000000000000000000000000000000000000000000000000878c8b6002018151811061447957fe5b60200260200101516140c6565b90506144b37f000000000000000000000000000000000000000000000000000000000000000088886140c6565b73ffffffffffffffffffffffffffffffffffffffff1663022c0d9f84848460006040519080825280601f01601f1916602001820160405280156144fd576020820181803683370190505b506040518563ffffffff1660e01b8152600401808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015614588578181015183820152602001614570565b50505050905090810190601f1680156145b55780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156145d757600080fd5b505af11580156145eb573d6000803e3d6000fd5b505060019099019850614384975050505050505050565b50505050565b606060028251101561467b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a20494e56414c49445f504154480000604482015290519081900360640190fd5b815167ffffffffffffffff8111801561469357600080fd5b506040519080825280602002602001820160405280156146bd578160200160208202803683370190505b50905082816001835103815181106146d157fe5b602090810291909101015281517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff015b80156140be576000806147318786600186038151811061471d57fe5b602002602001015187868151811061406b57fe5b9150915061475384848151811061474457fe5b60200260200101518383614b9b565b84600185038151811061476257fe5b602090810291909101015250507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01614701565b60005b6001835103811015613e37576000808483815181106147b457fe5b60200260200101518584600101815181106147cb57fe5b60200260200101519150915060006147e38383614d9f565b50905060006148137f000000000000000000000000000000000000000000000000000000000000000085856140c6565b90506000806000808473ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561486157600080fd5b505afa158015614875573d6000803e3d6000fd5b505050506040513d606081101561488b57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905060008073ffffffffffffffffffffffffffffffffffffffff8a8116908916146148d55782846148d8565b83835b9150915061495d828b73ffffffffffffffffffffffffffffffffffffffff166370a082318a6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611cfe57600080fd5b955061496a868383613e3c565b9450505050506000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146149ae578260006149b2565b6000835b91509150600060028c51038a106149c9578a6149fd565b6149fd7f0000000000000000000000000000000000000000000000000000000000000000898e8d6002018151811061447957fe5b60408051600080825260208201928390527f022c0d9f000000000000000000000000000000000000000000000000000000008352602482018781526044830187905273ffffffffffffffffffffffffffffffffffffffff8086166064850152608060848501908152845160a48601819052969750908c169563022c0d9f958a958a958a9591949193919260c486019290918190849084905b83811015614aad578181015183820152602001614a95565b50505050905090810190601f168015614ada5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015614afc57600080fd5b505af1158015614b10573d6000803e3d6000fd5b50506001909b019a506147999950505050505050505050565b8082038281111561139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604482015290519081900360640190fd5b6000808411614bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806153d4602c913960400191505060405180910390fd5b600083118015614c055750600082115b614c5a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b6000614c7e6103e8614c72868863ffffffff6151f316565b9063ffffffff6151f316565b90506000614c986103e5614c72868963ffffffff614b2916565b9050614cb56001828481614ca857fe5b049063ffffffff61527916565b9695505050505050565b6000808411614d19576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806154736025913960400191505060405180910390fd5b600083118015614d295750600082115b614d7e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061544b6028913960400191505060405180910390fd5b82614d8f858463ffffffff6151f316565b81614d9657fe5b04949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415614e27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806154006025913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610614e61578284614e64565b83835b909250905073ffffffffffffffffffffffffffffffffffffffff8216614eeb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b604080517fe6a4390500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff888116600483015287811660248301529151600092839283927f00000000000000000000000000000000000000000000000000000000000000009092169163e6a4390591604480820192602092909190829003018186803b158015614f9257600080fd5b505afa158015614fa6573d6000803e3d6000fd5b505050506040513d6020811015614fbc57600080fd5b505173ffffffffffffffffffffffffffffffffffffffff1614156150a257604080517fc9c6539600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8a81166004830152898116602483015291517f00000000000000000000000000000000000000000000000000000000000000009092169163c9c65396916044808201926020929091908290030181600087803b15801561507557600080fd5b505af1158015615089573d6000803e3d6000fd5b505050506040513d602081101561509f57600080fd5b50505b6000806150d07f00000000000000000000000000000000000000000000000000000000000000008b8b6152eb565b915091508160001480156150e2575080155b156150f2578793508692506151e6565b60006150ff898484614cbf565b905087811161516c5785811015615161576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154256026913960400191505060405180910390fd5b8894509250826151e4565b6000615179898486614cbf565b90508981111561518557fe5b878110156151de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806154bf6026913960400191505060405180910390fd5b94508793505b505b5050965096945050505050565b600081158061520e5750508082028282828161520b57fe5b04145b61139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6d756c2d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b8082018281101561139457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604482015290519081900360640190fd5b60008060006152fa8585614d9f565b50905060008061530b8888886140c6565b73ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561535057600080fd5b505afa158015615364573d6000803e3d6000fd5b505050506040513d606081101561537a57600080fd5b5080516020909101516dffffffffffffffffffffffffffff918216935016905073ffffffffffffffffffffffffffffffffffffffff878116908416146153c15780826153c4565b81815b9099909850965050505050505056fe556e697377617056324c6962726172793a20494e53554646494349454e545f4f55545055545f414d4f554e54556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e69737761705632526f757465723a20494e53554646494349454e545f425f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e54556e69737761705632526f757465723a204558434553534956455f494e5055545f414d4f554e54556e69737761705632526f757465723a20494e53554646494349454e545f415f414d4f554e545472616e7366657248656c7065723a204554485f5452414e534645525f4641494c4544556e69737761705632526f757465723a20494e53554646494349454e545f4f55545055545f414d4f554e545472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a26469706673582212206dd6e03c4b2c0a8e55214926227ae9e2d6f9fec2ce74a6446d615afa355c84f364736f6c63430006060033000000000000000000000000{uniV2Factory}000000000000000000000000{weth}" +[[create]] +name = "unicheat" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +bytecode = "0x608060405234801561001057600080fd5b506040516104d13803806104d183398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b61043e806100936000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063df791e501461003b578063f887ea4014610050575b600080fd5b61004e61004936600461021f565b61007f565b005b600054610063906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005460405163095ea7b360e01b81526001600160a01b0391821660048201526001600160fc1b0360248201529084169063095ea7b3906044016020604051808303816000875af11580156100d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100fc919061025b565b5060408051600280825260608201835260009260208301908036833701905050905083816000815181106101325761013261029a565b60200260200101906001600160a01b031690816001600160a01b03168152505082816001815181106101665761016661029a565b6001600160a01b039283166020918202929092010152600054166338ed173983600184306101954260646102b0565b6040518663ffffffff1660e01b81526004016101b59594939291906102d7565b6000604051808303816000875af11580156101d4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526101fc919081019061034a565b5050505050565b80356001600160a01b038116811461021a57600080fd5b919050565b60008060006060848603121561023457600080fd5b61023d84610203565b925061024b60208501610203565b9150604084013590509250925092565b60006020828403121561026d57600080fd5b8151801515811461027d57600080fd5b9392505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b808201808211156102d157634e487b7160e01b600052601160045260246000fd5b92915050565b600060a08201878352602087602085015260a0604085015281875180845260c08601915060208901935060005b818110156103295784516001600160a01b031683529383019391830191600101610304565b50506001600160a01b03969096166060850152505050608001529392505050565b6000602080838503121561035d57600080fd5b825167ffffffffffffffff8082111561037557600080fd5b818501915085601f83011261038957600080fd5b81518181111561039b5761039b610284565b8060051b604051601f19603f830116810181811085821117156103c0576103c0610284565b6040529182528482019250838101850191888311156103de57600080fd5b938501935b828510156103fc578451845293850193928501926103e3565b9897505050505050505056fea2646970667358221220f9188d1b17ff745ca5152df6b220d5604194269632dab40f88e692883fd933f764736f6c63430008180033000000000000000000000000{uniRouterV2}" + ### setup contracts ## weth deposits ############################################################### @@ -36,6 +41,7 @@ bytecode = "0x60c06040523480156200001157600080fd5b506040516200573e3803806200573e [[setup]] to = "{weth}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +<<<<<<< Updated upstream signature = "function deposit() public payable" value = "10000000000000000000" @@ -48,6 +54,8 @@ value = "10000000000000000000" [[setup]] to = "{weth}" from = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" +======= +>>>>>>> Stashed changes signature = "function deposit() public payable" value = "10000000000000000000" @@ -63,6 +71,28 @@ args = [ "{testToken}" ] +## transfer funds to Unicheat ################################################## + +[[setup]] +kind = "weth_fund_unicheat" +to = "{weth}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "function transfer(address recipient, uint256 amount) external returns (bool)" +args = [ + "{unicheat}", + "5000000000000000000" +] + +[[setup]] +kind = "testToken_fund_unicheat" +to = "{testToken}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "function transfer(address recipient, uint256 amount) external returns (bool)" +args = [ + "{unicheat}", + "500000000000000000000000" +] + ## token approvals ############################################################# #admin @@ -84,6 +114,7 @@ args = [ "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] +<<<<<<< Updated upstream # contender1 [[setup]] to = "{weth}" @@ -122,20 +153,22 @@ args = [ "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] +======= +>>>>>>> Stashed changes ## add liquidity ############################################################### [[setup]] -kind = "uniswap_v2" +kind = "univ2_add_liquidity" to = "{uniRouterV2}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "addLiquidity(address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB, uint liquidity)" args = [ "{weth}", "{testToken}", - "10000000000000000000", - "10000000000000000000000", + "5000000000000000000", + "50000000000000000000000", "100000000000000", - "10000000000000000", + "5000000000000000", "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", "10000000000000" ] @@ -146,34 +179,36 @@ args = [ [spam.tx] kind = "uniswap_v2" +<<<<<<< Updated upstream to = "{uniRouterV2}" from = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" signature = "swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) external returns (uint256[] memory)" +======= +to = "{unicheat}" +from_pool = "pool1" +signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" +>>>>>>> Stashed changes args = [ - "1000000000000000000", - "1000", - '[{weth}, {testToken}]', - "0x70997970C51812dc3A010C7d01b50e0d17dc79C8", - "10000000000000" # TODO: implement block-aware variables for dynamic values like `deadline`. For now, this is just so far in the future I won't be alive to hear about it reverting. + "{weth}", + "{testToken}", + "10000000000000000" ] -fuzz = [{param = "amountIn", min = "1", max = "100000000000000000"}] [[spam]] [spam.tx] kind = "uniswap_v2" +<<<<<<< Updated upstream to = "{uniRouterV2}" from = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" signature = "swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) external returns (uint256[] memory)" +======= +to = "{unicheat}" +from_pool = "pool2" +signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" +>>>>>>> Stashed changes args = [ - "1000000000000000000", - "1000", - '[{weth}, {testToken}]', - "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", - "10000000000000" -] - -[[spam.tx.fuzz]] -param = "amountIn" -min = "100000" -max = "10000000000" + "{testToken}", + "{weth}", + "1000000000000000000" +] \ No newline at end of file From a795fbe7e3496a1f08548381a7ecf0b98b998a65 Mon Sep 17 00:00:00 2001 From: Brock Smedley <2791467+zeroXbrock@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:27:47 -0800 Subject: [PATCH 2/5] fix broken commit --- scenarios/univ2ConfigTest.toml | 69 ---------------------------------- 1 file changed, 69 deletions(-) diff --git a/scenarios/univ2ConfigTest.toml b/scenarios/univ2ConfigTest.toml index f1a4364..7bd2a72 100644 --- a/scenarios/univ2ConfigTest.toml +++ b/scenarios/univ2ConfigTest.toml @@ -41,27 +41,11 @@ bytecode = "0x608060405234801561001057600080fd5b506040516104d13803806104d1833981 [[setup]] to = "{weth}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" -<<<<<<< Updated upstream -signature = "function deposit() public payable" -value = "10000000000000000000" - -[[setup]] -to = "{weth}" -from = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" -signature = "function deposit() public payable" -value = "10000000000000000000" - -[[setup]] -to = "{weth}" -from = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" -======= ->>>>>>> Stashed changes signature = "function deposit() public payable" value = "10000000000000000000" ## uniV2 pair: weth/token ###################################################### - [[setup]] to = "{uniV2Factory}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" @@ -114,47 +98,6 @@ args = [ "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] -<<<<<<< Updated upstream -# contender1 -[[setup]] -to = "{weth}" -from = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" -signature = "approve(address spender, uint256 amount) returns (bool)" -args = [ - "{uniRouterV2}", - "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" -] - -[[setup]] -to = "{testToken}" -from = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" -signature = "approve(address spender, uint256 amount) returns (bool)" -args = [ - "{uniRouterV2}", - "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" -] - -# contender2 -[[setup]] -to = "{weth}" -from = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" -signature = "approve(address spender, uint256 amount) returns (bool)" -args = [ - "{uniRouterV2}", - "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" -] - -[[setup]] -to = "{testToken}" -from = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" -signature = "approve(address spender, uint256 amount) returns (bool)" -args = [ - "{uniRouterV2}", - "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" -] - -======= ->>>>>>> Stashed changes ## add liquidity ############################################################### [[setup]] @@ -179,15 +122,9 @@ args = [ [spam.tx] kind = "uniswap_v2" -<<<<<<< Updated upstream -to = "{uniRouterV2}" -from = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" -signature = "swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) external returns (uint256[] memory)" -======= to = "{unicheat}" from_pool = "pool1" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" ->>>>>>> Stashed changes args = [ "{weth}", "{testToken}", @@ -198,15 +135,9 @@ args = [ [spam.tx] kind = "uniswap_v2" -<<<<<<< Updated upstream -to = "{uniRouterV2}" -from = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" -signature = "swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) external returns (uint256[] memory)" -======= to = "{unicheat}" from_pool = "pool2" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" ->>>>>>> Stashed changes args = [ "{testToken}", "{weth}", From 295c47b0cd670010c4e00b1110a1e46db3545a2b Mon Sep 17 00:00:00 2001 From: Brock Smedley <2791467+zeroXbrock@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:39:30 -0800 Subject: [PATCH 3/5] label all setup steps --- scenarios/univ2ConfigTest.toml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scenarios/univ2ConfigTest.toml b/scenarios/univ2ConfigTest.toml index 7bd2a72..12c3491 100644 --- a/scenarios/univ2ConfigTest.toml +++ b/scenarios/univ2ConfigTest.toml @@ -39,6 +39,7 @@ bytecode = "0x608060405234801561001057600080fd5b506040516104d13803806104d1833981 ## weth deposits ############################################################### [[setup]] +kind = "admin_weth_deposit" to = "{weth}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function deposit() public payable" @@ -47,6 +48,7 @@ value = "10000000000000000000" ## uniV2 pair: weth/token ###################################################### [[setup]] +kind = "univ2_create_pair" to = "{uniV2Factory}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function createPair(address tokenA, address tokenB) external returns (address pair)" @@ -81,6 +83,7 @@ args = [ #admin [[setup]] +kind = "admin_approve_router_weth" to = "{weth}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "approve(address spender, uint256 amount) returns (bool)" @@ -90,6 +93,7 @@ args = [ ] [[setup]] +kind = "admin_approve_router_testToken" to = "{testToken}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "approve(address spender, uint256 amount) returns (bool)" @@ -101,7 +105,7 @@ args = [ ## add liquidity ############################################################### [[setup]] -kind = "univ2_add_liquidity" +kind = "admin_univ2_add_liquidity" to = "{uniRouterV2}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "addLiquidity(address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB, uint liquidity)" @@ -142,4 +146,4 @@ args = [ "{testToken}", "{weth}", "1000000000000000000" -] \ No newline at end of file +] From a191db882624aed2f33eef985fb75bd8c405beca Mon Sep 17 00:00:00 2001 From: Brock Smedley <2791467+zeroXbrock@users.noreply.github.com> Date: Mon, 16 Dec 2024 00:32:55 -0800 Subject: [PATCH 4/5] add another token to uniV2 scenario --- scenarios/univ2ConfigTest.toml | 142 +++++++++++++++++++++++++++++++-- 1 file changed, 137 insertions(+), 5 deletions(-) diff --git a/scenarios/univ2ConfigTest.toml b/scenarios/univ2ConfigTest.toml index 12c3491..eb8af58 100644 --- a/scenarios/univ2ConfigTest.toml +++ b/scenarios/univ2ConfigTest.toml @@ -17,6 +17,12 @@ name = "testToken" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" bytecode = "0x60806040523480156200001157600080fd5b5060405162000b0938038062000b09833981016040819052620000349162000223565b604051806040016040528060098152602001682a32b9ba2a37b5b2b760b91b815250604051806040016040528060038152602001622a25a760e91b8152508160039081620000839190620002e4565b506004620000928282620002e4565b505050620000a73382620000ae60201b60201c565b50620003d8565b6001600160a01b038216620000de5760405163ec442f0560e01b8152600060048201526024015b60405180910390fd5b620000ec60008383620000f0565b5050565b6001600160a01b0383166200011f578060026000828254620001139190620003b0565b90915550620001939050565b6001600160a01b03831660009081526020819052604090205481811015620001745760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000d5565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b038216620001b157600280548290039055620001d0565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200021691815260200190565b60405180910390a3505050565b6000602082840312156200023657600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200026857607f821691505b6020821081036200028957634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002df576000816000526020600020601f850160051c81016020861015620002ba5750805b601f850160051c820191505b81811015620002db57828155600101620002c6565b5050505b505050565b81516001600160401b038111156200030057620003006200023d565b620003188162000311845462000253565b846200028f565b602080601f831160018114620003505760008415620003375750858301515b600019600386901b1c1916600185901b178555620002db565b600085815260208120601f198616915b82811015620003815788860151825594840194600190910190840162000360565b5085821015620003a05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003d257634e487b7160e01b600052601160045260246000fd5b92915050565b61072180620003e86000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce567146100fe57806370a082311461010d57806395d89b4114610136578063a9059cbb1461013e578063dd62ed3e1461015157600080fd5b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100d957806323b872dd146100eb575b600080fd5b6100a061018a565b6040516100ad919061056a565b60405180910390f35b6100c96100c43660046105d5565b61021c565b60405190151581526020016100ad565b6002545b6040519081526020016100ad565b6100c96100f93660046105ff565b610236565b604051601281526020016100ad565b6100dd61011b36600461063b565b6001600160a01b031660009081526020819052604090205490565b6100a061025a565b6100c961014c3660046105d5565b610269565b6100dd61015f36600461065d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461019990610690565b80601f01602080910402602001604051908101604052809291908181526020018280546101c590610690565b80156102125780601f106101e757610100808354040283529160200191610212565b820191906000526020600020905b8154815290600101906020018083116101f557829003601f168201915b5050505050905090565b60003361022a818585610277565b60019150505b92915050565b600033610244858285610289565b61024f85858561030c565b506001949350505050565b60606004805461019990610690565b60003361022a81858561030c565b610284838383600161036b565b505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461030657818110156102f757604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b6103068484848403600061036b565b50505050565b6001600160a01b03831661033657604051634b637e8f60e11b8152600060048201526024016102ee565b6001600160a01b0382166103605760405163ec442f0560e01b8152600060048201526024016102ee565b610284838383610440565b6001600160a01b0384166103955760405163e602df0560e01b8152600060048201526024016102ee565b6001600160a01b0383166103bf57604051634a1406b160e11b8152600060048201526024016102ee565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561030657826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161043291815260200190565b60405180910390a350505050565b6001600160a01b03831661046b57806002600082825461046091906106ca565b909155506104dd9050565b6001600160a01b038316600090815260208190526040902054818110156104be5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016102ee565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166104f957600280548290039055610518565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161055d91815260200190565b60405180910390a3505050565b60006020808352835180602085015260005b818110156105985785810183015185820160400152820161057c565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146105d057600080fd5b919050565b600080604083850312156105e857600080fd5b6105f1836105b9565b946020939093013593505050565b60008060006060848603121561061457600080fd5b61061d846105b9565b925061062b602085016105b9565b9150604084013590509250925092565b60006020828403121561064d57600080fd5b610656826105b9565b9392505050565b6000806040838503121561067057600080fd5b610679836105b9565b9150610687602084016105b9565b90509250929050565b600181811c908216806106a457607f821691505b6020821081036106c457634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561023057634e487b7160e01b600052601160045260246000fdfea2646970667358221220a39541e410f65911c43f31309b31f8820573a9b5537c0bb5e14096efb9bff7ba64736f6c63430008170033{initialSupply}" +[[create]] +name = "testToken2" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +bytecode = "0x60806040523480156200001157600080fd5b5060405162000b0938038062000b09833981016040819052620000349162000223565b604051806040016040528060098152602001682a32b9ba2a37b5b2b760b91b815250604051806040016040528060038152602001622a25a760e91b8152508160039081620000839190620002e4565b506004620000928282620002e4565b505050620000a73382620000ae60201b60201c565b50620003d8565b6001600160a01b038216620000de5760405163ec442f0560e01b8152600060048201526024015b60405180910390fd5b620000ec60008383620000f0565b5050565b6001600160a01b0383166200011f578060026000828254620001139190620003b0565b90915550620001939050565b6001600160a01b03831660009081526020819052604090205481811015620001745760405163391434e360e21b81526001600160a01b03851660048201526024810182905260448101839052606401620000d5565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b038216620001b157600280548290039055620001d0565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200021691815260200190565b60405180910390a3505050565b6000602082840312156200023657600080fd5b5051919050565b634e487b7160e01b600052604160045260246000fd5b600181811c908216806200026857607f821691505b6020821081036200028957634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620002df576000816000526020600020601f850160051c81016020861015620002ba5750805b601f850160051c820191505b81811015620002db57828155600101620002c6565b5050505b505050565b81516001600160401b038111156200030057620003006200023d565b620003188162000311845462000253565b846200028f565b602080601f831160018114620003505760008415620003375750858301515b600019600386901b1c1916600185901b178555620002db565b600085815260208120601f198616915b82811015620003815788860151825594840194600190910190840162000360565b5085821015620003a05787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b80820180821115620003d257634e487b7160e01b600052601160045260246000fd5b92915050565b61072180620003e86000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce567146100fe57806370a082311461010d57806395d89b4114610136578063a9059cbb1461013e578063dd62ed3e1461015157600080fd5b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100d957806323b872dd146100eb575b600080fd5b6100a061018a565b6040516100ad919061056a565b60405180910390f35b6100c96100c43660046105d5565b61021c565b60405190151581526020016100ad565b6002545b6040519081526020016100ad565b6100c96100f93660046105ff565b610236565b604051601281526020016100ad565b6100dd61011b36600461063b565b6001600160a01b031660009081526020819052604090205490565b6100a061025a565b6100c961014c3660046105d5565b610269565b6100dd61015f36600461065d565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b60606003805461019990610690565b80601f01602080910402602001604051908101604052809291908181526020018280546101c590610690565b80156102125780601f106101e757610100808354040283529160200191610212565b820191906000526020600020905b8154815290600101906020018083116101f557829003601f168201915b5050505050905090565b60003361022a818585610277565b60019150505b92915050565b600033610244858285610289565b61024f85858561030c565b506001949350505050565b60606004805461019990610690565b60003361022a81858561030c565b610284838383600161036b565b505050565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461030657818110156102f757604051637dc7a0d960e11b81526001600160a01b038416600482015260248101829052604481018390526064015b60405180910390fd5b6103068484848403600061036b565b50505050565b6001600160a01b03831661033657604051634b637e8f60e11b8152600060048201526024016102ee565b6001600160a01b0382166103605760405163ec442f0560e01b8152600060048201526024016102ee565b610284838383610440565b6001600160a01b0384166103955760405163e602df0560e01b8152600060048201526024016102ee565b6001600160a01b0383166103bf57604051634a1406b160e11b8152600060048201526024016102ee565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561030657826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161043291815260200190565b60405180910390a350505050565b6001600160a01b03831661046b57806002600082825461046091906106ca565b909155506104dd9050565b6001600160a01b038316600090815260208190526040902054818110156104be5760405163391434e360e21b81526001600160a01b038516600482015260248101829052604481018390526064016102ee565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b0382166104f957600280548290039055610518565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161055d91815260200190565b60405180910390a3505050565b60006020808352835180602085015260005b818110156105985785810183015185820160400152820161057c565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b03811681146105d057600080fd5b919050565b600080604083850312156105e857600080fd5b6105f1836105b9565b946020939093013593505050565b60008060006060848603121561061457600080fd5b61061d846105b9565b925061062b602085016105b9565b9150604084013590509250925092565b60006020828403121561064d57600080fd5b610656826105b9565b9392505050565b6000806040838503121561067057600080fd5b610679836105b9565b9150610687602084016105b9565b90509250929050565b600181811c908216806106a457607f821691505b6020821081036106c457634e487b7160e01b600052602260045260246000fd5b50919050565b8082018082111561023057634e487b7160e01b600052601160045260246000fdfea2646970667358221220a39541e410f65911c43f31309b31f8820573a9b5537c0bb5e14096efb9bff7ba64736f6c63430008170033{initialSupply}" + + [[create]] # requires {feeToSetter} name = "uniV2Factory" @@ -48,7 +54,7 @@ value = "10000000000000000000" ## uniV2 pair: weth/token ###################################################### [[setup]] -kind = "univ2_create_pair" +kind = "univ2_create_pair_token1-weth" to = "{uniV2Factory}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function createPair(address tokenA, address tokenB) external returns (address pair)" @@ -57,6 +63,26 @@ args = [ "{testToken}" ] +[[setup]] +kind = "univ2_create_pair_token2-weth" +to = "{uniV2Factory}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "function createPair(address tokenA, address tokenB) external returns (address pair)" +args = [ + "{weth}", + "{testToken2}" +] + +[[setup]] +kind = "univ2_create_pair_token1-token2" +to = "{uniV2Factory}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "function createPair(address tokenA, address tokenB) external returns (address pair)" +args = [ + "{testToken}", + "{testToken2}" +] + ## transfer funds to Unicheat ################################################## [[setup]] @@ -79,6 +105,17 @@ args = [ "500000000000000000000000" ] +[[setup]] +kind = "testToken2_fund_unicheat" +to = "{testToken2}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "function transfer(address recipient, uint256 amount) external returns (bool)" +args = [ + "{unicheat}", + "500000000000000000000000" +] + + ## token approvals ############################################################# #admin @@ -102,17 +139,43 @@ args = [ "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ] +[[setup]] +kind = "admin_approve_router_testToken2" +to = "{testToken2}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "approve(address spender, uint256 amount) returns (bool)" +args = [ + "{uniRouterV2}", + "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" +] + ## add liquidity ############################################################### [[setup]] -kind = "admin_univ2_add_liquidity" +kind = "admin_univ2_add_liquidity_weth-testToken" to = "{uniRouterV2}" from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "addLiquidity(address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB, uint liquidity)" args = [ "{weth}", "{testToken}", - "5000000000000000000", + "2500000000000000000", + "50000000000000000000000", + "100000000000000", + "5000000000000000", + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "10000000000000" +] + +[[setup]] +kind = "admin_univ2_add_liquidity_weth-testToken2" +to = "{uniRouterV2}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "addLiquidity(address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB, uint liquidity)" +args = [ + "{weth}", + "{testToken2}", + "2500000000000000000", "50000000000000000000000", "100000000000000", "5000000000000000", @@ -120,12 +183,29 @@ args = [ "10000000000000" ] +[[setup]] +kind = "admin_univ2_add_liquidity_testToken-testToken2" +to = "{uniRouterV2}" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" +signature = "addLiquidity(address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB, uint liquidity)" +args = [ + "{testToken}", + "{testToken2}", + "50000000000000000000000", + "50000000000000000000000", + "5000000000000000", + "5000000000000000", + "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", + "10000000000000" +] + + ### SPAM [[spam]] [spam.tx] -kind = "uniswap_v2" +kind = "uniswap_v2_swap_weth-testToken" to = "{unicheat}" from_pool = "pool1" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" @@ -138,7 +218,7 @@ args = [ [[spam]] [spam.tx] -kind = "uniswap_v2" +kind = "uniswap_v2_swap_testToken-weth" to = "{unicheat}" from_pool = "pool2" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" @@ -147,3 +227,55 @@ args = [ "{weth}", "1000000000000000000" ] + +[[spam]] + +[spam.tx] +kind = "uniswap_v2_swap_weth-testToken2" +to = "{unicheat}" +from_pool = "pool3" +signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" +args = [ + "{weth}", + "{testToken2}", + "10000000000000000" +] + +[[spam]] + +[spam.tx] +kind = "uniswap_v2_swap_testToken2-weth" +to = "{unicheat}" +from_pool = "pool4" +signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" +args = [ + "{testToken2}", + "{weth}", + "1000000000000000000" +] + +[[spam]] + +[spam.tx] +kind = "uniswap_v2_swap_testToken-testToken2" +to = "{unicheat}" +from_pool = "pool5" +signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" +args = [ + "{testToken}", + "{testToken2}", + "1000000000000000000" +] + +[[spam]] + +[spam.tx] +kind = "uniswap_v2_swap_testToken2-testToken" +to = "{unicheat}" +from_pool = "pool6" +signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" +args = [ + "{testToken2}", + "{testToken}", + "1000000000000000000" +] From a8f7470c4e1a48062ca935291436df1c37b44ace Mon Sep 17 00:00:00 2001 From: zeroXbrock <2791467+zeroXbrock@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:28:30 -0800 Subject: [PATCH 5/5] don't use from_pool in setup (tokens auto-mint to sender) - need to enable from_pool in [[create]] steps too before this will work --- scenarios/univ2ConfigTest.toml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scenarios/univ2ConfigTest.toml b/scenarios/univ2ConfigTest.toml index eb8af58..afe41a1 100644 --- a/scenarios/univ2ConfigTest.toml +++ b/scenarios/univ2ConfigTest.toml @@ -42,6 +42,8 @@ bytecode = "0x608060405234801561001057600080fd5b506040516104d13803806104d1833981 ### setup contracts +# TODO: enable from_pool for [[create]] steps too + ## weth deposits ############################################################### [[setup]] @@ -207,7 +209,7 @@ args = [ [spam.tx] kind = "uniswap_v2_swap_weth-testToken" to = "{unicheat}" -from_pool = "pool1" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" args = [ "{weth}", @@ -220,7 +222,7 @@ args = [ [spam.tx] kind = "uniswap_v2_swap_testToken-weth" to = "{unicheat}" -from_pool = "pool2" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" args = [ "{testToken}", @@ -233,7 +235,7 @@ args = [ [spam.tx] kind = "uniswap_v2_swap_weth-testToken2" to = "{unicheat}" -from_pool = "pool3" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" args = [ "{weth}", @@ -246,7 +248,7 @@ args = [ [spam.tx] kind = "uniswap_v2_swap_testToken2-weth" to = "{unicheat}" -from_pool = "pool4" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" args = [ "{testToken2}", @@ -259,7 +261,7 @@ args = [ [spam.tx] kind = "uniswap_v2_swap_testToken-testToken2" to = "{unicheat}" -from_pool = "pool5" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" args = [ "{testToken}", @@ -272,7 +274,7 @@ args = [ [spam.tx] kind = "uniswap_v2_swap_testToken2-testToken" to = "{unicheat}" -from_pool = "pool6" +from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" signature = "function swap(address tokenIn, address tokenOut, uint256 amountIn) public" args = [ "{testToken2}",