From 30b98e09d0486cd5cc3e4360e3277eb7cb60d2d5 Mon Sep 17 00:00:00 2001 From: Zach Yang Date: Tue, 16 Jul 2024 07:26:29 -0700 Subject: [PATCH] feat(uniswapx-sdk): PriorityOrder type and builder (#55) Co-authored-by: Eric Zhong --- .../abis/PriorityOrderReactor.json | 1 + .../src/builder/PriorityOrderBuilder.test.ts | 235 +++++++ .../src/builder/PriorityOrderBuilder.ts | 267 ++++++++ sdks/uniswapx-sdk/src/builder/index.ts | 1 + sdks/uniswapx-sdk/src/constants.test.ts | 7 + sdks/uniswapx-sdk/src/constants.ts | 20 +- .../src/contracts/PriorityOrderReactor.ts | 426 +++++++++++++ .../PriorityOrderReactor__factory.ts | 426 +++++++++++++ .../src/contracts/factories/index.ts | 1 + sdks/uniswapx-sdk/src/contracts/index.ts | 2 + .../src/order/PriorityOrder.test.ts | 114 ++++ sdks/uniswapx-sdk/src/order/PriorityOrder.ts | 602 ++++++++++++++++++ sdks/uniswapx-sdk/src/order/index.ts | 6 +- sdks/uniswapx-sdk/src/order/types.ts | 27 + 14 files changed, 2130 insertions(+), 5 deletions(-) create mode 100644 sdks/uniswapx-sdk/abis/PriorityOrderReactor.json create mode 100644 sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.test.ts create mode 100644 sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.ts create mode 100644 sdks/uniswapx-sdk/src/contracts/PriorityOrderReactor.ts create mode 100644 sdks/uniswapx-sdk/src/contracts/factories/PriorityOrderReactor__factory.ts create mode 100644 sdks/uniswapx-sdk/src/order/PriorityOrder.test.ts create mode 100644 sdks/uniswapx-sdk/src/order/PriorityOrder.ts diff --git a/sdks/uniswapx-sdk/abis/PriorityOrderReactor.json b/sdks/uniswapx-sdk/abis/PriorityOrderReactor.json new file mode 100644 index 000000000..523e69ffc --- /dev/null +++ b/sdks/uniswapx-sdk/abis/PriorityOrderReactor.json @@ -0,0 +1 @@ +{"abi":[{"type":"constructor","inputs":[{"name":"_permit2","type":"address","internalType":"contract IPermit2"},{"name":"_protocolFeeOwner","type":"address","internalType":"address"}],"stateMutability":"nonpayable"},{"type":"receive","stateMutability":"payable"},{"type":"function","name":"execute","inputs":[{"name":"order","type":"tuple","internalType":"struct SignedOrder","components":[{"name":"order","type":"bytes","internalType":"bytes"},{"name":"sig","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"executeBatch","inputs":[{"name":"orders","type":"tuple[]","internalType":"struct SignedOrder[]","components":[{"name":"order","type":"bytes","internalType":"bytes"},{"name":"sig","type":"bytes","internalType":"bytes"}]}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"executeBatchWithCallback","inputs":[{"name":"orders","type":"tuple[]","internalType":"struct SignedOrder[]","components":[{"name":"order","type":"bytes","internalType":"bytes"},{"name":"sig","type":"bytes","internalType":"bytes"}]},{"name":"callbackData","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"executeWithCallback","inputs":[{"name":"order","type":"tuple","internalType":"struct SignedOrder","components":[{"name":"order","type":"bytes","internalType":"bytes"},{"name":"sig","type":"bytes","internalType":"bytes"}]},{"name":"callbackData","type":"bytes","internalType":"bytes"}],"outputs":[],"stateMutability":"payable"},{"type":"function","name":"feeController","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IProtocolFeeController"}],"stateMutability":"view"},{"type":"function","name":"owner","inputs":[],"outputs":[{"name":"","type":"address","internalType":"address"}],"stateMutability":"view"},{"type":"function","name":"permit2","inputs":[],"outputs":[{"name":"","type":"address","internalType":"contract IPermit2"}],"stateMutability":"view"},{"type":"function","name":"setProtocolFeeController","inputs":[{"name":"_newFeeController","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"function","name":"transferOwnership","inputs":[{"name":"newOwner","type":"address","internalType":"address"}],"outputs":[],"stateMutability":"nonpayable"},{"type":"event","name":"Fill","inputs":[{"name":"orderHash","type":"bytes32","indexed":true,"internalType":"bytes32"},{"name":"filler","type":"address","indexed":true,"internalType":"address"},{"name":"swapper","type":"address","indexed":true,"internalType":"address"},{"name":"nonce","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"name":"user","type":"address","indexed":true,"internalType":"address"},{"name":"newOwner","type":"address","indexed":true,"internalType":"address"}],"anonymous":false},{"type":"event","name":"ProtocolFeeControllerSet","inputs":[{"name":"oldFeeController","type":"address","indexed":false,"internalType":"address"},{"name":"newFeeController","type":"address","indexed":false,"internalType":"address"}],"anonymous":false},{"type":"error","name":"DuplicateFeeOutput","inputs":[{"name":"duplicateToken","type":"address","internalType":"address"}]},{"type":"error","name":"FeeTooLarge","inputs":[{"name":"token","type":"address","internalType":"address"},{"name":"amount","type":"uint256","internalType":"uint256"},{"name":"recipient","type":"address","internalType":"address"}]},{"type":"error","name":"InputAndOutputFees","inputs":[]},{"type":"error","name":"InputOutputScaling","inputs":[]},{"type":"error","name":"InvalidCosignature","inputs":[]},{"type":"error","name":"InvalidDeadline","inputs":[]},{"type":"error","name":"InvalidFeeToken","inputs":[{"name":"feeToken","type":"address","internalType":"address"}]},{"type":"error","name":"InvalidGasPrice","inputs":[]},{"type":"error","name":"InvalidReactor","inputs":[]},{"type":"error","name":"NativeTransferFailed","inputs":[]},{"type":"error","name":"OrderNotFillable","inputs":[]}],"bytecode":{"object":"0x60a06040523480156200001157600080fd5b50604051620031b7380380620031b78339810160408190526200003491620000b8565b600080546001600160a01b0319166001600160a01b03831690811782556040518492849283928392907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350506001600255506001600160a01b031660805250620000f79050565b6001600160a01b0381168114620000b557600080fd5b50565b60008060408385031215620000cc57600080fd5b8251620000d9816200009f565b6020840151909250620000ec816200009f565b809150509250929050565b60805161309e620001196000396000818160e00152611919015261309e6000f3fe60806040526004361061009a5760003560e01c80632d771389116100695780636999b3771161004e5780636999b377146101715780638da5cb5b1461019e578063f2fde38b146101cb57600080fd5b80632d7713891461013e5780633f62192e1461015e57600080fd5b80630d335884146100a65780630d7a16c3146100bb57806312261ee7146100ce57806313fb72c71461012b57600080fd5b366100a157005b600080fd5b6100b96100b43660046120dc565b6101eb565b005b6100b96100c936600461218a565b610364565b3480156100da57600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b96101393660046121cc565b6104c5565b34801561014a57600080fd5b506100b9610159366004612265565b610683565b6100b961016c366004612289565b61078f565b34801561017d57600080fd5b506001546101029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101aa57600080fd5b506000546101029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101d757600080fd5b506100b96101e6366004612265565b610894565b6101f3610985565b604080516001808252818301909252600091816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161020a5790505090506102b2846109f6565b816000815181106102c5576102c56122f5565b60200260200101819052506102d981610b5e565b6040517f585da628000000000000000000000000000000000000000000000000000000008152339063585da62890610319908490879087906004016124f8565b600060405180830381600087803b15801561033357600080fd5b505af1158015610347573d6000803e3d6000fd5b5050505061035481610baf565b5061035f6001600255565b505050565b61036c610985565b8060008167ffffffffffffffff811115610388576103886122c6565b60405190808252806020026020018201604052801561044357816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816103a65790505b50905060005b828110156104a25761047d858583818110610466576104666122f5565b905060200281019061047891906125be565b6109f6565b82828151811061048f5761048f6122f5565b6020908102919091010152600101610449565b506104ac81610b5e565b6104b581610baf565b50506104c16001600255565b5050565b6104cd610985565b8260008167ffffffffffffffff8111156104e9576104e96122c6565b6040519080825280602002602001820160405280156105a457816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816105075790505b50905060005b828110156105ec576105c7878783818110610466576104666122f5565b8282815181106105d9576105d96122f5565b60209081029190910101526001016105aa565b506105f681610b5e565b6040517f585da628000000000000000000000000000000000000000000000000000000008152339063585da62890610636908490889088906004016124f8565b600060405180830381600087803b15801561065057600080fd5b505af1158015610664573d6000803e3d6000fd5b5050505061067181610baf565b505061067d6001600255565b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527fb904ae9529e373e48bc82df4326cceaf1b4c472babf37f5b7dec46fecc6b53e0910160405180910390a15050565b610797610985565b604080516001808252818301909252600091816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816107ae579050509050610856826109f6565b81600081518110610869576108696122f5565b602002602001018190525061087d81610b5e565b61088681610baf565b506108916001600255565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610700565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60028054036109f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610700565b60028055565b6040805161016081018252600060a0820181815260c0830182905260e083018290526101008301829052610120830182905260606101408401819052908352835180820185528281526020808201849052818601849052840152928201839052828201929092526080810182905290610a6f83806125fc565b810190610a7c91906129c8565b90506000610a8982610d02565b90508160400151431015610aa157610aa18183610e15565b610aaa82610ffe565b6000610ab983606001516110fd565b90506040518060a0016040528084600001518152602001610ae783866080015161115290919063ffffffff16565b8152602001610b03838660a0015161124990919063ffffffff16565b8152602001868060200190610b1891906125fc565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200192909252509392505050565b805160005b8181101561035f576000838281518110610b7f57610b7f6122f5565b60200260200101519050610b928161132e565b610b9c813361181e565b610ba68133611917565b50600101610b63565b805160005b81811015610cf1576000838281518110610bd057610bd06122f5565b602002602001015190506000816040015151905060005b81811015610c5157600083604001518281518110610c0757610c076122f5565b60200260200101519050610c4881604001518260200151836000015173ffffffffffffffffffffffffffffffffffffffff16611b709092919063ffffffff16565b50600101610be7565b5081600001516020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16868581518110610c9a57610c9a6122f5565b6020026020010151608001517f78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66856000015160400151604051610cdf91815260200190565b60405180910390a45050600101610bb4565b5047156104c1576104c13347611bb7565b60006040518060c00160405280608d8152602001612f81608d9139604051806080016040528060488152602001612f0b604891396040518060800160405280605b815260200161300e605b9139604051602001610d6193929190612ac9565b60405160208183030381529060405280519060200120610d848360000151611c51565b836020015184604001518560600151610da08760800151611ceb565b610dad8860a00151611d52565b60408051602081019890985287019590955273ffffffffffffffffffffffffffffffffffffffff9093166060860152608085019190915260a084015260c083015260e0820152610100015b604051602081830303815290604052805190602001209050919050565b60c081015151600003610e26575050565b604081015160c0820151511015610e435760c08101515160408201525b6000808260e00151806020019051810190610e5e9190612c1f565b9150915060008360e00151604081518110610e7b57610e7b6122f5565b602001015160f81c60f81b60f81c905060006001868660c00151604051602001610ea89151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610ee49291602001612c43565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600084529083018083525260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015610f60573d6000803e3d6000fd5b5050506020604051035190508073ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff16141580610fbf575073ffffffffffffffffffffffffffffffffffffffff8116155b15610ff6576040517fd7815be100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050565b80516060015142111561103d576040517f769d11e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b438160400151111561107b576040517fc603552000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b608081015160400151156108915760005b8160a00151518110156104c15760008260a0015182815181106110b1576110b16122f5565b60200260200101516040015111156110f5576040517fa6b844f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60010161108c565b6000483a1015611139576040517ff3eb44e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50483a0381811115611149570390565b5060005b919050565b61118c6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b600083604001518361119e9190612c98565b90506298968081106111ec576040518060600160405280856000015173ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018560200151815250915050611243565b6040805160608101909152845173ffffffffffffffffffffffffffffffffffffffff168152602081016112346112258462989680612caf565b60208801519062989680611df0565b81526020868101519101529150505b92915050565b81516060908067ffffffffffffffff811115611267576112676122c6565b6040519080825280602002602001820160405280156112d057816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816112855790505b50915060005b81811015611326576113018582815181106112f3576112f36122f5565b602002602001015185611e2c565b838281518110611313576113136122f5565b60209081029190910101526001016112d6565b505092915050565b60015473ffffffffffffffffffffffffffffffffffffffff1661134e5750565b6001546040517f8aa6cf0300000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff1690638aa6cf03906113a5908590600401612cc2565b600060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526114089190810190612cd5565b60408301515181519192509060006114208284612da5565b67ffffffffffffffff811115611438576114386122c6565b6040519080825280602002602001820160405280156114a157816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816114565790505b50905060005b838110156114f257856040015181815181106114c5576114c56122f5565b60200260200101518282815181106114df576114df6122f5565b60209081029190910101526001016114a7565b5060008060005b8481101561180d576000878281518110611515576115156122f5565b6020026020010151905060005b828110156115d35788818151811061153c5761153c6122f5565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff16036115cb5781516040517ffff0830300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610700565b600101611522565b506000805b888110156116945760008b6040015182815181106115f8576115f86122f5565b60200260200101519050836000015173ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff160361168b578515611675576040517fedc7e2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516116849084612da5565b9250600196505b506001016115d8565b50815160208b01515173ffffffffffffffffffffffffffffffffffffffff91821691160361170d5784156116f4576040517fedc7e2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808b015101516117069082612da5565b9050600193505b806000036117625781516040517feddf07f500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610700565b611770816005612710611df0565b826020015111156117e3578151602083015160408085015190517f82e7565600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201526024810192909252919091166044820152606401610700565b8186848a01815181106117f8576117f86122f5565b602090810291909101015250506001016114f9565b505050604090940193909352505050565b81515173ffffffffffffffffffffffffffffffffffffffff16301461186f576040517f4ddf4a6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516080015173ffffffffffffffffffffffffffffffffffffffff16156104c1578151608001516040517f6e84ba2b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636e84ba2b906118eb9084908690600401612db8565b60006040518083038186803b15801561190357600080fd5b505afa158015610ff6573d6000803e3d6000fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663137c29fe6119d7846040805160a0810182526000606082018181526080830182905282526020820181905291810191909152506040805160a081018252602080840180515173ffffffffffffffffffffffffffffffffffffffff1660608085019182529151850151608085015283528451840151918301919091529251909201519082015290565b6040805180820182526000808252602091820152815180830190925273ffffffffffffffffffffffffffffffffffffffff86168252808701518101519082015285600001516020015186608001516040518060c00160405280608d8152602001612f81608d9139604051806080016040528060488152602001612f0b604891396040518060800160405280605b815260200161300e605b9139604051602001611a8293929190612ac9565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815260608301909152602e808352909190612f536020830139604051602001611ad5929190612de7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905260608a01517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b168352611b429695949392600401612e42565b600060405180830381600087803b158015611b5c57600080fd5b505af1158015610ff6573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff8316611b955761035f8282611bb7565b61035f73ffffffffffffffffffffffffffffffffffffffff8416338484611ece565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611c11576040519150601f19603f3d011682016040523d82523d6000602084013e611c16565b606091505b505090508061035f576040517ff4b3b1bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040518060c00160405280608d8152602001612f81608d913980516020918201208351848301516040808701516060880151608089015160a08a01518051908901209351610df898939492939192910196875273ffffffffffffffffffffffffffffffffffffffff958616602088015293851660408701526060860192909252608085015290911660a083015260c082015260e00190565b6000604051806080016040528060488152602001612f0b6048913980516020918201208351848301516040808701519051610df8950193845273ffffffffffffffffffffffffffffffffffffffff9290921660208401526040830152606082015260800190565b600080825160200267ffffffffffffffff811115611d7257611d726122c6565b6040519080825280601f01601f191660200182016040528015611d9c576020820181803683370190505b50905060005b8351811015611de1576000611dcf858381518110611dc257611dc26122f5565b6020026020010151611fc0565b60208381028501015250600101611da2565b50805160209091012092915050565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0484118302158202611e2557600080fd5b5091020490565b60408051606081018252600080825260208201819052918101919091526040518060600160405280846000015173ffffffffffffffffffffffffffffffffffffffff168152602001611ea3856040015185611e879190612c98565b611e949062989680612da5565b60208701519062989680612037565b8152602001846060015173ffffffffffffffffffffffffffffffffffffffff16815250905092915050565b60006040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015273ffffffffffffffffffffffffffffffffffffffff841660248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080611fb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610700565b5050505050565b60006040518060800160405280605b815260200161300e605b9139805160209182012083518483015160408087015160608801519151610df8969192910194855273ffffffffffffffffffffffffffffffffffffffff93841660208601526040850192909252606084015216608082015260a00190565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261206c57600080fd5b50910281810615159190040190565b60006040828403121561208d57600080fd5b50919050565b60008083601f8401126120a557600080fd5b50813567ffffffffffffffff8111156120bd57600080fd5b6020830191508360208285010111156120d557600080fd5b9250929050565b6000806000604084860312156120f157600080fd5b833567ffffffffffffffff8082111561210957600080fd5b6121158783880161207b565b9450602086013591508082111561212b57600080fd5b5061213886828701612093565b9497909650939450505050565b60008083601f84011261215757600080fd5b50813567ffffffffffffffff81111561216f57600080fd5b6020830191508360208260051b85010111156120d557600080fd5b6000806020838503121561219d57600080fd5b823567ffffffffffffffff8111156121b457600080fd5b6121c085828601612145565b90969095509350505050565b600080600080604085870312156121e257600080fd5b843567ffffffffffffffff808211156121fa57600080fd5b61220688838901612145565b9096509450602087013591508082111561221f57600080fd5b5061222c87828801612093565b95989497509550505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461089157600080fd5b803561114d81612238565b60006020828403121561227757600080fd5b813561228281612238565b9392505050565b60006020828403121561229b57600080fd5b813567ffffffffffffffff8111156122b257600080fd5b6122be8482850161207b565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b8381101561233f578181015183820152602001612327565b50506000910152565b60008151808452612360816020860160208601612324565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008151808452602080850194506020840160005b838110156123f2578151805173ffffffffffffffffffffffffffffffffffffffff908116895284820151858a01526040918201511690880152606090960195908201906001016123a7565b509495945050505050565b6000815160e0845273ffffffffffffffffffffffffffffffffffffffff8082511660e08601528060208301511661010086015260408201516101208601526060820151610140860152806080830151166101608601525060a0810151905060c06101808501526124716101a0850182612348565b905060208301516124af6020860182805173ffffffffffffffffffffffffffffffffffffffff16825260208082015190830152604090810151910152565b50604083015184820360808601526124c78282612392565b915050606083015184820360a08601526124e18282612348565b915050608083015160c08501528091505092915050565b6000604082016040835280865180835260608501915060608160051b8601019250602080890160005b8381101561256d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa088870301855261255b8683516123fd565b95509382019390820190600101612521565b5050858403818701528684528688828601376000848801820152601f9096017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092019094019695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126125f257600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261263157600080fd5b83018035915067ffffffffffffffff82111561264c57600080fd5b6020019150368190038213156120d557600080fd5b6040516060810167ffffffffffffffff81118282101715612684576126846122c6565b60405290565b6040516080810167ffffffffffffffff81118282101715612684576126846122c6565b604051610100810167ffffffffffffffff81118282101715612684576126846122c6565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612718576127186122c6565b604052919050565b600082601f83011261273157600080fd5b813567ffffffffffffffff81111561274b5761274b6122c6565b61277c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016126d1565b81815284602083860101111561279157600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156127c057600080fd5b60405160c0810167ffffffffffffffff82821081831117156127e4576127e46122c6565b81604052829350843591506127f882612238565b90825260208401359061280a82612238565b81602084015260408501356040840152606085013560608401526080850135915061283482612238565b81608084015260a085013591508082111561284e57600080fd5b5061285b85828601612720565b60a0830152505092915050565b60006060828403121561287a57600080fd5b612882612661565b9050813561288f81612238565b80825250602082013560208201526040820135604082015292915050565b600067ffffffffffffffff8211156128c7576128c76122c6565b5060051b60200190565b600082601f8301126128e257600080fd5b813560206128f76128f2836128ad565b6126d1565b82815260079290921b8401810191818101908684111561291657600080fd5b8286015b8481101561297b57608081890312156129335760008081fd5b61293b61268a565b813561294681612238565b815281850135858201526040808301359082015260608083013561296981612238565b9082015283529183019160800161291a565b509695505050505050565b60006020828403121561299857600080fd5b6040516020810181811067ffffffffffffffff821117156129bb576129bb6122c6565b6040529135825250919050565b6000602082840312156129da57600080fd5b813567ffffffffffffffff808211156129f257600080fd5b908301906101408286031215612a0757600080fd5b612a0f6126ad565b823582811115612a1e57600080fd5b612a2a878286016127ae565b825250612a396020840161225a565b60208201526040830135604082015260608301356060820152612a5f8660808501612868565b608082015260e083013582811115612a7657600080fd5b612a82878286016128d1565b60a083015250612a96866101008501612986565b60c082015261012083013582811115612aae57600080fd5b612aba87828601612720565b60e08301525095945050505050565b7f5072696f726974794f726465722800000000000000000000000000000000000081527f4f72646572496e666f20696e666f2c0000000000000000000000000000000000600e8201527f6164647265737320636f7369676e65722c000000000000000000000000000000601d8201527f75696e743235362061756374696f6e5374617274426c6f636b2c000000000000602e8201527f75696e7432353620626173656c696e655072696f726974794665655765692c0060488201527f5072696f72697479496e70757420696e7075742c00000000000000000000000060678201527f5072696f726974794f75747075745b5d206f7574707574732900000000000000607b82015260008451612be5816094850160208901612324565b845190830190612bfc816094840160208901612324565b8451910190612c12816094840160208801612324565b0160940195945050505050565b60008060408385031215612c3257600080fd5b505080516020909101519092909150565b82815260008251612c5b816020850160208701612324565b919091016020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761124357611243612c69565b8181038181111561124357611243612c69565b60208152600061228260208301846123fd565b60006020808385031215612ce857600080fd5b825167ffffffffffffffff811115612cff57600080fd5b8301601f81018513612d1057600080fd5b8051612d1e6128f2826128ad565b81815260609182028301840191848201919088841115612d3d57600080fd5b938501935b83851015612d995780858a031215612d5a5760008081fd5b612d62612661565b8551612d6d81612238565b81528587015187820152604080870151612d8681612238565b9082015283529384019391850191612d42565b50979650505050505050565b8082018082111561124357611243612c69565b73ffffffffffffffffffffffffffffffffffffffff831681526040602082015260006122be60408301846123fd565b7f5072696f726974794f72646572207769746e6573732900000000000000000000815260008351612e1f816016850160208801612324565b835190830190612e36816016840160208801612324565b01601601949350505050565b6000610140612e72838a51805173ffffffffffffffffffffffffffffffffffffffff168252602090810151910152565b6020890151604084015260408901516060840152612eb36080840189805173ffffffffffffffffffffffffffffffffffffffff168252602090810151910152565b73ffffffffffffffffffffffffffffffffffffffff871660c08401528560e084015280610100840152612ee881840186612348565b9050828103610120840152612efd8185612348565b999850505050505050505056fe5072696f72697479496e707574286164647265737320746f6b656e2c75696e7432353620616d6f756e742c75696e74323536206d70735065725072696f7269747946656557656929546f6b656e5065726d697373696f6e73286164647265737320746f6b656e2c75696e7432353620616d6f756e74294f72646572496e666f28616464726573732072656163746f722c6164647265737320737761707065722c75696e74323536206e6f6e63652c75696e7432353620646561646c696e652c61646472657373206164646974696f6e616c56616c69646174696f6e436f6e74726163742c6279746573206164646974696f6e616c56616c69646174696f6e44617461295072696f726974794f7574707574286164647265737320746f6b656e2c75696e7432353620616d6f756e742c75696e74323536206d70735065725072696f726974794665655765692c6164647265737320726563697069656e7429a26469706673582212200157f640b2a364169513823e9bc04e1403e405f2593efb4a28be4df19b3c545364736f6c63430008180033","sourceMap":"585:4960:73:-:0;;;1345:101;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1045:5:41;:14;;-1:-1:-1;;;;;;1045:14:41;-1:-1:-1;;;;;1045:14:41;;;;;;;1075:40;;1415:8:73;;1045:14:41;;;;;;:5;1075:40;;1045:5;;1075:40;-1:-1:-1;;1716:1:27;1821:7;:22;-1:-1:-1;;;;;;1352:18:69::1;;::::0;-1:-1:-1;585:4960:73;;-1:-1:-1;585:4960:73;14:141:118;-1:-1:-1;;;;;99:31:118;;89:42;;79:70;;145:1;142;135:12;79:70;14:141;:::o;160:423::-;257:6;265;318:2;306:9;297:7;293:23;289:32;286:52;;;334:1;331;324:12;286:52;366:9;360:16;385:41;420:5;385:41;:::i;:::-;495:2;480:18;;474:25;445:5;;-1:-1:-1;508:43:118;474:25;508:43;:::i;:::-;570:7;560:17;;;160:423;;;;;:::o;:::-;585:4960:73;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x60806040526004361061009a5760003560e01c80632d771389116100695780636999b3771161004e5780636999b377146101715780638da5cb5b1461019e578063f2fde38b146101cb57600080fd5b80632d7713891461013e5780633f62192e1461015e57600080fd5b80630d335884146100a65780630d7a16c3146100bb57806312261ee7146100ce57806313fb72c71461012b57600080fd5b366100a157005b600080fd5b6100b96100b43660046120dc565b6101eb565b005b6100b96100c936600461218a565b610364565b3480156100da57600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b96101393660046121cc565b6104c5565b34801561014a57600080fd5b506100b9610159366004612265565b610683565b6100b961016c366004612289565b61078f565b34801561017d57600080fd5b506001546101029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101aa57600080fd5b506000546101029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101d757600080fd5b506100b96101e6366004612265565b610894565b6101f3610985565b604080516001808252818301909252600091816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161020a5790505090506102b2846109f6565b816000815181106102c5576102c56122f5565b60200260200101819052506102d981610b5e565b6040517f585da628000000000000000000000000000000000000000000000000000000008152339063585da62890610319908490879087906004016124f8565b600060405180830381600087803b15801561033357600080fd5b505af1158015610347573d6000803e3d6000fd5b5050505061035481610baf565b5061035f6001600255565b505050565b61036c610985565b8060008167ffffffffffffffff811115610388576103886122c6565b60405190808252806020026020018201604052801561044357816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816103a65790505b50905060005b828110156104a25761047d858583818110610466576104666122f5565b905060200281019061047891906125be565b6109f6565b82828151811061048f5761048f6122f5565b6020908102919091010152600101610449565b506104ac81610b5e565b6104b581610baf565b50506104c16001600255565b5050565b6104cd610985565b8260008167ffffffffffffffff8111156104e9576104e96122c6565b6040519080825280602002602001820160405280156105a457816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816105075790505b50905060005b828110156105ec576105c7878783818110610466576104666122f5565b8282815181106105d9576105d96122f5565b60209081029190910101526001016105aa565b506105f681610b5e565b6040517f585da628000000000000000000000000000000000000000000000000000000008152339063585da62890610636908490889088906004016124f8565b600060405180830381600087803b15801561065057600080fd5b505af1158015610664573d6000803e3d6000fd5b5050505061067181610baf565b505061067d6001600255565b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527fb904ae9529e373e48bc82df4326cceaf1b4c472babf37f5b7dec46fecc6b53e0910160405180910390a15050565b610797610985565b604080516001808252818301909252600091816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816107ae579050509050610856826109f6565b81600081518110610869576108696122f5565b602002602001018190525061087d81610b5e565b61088681610baf565b506108916001600255565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610700565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60028054036109f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610700565b60028055565b6040805161016081018252600060a0820181815260c0830182905260e083018290526101008301829052610120830182905260606101408401819052908352835180820185528281526020808201849052818601849052840152928201839052828201929092526080810182905290610a6f83806125fc565b810190610a7c91906129c8565b90506000610a8982610d02565b90508160400151431015610aa157610aa18183610e15565b610aaa82610ffe565b6000610ab983606001516110fd565b90506040518060a0016040528084600001518152602001610ae783866080015161115290919063ffffffff16565b8152602001610b03838660a0015161124990919063ffffffff16565b8152602001868060200190610b1891906125fc565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200192909252509392505050565b805160005b8181101561035f576000838281518110610b7f57610b7f6122f5565b60200260200101519050610b928161132e565b610b9c813361181e565b610ba68133611917565b50600101610b63565b805160005b81811015610cf1576000838281518110610bd057610bd06122f5565b602002602001015190506000816040015151905060005b81811015610c5157600083604001518281518110610c0757610c076122f5565b60200260200101519050610c4881604001518260200151836000015173ffffffffffffffffffffffffffffffffffffffff16611b709092919063ffffffff16565b50600101610be7565b5081600001516020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16868581518110610c9a57610c9a6122f5565b6020026020010151608001517f78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66856000015160400151604051610cdf91815260200190565b60405180910390a45050600101610bb4565b5047156104c1576104c13347611bb7565b60006040518060c00160405280608d8152602001612f81608d9139604051806080016040528060488152602001612f0b604891396040518060800160405280605b815260200161300e605b9139604051602001610d6193929190612ac9565b60405160208183030381529060405280519060200120610d848360000151611c51565b836020015184604001518560600151610da08760800151611ceb565b610dad8860a00151611d52565b60408051602081019890985287019590955273ffffffffffffffffffffffffffffffffffffffff9093166060860152608085019190915260a084015260c083015260e0820152610100015b604051602081830303815290604052805190602001209050919050565b60c081015151600003610e26575050565b604081015160c0820151511015610e435760c08101515160408201525b6000808260e00151806020019051810190610e5e9190612c1f565b9150915060008360e00151604081518110610e7b57610e7b6122f5565b602001015160f81c60f81b60f81c905060006001868660c00151604051602001610ea89151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610ee49291602001612c43565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600084529083018083525260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015610f60573d6000803e3d6000fd5b5050506020604051035190508073ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff16141580610fbf575073ffffffffffffffffffffffffffffffffffffffff8116155b15610ff6576040517fd7815be100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050565b80516060015142111561103d576040517f769d11e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b438160400151111561107b576040517fc603552000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b608081015160400151156108915760005b8160a00151518110156104c15760008260a0015182815181106110b1576110b16122f5565b60200260200101516040015111156110f5576040517fa6b844f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60010161108c565b6000483a1015611139576040517ff3eb44e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50483a0381811115611149570390565b5060005b919050565b61118c6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b600083604001518361119e9190612c98565b90506298968081106111ec576040518060600160405280856000015173ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018560200151815250915050611243565b6040805160608101909152845173ffffffffffffffffffffffffffffffffffffffff168152602081016112346112258462989680612caf565b60208801519062989680611df0565b81526020868101519101529150505b92915050565b81516060908067ffffffffffffffff811115611267576112676122c6565b6040519080825280602002602001820160405280156112d057816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816112855790505b50915060005b81811015611326576113018582815181106112f3576112f36122f5565b602002602001015185611e2c565b838281518110611313576113136122f5565b60209081029190910101526001016112d6565b505092915050565b60015473ffffffffffffffffffffffffffffffffffffffff1661134e5750565b6001546040517f8aa6cf0300000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff1690638aa6cf03906113a5908590600401612cc2565b600060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526114089190810190612cd5565b60408301515181519192509060006114208284612da5565b67ffffffffffffffff811115611438576114386122c6565b6040519080825280602002602001820160405280156114a157816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816114565790505b50905060005b838110156114f257856040015181815181106114c5576114c56122f5565b60200260200101518282815181106114df576114df6122f5565b60209081029190910101526001016114a7565b5060008060005b8481101561180d576000878281518110611515576115156122f5565b6020026020010151905060005b828110156115d35788818151811061153c5761153c6122f5565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff16036115cb5781516040517ffff0830300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610700565b600101611522565b506000805b888110156116945760008b6040015182815181106115f8576115f86122f5565b60200260200101519050836000015173ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff160361168b578515611675576040517fedc7e2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516116849084612da5565b9250600196505b506001016115d8565b50815160208b01515173ffffffffffffffffffffffffffffffffffffffff91821691160361170d5784156116f4576040517fedc7e2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808b015101516117069082612da5565b9050600193505b806000036117625781516040517feddf07f500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610700565b611770816005612710611df0565b826020015111156117e3578151602083015160408085015190517f82e7565600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201526024810192909252919091166044820152606401610700565b8186848a01815181106117f8576117f86122f5565b602090810291909101015250506001016114f9565b505050604090940193909352505050565b81515173ffffffffffffffffffffffffffffffffffffffff16301461186f576040517f4ddf4a6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516080015173ffffffffffffffffffffffffffffffffffffffff16156104c1578151608001516040517f6e84ba2b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636e84ba2b906118eb9084908690600401612db8565b60006040518083038186803b15801561190357600080fd5b505afa158015610ff6573d6000803e3d6000fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663137c29fe6119d7846040805160a0810182526000606082018181526080830182905282526020820181905291810191909152506040805160a081018252602080840180515173ffffffffffffffffffffffffffffffffffffffff1660608085019182529151850151608085015283528451840151918301919091529251909201519082015290565b6040805180820182526000808252602091820152815180830190925273ffffffffffffffffffffffffffffffffffffffff86168252808701518101519082015285600001516020015186608001516040518060c00160405280608d8152602001612f81608d9139604051806080016040528060488152602001612f0b604891396040518060800160405280605b815260200161300e605b9139604051602001611a8293929190612ac9565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815260608301909152602e808352909190612f536020830139604051602001611ad5929190612de7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905260608a01517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b168352611b429695949392600401612e42565b600060405180830381600087803b158015611b5c57600080fd5b505af1158015610ff6573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff8316611b955761035f8282611bb7565b61035f73ffffffffffffffffffffffffffffffffffffffff8416338484611ece565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611c11576040519150601f19603f3d011682016040523d82523d6000602084013e611c16565b606091505b505090508061035f576040517ff4b3b1bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040518060c00160405280608d8152602001612f81608d913980516020918201208351848301516040808701516060880151608089015160a08a01518051908901209351610df898939492939192910196875273ffffffffffffffffffffffffffffffffffffffff958616602088015293851660408701526060860192909252608085015290911660a083015260c082015260e00190565b6000604051806080016040528060488152602001612f0b6048913980516020918201208351848301516040808701519051610df8950193845273ffffffffffffffffffffffffffffffffffffffff9290921660208401526040830152606082015260800190565b600080825160200267ffffffffffffffff811115611d7257611d726122c6565b6040519080825280601f01601f191660200182016040528015611d9c576020820181803683370190505b50905060005b8351811015611de1576000611dcf858381518110611dc257611dc26122f5565b6020026020010151611fc0565b60208381028501015250600101611da2565b50805160209091012092915050565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0484118302158202611e2557600080fd5b5091020490565b60408051606081018252600080825260208201819052918101919091526040518060600160405280846000015173ffffffffffffffffffffffffffffffffffffffff168152602001611ea3856040015185611e879190612c98565b611e949062989680612da5565b60208701519062989680612037565b8152602001846060015173ffffffffffffffffffffffffffffffffffffffff16815250905092915050565b60006040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015273ffffffffffffffffffffffffffffffffffffffff841660248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080611fb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610700565b5050505050565b60006040518060800160405280605b815260200161300e605b9139805160209182012083518483015160408087015160608801519151610df8969192910194855273ffffffffffffffffffffffffffffffffffffffff93841660208601526040850192909252606084015216608082015260a00190565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261206c57600080fd5b50910281810615159190040190565b60006040828403121561208d57600080fd5b50919050565b60008083601f8401126120a557600080fd5b50813567ffffffffffffffff8111156120bd57600080fd5b6020830191508360208285010111156120d557600080fd5b9250929050565b6000806000604084860312156120f157600080fd5b833567ffffffffffffffff8082111561210957600080fd5b6121158783880161207b565b9450602086013591508082111561212b57600080fd5b5061213886828701612093565b9497909650939450505050565b60008083601f84011261215757600080fd5b50813567ffffffffffffffff81111561216f57600080fd5b6020830191508360208260051b85010111156120d557600080fd5b6000806020838503121561219d57600080fd5b823567ffffffffffffffff8111156121b457600080fd5b6121c085828601612145565b90969095509350505050565b600080600080604085870312156121e257600080fd5b843567ffffffffffffffff808211156121fa57600080fd5b61220688838901612145565b9096509450602087013591508082111561221f57600080fd5b5061222c87828801612093565b95989497509550505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461089157600080fd5b803561114d81612238565b60006020828403121561227757600080fd5b813561228281612238565b9392505050565b60006020828403121561229b57600080fd5b813567ffffffffffffffff8111156122b257600080fd5b6122be8482850161207b565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b8381101561233f578181015183820152602001612327565b50506000910152565b60008151808452612360816020860160208601612324565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008151808452602080850194506020840160005b838110156123f2578151805173ffffffffffffffffffffffffffffffffffffffff908116895284820151858a01526040918201511690880152606090960195908201906001016123a7565b509495945050505050565b6000815160e0845273ffffffffffffffffffffffffffffffffffffffff8082511660e08601528060208301511661010086015260408201516101208601526060820151610140860152806080830151166101608601525060a0810151905060c06101808501526124716101a0850182612348565b905060208301516124af6020860182805173ffffffffffffffffffffffffffffffffffffffff16825260208082015190830152604090810151910152565b50604083015184820360808601526124c78282612392565b915050606083015184820360a08601526124e18282612348565b915050608083015160c08501528091505092915050565b6000604082016040835280865180835260608501915060608160051b8601019250602080890160005b8381101561256d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa088870301855261255b8683516123fd565b95509382019390820190600101612521565b5050858403818701528684528688828601376000848801820152601f9096017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092019094019695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126125f257600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261263157600080fd5b83018035915067ffffffffffffffff82111561264c57600080fd5b6020019150368190038213156120d557600080fd5b6040516060810167ffffffffffffffff81118282101715612684576126846122c6565b60405290565b6040516080810167ffffffffffffffff81118282101715612684576126846122c6565b604051610100810167ffffffffffffffff81118282101715612684576126846122c6565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612718576127186122c6565b604052919050565b600082601f83011261273157600080fd5b813567ffffffffffffffff81111561274b5761274b6122c6565b61277c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016126d1565b81815284602083860101111561279157600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156127c057600080fd5b60405160c0810167ffffffffffffffff82821081831117156127e4576127e46122c6565b81604052829350843591506127f882612238565b90825260208401359061280a82612238565b81602084015260408501356040840152606085013560608401526080850135915061283482612238565b81608084015260a085013591508082111561284e57600080fd5b5061285b85828601612720565b60a0830152505092915050565b60006060828403121561287a57600080fd5b612882612661565b9050813561288f81612238565b80825250602082013560208201526040820135604082015292915050565b600067ffffffffffffffff8211156128c7576128c76122c6565b5060051b60200190565b600082601f8301126128e257600080fd5b813560206128f76128f2836128ad565b6126d1565b82815260079290921b8401810191818101908684111561291657600080fd5b8286015b8481101561297b57608081890312156129335760008081fd5b61293b61268a565b813561294681612238565b815281850135858201526040808301359082015260608083013561296981612238565b9082015283529183019160800161291a565b509695505050505050565b60006020828403121561299857600080fd5b6040516020810181811067ffffffffffffffff821117156129bb576129bb6122c6565b6040529135825250919050565b6000602082840312156129da57600080fd5b813567ffffffffffffffff808211156129f257600080fd5b908301906101408286031215612a0757600080fd5b612a0f6126ad565b823582811115612a1e57600080fd5b612a2a878286016127ae565b825250612a396020840161225a565b60208201526040830135604082015260608301356060820152612a5f8660808501612868565b608082015260e083013582811115612a7657600080fd5b612a82878286016128d1565b60a083015250612a96866101008501612986565b60c082015261012083013582811115612aae57600080fd5b612aba87828601612720565b60e08301525095945050505050565b7f5072696f726974794f726465722800000000000000000000000000000000000081527f4f72646572496e666f20696e666f2c0000000000000000000000000000000000600e8201527f6164647265737320636f7369676e65722c000000000000000000000000000000601d8201527f75696e743235362061756374696f6e5374617274426c6f636b2c000000000000602e8201527f75696e7432353620626173656c696e655072696f726974794665655765692c0060488201527f5072696f72697479496e70757420696e7075742c00000000000000000000000060678201527f5072696f726974794f75747075745b5d206f7574707574732900000000000000607b82015260008451612be5816094850160208901612324565b845190830190612bfc816094840160208901612324565b8451910190612c12816094840160208801612324565b0160940195945050505050565b60008060408385031215612c3257600080fd5b505080516020909101519092909150565b82815260008251612c5b816020850160208701612324565b919091016020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761124357611243612c69565b8181038181111561124357611243612c69565b60208152600061228260208301846123fd565b60006020808385031215612ce857600080fd5b825167ffffffffffffffff811115612cff57600080fd5b8301601f81018513612d1057600080fd5b8051612d1e6128f2826128ad565b81815260609182028301840191848201919088841115612d3d57600080fd5b938501935b83851015612d995780858a031215612d5a5760008081fd5b612d62612661565b8551612d6d81612238565b81528587015187820152604080870151612d8681612238565b9082015283529384019391850191612d42565b50979650505050505050565b8082018082111561124357611243612c69565b73ffffffffffffffffffffffffffffffffffffffff831681526040602082015260006122be60408301846123fd565b7f5072696f726974794f72646572207769746e6573732900000000000000000000815260008351612e1f816016850160208801612324565b835190830190612e36816016840160208801612324565b01601601949350505050565b6000610140612e72838a51805173ffffffffffffffffffffffffffffffffffffffff168252602090810151910152565b6020890151604084015260408901516060840152612eb36080840189805173ffffffffffffffffffffffffffffffffffffffff168252602090810151910152565b73ffffffffffffffffffffffffffffffffffffffff871660c08401528560e084015280610100840152612ee881840186612348565b9050828103610120840152612efd8185612348565b999850505050505050505056fe5072696f72697479496e707574286164647265737320746f6b656e2c75696e7432353620616d6f756e742c75696e74323536206d70735065725072696f7269747946656557656929546f6b656e5065726d697373696f6e73286164647265737320746f6b656e2c75696e7432353620616d6f756e74294f72646572496e666f28616464726573732072656163746f722c6164647265737320737761707065722c75696e74323536206e6f6e63652c75696e7432353620646561646c696e652c61646472657373206164646974696f6e616c56616c69646174696f6e436f6e74726163742c6279746573206164646974696f6e616c56616c69646174696f6e44617461295072696f726974794f7574707574286164647265737320746f6b656e2c75696e7432353620616d6f756e742c75696e74323536206d70735065725072696f726974794665655765692c6164647265737320726563697069656e7429a26469706673582212200157f640b2a364169513823e9bc04e1403e405f2593efb4a28be4df19b3c545364736f6c63430008180033","sourceMap":"585:4960:73:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1721:435:69;;;;;;:::i;:::-;;:::i;:::-;;2191:453;;;;;;:::i;:::-;;:::i;1212:33::-;;;;;;;;;;;;;;;;;;2288:42:118;2276:55;;;2258:74;;2246:2;2231:18;1212:33:69;;;;;;;2679:614;;;;;;:::i;:::-;;:::i;4161:289:48:-;;;;;;;;;;-1:-1:-1;4161:289:48;;;;;:::i;:::-;;:::i;1412:274:69:-;;;;;;:::i;:::-;;:::i;1479:43:48:-;;;;;;;;;;-1:-1:-1;1479:43:48;;;;;;;;690:20:41;;;;;;;;;;-1:-1:-1;690:20:41;;;;;;;;1312:161;;;;;;;;;;-1:-1:-1;1312:161:41;;;;;:::i;:::-;;:::i;1721:435:69:-;2261:21:27;:19;:21::i;:::-;1932:22:69::1;::::0;;1952:1:::1;1932:22:::0;;;;;::::1;::::0;;;1892:37:::1;::::0;1932:22:::1;;;;-1:-1:-1::0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1932:22:69;;;;;;;::::1;::::0;::::1;;;;;1892:62;;1984:15;1993:5;1984:8;:15::i;:::-;1964:14;1979:1;1964:17;;;;;;;;:::i;:::-;;;;;;:35;;;;2010:24;2019:14;2010:8;:24::i;:::-;2044:74;::::0;;;;2061:10:::1;::::0;2044:44:::1;::::0;:74:::1;::::0;2089:14;;2105:12;;;;2044:74:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;2128:21;2134:14;2128:5;:21::i;:::-;1882:274;2303:20:27::0;1716:1;2809:7;:22;2629:209;2303:20;1721:435:69;;;:::o;2191:453::-;2261:21:27;:19;:21::i;:::-;2316:6:69;2293:20:::1;2316:6:::0;2379:33:::1;::::0;::::1;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2379:33:69;;;;;;;::::1;::::0;::::1;;;;;;2339:73;;2452:9;2447:115;2471:12;2467:1;:16;2447:115;;;2528:19;2537:6;;2544:1;2537:9;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;2528:8;:19::i;:::-;2508:14;2523:1;2508:17;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;:39;2485:3:::1;;2447:115;;;;2582:24;2591:14;2582:8;:24::i;:::-;2616:21;2622:14;2616:5;:21::i;:::-;2283:361;;2303:20:27::0;1716:1;2809:7;:22;2629:209;2303:20;2191:453:69;;:::o;2679:614::-;2261:21:27;:19;:21::i;:::-;2881:6:69;2858:20:::1;2881:6:::0;2944:33:::1;::::0;::::1;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1::0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2944:33:69;;;;;;;::::1;::::0;::::1;;;;;;2904:73;;3017:9;3012:115;3036:12;3032:1;:16;3012:115;;;3093:19;3102:6;;3109:1;3102:9;;;;;;;:::i;3093:19::-;3073:14;3088:1;3073:17;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;:39;3050:3:::1;;3012:115;;;;3147:24;3156:14;3147:8;:24::i;:::-;3181:74;::::0;;;;3198:10:::1;::::0;3181:44:::1;::::0;:74:::1;::::0;3226:14;;3242:12;;;;3181:74:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;3265:21;3271:14;3265:5;:21::i;:::-;2848:445;;2303:20:27::0;1716:1;2809:7;:22;2629:209;2303:20;2679:614:69;;;;:::o;4161:289:48:-;778:5:41;;;;764:10;:19;756:44;;;;;;;9611:2:118;756:44:41;;;9593:21:118;9650:2;9630:18;;;9623:30;9689:14;9669:18;;;9662:42;9721:18;;756:44:41;;;;;;;;;4286:13:48::1;::::0;;::::1;4310:57:::0;;::::1;::::0;;::::1;::::0;::::1;::::0;;;4382:61:::1;::::0;;4286:13;;;::::1;9985:34:118::0;;;10050:2;10035:18;;10028:43;;;;4382:61:48::1;::::0;9897:18:118;4382:61:48::1;;;;;;;4241:209;4161:289:::0;:::o;1412:274:69:-;2261:21:27;:19;:21::i;:::-;1546:22:69::1;::::0;;1566:1:::1;1546:22:::0;;;;;::::1;::::0;;;1506:37:::1;::::0;1546:22:::1;;;;-1:-1:-1::0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1546:22:69;;;;;;;::::1;::::0;::::1;;;;;1506:62;;1598:15;1607:5;1598:8;:15::i;:::-;1578:14;1593:1;1578:17;;;;;;;;:::i;:::-;;;;;;:35;;;;1624:24;1633:14;1624:8;:24::i;:::-;1658:21;1664:14;1658:5;:21::i;:::-;1496:190;2303:20:27::0;1716:1;2809:7;:22;2629:209;2303:20;1412:274:69;:::o;1312:161:41:-;778:5;;;;764:10;:19;756:44;;;;;;;9611:2:118;756:44:41;;;9593:21:118;9650:2;9630:18;;;9623:30;9689:14;9669:18;;;9662:42;9721:18;;756:44:41;9409:336:118;756:44:41;1392:5:::1;:16:::0;;;::::1;;::::0;::::1;::::0;;::::1;::::0;;1424:42:::1;::::0;1392:16;;1445:10:::1;::::0;1424:42:::1;::::0;1392:5;1424:42:::1;1312:161:::0;:::o;2336:287:27:-;1759:1;2468:7;;:19;2460:63;;;;;;;10284:2:118;2460:63:27;;;10266:21:118;10323:2;10303:18;;;10296:30;10362:33;10342:18;;;10335:61;10413:18;;2460:63:27;10082:355:118;2460:63:27;1759:1;2598:18;;2336:287::o;1484:770:73:-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1690:17:73;:11;;:17;:::i;:::-;1679:46;;;;;;;:::i;:::-;1650:75;;1735:17;1755:12;:5;:10;:12::i;:::-;1735:32;;1797:5;:23;;;1782:12;:38;1778:110;;;1836:41;1860:9;1871:5;1836:23;:41::i;:::-;1897:21;1912:5;1897:14;:21::i;:::-;1929:19;1951:45;1967:5;:28;;;1951:15;:45::i;:::-;1929:67;;2023:224;;;;;;;;2057:5;:10;;;2023:224;;;;2088:30;2106:11;2088:5;:11;;;:17;;:30;;;;:::i;:::-;2023:224;;;;2141:32;2161:11;2141:5;:13;;;:19;;:32;;;;:::i;:::-;2023:224;;;;2192:11;:15;;;;;;;;:::i;:::-;2023:224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2023:224:73;;;-1:-1:-1;2023:224:73;;;;;;-1:-1:-1;2007:240:73;1484:770;-1:-1:-1;;;1484:770:73:o;3441:405:69:-;3532:13;;3509:20;3579:251;3603:12;3599:1;:16;3579:251;;;3640:26;3669:6;3676:1;3669:9;;;;;;;;:::i;:::-;;;;;;;3640:38;;3696:18;3708:5;3696:11;:18::i;:::-;3732:26;:5;3747:10;3732:14;:26::i;:::-;3776:39;3797:5;3804:10;3776:20;:39::i;:::-;-1:-1:-1;3617:3:69;;3579:251;;3968:1267;4056:13;;4033:20;4236:536;4260:12;4256:1;:16;4236:536;;;4297:34;4334:6;4341:1;4334:9;;;;;;;;:::i;:::-;;;;;;;4297:46;;4361:21;4385:13;:21;;;:28;4361:52;;4436:9;4431:217;4455:13;4451:1;:17;4431:217;;;4497:25;4525:13;:21;;;4547:1;4525:24;;;;;;;;:::i;:::-;;;;;;;4497:52;;4571:58;4597:6;:16;;;4615:6;:13;;;4571:6;:12;;;:25;;;;:58;;;;;:::i;:::-;-1:-1:-1;4470:3:69;;4431:217;;;;4704:13;:18;;;:26;;;4671:86;;4692:10;4671:86;;4676:6;4683:1;4676:9;;;;;;;;:::i;:::-;;;;;;;:14;;;4671:86;4732:13;:18;;;:24;;;4671:86;;;;17718:25:118;;17706:2;17691:18;;17572:177;4671:86:69;;;;;;;;-1:-1:-1;;4274:3:69;;4236:536;;;-1:-1:-1;5112:21:69;:25;5108:121;;5153:65;5184:10;5196:21;5153:30;:65::i;4247:414:66:-;4312:7;2454:28;;;;;;;;;;;;;;;;;2492:25;;;;;;;;;;;;;;;;;2527:26;;;;;;;;;;;;;;;;;2196:363;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;2609:21;;;;;;4422:17;:5;:10;;;:15;:17::i;:::-;4457:5;:14;;;4489:5;:23;;;4530:5;:28;;;4576:17;4581:5;:11;;;4576:4;:17::i;:::-;4611:19;4616:5;:13;;;4611:4;:19::i;:::-;4361:283;;;;;;19872:25:118;;;;19913:18;;19906:34;;;;19988:42;19976:55;;;19956:18;;;19949:83;20048:18;;;20041:34;;;;20091:19;;;20084:35;20135:19;;;20128:35;20179:19;;;20172:35;19844:19;;4361:283:66;;;;;;;;;;;;;4338:316;;;;;;4331:323;;4247:414;;;:::o;2895:848:73:-;3057:18;;;;:37;;:42;3053:55;;2895:848;;:::o;3053:55::-;3162:23;;;;3122:18;;;;:37;:63;3118:157;;;3227:18;;;;:37;3201:23;;;:63;3118:157;3324:9;3335;3359:5;:17;;;3348:49;;;;;;;;;;;;:::i;:::-;3323:74;;;;3407:7;3423:5;:17;;;3441:2;3423:21;;;;;;;;:::i;:::-;;;;;;;;;3417:28;;3407:38;;3514:14;3531:90;3568:9;3590:5;:18;;;3579:30;;;;;;20710:13:118;20692:32;;20680:2;20665:18;;20468:262;3579:30:73;;;;;;;;;;;;;;;3551:59;;;3579:30;3551:59;;:::i;:::-;;;;;;;;;;;;;;3541:70;;3551:59;3541:70;;;;3531:90;;;;;;;;;21326:25:118;21399:4;21387:17;;21367:18;;;21360:45;21421:18;;;21414:34;;;21464:18;;;21457:34;;;21298:19;;3531:90:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3514:107;;3653:6;3635:24;;:5;:14;;;:24;;;;:48;;;-1:-1:-1;3663:20:73;;;;3635:48;3631:106;;;3706:20;;;;;;;;;;;;;;3631:106;2989:754;;;;2895:848;;:::o;4084:706::-;4164:10;;:19;;;4186:15;-1:-1:-1;4160:92:73;;;4224:17;;;;;;;;;;;;;;4160:92;4446:12;4420:5;:23;;;:38;4416:94;;;4481:18;;;;;;;;;;;;;;4416:94;4524:11;;;;:32;;;:36;4520:264;;4581:9;4576:198;4600:5;:13;;;:20;4596:1;:24;4576:198;;;4689:1;4649:5;:13;;;4663:1;4649:16;;;;;;;;:::i;:::-;;;;;;;:37;;;:41;4645:115;;;4721:20;;;;;;;;;;;;;;4645:115;4622:3;;4576:198;;5104:439;5184:19;5233:13;5219:11;:27;5215:57;;;5255:17;;;;;;;;;;;;;;5215:57;-1:-1:-1;5334:13:73;5320:11;:27;5365:36;;;5361:166;;;5421:37;;5104:439::o;5361:166::-;-1:-1:-1;5511:1:73;5361:166;5104:439;;;:::o;1023:503:65:-;1110:17;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;1110:17:65;1139:21;1177:5;:26;;;1163:11;:40;;;;:::i;:::-;1139:64;;542:3;1217:13;:20;1213:126;;1260:68;;;;;;;;1279:5;:11;;;1260:68;;;;;;1300:1;1260:68;;;;1314:5;:12;;;1260:68;;;1253:75;;;;;1213:126;1355:164;;;;;;;;;1387:11;;1355:164;;;;;;;1420:51;1445:19;1451:13;542:3;1445:19;:::i;:::-;1420:12;;;;;542:3;1420:23;:51::i;:::-;1355:164;;;1496:12;;;;1355:164;;;1348:171;-1:-1:-1;;1023:503:65;;;;;:::o;2248:372::-;2430:14;;2364:27;;2430:14;2463:31;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;2463:31:65;;;;;;;;;;;;;;;2454:40;;2509:9;2504:110;2528:12;2524:1;:16;2504:110;;;2573:30;2579:7;2587:1;2579:10;;;;;;;;:::i;:::-;;;;;;;2591:11;2573:5;:30::i;:::-;2561:6;2568:1;2561:9;;;;;;;;:::i;:::-;;;;;;;;;;:42;2542:3;;2504:110;;;;2397:223;2248:372;;;;:::o;1825:2185:48:-;1910:13;;1902:36;1910:13;1898:73;;1825:2185;:::o;1898:73::-;2015:13;;:34;;;;;1981:31;;2015:13;;;:27;;:34;;2043:5;;2015:34;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;2083:13;;;;:20;2140:17;;1981:68;;-1:-1:-1;2083:20:48;2059:21;2294:32;2140:17;2083:20;2294:32;:::i;:::-;2276:51;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;2276:51:48;;;;;;;;;;;;;;;2242:85;;2343:9;2338:101;2362:13;2358:1;:17;2338:101;;;2412:5;:13;;;2426:1;2412:16;;;;;;;;:::i;:::-;;;;;;;2396:10;2407:1;2396:13;;;;;;;;:::i;:::-;;;;;;;;;;:32;2377:3;;2338:101;;;;2449:19;2486:18;2527:9;2522:1445;2546:16;2542:1;:20;2522:1445;;;2583:28;2614:10;2625:1;2614:13;;;;;;;;:::i;:::-;;;;;;;2583:44;;2682:9;2677:191;2701:1;2697;:5;2677:191;;;2750:10;2761:1;2750:13;;;;;;;;:::i;:::-;;;;;;;:19;;;2731:38;;:9;:15;;;:38;;;2727:127;;2819:15;;2800:35;;;;;2288:42:118;2276:55;;;2800:35:48;;;2258:74:118;2231:18;;2800:35:48;2094:244:118;2727:127:48;2704:3;;2677:191;;;-1:-1:-1;2933:18:48;;2965:354;2989:13;2985:1;:17;2965:354;;;3027:25;3055:5;:13;;;3069:1;3055:16;;;;;;;;:::i;:::-;;;;;;;3027:44;;3109:9;:15;;;3093:31;;:6;:12;;;:31;;;3089:216;;3152:13;3148:46;;;3174:20;;;;;;;;;;;;;;3148:46;3230:13;;;;3216:27;;;;:::i;:::-;;;3282:4;3265:21;;3089:216;-1:-1:-1;3004:3:48;;2965:354;;;-1:-1:-1;3415:15:48;;3393:11;;;;:17;3385:45;;;;;;;3381:219;;3454:14;3450:47;;;3477:20;;;;;;;;;;;;;;3450:47;3529:11;;;;;:18;;3515:32;;;;:::i;:::-;;;3581:4;3565:20;;3381:219;3618:10;3632:1;3618:15;3614:60;;3658:15;;3642:32;;;;;2288:42:118;2276:55;;;3642:32:48;;;2258:74:118;2231:18;;3642:32:48;2094:244:118;3614:60:48;3712:39;:10;1424:1;1373:6;3712:21;:39::i;:::-;3693:9;:16;;;:58;3689:171;;;3790:15;;3807:16;;;;3825:19;;;;;3778:67;;;;;24087:42:118;24156:15;;;3778:67:48;;;24138:34:118;24188:18;;;24181:34;;;;24251:15;;;;24231:18;;;24224:43;24050:18;;3778:67:48;23875:398:118;3689:171:48;3933:9;3901:10;3928:1;3912:13;:17;3901:29;;;;;;;;:::i;:::-;;;;;;;;;;:41;-1:-1:-1;;2564:3:48;;2522:1445;;;-1:-1:-1;;;3977:13:48;;;;:26;;;;-1:-1:-1;;;1825:2185:48:o;429:396:67:-;552:18;;:26;527:52;;535:4;527:52;523:106;;602:16;;;;;;;;;;;;;;523:106;651:18;;:47;;;643:70;;;639:180;;729:18;;:47;;;:79;;;;;:56;;;;;;;:79;;786:6;;729:13;;:79;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2292:345:73;2390:7;:33;;;2437:16;:5;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;509:303:64;;;572:149;;;;;641:11;;;;;;:17;572:149;;509:303;;;;572:149;;;685:11;;:21;;;572:149;;;;509:303;;742:10;;:16;;;509:303;;;;;;;782:10;;:19;;;;509:303;;;;;349:470;2437:16:73;-1:-1:-1;;;;;;;;;;;;;;;;;1071:90:64;;;;;;;;;;;;;1141:11;;;;:18;;;1071:90;;;;2506:5:73;:10;;;:18;;;2538:5;:10;;;2454:28:66;;;;;;;;;;;;;;;;;2492:25;;;;;;;;;;;;;;;;;2527:26;;;;;;;;;;;;;;;;;2196:363;;;;;;;;;;:::i;:::-;;;;;;;;;;;2856:22;;;;;;;;;;2196:363;;;2856:22;2196:363;2856:22;;;2801:78;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;2611:9:73;;;;2390:240;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1478:434:57;2501:18;;;1572:334;;1695:33;1710:9;1721:6;1695:14;:33::i;1572:334::-;1832:63;:32;;;1865:10;1877:9;1888:6;1832:32;:63::i;2084:189::-;2163:12;2180:9;:14;;2202:6;2180:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2162:51;;;2228:7;2223:43;;2244:22;;;;;;;;;;;;;;574:416:63;634:7;461:15;;;;;;;;;;;;;;;;;451:26;;;;;;;749:12;;779;;;;809:10;;;;;837:13;;;;868:33;;;;929:29;;;;919:40;;;;;;683:290;;;;809:10;;837:13;;868:33;;919:40;683:290;27221:25:118;;;27265:42;27343:15;;;27338:2;27323:18;;27316:43;27395:15;;;27390:2;27375:18;;27368:43;27442:2;27427:18;;27420:34;;;;27485:3;27470:19;;27463:35;27535:15;;;27529:3;27514:19;;27507:44;27582:3;27567:19;;27560:35;27208:3;27193:19;;26859:742;2945:217:66;3009:7;1863:25;;;;;;;;;;;;;;;;;1853:36;;;;;;;3100:11;;3113:12;;;;3127:26;;;;;3057:97;;;;;27852:25:118;;;27925:42;27913:55;;;;27908:2;27893:18;;27886:83;28000:2;27985:18;;27978:34;28043:2;28028:18;;28021:34;27839:3;27824:19;;27606:455;3637:489:66;3706:7;3749:25;3792:7;:14;3787:2;:19;3777:30;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3777:30:66;;3749:58;;3827:9;3822:243;3846:7;:14;3842:1;:18;3822:243;;;3885:18;3906:16;3911:7;3919:1;3911:10;;;;;;;;:::i;:::-;;;;;;;3906:4;:16::i;:::-;4014:4;4007:12;;;3978:42;;;3971:62;-1:-1:-1;3862:3:66;;3822:243;;;-1:-1:-1;4086:23:66;;;;;;;;3637:489;-1:-1:-1;;3637:489:66:o;1564:526:44:-;1680:9;1928:1;1915:11;1911:19;1908:1;1905:26;1902:1;1898:34;1891:42;1878:11;1874:60;1864:116;;1964:1;1961;1954:12;1864:116;-1:-1:-1;2051:9:44;;2047:27;;1564:526::o;1815:332:65:-;-1:-1:-1;;;;;;;;;;;;;;;;;;;;;;;;;1941:199:65;;;;;;;;1974:6;:12;;;1941:199;;;;;;2008:80;2053:6;:27;;;2039:11;:41;;;;:::i;:::-;2032:49;;542:3;2032:49;:::i;:::-;2008:13;;;;;542:3;2008:22;:80::i;:::-;1941:199;;;;2113:6;:16;;;1941:199;;;;;1934:206;;1815:332;;;;:::o;1328:1782:45:-;1466:12;1636:4;1630:11;1778:66;1759:17;1752:93;1902:42;1896:4;1892:53;1888:1;1869:17;1865:25;1858:88;2042:42;2038:2;2034:51;2029:2;2010:17;2006:26;1999:87;2172:6;2167:2;2148:17;2144:26;2137:42;3026:2;3023:1;3018:3;2999:17;2996:1;2989:5;2982;2977:52;2545:16;2538:24;2532:2;2514:16;2511:24;2507:1;2503;2497:8;2494:15;2490:46;2487:76;2287:756;2276:767;;;3071:7;3063:40;;;;;;;28268:2:118;3063:40:45;;;28250:21:118;28307:2;28287:18;;;28280:30;28346:22;28326:18;;;28319:50;28386:18;;3063:40:45;28066:344:118;3063:40:45;1456:1654;1328:1782;;;;:::o;3227:345:66:-;3293:7;2125:26;;;;;;;;;;;;;;;;;2115:37;;;;;;;3419:12;;3449:13;;;;3480:27;;;;;3525:16;;;;3342:213;;;;3480:27;;3525:16;3342:213;28674:25:118;;;28718:42;28796:15;;;28791:2;28776:18;;28769:43;28843:2;28828:18;;28821:34;;;;28886:2;28871:18;;28864:34;28935:15;28929:3;28914:19;;28907:44;28661:3;28646:19;;28415:542;2096:672:44;2210:9;2458:1;2445:11;2441:19;2438:1;2435:26;2432:1;2428:34;2421:42;2408:11;2404:60;2394:116;;2494:1;2491;2484:12;2394:116;-1:-1:-1;2728:9:44;;2691:27;;;2688:34;;2724:27;;;2684:68;;2096:672::o;14:159:118:-;78:5;123:2;114:6;109:3;105:16;101:25;98:45;;;139:1;136;129:12;98:45;-1:-1:-1;161:6:118;14:159;-1:-1:-1;14:159:118:o;178:347::-;229:8;239:6;293:3;286:4;278:6;274:17;270:27;260:55;;311:1;308;301:12;260:55;-1:-1:-1;334:20:118;;377:18;366:30;;363:50;;;409:1;406;399:12;363:50;446:4;438:6;434:17;422:29;;498:3;491:4;482:6;474;470:19;466:30;463:39;460:59;;;515:1;512;505:12;460:59;178:347;;;;;:::o;530:673::-;641:6;649;657;710:2;698:9;689:7;685:23;681:32;678:52;;;726:1;723;716:12;678:52;766:9;753:23;795:18;836:2;828:6;825:14;822:34;;;852:1;849;842:12;822:34;875:71;938:7;929:6;918:9;914:22;875:71;:::i;:::-;865:81;;999:2;988:9;984:18;971:32;955:48;;1028:2;1018:8;1015:16;1012:36;;;1044:1;1041;1034:12;1012:36;;1083:60;1135:7;1124:8;1113:9;1109:24;1083:60;:::i;:::-;530:673;;1162:8;;-1:-1:-1;1057:86:118;;-1:-1:-1;;;;530:673:118:o;1208:387::-;1291:8;1301:6;1355:3;1348:4;1340:6;1336:17;1332:27;1322:55;;1373:1;1370;1363:12;1322:55;-1:-1:-1;1396:20:118;;1439:18;1428:30;;1425:50;;;1471:1;1468;1461:12;1425:50;1508:4;1500:6;1496:17;1484:29;;1568:3;1561:4;1551:6;1548:1;1544:14;1536:6;1532:27;1528:38;1525:47;1522:67;;;1585:1;1582;1575:12;1600:489;1718:6;1726;1779:2;1767:9;1758:7;1754:23;1750:32;1747:52;;;1795:1;1792;1785:12;1747:52;1835:9;1822:23;1868:18;1860:6;1857:30;1854:50;;;1900:1;1897;1890:12;1854:50;1939:90;2021:7;2012:6;2001:9;1997:22;1939:90;:::i;:::-;2048:8;;1913:116;;-1:-1:-1;1600:489:118;-1:-1:-1;;;;1600:489:118:o;2343:797::-;2481:6;2489;2497;2505;2558:2;2546:9;2537:7;2533:23;2529:32;2526:52;;;2574:1;2571;2564:12;2526:52;2614:9;2601:23;2643:18;2684:2;2676:6;2673:14;2670:34;;;2700:1;2697;2690:12;2670:34;2739:90;2821:7;2812:6;2801:9;2797:22;2739:90;:::i;:::-;2848:8;;-1:-1:-1;2713:116:118;-1:-1:-1;2936:2:118;2921:18;;2908:32;;-1:-1:-1;2952:16:118;;;2949:36;;;2981:1;2978;2971:12;2949:36;;3020:60;3072:7;3061:8;3050:9;3046:24;3020:60;:::i;:::-;2343:797;;;;-1:-1:-1;3099:8:118;-1:-1:-1;;;;2343:797:118:o;3145:154::-;3231:42;3224:5;3220:54;3213:5;3210:65;3200:93;;3289:1;3286;3279:12;3304:134;3372:20;;3401:31;3372:20;3401:31;:::i;3443:247::-;3502:6;3555:2;3543:9;3534:7;3530:23;3526:32;3523:52;;;3571:1;3568;3561:12;3523:52;3610:9;3597:23;3629:31;3654:5;3629:31;:::i;:::-;3679:5;3443:247;-1:-1:-1;;;3443:247:118:o;3695:365::-;3786:6;3839:2;3827:9;3818:7;3814:23;3810:32;3807:52;;;3855:1;3852;3845:12;3807:52;3895:9;3882:23;3928:18;3920:6;3917:30;3914:50;;;3960:1;3957;3950:12;3914:50;3983:71;4046:7;4037:6;4026:9;4022:22;3983:71;:::i;:::-;3973:81;3695:365;-1:-1:-1;;;;3695:365:118:o;4559:184::-;4611:77;4608:1;4601:88;4708:4;4705:1;4698:15;4732:4;4729:1;4722:15;4748:184;4800:77;4797:1;4790:88;4897:4;4894:1;4887:15;4921:4;4918:1;4911:15;4937:250;5022:1;5032:113;5046:6;5043:1;5040:13;5032:113;;;5122:11;;;5116:18;5103:11;;;5096:39;5068:2;5061:10;5032:113;;;-1:-1:-1;;5179:1:118;5161:16;;5154:27;4937:250::o;5192:329::-;5233:3;5271:5;5265:12;5298:6;5293:3;5286:19;5314:76;5383:6;5376:4;5371:3;5367:14;5360:4;5353:5;5349:16;5314:76;:::i;:::-;5435:2;5423:15;5440:66;5419:88;5410:98;;;;5510:4;5406:109;;5192:329;-1:-1:-1;;5192:329:118:o;5787:700::-;5851:3;5889:5;5883:12;5916:6;5911:3;5904:19;5942:4;5971;5966:3;5962:14;5955:21;;6010:4;6003:5;5999:16;6033:1;6043:419;6057:6;6054:1;6051:13;6043:419;;;6116:13;;6223:9;;6152:42;6219:18;;;6207:31;;6278:11;;;6272:18;6258:12;;;6251:40;6314:4;6362:11;;;6356:18;6352:27;6338:12;;;6331:49;6409:4;6400:14;;;;6437:15;;;;6079:1;6072:9;6043:419;;;-1:-1:-1;6478:3:118;;5787:700;-1:-1:-1;;;;;5787:700:118:o;6492:1240::-;6548:3;6592:5;6586:12;6619:4;6614:3;6607:17;6643:42;6742:2;6727:12;6721:19;6717:28;6710:4;6705:3;6701:14;6694:52;6813:2;6805:4;6791:12;6787:23;6781:30;6777:39;6771:3;6766;6762:13;6755:62;6872:4;6858:12;6854:23;6848:30;6842:3;6837;6833:13;6826:53;6934:4;6920:12;6916:23;6910:30;6904:3;6899;6895:13;6888:53;7008:2;7000:4;6986:12;6982:23;6976:30;6972:39;6966:3;6961;6957:13;6950:62;;7067:4;7053:12;7049:23;7043:30;7021:52;;7104:4;7098:3;7093;7089:13;7082:27;7131:47;7173:3;7168;7164:13;7148:14;7131:47;:::i;:::-;7118:60;;7226:4;7219:5;7215:16;7209:23;7241:60;7295:4;7290:3;7286:14;7270;5606:12;;5620:42;5602:61;5590:74;;5713:4;5702:16;;;5696:23;5680:14;;;5673:47;5769:4;5758:16;;;5752:23;5736:14;;5729:47;5526:256;7241:60;;7349:4;7342:5;7338:16;7332:23;7398:3;7391:5;7387:15;7380:4;7375:3;7371:14;7364:39;7424:62;7480:5;7464:14;7424:62;:::i;:::-;7412:74;;;7534:4;7527:5;7523:16;7517:23;7582:3;7576:4;7572:14;7565:4;7560:3;7556:14;7549:38;7610;7643:4;7627:14;7610:38;:::i;:::-;7596:52;;;7697:4;7690:5;7686:16;7680:23;7673:4;7668:3;7664:14;7657:47;7720:6;7713:13;;;6492:1240;;;;:::o;7737:1274::-;7999:4;8047:2;8036:9;8032:18;8077:2;8066:9;8059:21;8100:6;8135;8129:13;8166:6;8158;8151:22;8204:2;8193:9;8189:18;8182:25;;8266:2;8256:6;8253:1;8249:14;8238:9;8234:30;8230:39;8216:53;;8288:4;8327:2;8319:6;8315:15;8348:1;8358:328;8372:6;8369:1;8366:13;8358:328;;;8461:66;8449:9;8441:6;8437:22;8433:95;8428:3;8421:108;8552:54;8599:6;8590;8584:13;8552:54;:::i;:::-;8542:64;-1:-1:-1;8664:12:118;;;;8629:15;;;;8394:1;8387:9;8358:328;;;8362:3;;8734:9;8726:6;8722:22;8717:2;8706:9;8702:18;8695:50;8769:6;8761;8754:22;8823:6;8815;8810:2;8802:6;8798:15;8785:45;8876:1;8850:19;;;8846:28;;8839:39;8927:2;8915:15;;;8932:66;8911:88;8899:101;;;8895:110;;;;7737:1274;-1:-1:-1;;;;;;7737:1274:118:o;9016:388::-;9114:4;9172:11;9159:25;9262:66;9251:8;9235:14;9231:29;9227:102;9207:18;9203:127;9193:155;;9344:1;9341;9334:12;9193:155;9365:33;;;;;9016:388;-1:-1:-1;;9016:388:118:o;10442:580::-;10519:4;10525:6;10585:11;10572:25;10675:66;10664:8;10648:14;10644:29;10640:102;10620:18;10616:127;10606:155;;10757:1;10754;10747:12;10606:155;10784:33;;10836:20;;;-1:-1:-1;10879:18:118;10868:30;;10865:50;;;10911:1;10908;10901:12;10865:50;10944:4;10932:17;;-1:-1:-1;10975:14:118;10971:27;;;10961:38;;10958:58;;;11012:1;11009;11002:12;11027:253;11099:2;11093:9;11141:4;11129:17;;11176:18;11161:34;;11197:22;;;11158:62;11155:88;;;11223:18;;:::i;:::-;11259:2;11252:22;11027:253;:::o;11285:::-;11357:2;11351:9;11399:4;11387:17;;11434:18;11419:34;;11455:22;;;11416:62;11413:88;;;11481:18;;:::i;11543:255::-;11615:2;11609:9;11657:6;11645:19;;11694:18;11679:34;;11715:22;;;11676:62;11673:88;;;11741:18;;:::i;11803:334::-;11874:2;11868:9;11930:2;11920:13;;11935:66;11916:86;11904:99;;12033:18;12018:34;;12054:22;;;12015:62;12012:88;;;12080:18;;:::i;:::-;12116:2;12109:22;11803:334;;-1:-1:-1;11803:334:118:o;12142:589::-;12184:5;12237:3;12230:4;12222:6;12218:17;12214:27;12204:55;;12255:1;12252;12245:12;12204:55;12291:6;12278:20;12317:18;12313:2;12310:26;12307:52;;;12339:18;;:::i;:::-;12383:114;12491:4;12422:66;12415:4;12411:2;12407:13;12403:86;12399:97;12383:114;:::i;:::-;12522:2;12513:7;12506:19;12568:3;12561:4;12556:2;12548:6;12544:15;12540:26;12537:35;12534:55;;;12585:1;12582;12575:12;12534:55;12650:2;12643:4;12635:6;12631:17;12624:4;12615:7;12611:18;12598:55;12698:1;12673:16;;;12691:4;12669:27;12662:38;;;;12677:7;12142:589;-1:-1:-1;;;12142:589:118:o;12736:1093::-;12792:5;12840:4;12828:9;12823:3;12819:19;12815:30;12812:50;;;12858:1;12855;12848:12;12812:50;12891:2;12885:9;12933:4;12925:6;12921:17;12957:18;13025:6;13013:10;13010:22;13005:2;12993:10;12990:18;12987:46;12984:72;;;13036:18;;:::i;:::-;13076:10;13072:2;13065:22;13105:6;13096:15;;13148:9;13135:23;13120:38;;13167:33;13192:7;13167:33;:::i;:::-;13209:23;;;13284:2;13269:18;;13256:32;;13297:33;13256:32;13297:33;:::i;:::-;13363:7;13358:2;13350:6;13346:15;13339:32;13432:2;13421:9;13417:18;13404:32;13399:2;13391:6;13387:15;13380:57;13498:2;13487:9;13483:18;13470:32;13465:2;13457:6;13453:15;13446:57;13555:3;13544:9;13540:19;13527:33;13512:48;;13569:33;13594:7;13569:33;:::i;:::-;13636:7;13630:3;13622:6;13618:16;13611:33;13695:3;13684:9;13680:19;13667:33;13653:47;;13723:2;13715:6;13712:14;13709:34;;;13739:1;13736;13729:12;13709:34;;13777:45;13818:3;13809:6;13798:9;13794:22;13777:45;:::i;:::-;13771:3;13763:6;13759:16;13752:71;;;12736:1093;;;;:::o;13834:426::-;13894:5;13942:4;13930:9;13925:3;13921:19;13917:30;13914:50;;;13960:1;13957;13950:12;13914:50;13982:22;;:::i;:::-;13973:31;;14041:9;14028:23;14060:33;14085:7;14060:33;:::i;:::-;14116:7;14109:5;14102:22;;14184:2;14173:9;14169:18;14156:32;14151:2;14144:5;14140:14;14133:56;14249:2;14238:9;14234:18;14221:32;14216:2;14209:5;14205:14;14198:56;13834:426;;;;:::o;14265:197::-;14339:4;14372:18;14364:6;14361:30;14358:56;;;14394:18;;:::i;:::-;-1:-1:-1;14439:1:118;14435:14;14451:4;14431:25;;14265:197::o;14467:1301::-;14535:5;14588:3;14581:4;14573:6;14569:17;14565:27;14555:55;;14606:1;14603;14596:12;14555:55;14642:6;14629:20;14668:4;14692:74;14708:57;14762:2;14708:57;:::i;:::-;14692:74;:::i;:::-;14800:15;;;14886:1;14882:10;;;;14870:23;;14866:32;;;14831:12;;;;14910:15;;;14907:35;;;14938:1;14935;14928:12;14907:35;14974:2;14966:6;14962:15;14986:753;15002:6;14997:3;14994:15;14986:753;;;15080:4;15074:3;15069;15065:13;15061:24;15058:114;;;15126:1;15155:2;15151;15144:14;15058:114;15198:22;;:::i;:::-;15261:3;15248:17;15278:33;15303:7;15278:33;:::i;:::-;15324:22;;15395:12;;;15382:26;15366:14;;;15359:50;15432:2;15483:12;;;15470:26;15454:14;;;15447:50;15520:2;15563:12;;;15550:26;15589:33;15550:26;15589:33;:::i;:::-;15642:14;;;15635:31;15679:18;;15717:12;;;;15028:4;15019:14;14986:753;;;-1:-1:-1;15757:5:118;14467:1301;-1:-1:-1;;;;;;14467:1301:118:o;15773:419::-;15840:5;15888:4;15876:9;15871:3;15867:19;15863:30;15860:50;;;15906:1;15903;15896:12;15860:50;15939:2;15933:9;15981:4;15973:6;15969:17;16052:6;16040:10;16037:22;16016:18;16004:10;16001:34;15998:62;15995:88;;;16063:18;;:::i;:::-;16099:2;16092:22;16162:23;;16147:39;;-1:-1:-1;16132:6:118;15773:419;-1:-1:-1;15773:419:118:o;16197:1370::-;16288:6;16341:2;16329:9;16320:7;16316:23;16312:32;16309:52;;;16357:1;16354;16347:12;16309:52;16397:9;16384:23;16426:18;16467:2;16459:6;16456:14;16453:34;;;16483:1;16480;16473:12;16453:34;16506:22;;;;16562:6;16544:16;;;16540:29;16537:49;;;16582:1;16579;16572:12;16537:49;16608:22;;:::i;:::-;16668:2;16655:16;16696:2;16686:8;16683:16;16680:36;;;16712:1;16709;16702:12;16680:36;16739:55;16786:7;16775:8;16771:2;16767:17;16739:55;:::i;:::-;16732:5;16725:70;;16827:31;16854:2;16850;16846:11;16827:31;:::i;:::-;16822:2;16815:5;16811:14;16804:55;16912:2;16908;16904:11;16891:25;16886:2;16879:5;16875:14;16868:49;16970:2;16966;16962:11;16949:25;16944:2;16937:5;16933:14;16926:49;17008:54;17054:7;17048:3;17044:2;17040:12;17008:54;:::i;:::-;17002:3;16995:5;16991:15;16984:79;17109:3;17105:2;17101:12;17088:26;17139:2;17129:8;17126:16;17123:36;;;17155:1;17152;17145:12;17123:36;17193:70;17255:7;17244:8;17240:2;17236:17;17193:70;:::i;:::-;17186:4;17179:5;17175:16;17168:96;;17298:64;17354:7;17345:6;17341:2;17337:15;17298:64;:::i;:::-;17291:4;17284:5;17280:16;17273:90;17409:3;17405:2;17401:12;17388:26;17439:2;17429:8;17426:16;17423:36;;;17455:1;17452;17445:12;17423:36;17492:44;17528:7;17517:8;17513:2;17509:17;17492:44;:::i;:::-;17486:3;17475:15;;17468:69;-1:-1:-1;17479:5:118;16197:1370;-1:-1:-1;;;;;16197:1370:118:o;17754:1798::-;18712:16;18707:3;18700:29;18759:17;18754:2;18749:3;18745:12;18738:39;18807:19;18802:2;18797:3;18793:12;18786:41;18857:28;18852:2;18847:3;18843:12;18836:50;18916:33;18911:2;18906:3;18902:12;18895:55;18981:22;18975:3;18970;18966:13;18959:45;19035:27;19029:3;19024;19020:13;19013:50;18682:3;19092:6;19086:13;19108:76;19177:6;19171:3;19166;19162:13;19155:4;19147:6;19143:17;19108:76;:::i;:::-;19244:13;;19203:16;;;;19266:77;19244:13;19328:3;19320:12;;19313:4;19301:17;;19266:77;:::i;:::-;19404:13;;19362:17;;;19426:77;19404:13;19488:3;19480:12;;19473:4;19461:17;;19426:77;:::i;:::-;19523:17;19542:3;19519:27;;17754:1798;-1:-1:-1;;;;;17754:1798:118:o;20218:245::-;20297:6;20305;20358:2;20346:9;20337:7;20333:23;20329:32;20326:52;;;20374:1;20371;20364:12;20326:52;-1:-1:-1;;20397:16:118;;20453:2;20438:18;;;20432:25;20397:16;;20432:25;;-1:-1:-1;20218:245:118:o;20735:359::-;20922:6;20917:3;20910:19;20892:3;20958:6;20952:13;20974:73;21040:6;21035:2;21030:3;21026:12;21021:2;21013:6;21009:15;20974:73;:::i;:::-;21067:16;;;;21085:2;21063:25;;20735:359;-1:-1:-1;;;20735:359:118:o;21502:184::-;21554:77;21551:1;21544:88;21651:4;21648:1;21641:15;21675:4;21672:1;21665:15;21691:168;21764:9;;;21795;;21812:15;;;21806:22;;21792:37;21782:71;;21833:18;;:::i;21864:128::-;21931:9;;;21952:11;;;21949:37;;;21966:18;;:::i;21997:278::-;22190:2;22179:9;22172:21;22153:4;22210:59;22265:2;22254:9;22250:18;22242:6;22210:59;:::i;22280:1460::-;22405:6;22436:2;22479;22467:9;22458:7;22454:23;22450:32;22447:52;;;22495:1;22492;22485:12;22447:52;22528:9;22522:16;22561:18;22553:6;22550:30;22547:50;;;22593:1;22590;22583:12;22547:50;22616:22;;22669:4;22661:13;;22657:27;-1:-1:-1;22647:55:118;;22698:1;22695;22688:12;22647:55;22727:2;22721:9;22750:74;22766:57;22820:2;22766:57;:::i;22750:74::-;22858:15;;;22920:4;22959:13;;;22951:22;;22947:31;;;22889:12;;;;22846:3;22990:19;;;22987:39;;;23022:1;23019;23012:12;22987:39;23046:11;;;;23066:644;23082:6;23077:3;23074:15;23066:644;;;23162:2;23156:3;23147:7;23143:17;23139:26;23136:116;;;23206:1;23235:2;23231;23224:14;23136:116;23278:22;;:::i;:::-;23334:3;23328:10;23351:33;23376:7;23351:33;:::i;:::-;23397:22;;23461:12;;;23455:19;23439:14;;;23432:43;23498:2;23534:12;;;23528:19;23560:33;23528:19;23560:33;:::i;:::-;23613:14;;;23606:31;23650:18;;23099:12;;;;23688;;;;23066:644;;;-1:-1:-1;23729:5:118;22280:1460;-1:-1:-1;;;;;;;22280:1460:118:o;23745:125::-;23810:9;;;23831:10;;;23828:36;;;23844:18;;:::i;24278:398::-;24511:42;24503:6;24499:55;24488:9;24481:74;24591:2;24586;24575:9;24571:18;24564:30;24462:4;24611:59;24666:2;24655:9;24651:18;24643:6;24611:59;:::i;24681:659::-;24989:24;24984:3;24977:37;24959:3;25043:6;25037:13;25059:75;25127:6;25122:2;25117:3;25113:12;25106:4;25098:6;25094:17;25059:75;:::i;:::-;25194:13;;25153:16;;;;25216:76;25194:13;25278:2;25270:11;;25263:4;25251:17;;25216:76;:::i;:::-;25312:17;25331:2;25308:26;;24681:659;-1:-1:-1;;;;24681:659:118:o;25556:1088::-;25986:4;26015:3;26027:60;26077:9;26068:6;26062:13;25431:12;;25445:42;25427:61;25415:74;;25538:4;25527:16;;;25521:23;25505:14;;25498:47;25345:206;26027:60;26143:4;26135:6;26131:17;26125:24;26118:4;26107:9;26103:20;26096:54;26206:4;26198:6;26194:17;26188:24;26181:4;26170:9;26166:20;26159:54;26222:63;26280:3;26269:9;26265:19;26257:6;25431:12;;25445:42;25427:61;25415:74;;25538:4;25527:16;;;25521:23;25505:14;;25498:47;25345:206;26222:63;26334:42;26326:6;26322:55;26316:3;26305:9;26301:19;26294:84;26415:6;26409:3;26398:9;26394:19;26387:35;26459:2;26453:3;26442:9;26438:19;26431:31;26485:44;26525:2;26514:9;26510:18;26502:6;26485:44;:::i;:::-;26471:58;;26578:9;26570:6;26566:22;26560:3;26549:9;26545:19;26538:51;26606:32;26631:6;26623;26606:32;:::i;:::-;26598:40;25556:1088;-1:-1:-1;;;;;;;;;25556:1088:118:o","linkReferences":{},"immutableReferences":{"54921":[{"start":224,"length":32},{"start":6425,"length":32}]}},"methodIdentifiers":{"execute((bytes,bytes))":"3f62192e","executeBatch((bytes,bytes)[])":"0d7a16c3","executeBatchWithCallback((bytes,bytes)[],bytes)":"13fb72c7","executeWithCallback((bytes,bytes),bytes)":"0d335884","feeController()":"6999b377","owner()":"8da5cb5b","permit2()":"12261ee7","setProtocolFeeController(address)":"2d771389","transferOwnership(address)":"f2fde38b"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.24+commit.e11b9ed9\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IPermit2\",\"name\":\"_permit2\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_protocolFeeOwner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"duplicateToken\",\"type\":\"address\"}],\"name\":\"DuplicateFeeOutput\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"FeeTooLarge\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputAndOutputFees\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InputOutputScaling\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidCosignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDeadline\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"feeToken\",\"type\":\"address\"}],\"name\":\"InvalidFeeToken\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidGasPrice\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidReactor\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NativeTransferFailed\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"OrderNotFillable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"orderHash\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"filler\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"swapper\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"}],\"name\":\"Fill\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldFeeController\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newFeeController\",\"type\":\"address\"}],\"name\":\"ProtocolFeeControllerSet\",\"type\":\"event\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"order\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"internalType\":\"struct SignedOrder\",\"name\":\"order\",\"type\":\"tuple\"}],\"name\":\"execute\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"order\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"internalType\":\"struct SignedOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"}],\"name\":\"executeBatch\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"order\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"internalType\":\"struct SignedOrder[]\",\"name\":\"orders\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes\",\"name\":\"callbackData\",\"type\":\"bytes\"}],\"name\":\"executeBatchWithCallback\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"order\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"sig\",\"type\":\"bytes\"}],\"internalType\":\"struct SignedOrder\",\"name\":\"order\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"callbackData\",\"type\":\"bytes\"}],\"name\":\"executeWithCallback\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeController\",\"outputs\":[{\"internalType\":\"contract IProtocolFeeController\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"permit2\",\"outputs\":[{\"internalType\":\"contract IPermit2\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newFeeController\",\"type\":\"address\"}],\"name\":\"setProtocolFeeController\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"only supported on chains which use priority fee transaction ordering\",\"events\":{\"Fill(bytes32,address,address,uint256)\":{\"params\":{\"filler\":\"The address which executed the fill\",\"nonce\":\"The nonce of the filled order\",\"orderHash\":\"The hash of the order that was filled\",\"swapper\":\"The swapper of the filled order\"}}},\"kind\":\"dev\",\"methods\":{\"execute((bytes,bytes))\":{\"params\":{\"order\":\"The order definition and valid signature to execute\"}},\"executeBatch((bytes,bytes)[])\":{\"params\":{\"orders\":\"The order definitions and valid signatures to execute\"}},\"executeBatchWithCallback((bytes,bytes)[],bytes)\":{\"params\":{\"callbackData\":\"The callbackData to pass to the callback\",\"orders\":\"The order definitions and valid signatures to execute\"}},\"executeWithCallback((bytes,bytes),bytes)\":{\"params\":{\"callbackData\":\"The callbackData to pass to the callback\",\"order\":\"The order definition and valid signature to execute\"}},\"setProtocolFeeController(address)\":{\"details\":\"only callable by the owner\",\"params\":{\"_newFeeController\":\"the new fee controller\"}}},\"version\":1},\"userdoc\":{\"errors\":{\"DuplicateFeeOutput(address)\":[{\"notice\":\"thrown if two fee outputs have the same token\"}],\"FeeTooLarge(address,uint256,address)\":[{\"notice\":\"thrown if a given fee output is greater than MAX_FEE_BPS of the order outputs\"}],\"InputAndOutputFees()\":[{\"notice\":\"thrown if fees are taken on both inputs and outputs\"}],\"InputOutputScaling()\":[{\"notice\":\"thrown when an order's input and outputs both scale with priority fee\"}],\"InvalidCosignature()\":[{\"notice\":\"thrown when an order's cosignature does not match the expected cosigner\"}],\"InvalidDeadline()\":[{\"notice\":\"thrown when an order's deadline is in the past\"}],\"InvalidFeeToken(address)\":[{\"notice\":\"thrown if a fee output token does not have a corresponding non-fee output\"}],\"InvalidGasPrice()\":[{\"notice\":\"thrown when tx gasprice is less than block.basefee\"}],\"InvalidReactor()\":[{\"notice\":\"thrown when the order targets a different reactor\"}],\"NativeTransferFailed()\":[{\"notice\":\"Thrown when a native transfer fails\"}],\"OrderNotFillable()\":[{\"notice\":\"thrown when an order's auctionStartBlock is in the future\"}]},\"events\":{\"Fill(bytes32,address,address,uint256)\":{\"notice\":\"emitted when an order is filled\"}},\"kind\":\"user\",\"methods\":{\"execute((bytes,bytes))\":{\"notice\":\"Execute a single order\"},\"executeBatch((bytes,bytes)[])\":{\"notice\":\"Execute the given orders at once\"},\"executeBatchWithCallback((bytes,bytes)[],bytes)\":{\"notice\":\"Execute the given orders at once using a callback with the given callback data\"},\"executeWithCallback((bytes,bytes),bytes)\":{\"notice\":\"Execute a single order using the given callback data\"},\"permit2()\":{\"notice\":\"permit2 address used for token transfers and signature verification\"},\"setProtocolFeeController(address)\":{\"notice\":\"sets the protocol fee controller\"}},\"notice\":\"Reactor for priority orders\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/reactors/PriorityOrderReactor.sol\":\"PriorityOrderReactor\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":1000000},\"remappings\":[\":ds-test/=lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-gas-snapshot/=lib/forge-gas-snapshot/src/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/\",\":openzeppelin/=lib/openzeppelin-contracts/contracts/\",\":permit2/=lib/permit2/\",\":solarray/=lib/solarray/src/\",\":solmate/=lib/solmate/\"]},\"sources\":{\"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol\":{\"keccak256\":\"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://41319e7f621f2dc3733511332c4fd032f8e32ad2aa7fd6f665c19741d9941a34\",\"dweb:/ipfs/QmcYR3bd862GD1Bc7jwrU9bGxrhUu5na1oP964bDCu2id1\"]},\"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol\":{\"keccak256\":\"0x52a8cfb0f5239d11b457dcdd1b326992ef672714ca8da71a157255bddd13f3ad\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://495145362c7ff1c9ca88c58bbbbcb412e3c2004406647412394486552ff6c278\",\"dweb:/ipfs/QmNNCeng6d5eRPDn6tkWSQhjE39XWfQEfjA63rRwHmr1iH\"]},\"lib/permit2/src/interfaces/IAllowanceTransfer.sol\":{\"keccak256\":\"0x78931704a7f1d89ef24244b155863abb751cc3b3818f64303ccb47a396d48dcb\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b8d6e198ee29d809564f1c1d7caa11a2c329bb5d051f61210548e546493444d2\",\"dweb:/ipfs/QmVxWftbgETjudymgLdwF77S54DWrp6qB5ooauKXW81cm7\"]},\"lib/permit2/src/interfaces/IEIP712.sol\":{\"keccak256\":\"0xea70db68ce450ad38dfbd490058595441144808eb95272ae9b89e3fbe6456954\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e8fad9ff319665acdc2f1295bb82db3e5b4d52babc0b58f147dbdbb9f322c6e5\",\"dweb:/ipfs/QmTbYJPcux8eJ3qGVYQh6TiwCA2FPu6HXTUg6QFTnX91Ks\"]},\"lib/permit2/src/interfaces/IPermit2.sol\":{\"keccak256\":\"0xaa631cc9f53e699301d94233007110a345e6779011def484e8dd97b8fe0af771\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fc0502cf19c9c18f320a3001201e89e350393b75837f6b7971de18b2de06f30d\",\"dweb:/ipfs/QmT9SfhdJ7VJNNrf94g4H5usyi7ShqWGx7Cqsz9jZTjX96\"]},\"lib/permit2/src/interfaces/ISignatureTransfer.sol\":{\"keccak256\":\"0x6805563eaad92471fa1b3591a71d7020a93e59f1a4ac95398daf74927f5bd033\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://48cd13806cb8e82dcc38eb93423a372fbdd3b05364ecebb8bfd9cd29078dd90c\",\"dweb:/ipfs/QmeLyFVrzKRHcm6aaFFBCG5mFESCqWLp1KYT41H8XhzMCp\"]},\"lib/solmate/src/auth/Owned.sol\":{\"keccak256\":\"0xfedb27d14c508342c33eb067c9a02eabcdb0f9dcf93b04ded1001f580d12d0ea\",\"license\":\"AGPL-3.0-only\",\"urls\":[\"bzz-raw://1ff52bbee698b9cf9e4574615e6550be0887ccf355f6571e23d6f25b332e79b4\",\"dweb:/ipfs/QmVorA2apojVRStzS7h8aFccR3Uv32G6HVtBtFHZrE7YXx\"]},\"lib/solmate/src/tokens/ERC20.sol\":{\"keccak256\":\"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10\",\"license\":\"AGPL-3.0-only\",\"urls\":[\"bzz-raw://57b3ab70cde374af1cf2c9888636e8de6cf660f087b1c9abd805e9271e19fa35\",\"dweb:/ipfs/QmNrLDBAHYFjpjSd12jerm1AdBkDqEYUUaXgnT854BUZ97\"]},\"lib/solmate/src/utils/FixedPointMathLib.sol\":{\"keccak256\":\"0x1b62af9baf5b8e991ed7531bc87f45550ba9d61e8dbff5caf237ccaf3a3fd843\",\"license\":\"AGPL-3.0-only\",\"urls\":[\"bzz-raw://b7b38b977c5305b18ceefbeed4c9ceaaaefa419b520de62de6604ea661f8c0a9\",\"dweb:/ipfs/QmecMRzgfMyDVa2pvBqMMDLYBappaj7Aa3qcMoQYEQrhWi\"]},\"lib/solmate/src/utils/SafeTransferLib.sol\":{\"keccak256\":\"0x6ab948013c2c7ca6351e593600425b0ec6df9035320280c678e735bce16e996b\",\"license\":\"AGPL-3.0-only\",\"urls\":[\"bzz-raw://2ab977d0eeb2bf458f9798250215c646d2f3b1f90b5a7e2b506fdf3335c0f060\",\"dweb:/ipfs/QmYPRoPhNtBAmCSq7imN1scMVpKNQvMTpoqab3tXUx5Tnv\"]},\"src/base/ProtocolFees.sol\":{\"keccak256\":\"0x1152eee4ac698694bcdbf90b016411112d679812ca0abc1cacd7e6b465e6729a\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://c1be6b94c6268b68362111e728598e7c1517b20998fdf6752d08e32d55c210f8\",\"dweb:/ipfs/QmStQC274cQqnQSo3QDBcT5BdqEkpwZwFaWwxaYXMZidvw\"]},\"src/base/ReactorEvents.sol\":{\"keccak256\":\"0x61df7aa3ef970f1305c5a6d8c68b0d7ab8bebb9b7518e191c8d2fda532859f61\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://93db11be28b3394485b57a7b120ca224fdb93b471db8468738406f77ebaa13fc\",\"dweb:/ipfs/Qmci4TSUH81C3WDV7TMv56VmiUFZ9MDxZcGTRKhhEPS6gC\"]},\"src/base/ReactorStructs.sol\":{\"keccak256\":\"0x78e6db322ca69aaf552e59d5e74a00fd465a802388c2d03f9bf4b711f5704588\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://12d8fc82c3543bfe0d2cd44cdbc524bed1f074abafe086f7e58573cbaff2a74e\",\"dweb:/ipfs/QmREbamTn3nz89nEjv2uWHNHKSF6Yga2gQ688Cde89xcNT\"]},\"src/interfaces/IProtocolFeeController.sol\":{\"keccak256\":\"0x21a895ff5b778abf95753001a20b4004adfadd1bba622eaec18eb81836ede86c\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://67f9eae1da9f238f6630247882e382458dcc0135c0a4837b99a44a2360a3845c\",\"dweb:/ipfs/QmdJyKhVyD6nAtgdTofaU2xaoWrPGM1Q6Sd7FiN2LxXZQx\"]},\"src/interfaces/IReactor.sol\":{\"keccak256\":\"0x23714e546bbeeaa7fe35665d7241319c964421a9fe6d81aead4b85027cabf1e1\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://3b94402a2e90f75d6238d4460c0b1125bf67b98523803156b104ce57cafdd05b\",\"dweb:/ipfs/QmbY3Mr44MPEMAe9bh9tUSqpPg3AAKfkVfydwJCEzFA14a\"]},\"src/interfaces/IReactorCallback.sol\":{\"keccak256\":\"0xf3ee1fe09545fc5be000c33bb6779e897b4e5013bd9de3e7c3107bf466b4dfa1\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://12d7fd1ac3dca76614796f0d012ea4de79bf09cf124cc74efffdf25a56756344\",\"dweb:/ipfs/QmXyeSrG7caihgzUZdPdPbbRj6v1w65gBnfn9a7HhbVJX9\"]},\"src/interfaces/IValidationCallback.sol\":{\"keccak256\":\"0xc31e3a60e210e9a4089f48ba4fae06dec6f4d33da4fbe415cfb8cdc202003bae\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://ee145d5fc0e0806dc9db57825142d5d7c3eafc248a27ee301ffd13592f2cda34\",\"dweb:/ipfs/QmQr2HBHZKiUu88a3M1Hs4QSjFemsZmPEd115QG6GKjsC1\"]},\"src/lib/CurrencyLibrary.sol\":{\"keccak256\":\"0x73688c07cd36b5040e0deca3dd1f21a8b19585d6cdfefb816fae98af92a545ea\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://750375d6f0e59f7977b9cfc2cf05fef7b356cea7875fbb71b0ca359d091b8479\",\"dweb:/ipfs/QmZbdTSS1BxWqAHjmtwoJsggbRVkwnxynJuaxzKkkakm4Y\"]},\"src/lib/OrderInfoLib.sol\":{\"keccak256\":\"0x38672b528e63dc53f36ed82d0037110a9f5893ad0a3957e24f19fa3fdbd80015\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://147172dbebf4bb579bc392f25666645719264c0b47378f7fc4f3a95c79bdf5a4\",\"dweb:/ipfs/Qmd5wVnQ8rKHHQgUQzEDcAPiqrVzmNr9t2D7d1SqUg9hTo\"]},\"src/lib/Permit2Lib.sol\":{\"keccak256\":\"0xcb5e1e204f4ac6ea3fa164b8be1b1d31cbad0dff981072ea2c33abd720369e78\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://cfa162286525ef8684112639c7b981c0472b06ce799f2440c626a70c273bb533\",\"dweb:/ipfs/QmV1Uy4oodhg4SbCajv9xhiWFuwtU1YcTTvca1cDYCkND9\"]},\"src/lib/PriorityFeeLib.sol\":{\"keccak256\":\"0xeb10a0ad27cf0f0131bdd205b0d7614423eedebd9f745e0c02be6ccef7e44742\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://706633e79e0967cd3ebd5faf733634053b0eb4b51c293d1549af4654856f3459\",\"dweb:/ipfs/QmfTuDHUm5cyTW9grpb1N8xyGYmpUq2ANbh4P3DWJoLzwm\"]},\"src/lib/PriorityOrderLib.sol\":{\"keccak256\":\"0x98ff55bb03fd9dd0eb5cb453cd7d36991c6d76c81964c9ef8b923428dad47d79\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://dfd9a57f9b603faff8d32153a953d23b769dacd9a6246df48790cd3620aa993d\",\"dweb:/ipfs/QmcKbUMwEHAxLvwe6qPyso2JPrTAATJ28kWYepUJXUEz6k\"]},\"src/lib/ResolvedOrderLib.sol\":{\"keccak256\":\"0xc56a31e72001e3e6ee0baf193423a7563cc61ba4869133e1cae5cf998bfe4d96\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://4bddef26f26939f48923b11674495515d792cffbb2dc04f092212ff0b9971636\",\"dweb:/ipfs/QmS1YAzhYLCi9oDtZN33mwBf5iExdwMhPNcnzh5nA8fPKX\"]},\"src/reactors/BaseReactor.sol\":{\"keccak256\":\"0xd31b25dd7209a704fb17865e8112bc83a72e1816bc1d636c89366b2f1e3c4210\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://f10c83e80f01d728f48aa06905e272eef776159ea83b53885c182da15597e3ca\",\"dweb:/ipfs/Qmf2nx9abWsTMCVBV1At66HS3FVTXHreUVCpwVDKjkYadY\"]},\"src/reactors/PriorityOrderReactor.sol\":{\"keccak256\":\"0x9ec70c0297411fe7965cc8347431fb8995d797d48e59f103307f782d47ac3066\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://1786b6423447bf5695641378b3b202107e3e096ac92d48b58336e52bbbb086e9\",\"dweb:/ipfs/QmQ39XpzHgJ4rHqSG7k2fuTNcWXVsnTxoDS34zKxaRjPgH\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.24+commit.e11b9ed9"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"contract IPermit2","name":"_permit2","type":"address"},{"internalType":"address","name":"_protocolFeeOwner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"duplicateToken","type":"address"}],"type":"error","name":"DuplicateFeeOutput"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"type":"error","name":"FeeTooLarge"},{"inputs":[],"type":"error","name":"InputAndOutputFees"},{"inputs":[],"type":"error","name":"InputOutputScaling"},{"inputs":[],"type":"error","name":"InvalidCosignature"},{"inputs":[],"type":"error","name":"InvalidDeadline"},{"inputs":[{"internalType":"address","name":"feeToken","type":"address"}],"type":"error","name":"InvalidFeeToken"},{"inputs":[],"type":"error","name":"InvalidGasPrice"},{"inputs":[],"type":"error","name":"InvalidReactor"},{"inputs":[],"type":"error","name":"NativeTransferFailed"},{"inputs":[],"type":"error","name":"OrderNotFillable"},{"inputs":[{"internalType":"bytes32","name":"orderHash","type":"bytes32","indexed":true},{"internalType":"address","name":"filler","type":"address","indexed":true},{"internalType":"address","name":"swapper","type":"address","indexed":true},{"internalType":"uint256","name":"nonce","type":"uint256","indexed":false}],"type":"event","name":"Fill","anonymous":false},{"inputs":[{"internalType":"address","name":"user","type":"address","indexed":true},{"internalType":"address","name":"newOwner","type":"address","indexed":true}],"type":"event","name":"OwnershipTransferred","anonymous":false},{"inputs":[{"internalType":"address","name":"oldFeeController","type":"address","indexed":false},{"internalType":"address","name":"newFeeController","type":"address","indexed":false}],"type":"event","name":"ProtocolFeeControllerSet","anonymous":false},{"inputs":[{"internalType":"struct SignedOrder","name":"order","type":"tuple","components":[{"internalType":"bytes","name":"order","type":"bytes"},{"internalType":"bytes","name":"sig","type":"bytes"}]}],"stateMutability":"payable","type":"function","name":"execute"},{"inputs":[{"internalType":"struct SignedOrder[]","name":"orders","type":"tuple[]","components":[{"internalType":"bytes","name":"order","type":"bytes"},{"internalType":"bytes","name":"sig","type":"bytes"}]}],"stateMutability":"payable","type":"function","name":"executeBatch"},{"inputs":[{"internalType":"struct SignedOrder[]","name":"orders","type":"tuple[]","components":[{"internalType":"bytes","name":"order","type":"bytes"},{"internalType":"bytes","name":"sig","type":"bytes"}]},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"stateMutability":"payable","type":"function","name":"executeBatchWithCallback"},{"inputs":[{"internalType":"struct SignedOrder","name":"order","type":"tuple","components":[{"internalType":"bytes","name":"order","type":"bytes"},{"internalType":"bytes","name":"sig","type":"bytes"}]},{"internalType":"bytes","name":"callbackData","type":"bytes"}],"stateMutability":"payable","type":"function","name":"executeWithCallback"},{"inputs":[],"stateMutability":"view","type":"function","name":"feeController","outputs":[{"internalType":"contract IProtocolFeeController","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}]},{"inputs":[],"stateMutability":"view","type":"function","name":"permit2","outputs":[{"internalType":"contract IPermit2","name":"","type":"address"}]},{"inputs":[{"internalType":"address","name":"_newFeeController","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"setProtocolFeeController"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"transferOwnership"},{"inputs":[],"stateMutability":"payable","type":"receive"}],"devdoc":{"kind":"dev","methods":{"execute((bytes,bytes))":{"params":{"order":"The order definition and valid signature to execute"}},"executeBatch((bytes,bytes)[])":{"params":{"orders":"The order definitions and valid signatures to execute"}},"executeBatchWithCallback((bytes,bytes)[],bytes)":{"params":{"callbackData":"The callbackData to pass to the callback","orders":"The order definitions and valid signatures to execute"}},"executeWithCallback((bytes,bytes),bytes)":{"params":{"callbackData":"The callbackData to pass to the callback","order":"The order definition and valid signature to execute"}},"setProtocolFeeController(address)":{"details":"only callable by the owner","params":{"_newFeeController":"the new fee controller"}}},"version":1},"userdoc":{"kind":"user","methods":{"execute((bytes,bytes))":{"notice":"Execute a single order"},"executeBatch((bytes,bytes)[])":{"notice":"Execute the given orders at once"},"executeBatchWithCallback((bytes,bytes)[],bytes)":{"notice":"Execute the given orders at once using a callback with the given callback data"},"executeWithCallback((bytes,bytes),bytes)":{"notice":"Execute a single order using the given callback data"},"permit2()":{"notice":"permit2 address used for token transfers and signature verification"},"setProtocolFeeController(address)":{"notice":"sets the protocol fee controller"}},"version":1}},"settings":{"remappings":["ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-gas-snapshot/=lib/forge-gas-snapshot/src/","forge-std/=lib/forge-std/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/","openzeppelin/=lib/openzeppelin-contracts/contracts/","permit2/=lib/permit2/","solarray/=lib/solarray/src/","solmate/=lib/solmate/"],"optimizer":{"enabled":true,"runs":1000000},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/reactors/PriorityOrderReactor.sol":"PriorityOrderReactor"},"evmVersion":"paris","libraries":{}},"sources":{"lib/openzeppelin-contracts/contracts/security/ReentrancyGuard.sol":{"keccak256":"0xa535a5df777d44e945dd24aa43a11e44b024140fc340ad0dfe42acf4002aade1","urls":["bzz-raw://41319e7f621f2dc3733511332c4fd032f8e32ad2aa7fd6f665c19741d9941a34","dweb:/ipfs/QmcYR3bd862GD1Bc7jwrU9bGxrhUu5na1oP964bDCu2id1"],"license":"MIT"},"lib/openzeppelin-contracts/contracts/utils/math/SafeCast.sol":{"keccak256":"0x52a8cfb0f5239d11b457dcdd1b326992ef672714ca8da71a157255bddd13f3ad","urls":["bzz-raw://495145362c7ff1c9ca88c58bbbbcb412e3c2004406647412394486552ff6c278","dweb:/ipfs/QmNNCeng6d5eRPDn6tkWSQhjE39XWfQEfjA63rRwHmr1iH"],"license":"MIT"},"lib/permit2/src/interfaces/IAllowanceTransfer.sol":{"keccak256":"0x78931704a7f1d89ef24244b155863abb751cc3b3818f64303ccb47a396d48dcb","urls":["bzz-raw://b8d6e198ee29d809564f1c1d7caa11a2c329bb5d051f61210548e546493444d2","dweb:/ipfs/QmVxWftbgETjudymgLdwF77S54DWrp6qB5ooauKXW81cm7"],"license":"MIT"},"lib/permit2/src/interfaces/IEIP712.sol":{"keccak256":"0xea70db68ce450ad38dfbd490058595441144808eb95272ae9b89e3fbe6456954","urls":["bzz-raw://e8fad9ff319665acdc2f1295bb82db3e5b4d52babc0b58f147dbdbb9f322c6e5","dweb:/ipfs/QmTbYJPcux8eJ3qGVYQh6TiwCA2FPu6HXTUg6QFTnX91Ks"],"license":"MIT"},"lib/permit2/src/interfaces/IPermit2.sol":{"keccak256":"0xaa631cc9f53e699301d94233007110a345e6779011def484e8dd97b8fe0af771","urls":["bzz-raw://fc0502cf19c9c18f320a3001201e89e350393b75837f6b7971de18b2de06f30d","dweb:/ipfs/QmT9SfhdJ7VJNNrf94g4H5usyi7ShqWGx7Cqsz9jZTjX96"],"license":"MIT"},"lib/permit2/src/interfaces/ISignatureTransfer.sol":{"keccak256":"0x6805563eaad92471fa1b3591a71d7020a93e59f1a4ac95398daf74927f5bd033","urls":["bzz-raw://48cd13806cb8e82dcc38eb93423a372fbdd3b05364ecebb8bfd9cd29078dd90c","dweb:/ipfs/QmeLyFVrzKRHcm6aaFFBCG5mFESCqWLp1KYT41H8XhzMCp"],"license":"MIT"},"lib/solmate/src/auth/Owned.sol":{"keccak256":"0xfedb27d14c508342c33eb067c9a02eabcdb0f9dcf93b04ded1001f580d12d0ea","urls":["bzz-raw://1ff52bbee698b9cf9e4574615e6550be0887ccf355f6571e23d6f25b332e79b4","dweb:/ipfs/QmVorA2apojVRStzS7h8aFccR3Uv32G6HVtBtFHZrE7YXx"],"license":"AGPL-3.0-only"},"lib/solmate/src/tokens/ERC20.sol":{"keccak256":"0xcdfd8db76b2a3415620e4d18cc5545f3d50de792dbf2c3dd5adb40cbe6f94b10","urls":["bzz-raw://57b3ab70cde374af1cf2c9888636e8de6cf660f087b1c9abd805e9271e19fa35","dweb:/ipfs/QmNrLDBAHYFjpjSd12jerm1AdBkDqEYUUaXgnT854BUZ97"],"license":"AGPL-3.0-only"},"lib/solmate/src/utils/FixedPointMathLib.sol":{"keccak256":"0x1b62af9baf5b8e991ed7531bc87f45550ba9d61e8dbff5caf237ccaf3a3fd843","urls":["bzz-raw://b7b38b977c5305b18ceefbeed4c9ceaaaefa419b520de62de6604ea661f8c0a9","dweb:/ipfs/QmecMRzgfMyDVa2pvBqMMDLYBappaj7Aa3qcMoQYEQrhWi"],"license":"AGPL-3.0-only"},"lib/solmate/src/utils/SafeTransferLib.sol":{"keccak256":"0x6ab948013c2c7ca6351e593600425b0ec6df9035320280c678e735bce16e996b","urls":["bzz-raw://2ab977d0eeb2bf458f9798250215c646d2f3b1f90b5a7e2b506fdf3335c0f060","dweb:/ipfs/QmYPRoPhNtBAmCSq7imN1scMVpKNQvMTpoqab3tXUx5Tnv"],"license":"AGPL-3.0-only"},"src/base/ProtocolFees.sol":{"keccak256":"0x1152eee4ac698694bcdbf90b016411112d679812ca0abc1cacd7e6b465e6729a","urls":["bzz-raw://c1be6b94c6268b68362111e728598e7c1517b20998fdf6752d08e32d55c210f8","dweb:/ipfs/QmStQC274cQqnQSo3QDBcT5BdqEkpwZwFaWwxaYXMZidvw"],"license":"GPL-2.0-or-later"},"src/base/ReactorEvents.sol":{"keccak256":"0x61df7aa3ef970f1305c5a6d8c68b0d7ab8bebb9b7518e191c8d2fda532859f61","urls":["bzz-raw://93db11be28b3394485b57a7b120ca224fdb93b471db8468738406f77ebaa13fc","dweb:/ipfs/Qmci4TSUH81C3WDV7TMv56VmiUFZ9MDxZcGTRKhhEPS6gC"],"license":"GPL-2.0-or-later"},"src/base/ReactorStructs.sol":{"keccak256":"0x78e6db322ca69aaf552e59d5e74a00fd465a802388c2d03f9bf4b711f5704588","urls":["bzz-raw://12d8fc82c3543bfe0d2cd44cdbc524bed1f074abafe086f7e58573cbaff2a74e","dweb:/ipfs/QmREbamTn3nz89nEjv2uWHNHKSF6Yga2gQ688Cde89xcNT"],"license":"GPL-2.0-or-later"},"src/interfaces/IProtocolFeeController.sol":{"keccak256":"0x21a895ff5b778abf95753001a20b4004adfadd1bba622eaec18eb81836ede86c","urls":["bzz-raw://67f9eae1da9f238f6630247882e382458dcc0135c0a4837b99a44a2360a3845c","dweb:/ipfs/QmdJyKhVyD6nAtgdTofaU2xaoWrPGM1Q6Sd7FiN2LxXZQx"],"license":"GPL-2.0-or-later"},"src/interfaces/IReactor.sol":{"keccak256":"0x23714e546bbeeaa7fe35665d7241319c964421a9fe6d81aead4b85027cabf1e1","urls":["bzz-raw://3b94402a2e90f75d6238d4460c0b1125bf67b98523803156b104ce57cafdd05b","dweb:/ipfs/QmbY3Mr44MPEMAe9bh9tUSqpPg3AAKfkVfydwJCEzFA14a"],"license":"GPL-2.0-or-later"},"src/interfaces/IReactorCallback.sol":{"keccak256":"0xf3ee1fe09545fc5be000c33bb6779e897b4e5013bd9de3e7c3107bf466b4dfa1","urls":["bzz-raw://12d7fd1ac3dca76614796f0d012ea4de79bf09cf124cc74efffdf25a56756344","dweb:/ipfs/QmXyeSrG7caihgzUZdPdPbbRj6v1w65gBnfn9a7HhbVJX9"],"license":"GPL-2.0-or-later"},"src/interfaces/IValidationCallback.sol":{"keccak256":"0xc31e3a60e210e9a4089f48ba4fae06dec6f4d33da4fbe415cfb8cdc202003bae","urls":["bzz-raw://ee145d5fc0e0806dc9db57825142d5d7c3eafc248a27ee301ffd13592f2cda34","dweb:/ipfs/QmQr2HBHZKiUu88a3M1Hs4QSjFemsZmPEd115QG6GKjsC1"],"license":"GPL-2.0-or-later"},"src/lib/CurrencyLibrary.sol":{"keccak256":"0x73688c07cd36b5040e0deca3dd1f21a8b19585d6cdfefb816fae98af92a545ea","urls":["bzz-raw://750375d6f0e59f7977b9cfc2cf05fef7b356cea7875fbb71b0ca359d091b8479","dweb:/ipfs/QmZbdTSS1BxWqAHjmtwoJsggbRVkwnxynJuaxzKkkakm4Y"],"license":"GPL-2.0-or-later"},"src/lib/OrderInfoLib.sol":{"keccak256":"0x38672b528e63dc53f36ed82d0037110a9f5893ad0a3957e24f19fa3fdbd80015","urls":["bzz-raw://147172dbebf4bb579bc392f25666645719264c0b47378f7fc4f3a95c79bdf5a4","dweb:/ipfs/Qmd5wVnQ8rKHHQgUQzEDcAPiqrVzmNr9t2D7d1SqUg9hTo"],"license":"GPL-2.0-or-later"},"src/lib/Permit2Lib.sol":{"keccak256":"0xcb5e1e204f4ac6ea3fa164b8be1b1d31cbad0dff981072ea2c33abd720369e78","urls":["bzz-raw://cfa162286525ef8684112639c7b981c0472b06ce799f2440c626a70c273bb533","dweb:/ipfs/QmV1Uy4oodhg4SbCajv9xhiWFuwtU1YcTTvca1cDYCkND9"],"license":"GPL-2.0-or-later"},"src/lib/PriorityFeeLib.sol":{"keccak256":"0xeb10a0ad27cf0f0131bdd205b0d7614423eedebd9f745e0c02be6ccef7e44742","urls":["bzz-raw://706633e79e0967cd3ebd5faf733634053b0eb4b51c293d1549af4654856f3459","dweb:/ipfs/QmfTuDHUm5cyTW9grpb1N8xyGYmpUq2ANbh4P3DWJoLzwm"],"license":"GPL-2.0-or-later"},"src/lib/PriorityOrderLib.sol":{"keccak256":"0x98ff55bb03fd9dd0eb5cb453cd7d36991c6d76c81964c9ef8b923428dad47d79","urls":["bzz-raw://dfd9a57f9b603faff8d32153a953d23b769dacd9a6246df48790cd3620aa993d","dweb:/ipfs/QmcKbUMwEHAxLvwe6qPyso2JPrTAATJ28kWYepUJXUEz6k"],"license":"GPL-2.0-or-later"},"src/lib/ResolvedOrderLib.sol":{"keccak256":"0xc56a31e72001e3e6ee0baf193423a7563cc61ba4869133e1cae5cf998bfe4d96","urls":["bzz-raw://4bddef26f26939f48923b11674495515d792cffbb2dc04f092212ff0b9971636","dweb:/ipfs/QmS1YAzhYLCi9oDtZN33mwBf5iExdwMhPNcnzh5nA8fPKX"],"license":"GPL-2.0-or-later"},"src/reactors/BaseReactor.sol":{"keccak256":"0xd31b25dd7209a704fb17865e8112bc83a72e1816bc1d636c89366b2f1e3c4210","urls":["bzz-raw://f10c83e80f01d728f48aa06905e272eef776159ea83b53885c182da15597e3ca","dweb:/ipfs/Qmf2nx9abWsTMCVBV1At66HS3FVTXHreUVCpwVDKjkYadY"],"license":"GPL-2.0-or-later"},"src/reactors/PriorityOrderReactor.sol":{"keccak256":"0x9ec70c0297411fe7965cc8347431fb8995d797d48e59f103307f782d47ac3066","urls":["bzz-raw://1786b6423447bf5695641378b3b202107e3e096ac92d48b58336e52bbbb086e9","dweb:/ipfs/QmQ39XpzHgJ4rHqSG7k2fuTNcWXVsnTxoDS34zKxaRjPgH"],"license":"GPL-2.0-or-later"}},"version":1},"id":73} \ No newline at end of file diff --git a/sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.test.ts b/sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.test.ts new file mode 100644 index 000000000..b6b7dc6e4 --- /dev/null +++ b/sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.test.ts @@ -0,0 +1,235 @@ +import { BigNumber, constants } from "ethers"; + +import { CosignedPriorityOrder } from "../order"; + +import { PriorityOrderBuilder } from "./PriorityOrderBuilder"; + +const BLOCK = BigNumber.from(100); +const AMOUNT = BigNumber.from("1000000"); + +describe("PriorityOrderBuilder", () => { + let builder: PriorityOrderBuilder; + let order: CosignedPriorityOrder; + + beforeEach(() => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + order = builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .auctionStartBlock(BLOCK) + .baselinePriorityFeeWei(BigNumber.from(0)) + .cosigner(constants.AddressZero) + .input({ + token: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + amount: AMOUNT, + mpsPerPriorityFeeWei: BigNumber.from(0), + }) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: AMOUNT, + mpsPerPriorityFeeWei: BigNumber.from(1), + recipient: "0x0000000000000000000000000000000000000000", + }) + .auctionTargetBlock(BLOCK.sub(2)) + .cosignature("0x") + .build(); + }); + + it("Builds a valid order", () => { + expect(order.info.auctionStartBlock).toEqual(BLOCK); + expect(order.info.cosignerData.auctionTargetBlock).toEqual(BLOCK.sub(2)); + expect(order.info.input.amount).toEqual(AMOUNT); + expect(order.info.input.mpsPerPriorityFeeWei).toEqual(BigNumber.from(0)); + expect(order.info.outputs.length).toEqual(1); + expect(order.info.outputs[0].amount).toEqual(AMOUNT); + expect(order.info.outputs[0].mpsPerPriorityFeeWei).toEqual( + BigNumber.from(1) + ); + }); + + it("Regenerates builder from order", () => { + const regenerated = PriorityOrderBuilder.fromOrder(order).build(); + expect(regenerated.toJSON()).toMatchObject(order.toJSON()); + }); + + it("Regenerates builder from order json", () => { + const json = order.toJSON(); + const regenerated = PriorityOrderBuilder.fromOrder( + CosignedPriorityOrder.fromJSON(json, 1) + ).build(); + expect(regenerated.toJSON()).toMatchObject(order.toJSON()); + }); + + it("Regenerates builder allows modification", () => { + const regenerated = PriorityOrderBuilder.fromOrder(order) + .auctionStartBlock(BLOCK.add(1)) + .build(); + expect(regenerated.info.auctionStartBlock).toEqual( + order.info.auctionStartBlock.add(1) + ); + }); + + it("Builds a valid order with multiple outputs", () => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + order = builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .auctionStartBlock(BLOCK) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .cosignature(order.info.cosignature) + .auctionTargetBlock(BLOCK.sub(2)) + .input({ + token: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48", + amount: AMOUNT, + mpsPerPriorityFeeWei: BigNumber.from(0), + }) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: AMOUNT, + mpsPerPriorityFeeWei: BigNumber.from(1), + recipient: "0x0000000000000000000000000000000000000000", + }) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: AMOUNT.div(10), + mpsPerPriorityFeeWei: BigNumber.from(1), + recipient: "0x0000000000000000000000000000000000000000", + }) + .build(); + + expect(order.info.outputs.length).toEqual(2); + }); + + it("Must set input", () => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + expect(() => + builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .auctionStartBlock(BLOCK) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .cosignature(order.info.cosignature) + .auctionTargetBlock(BLOCK.sub(2)) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(1), + recipient: "0x0000000000000000000000000000000000000000", + }) + .build() + ).toThrow("input not set"); + }); + + it("Must set output(s)", () => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + expect(() => + builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .auctionStartBlock(BLOCK) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .cosignature(order.info.cosignature) + .auctionTargetBlock(BLOCK.sub(2)) + .input({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(1), + }) + .build() + ).toThrow("outputs not set"); + }); + + it("Must set auctionStartBlock", () => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + expect(() => + builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .cosignature(order.info.cosignature) + .auctionTargetBlock(BLOCK.sub(2)) + .input({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(0), + }) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(1), + recipient: "0x0000000000000000000000000000000000000000", + }) + .build() + ).toThrow("auctionStartBlock not set"); + }); + + it("Must configure priority auction on either input or output", () => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + expect(() => + builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .auctionStartBlock(BLOCK) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .cosignature(order.info.cosignature) + .auctionTargetBlock(BLOCK.sub(2)) + .input({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(0), + }) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(0), + recipient: "0x0000000000000000000000000000000000000000", + }) + .build() + ).toThrow("Priority auction not configured"); + }); + + it("Cannot configure priority auction on both input and output", () => { + const deadline = Math.floor(Date.now() / 1000) + 1000; + builder = new PriorityOrderBuilder(1); + expect(() => + builder + .deadline(deadline) + .swapper("0x0000000000000000000000000000000000000001") + .nonce(BigNumber.from(100)) + .auctionStartBlock(BLOCK) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .cosignature(order.info.cosignature) + .auctionTargetBlock(BLOCK.sub(2)) + .input({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(1), + }) + .output({ + token: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", + amount: BigNumber.from("100"), + mpsPerPriorityFeeWei: BigNumber.from(1), + recipient: "0x0000000000000000000000000000000000000000", + }) + .build() + ).toThrow("Can only configure priority auction on either input or output"); + }); +}); diff --git a/sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.ts b/sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.ts new file mode 100644 index 000000000..7f2933319 --- /dev/null +++ b/sdks/uniswapx-sdk/src/builder/PriorityOrderBuilder.ts @@ -0,0 +1,267 @@ +import { BigNumber } from "ethers"; +import invariant from "tiny-invariant"; + +import { OrderType } from "../constants"; +import { + CosignedPriorityOrder, + CosignedPriorityOrderInfo, + PriorityCosignerData, + PriorityInput, + PriorityOutput, + UnsignedPriorityOrder, +} from "../order"; +import { ValidationInfo } from "../order/validation"; +import { getPermit2, getReactor } from "../utils"; + +import { OrderBuilder } from "./OrderBuilder"; + +/** + * Helper builder for generating priority gas auction orders + */ +export class PriorityOrderBuilder extends OrderBuilder { + private info: Partial; + + static fromOrder( + order: O + ): PriorityOrderBuilder { + // note chainId not used if passing in true reactor address + const builder = new PriorityOrderBuilder(order.chainId, order.info.reactor) + .deadline(order.info.deadline) + .swapper(order.info.swapper) + .nonce(order.info.nonce) + .input(order.info.input) + .auctionStartBlock(order.info.auctionStartBlock) + .baselinePriorityFeeWei(order.info.baselinePriorityFeeWei) + .cosigner(order.info.cosigner) + .validation({ + additionalValidationContract: order.info.additionalValidationContract, + additionalValidationData: order.info.additionalValidationData, + }); + + for (const output of order.info.outputs) { + builder.output(output); + } + + if (isCosigned(order)) { + builder.cosignature(order.info.cosignature); + builder.auctionTargetBlock(order.info.cosignerData.auctionTargetBlock); + } + return builder; + } + + constructor( + private chainId: number, + reactorAddress?: string, + private permit2Address?: string + ) { + super(); + + this.reactor(getReactor(chainId, OrderType.Priority, reactorAddress)); + this.permit2Address = getPermit2(chainId, permit2Address); + + this.info = { + cosignerData: { + auctionTargetBlock: BigNumber.from(0), + }, + outputs: [], + }; + } + + cosigner(cosigner: string): this { + this.info.cosigner = cosigner; + return this; + } + + auctionStartBlock(auctionStartBlock: BigNumber): this { + this.info.auctionStartBlock = auctionStartBlock; + return this; + } + + auctionTargetBlock(auctionTargetBlock: BigNumber): this { + if (!this.info.cosignerData) { + this.info.cosignerData = { + auctionTargetBlock: auctionTargetBlock, + }; + } else { + this.info.cosignerData.auctionTargetBlock = auctionTargetBlock; + } + return this; + } + + baselinePriorityFeeWei(baselinePriorityFeeWei: BigNumber): this { + this.info.baselinePriorityFeeWei = baselinePriorityFeeWei; + return this; + } + + cosignerData(cosignerData: PriorityCosignerData): this { + this.info.cosignerData = cosignerData; + return this; + } + + cosignature(cosignature: string | undefined): this { + this.info.cosignature = cosignature; + return this; + } + + input(input: PriorityInput): this { + this.info.input = input; + return this; + } + + output(output: PriorityOutput): this { + if (!this.info.outputs) { + this.info.outputs = []; + } + this.info.outputs.push(output); + return this; + } + + deadline(deadline: number): this { + super.deadline(deadline); + return this; + } + + swapper(swapper: string): this { + super.swapper(swapper); + return this; + } + + nonce(nonce: BigNumber): this { + super.nonce(nonce); + return this; + } + + validation(info: ValidationInfo): this { + super.validation(info); + return this; + } + + // ensures that we only change non fee outputs + nonFeeRecipient( + newRecipient: string, + feeRecipient?: string + ): PriorityOrderBuilder { + invariant( + newRecipient !== feeRecipient, + `newRecipient must be different from feeRecipient: ${newRecipient}` + ); + if (!this.info.outputs) { + return this; + } + this.info.outputs = this.info.outputs.map((output) => { + // if fee output then pass through + if ( + feeRecipient && + output.recipient.toLowerCase() === feeRecipient.toLowerCase() + ) { + return output; + } + + return { + ...output, + recipient: newRecipient, + }; + }); + return this; + } + + buildPartial(): UnsignedPriorityOrder { + invariant(this.info.input !== undefined, "input not set"); + invariant(this.info.cosigner !== undefined, "cosigner not set"); + invariant( + this.info.baselinePriorityFeeWei !== undefined, + "baselinePriorityFeeWei not set" + ); + invariant( + this.info.outputs !== undefined && this.info.outputs.length !== 0, + "outputs not set" + ); + invariant( + this.info.auctionStartBlock !== undefined && + this.info.auctionStartBlock.gt(0), + "auctionStartBlock not set" + ); + invariant( + !this.info.input.mpsPerPriorityFeeWei.eq(0) || + this.info.outputs.every((output) => !output.mpsPerPriorityFeeWei.eq(0)), + "Priority auction not configured" + ); + invariant( + !( + this.info.input.mpsPerPriorityFeeWei.gt(0) && + this.info.outputs.every((output) => output.mpsPerPriorityFeeWei.gt(0)) + ), + "Can only configure priority auction on either input or output" + ); + return new UnsignedPriorityOrder( + Object.assign(this.getOrderInfo(), { + cosigner: this.info.cosigner, + auctionStartBlock: this.info.auctionStartBlock, + baselinePriorityFeeWei: this.info.baselinePriorityFeeWei, + input: this.info.input, + outputs: this.info.outputs, + }), + this.chainId, + this.permit2Address + ); + } + + build(): CosignedPriorityOrder { + invariant(this.info.input !== undefined, "input not set"); + invariant(this.info.cosigner !== undefined, "cosigner not set"); + invariant(this.info.cosignature !== undefined, "cosignature not set"); + invariant( + this.info.baselinePriorityFeeWei !== undefined, + "baselinePriorityFeeWei not set" + ); + invariant( + this.info.outputs !== undefined && this.info.outputs.length !== 0, + "outputs not set" + ); + invariant( + this.info.auctionStartBlock !== undefined && + this.info.auctionStartBlock.gt(0), + "auctionStartBlock not set" + ); + invariant( + this.info.cosignerData !== undefined && + this.info.cosignerData.auctionTargetBlock.gt(0) && + this.info.cosignerData.auctionTargetBlock.lt( + this.info.auctionStartBlock + ), + "auctionTargetBlock not set properly" + ); + invariant( + !this.info.input.mpsPerPriorityFeeWei.eq(0) || + this.info.outputs.every((output) => !output.mpsPerPriorityFeeWei.eq(0)), + "Priority auction not configured" + ); + invariant( + !( + this.info.input.mpsPerPriorityFeeWei.gt(0) && + this.info.outputs.some((output) => output.mpsPerPriorityFeeWei.gt(0)) + ), + "Can only configure priority auction on either input or output" + ); + + return new CosignedPriorityOrder( + Object.assign(this.getOrderInfo(), { + cosigner: this.info.cosigner, + auctionStartBlock: this.info.auctionStartBlock, + baselinePriorityFeeWei: this.info.baselinePriorityFeeWei, + input: this.info.input, + outputs: this.info.outputs, + cosignerData: this.info.cosignerData, + cosignature: this.info.cosignature, + }), + this.chainId, + this.permit2Address + ); + } +} + +function isCosigned( + order: UnsignedPriorityOrder | CosignedPriorityOrder +): order is CosignedPriorityOrder { + return (order as CosignedPriorityOrder).info.cosignature !== undefined; +} diff --git a/sdks/uniswapx-sdk/src/builder/index.ts b/sdks/uniswapx-sdk/src/builder/index.ts index 1ee3fe59f..3e374a3a0 100644 --- a/sdks/uniswapx-sdk/src/builder/index.ts +++ b/sdks/uniswapx-sdk/src/builder/index.ts @@ -1,4 +1,5 @@ export * from "./DutchOrderBuilder"; export * from "./RelayOrderBuilder"; export * from "./V2DutchOrderBuilder"; +export * from "./PriorityOrderBuilder"; export * from "./OrderBuilder"; diff --git a/sdks/uniswapx-sdk/src/constants.test.ts b/sdks/uniswapx-sdk/src/constants.test.ts index 478b417cf..4fb7dbd56 100644 --- a/sdks/uniswapx-sdk/src/constants.test.ts +++ b/sdks/uniswapx-sdk/src/constants.test.ts @@ -7,6 +7,7 @@ describe("REACTOR_ADDRESS_MAPPING", () => { "1": Object { "Dutch": "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4", "Dutch_V2": "0x00000011F84B9aa48e5f8aA8B9897600006289Be", + "Priority": "0x0000000000000000000000000000000000000000", "Relay": "0x0000000000A4e21E2597DCac987455c48b12edBF", }, "11155111": Object { @@ -34,6 +35,12 @@ describe("REACTOR_ADDRESS_MAPPING", () => { "Dutch_V2": "0x0000000000000000000000000000000000000000", "Relay": "0x0000000000A4e21E2597DCac987455c48b12edBF", }, + "8453": Object { + "Dutch": "0x0000000000000000000000000000000000000000", + "Dutch_V2": "0x0000000000000000000000000000000000000000", + "Priority": "0x0000000000000000000000000000000000000000", + "Relay": "0x0000000000000000000000000000000000000000", + }, } `); }); diff --git a/sdks/uniswapx-sdk/src/constants.ts b/sdks/uniswapx-sdk/src/constants.ts index 7cb4d92bd..433e4d866 100644 --- a/sdks/uniswapx-sdk/src/constants.ts +++ b/sdks/uniswapx-sdk/src/constants.ts @@ -1,4 +1,5 @@ import { ChainId } from "@uniswap/sdk-core"; +import { BigNumber } from "ethers"; type AddressMap = { readonly [key: number]: string }; @@ -25,6 +26,7 @@ export const PERMIT2_MAPPING: AddressMap = { 11155111: "0x000000000022d473030f116ddee9f6b43ac78ba3", 42161: "0x000000000022d473030f116ddee9f6b43ac78ba3", 12341234: "0x000000000022d473030f116ddee9f6b43ac78ba3", + 8453: "0x000000000022d473030f116ddee9f6b43ac78ba3", }; export const UNISWAPX_ORDER_QUOTER_MAPPING: AddressMap = { @@ -51,6 +53,7 @@ export enum OrderType { Relay = "Relay", Dutch_V2 = "Dutch_V2", Limit = "Limit", + Priority = "Priority", } type Reactors = Partial<{ @@ -73,6 +76,7 @@ export const REACTOR_ADDRESS_MAPPING: ReactorMapping = { [OrderType.Dutch]: "0x6000da47483062A0D734Ba3dc7576Ce6A0B645C4", [OrderType.Dutch_V2]: "0x00000011F84B9aa48e5f8aA8B9897600006289Be", [OrderType.Relay]: "0x0000000000A4e21E2597DCac987455c48b12edBF", + [OrderType.Priority]: "0x0000000000000000000000000000000000000000", }, 12341234: { [OrderType.Dutch]: "0xbD7F9D0239f81C94b728d827a87b9864972661eC", @@ -89,6 +93,12 @@ export const REACTOR_ADDRESS_MAPPING: ReactorMapping = { [OrderType.Dutch]: "0x0000000000000000000000000000000000000000", [OrderType.Relay]: "0x0000000000000000000000000000000000000000", }, + 8453: { + [OrderType.Dutch]: "0x0000000000000000000000000000000000000000", + [OrderType.Dutch_V2]: "0x0000000000000000000000000000000000000000", + [OrderType.Relay]: "0x0000000000000000000000000000000000000000", + [OrderType.Priority]: "0x0000000000000000000000000000000000000000", + }, }; // aliasing for backwards compatibility @@ -96,23 +106,23 @@ export const REACTOR_CONTRACT_MAPPING: ReactorMapping = REACTOR_ADDRESS_MAPPING; // https://github.com/mds1/multicall export const multicallAddressOn = (chainId = 1) => { - switch(chainId) { + switch (chainId) { // multicall3 is deployed to a different address on zksync than all other EVM chains - // due to differences in create2 address derivation + // due to differences in create2 address derivation // deployment address from: https://github.com/mds1/multicall/blob/d7b62458c99c650ce1efa7464ffad69d2059ad56/deployments.json#L927 case 324: return "0xF9cda624FBC7e059355ce98a31693d299FACd963"; default: return "0xcA11bde05977b3631167028862bE2a173976CA11"; } -} +}; export const RELAY_SENTINEL_RECIPIENT = "0x0000000000000000000000000000000000000000"; export const REVERSE_REACTOR_MAPPING: ReverseReactorMapping = Object.entries( REACTOR_ADDRESS_MAPPING -// eslint-disable-next-line @typescript-eslint/no-unused-vars + // eslint-disable-next-line @typescript-eslint/no-unused-vars ).reduce((acc: ReverseReactorMapping, [_, orderTypes]) => { for (const [orderType, reactorAddress] of Object.entries(orderTypes)) { // lowercase for consistency when parsing orders @@ -125,3 +135,5 @@ export const REVERSE_REACTOR_MAPPING: ReverseReactorMapping = Object.entries( }, {}); export const BPS = 10000; + +export const MPS = BigNumber.from(10).pow(7); diff --git a/sdks/uniswapx-sdk/src/contracts/PriorityOrderReactor.ts b/sdks/uniswapx-sdk/src/contracts/PriorityOrderReactor.ts new file mode 100644 index 000000000..f06b229d4 --- /dev/null +++ b/sdks/uniswapx-sdk/src/contracts/PriorityOrderReactor.ts @@ -0,0 +1,426 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, + PromiseOrValue, +} from "./common"; + +export type SignedOrderStruct = { + order: PromiseOrValue; + sig: PromiseOrValue; +}; + +export type SignedOrderStructOutput = [string, string] & { + order: string; + sig: string; +}; + +export interface PriorityOrderReactorInterface extends utils.Interface { + functions: { + "execute((bytes,bytes))": FunctionFragment; + "executeBatch((bytes,bytes)[])": FunctionFragment; + "executeBatchWithCallback((bytes,bytes)[],bytes)": FunctionFragment; + "executeWithCallback((bytes,bytes),bytes)": FunctionFragment; + "feeController()": FunctionFragment; + "owner()": FunctionFragment; + "permit2()": FunctionFragment; + "setProtocolFeeController(address)": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "execute" + | "executeBatch" + | "executeBatchWithCallback" + | "executeWithCallback" + | "feeController" + | "owner" + | "permit2" + | "setProtocolFeeController" + | "transferOwnership" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "execute", + values: [SignedOrderStruct] + ): string; + encodeFunctionData( + functionFragment: "executeBatch", + values: [SignedOrderStruct[]] + ): string; + encodeFunctionData( + functionFragment: "executeBatchWithCallback", + values: [SignedOrderStruct[], PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "executeWithCallback", + values: [SignedOrderStruct, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "feeController", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData(functionFragment: "permit2", values?: undefined): string; + encodeFunctionData( + functionFragment: "setProtocolFeeController", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [PromiseOrValue] + ): string; + + decodeFunctionResult(functionFragment: "execute", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "executeBatch", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executeBatchWithCallback", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executeWithCallback", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "feeController", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "permit2", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setProtocolFeeController", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + + events: { + "Fill(bytes32,address,address,uint256)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + "ProtocolFeeControllerSet(address,address)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "Fill"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "ProtocolFeeControllerSet"): EventFragment; +} + +export interface FillEventObject { + orderHash: string; + filler: string; + swapper: string; + nonce: BigNumber; +} +export type FillEvent = TypedEvent< + [string, string, string, BigNumber], + FillEventObject +>; + +export type FillEventFilter = TypedEventFilter; + +export interface OwnershipTransferredEventObject { + user: string; + newOwner: string; +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +>; + +export type OwnershipTransferredEventFilter = + TypedEventFilter; + +export interface ProtocolFeeControllerSetEventObject { + oldFeeController: string; + newFeeController: string; +} +export type ProtocolFeeControllerSetEvent = TypedEvent< + [string, string], + ProtocolFeeControllerSetEventObject +>; + +export type ProtocolFeeControllerSetEventFilter = + TypedEventFilter; + +export interface PriorityOrderReactor extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: PriorityOrderReactorInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + execute( + order: SignedOrderStruct, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatch( + orders: SignedOrderStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatchWithCallback( + orders: SignedOrderStruct[], + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeWithCallback( + order: SignedOrderStruct, + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + feeController(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + permit2(overrides?: CallOverrides): Promise<[string]>; + + setProtocolFeeController( + _newFeeController: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + execute( + order: SignedOrderStruct, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatch( + orders: SignedOrderStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatchWithCallback( + orders: SignedOrderStruct[], + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeWithCallback( + order: SignedOrderStruct, + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + feeController(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + permit2(overrides?: CallOverrides): Promise; + + setProtocolFeeController( + _newFeeController: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + execute(order: SignedOrderStruct, overrides?: CallOverrides): Promise; + + executeBatch( + orders: SignedOrderStruct[], + overrides?: CallOverrides + ): Promise; + + executeBatchWithCallback( + orders: SignedOrderStruct[], + callbackData: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + executeWithCallback( + order: SignedOrderStruct, + callbackData: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + feeController(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + permit2(overrides?: CallOverrides): Promise; + + setProtocolFeeController( + _newFeeController: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "Fill(bytes32,address,address,uint256)"( + orderHash?: PromiseOrValue | null, + filler?: PromiseOrValue | null, + swapper?: PromiseOrValue | null, + nonce?: null + ): FillEventFilter; + Fill( + orderHash?: PromiseOrValue | null, + filler?: PromiseOrValue | null, + swapper?: PromiseOrValue | null, + nonce?: null + ): FillEventFilter; + + "OwnershipTransferred(address,address)"( + user?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + user?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null + ): OwnershipTransferredEventFilter; + + "ProtocolFeeControllerSet(address,address)"( + oldFeeController?: null, + newFeeController?: null + ): ProtocolFeeControllerSetEventFilter; + ProtocolFeeControllerSet( + oldFeeController?: null, + newFeeController?: null + ): ProtocolFeeControllerSetEventFilter; + }; + + estimateGas: { + execute( + order: SignedOrderStruct, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatch( + orders: SignedOrderStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatchWithCallback( + orders: SignedOrderStruct[], + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeWithCallback( + order: SignedOrderStruct, + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + feeController(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + permit2(overrides?: CallOverrides): Promise; + + setProtocolFeeController( + _newFeeController: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + execute( + order: SignedOrderStruct, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatch( + orders: SignedOrderStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeBatchWithCallback( + orders: SignedOrderStruct[], + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + executeWithCallback( + order: SignedOrderStruct, + callbackData: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue } + ): Promise; + + feeController(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + permit2(overrides?: CallOverrides): Promise; + + setProtocolFeeController( + _newFeeController: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/sdks/uniswapx-sdk/src/contracts/factories/PriorityOrderReactor__factory.ts b/sdks/uniswapx-sdk/src/contracts/factories/PriorityOrderReactor__factory.ts new file mode 100644 index 000000000..735425ff5 --- /dev/null +++ b/sdks/uniswapx-sdk/src/contracts/factories/PriorityOrderReactor__factory.ts @@ -0,0 +1,426 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import { Signer, utils, Contract, ContractFactory, Overrides } from "ethers"; +import type { Provider, TransactionRequest } from "@ethersproject/providers"; +import type { PromiseOrValue } from "../common"; +import type { + PriorityOrderReactor, + PriorityOrderReactorInterface, +} from "../PriorityOrderReactor"; + +const _abi = [ + { + type: "constructor", + inputs: [ + { + name: "_permit2", + type: "address", + internalType: "contract IPermit2", + }, + { + name: "_protocolFeeOwner", + type: "address", + internalType: "address", + }, + ], + stateMutability: "nonpayable", + }, + { + type: "receive", + stateMutability: "payable", + }, + { + type: "function", + name: "execute", + inputs: [ + { + name: "order", + type: "tuple", + internalType: "struct SignedOrder", + components: [ + { + name: "order", + type: "bytes", + internalType: "bytes", + }, + { + name: "sig", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "function", + name: "executeBatch", + inputs: [ + { + name: "orders", + type: "tuple[]", + internalType: "struct SignedOrder[]", + components: [ + { + name: "order", + type: "bytes", + internalType: "bytes", + }, + { + name: "sig", + type: "bytes", + internalType: "bytes", + }, + ], + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "function", + name: "executeBatchWithCallback", + inputs: [ + { + name: "orders", + type: "tuple[]", + internalType: "struct SignedOrder[]", + components: [ + { + name: "order", + type: "bytes", + internalType: "bytes", + }, + { + name: "sig", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "callbackData", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "function", + name: "executeWithCallback", + inputs: [ + { + name: "order", + type: "tuple", + internalType: "struct SignedOrder", + components: [ + { + name: "order", + type: "bytes", + internalType: "bytes", + }, + { + name: "sig", + type: "bytes", + internalType: "bytes", + }, + ], + }, + { + name: "callbackData", + type: "bytes", + internalType: "bytes", + }, + ], + outputs: [], + stateMutability: "payable", + }, + { + type: "function", + name: "feeController", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IProtocolFeeController", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "owner", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "address", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "permit2", + inputs: [], + outputs: [ + { + name: "", + type: "address", + internalType: "contract IPermit2", + }, + ], + stateMutability: "view", + }, + { + type: "function", + name: "setProtocolFeeController", + inputs: [ + { + name: "_newFeeController", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "function", + name: "transferOwnership", + inputs: [ + { + name: "newOwner", + type: "address", + internalType: "address", + }, + ], + outputs: [], + stateMutability: "nonpayable", + }, + { + type: "event", + name: "Fill", + inputs: [ + { + name: "orderHash", + type: "bytes32", + indexed: true, + internalType: "bytes32", + }, + { + name: "filler", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "swapper", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "nonce", + type: "uint256", + indexed: false, + internalType: "uint256", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "OwnershipTransferred", + inputs: [ + { + name: "user", + type: "address", + indexed: true, + internalType: "address", + }, + { + name: "newOwner", + type: "address", + indexed: true, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "event", + name: "ProtocolFeeControllerSet", + inputs: [ + { + name: "oldFeeController", + type: "address", + indexed: false, + internalType: "address", + }, + { + name: "newFeeController", + type: "address", + indexed: false, + internalType: "address", + }, + ], + anonymous: false, + }, + { + type: "error", + name: "DuplicateFeeOutput", + inputs: [ + { + name: "duplicateToken", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "FeeTooLarge", + inputs: [ + { + name: "token", + type: "address", + internalType: "address", + }, + { + name: "amount", + type: "uint256", + internalType: "uint256", + }, + { + name: "recipient", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "InputAndOutputFees", + inputs: [], + }, + { + type: "error", + name: "InputOutputScaling", + inputs: [], + }, + { + type: "error", + name: "InvalidCosignature", + inputs: [], + }, + { + type: "error", + name: "InvalidDeadline", + inputs: [], + }, + { + type: "error", + name: "InvalidFeeToken", + inputs: [ + { + name: "feeToken", + type: "address", + internalType: "address", + }, + ], + }, + { + type: "error", + name: "InvalidGasPrice", + inputs: [], + }, + { + type: "error", + name: "InvalidReactor", + inputs: [], + }, + { + type: "error", + name: "NativeTransferFailed", + inputs: [], + }, + { + type: "error", + name: "OrderNotFillable", + inputs: [], + }, +] as const; + +const _bytecode = + "0x60a06040523480156200001157600080fd5b50604051620031b7380380620031b78339810160408190526200003491620000b8565b600080546001600160a01b0319166001600160a01b03831690811782556040518492849283928392907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350506001600255506001600160a01b031660805250620000f79050565b6001600160a01b0381168114620000b557600080fd5b50565b60008060408385031215620000cc57600080fd5b8251620000d9816200009f565b6020840151909250620000ec816200009f565b809150509250929050565b60805161309e620001196000396000818160e00152611919015261309e6000f3fe60806040526004361061009a5760003560e01c80632d771389116100695780636999b3771161004e5780636999b377146101715780638da5cb5b1461019e578063f2fde38b146101cb57600080fd5b80632d7713891461013e5780633f62192e1461015e57600080fd5b80630d335884146100a65780630d7a16c3146100bb57806312261ee7146100ce57806313fb72c71461012b57600080fd5b366100a157005b600080fd5b6100b96100b43660046120dc565b6101eb565b005b6100b96100c936600461218a565b610364565b3480156100da57600080fd5b506101027f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100b96101393660046121cc565b6104c5565b34801561014a57600080fd5b506100b9610159366004612265565b610683565b6100b961016c366004612289565b61078f565b34801561017d57600080fd5b506001546101029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101aa57600080fd5b506000546101029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101d757600080fd5b506100b96101e6366004612265565b610894565b6101f3610985565b604080516001808252818301909252600091816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90920191018161020a5790505090506102b2846109f6565b816000815181106102c5576102c56122f5565b60200260200101819052506102d981610b5e565b6040517f585da628000000000000000000000000000000000000000000000000000000008152339063585da62890610319908490879087906004016124f8565b600060405180830381600087803b15801561033357600080fd5b505af1158015610347573d6000803e3d6000fd5b5050505061035481610baf565b5061035f6001600255565b505050565b61036c610985565b8060008167ffffffffffffffff811115610388576103886122c6565b60405190808252806020026020018201604052801561044357816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816103a65790505b50905060005b828110156104a25761047d858583818110610466576104666122f5565b905060200281019061047891906125be565b6109f6565b82828151811061048f5761048f6122f5565b6020908102919091010152600101610449565b506104ac81610b5e565b6104b581610baf565b50506104c16001600255565b5050565b6104cd610985565b8260008167ffffffffffffffff8111156104e9576104e96122c6565b6040519080825280602002602001820160405280156105a457816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816105075790505b50905060005b828110156105ec576105c7878783818110610466576104666122f5565b8282815181106105d9576105d96122f5565b60209081029190910101526001016105aa565b506105f681610b5e565b6040517f585da628000000000000000000000000000000000000000000000000000000008152339063585da62890610636908490889088906004016124f8565b600060405180830381600087803b15801561065057600080fd5b505af1158015610664573d6000803e3d6000fd5b5050505061067181610baf565b505061067d6001600255565b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610709576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a4544000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff000000000000000000000000000000000000000083168117909355604080519190921680825260208201939093527fb904ae9529e373e48bc82df4326cceaf1b4c472babf37f5b7dec46fecc6b53e0910160405180910390a15050565b610797610985565b604080516001808252818301909252600091816020015b6040805161016081018252600060a0820181815260c0830182905260e0830182905261010083018290526101208301829052606061014084018190529083528351808201855282815260208082018490528186018490528085019190915293830181905280830152608082015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816107ae579050509050610856826109f6565b81600081518110610869576108696122f5565b602002602001018190525061087d81610b5e565b61088681610baf565b506108916001600255565b50565b60005473ffffffffffffffffffffffffffffffffffffffff163314610915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152606401610700565b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b60028054036109f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610700565b60028055565b6040805161016081018252600060a0820181815260c0830182905260e083018290526101008301829052610120830182905260606101408401819052908352835180820185528281526020808201849052818601849052840152928201839052828201929092526080810182905290610a6f83806125fc565b810190610a7c91906129c8565b90506000610a8982610d02565b90508160400151431015610aa157610aa18183610e15565b610aaa82610ffe565b6000610ab983606001516110fd565b90506040518060a0016040528084600001518152602001610ae783866080015161115290919063ffffffff16565b8152602001610b03838660a0015161124990919063ffffffff16565b8152602001868060200190610b1891906125fc565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050509082525060200192909252509392505050565b805160005b8181101561035f576000838281518110610b7f57610b7f6122f5565b60200260200101519050610b928161132e565b610b9c813361181e565b610ba68133611917565b50600101610b63565b805160005b81811015610cf1576000838281518110610bd057610bd06122f5565b602002602001015190506000816040015151905060005b81811015610c5157600083604001518281518110610c0757610c076122f5565b60200260200101519050610c4881604001518260200151836000015173ffffffffffffffffffffffffffffffffffffffff16611b709092919063ffffffff16565b50600101610be7565b5081600001516020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16868581518110610c9a57610c9a6122f5565b6020026020010151608001517f78ad7ec0e9f89e74012afa58738b6b661c024cb0fd185ee2f616c0a28924bd66856000015160400151604051610cdf91815260200190565b60405180910390a45050600101610bb4565b5047156104c1576104c13347611bb7565b60006040518060c00160405280608d8152602001612f81608d9139604051806080016040528060488152602001612f0b604891396040518060800160405280605b815260200161300e605b9139604051602001610d6193929190612ac9565b60405160208183030381529060405280519060200120610d848360000151611c51565b836020015184604001518560600151610da08760800151611ceb565b610dad8860a00151611d52565b60408051602081019890985287019590955273ffffffffffffffffffffffffffffffffffffffff9093166060860152608085019190915260a084015260c083015260e0820152610100015b604051602081830303815290604052805190602001209050919050565b60c081015151600003610e26575050565b604081015160c0820151511015610e435760c08101515160408201525b6000808260e00151806020019051810190610e5e9190612c1f565b9150915060008360e00151604081518110610e7b57610e7b6122f5565b602001015160f81c60f81b60f81c905060006001868660c00151604051602001610ea89151815260200190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815290829052610ee49291602001612c43565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181528282528051602091820120600084529083018083525260ff851690820152606081018690526080810185905260a0016020604051602081039080840390855afa158015610f60573d6000803e3d6000fd5b5050506020604051035190508073ffffffffffffffffffffffffffffffffffffffff16856020015173ffffffffffffffffffffffffffffffffffffffff16141580610fbf575073ffffffffffffffffffffffffffffffffffffffff8116155b15610ff6576040517fd7815be100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050565b80516060015142111561103d576040517f769d11e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b438160400151111561107b576040517fc603552000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b608081015160400151156108915760005b8160a00151518110156104c15760008260a0015182815181106110b1576110b16122f5565b60200260200101516040015111156110f5576040517fa6b844f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60010161108c565b6000483a1015611139576040517ff3eb44e500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50483a0381811115611149570390565b5060005b919050565b61118c6040518060600160405280600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081525090565b600083604001518361119e9190612c98565b90506298968081106111ec576040518060600160405280856000015173ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018560200151815250915050611243565b6040805160608101909152845173ffffffffffffffffffffffffffffffffffffffff168152602081016112346112258462989680612caf565b60208801519062989680611df0565b81526020868101519101529150505b92915050565b81516060908067ffffffffffffffff811115611267576112676122c6565b6040519080825280602002602001820160405280156112d057816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816112855790505b50915060005b81811015611326576113018582815181106112f3576112f36122f5565b602002602001015185611e2c565b838281518110611313576113136122f5565b60209081029190910101526001016112d6565b505092915050565b60015473ffffffffffffffffffffffffffffffffffffffff1661134e5750565b6001546040517f8aa6cf0300000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff1690638aa6cf03906113a5908590600401612cc2565b600060405180830381865afa1580156113c2573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526114089190810190612cd5565b60408301515181519192509060006114208284612da5565b67ffffffffffffffff811115611438576114386122c6565b6040519080825280602002602001820160405280156114a157816020015b60408051606081018252600080825260208083018290529282015282527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9092019101816114565790505b50905060005b838110156114f257856040015181815181106114c5576114c56122f5565b60200260200101518282815181106114df576114df6122f5565b60209081029190910101526001016114a7565b5060008060005b8481101561180d576000878281518110611515576115156122f5565b6020026020010151905060005b828110156115d35788818151811061153c5761153c6122f5565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff16826000015173ffffffffffffffffffffffffffffffffffffffff16036115cb5781516040517ffff0830300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610700565b600101611522565b506000805b888110156116945760008b6040015182815181106115f8576115f86122f5565b60200260200101519050836000015173ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff160361168b578515611675576040517fedc7e2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60208101516116849084612da5565b9250600196505b506001016115d8565b50815160208b01515173ffffffffffffffffffffffffffffffffffffffff91821691160361170d5784156116f4576040517fedc7e2e400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6020808b015101516117069082612da5565b9050600193505b806000036117625781516040517feddf07f500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091166004820152602401610700565b611770816005612710611df0565b826020015111156117e3578151602083015160408085015190517f82e7565600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff93841660048201526024810192909252919091166044820152606401610700565b8186848a01815181106117f8576117f86122f5565b602090810291909101015250506001016114f9565b505050604090940193909352505050565b81515173ffffffffffffffffffffffffffffffffffffffff16301461186f576040517f4ddf4a6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81516080015173ffffffffffffffffffffffffffffffffffffffff16156104c1578151608001516040517f6e84ba2b00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff90911690636e84ba2b906118eb9084908690600401612db8565b60006040518083038186803b15801561190357600080fd5b505afa158015610ff6573d6000803e3d6000fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663137c29fe6119d7846040805160a0810182526000606082018181526080830182905282526020820181905291810191909152506040805160a081018252602080840180515173ffffffffffffffffffffffffffffffffffffffff1660608085019182529151850151608085015283528451840151918301919091529251909201519082015290565b6040805180820182526000808252602091820152815180830190925273ffffffffffffffffffffffffffffffffffffffff86168252808701518101519082015285600001516020015186608001516040518060c00160405280608d8152602001612f81608d9139604051806080016040528060488152602001612f0b604891396040518060800160405280605b815260200161300e605b9139604051602001611a8293929190612ac9565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815260608301909152602e808352909190612f536020830139604051602001611ad5929190612de7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905260608a01517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b168352611b429695949392600401612e42565b600060405180830381600087803b158015611b5c57600080fd5b505af1158015610ff6573d6000803e3d6000fd5b73ffffffffffffffffffffffffffffffffffffffff8316611b955761035f8282611bb7565b61035f73ffffffffffffffffffffffffffffffffffffffff8416338484611ece565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611c11576040519150601f19603f3d011682016040523d82523d6000602084013e611c16565b606091505b505090508061035f576040517ff4b3b1bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006040518060c00160405280608d8152602001612f81608d913980516020918201208351848301516040808701516060880151608089015160a08a01518051908901209351610df898939492939192910196875273ffffffffffffffffffffffffffffffffffffffff958616602088015293851660408701526060860192909252608085015290911660a083015260c082015260e00190565b6000604051806080016040528060488152602001612f0b6048913980516020918201208351848301516040808701519051610df8950193845273ffffffffffffffffffffffffffffffffffffffff9290921660208401526040830152606082015260800190565b600080825160200267ffffffffffffffff811115611d7257611d726122c6565b6040519080825280601f01601f191660200182016040528015611d9c576020820181803683370190505b50905060005b8351811015611de1576000611dcf858381518110611dc257611dc26122f5565b6020026020010151611fc0565b60208381028501015250600101611da2565b50805160209091012092915050565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0484118302158202611e2557600080fd5b5091020490565b60408051606081018252600080825260208201819052918101919091526040518060600160405280846000015173ffffffffffffffffffffffffffffffffffffffff168152602001611ea3856040015185611e879190612c98565b611e949062989680612da5565b60208701519062989680612037565b8152602001846060015173ffffffffffffffffffffffffffffffffffffffff16815250905092915050565b60006040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015273ffffffffffffffffffffffffffffffffffffffff841660248201528260448201526020600060648360008a5af13d15601f3d1160016000511416171691505080611fb9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c45440000000000000000000000006044820152606401610700565b5050505050565b60006040518060800160405280605b815260200161300e605b9139805160209182012083518483015160408087015160608801519151610df8969192910194855273ffffffffffffffffffffffffffffffffffffffff93841660208601526040850192909252606084015216608082015260a00190565b6000827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048411830215820261206c57600080fd5b50910281810615159190040190565b60006040828403121561208d57600080fd5b50919050565b60008083601f8401126120a557600080fd5b50813567ffffffffffffffff8111156120bd57600080fd5b6020830191508360208285010111156120d557600080fd5b9250929050565b6000806000604084860312156120f157600080fd5b833567ffffffffffffffff8082111561210957600080fd5b6121158783880161207b565b9450602086013591508082111561212b57600080fd5b5061213886828701612093565b9497909650939450505050565b60008083601f84011261215757600080fd5b50813567ffffffffffffffff81111561216f57600080fd5b6020830191508360208260051b85010111156120d557600080fd5b6000806020838503121561219d57600080fd5b823567ffffffffffffffff8111156121b457600080fd5b6121c085828601612145565b90969095509350505050565b600080600080604085870312156121e257600080fd5b843567ffffffffffffffff808211156121fa57600080fd5b61220688838901612145565b9096509450602087013591508082111561221f57600080fd5b5061222c87828801612093565b95989497509550505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461089157600080fd5b803561114d81612238565b60006020828403121561227757600080fd5b813561228281612238565b9392505050565b60006020828403121561229b57600080fd5b813567ffffffffffffffff8111156122b257600080fd5b6122be8482850161207b565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60005b8381101561233f578181015183820152602001612327565b50506000910152565b60008151808452612360816020860160208601612324565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60008151808452602080850194506020840160005b838110156123f2578151805173ffffffffffffffffffffffffffffffffffffffff908116895284820151858a01526040918201511690880152606090960195908201906001016123a7565b509495945050505050565b6000815160e0845273ffffffffffffffffffffffffffffffffffffffff8082511660e08601528060208301511661010086015260408201516101208601526060820151610140860152806080830151166101608601525060a0810151905060c06101808501526124716101a0850182612348565b905060208301516124af6020860182805173ffffffffffffffffffffffffffffffffffffffff16825260208082015190830152604090810151910152565b50604083015184820360808601526124c78282612392565b915050606083015184820360a08601526124e18282612348565b915050608083015160c08501528091505092915050565b6000604082016040835280865180835260608501915060608160051b8601019250602080890160005b8381101561256d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa088870301855261255b8683516123fd565b95509382019390820190600101612521565b5050858403818701528684528688828601376000848801820152601f9096017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169092019094019695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126125f257600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261263157600080fd5b83018035915067ffffffffffffffff82111561264c57600080fd5b6020019150368190038213156120d557600080fd5b6040516060810167ffffffffffffffff81118282101715612684576126846122c6565b60405290565b6040516080810167ffffffffffffffff81118282101715612684576126846122c6565b604051610100810167ffffffffffffffff81118282101715612684576126846122c6565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612718576127186122c6565b604052919050565b600082601f83011261273157600080fd5b813567ffffffffffffffff81111561274b5761274b6122c6565b61277c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016126d1565b81815284602083860101111561279157600080fd5b816020850160208301376000918101602001919091529392505050565b600060c082840312156127c057600080fd5b60405160c0810167ffffffffffffffff82821081831117156127e4576127e46122c6565b81604052829350843591506127f882612238565b90825260208401359061280a82612238565b81602084015260408501356040840152606085013560608401526080850135915061283482612238565b81608084015260a085013591508082111561284e57600080fd5b5061285b85828601612720565b60a0830152505092915050565b60006060828403121561287a57600080fd5b612882612661565b9050813561288f81612238565b80825250602082013560208201526040820135604082015292915050565b600067ffffffffffffffff8211156128c7576128c76122c6565b5060051b60200190565b600082601f8301126128e257600080fd5b813560206128f76128f2836128ad565b6126d1565b82815260079290921b8401810191818101908684111561291657600080fd5b8286015b8481101561297b57608081890312156129335760008081fd5b61293b61268a565b813561294681612238565b815281850135858201526040808301359082015260608083013561296981612238565b9082015283529183019160800161291a565b509695505050505050565b60006020828403121561299857600080fd5b6040516020810181811067ffffffffffffffff821117156129bb576129bb6122c6565b6040529135825250919050565b6000602082840312156129da57600080fd5b813567ffffffffffffffff808211156129f257600080fd5b908301906101408286031215612a0757600080fd5b612a0f6126ad565b823582811115612a1e57600080fd5b612a2a878286016127ae565b825250612a396020840161225a565b60208201526040830135604082015260608301356060820152612a5f8660808501612868565b608082015260e083013582811115612a7657600080fd5b612a82878286016128d1565b60a083015250612a96866101008501612986565b60c082015261012083013582811115612aae57600080fd5b612aba87828601612720565b60e08301525095945050505050565b7f5072696f726974794f726465722800000000000000000000000000000000000081527f4f72646572496e666f20696e666f2c0000000000000000000000000000000000600e8201527f6164647265737320636f7369676e65722c000000000000000000000000000000601d8201527f75696e743235362061756374696f6e5374617274426c6f636b2c000000000000602e8201527f75696e7432353620626173656c696e655072696f726974794665655765692c0060488201527f5072696f72697479496e70757420696e7075742c00000000000000000000000060678201527f5072696f726974794f75747075745b5d206f7574707574732900000000000000607b82015260008451612be5816094850160208901612324565b845190830190612bfc816094840160208901612324565b8451910190612c12816094840160208801612324565b0160940195945050505050565b60008060408385031215612c3257600080fd5b505080516020909101519092909150565b82815260008251612c5b816020850160208701612324565b919091016020019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808202811582820484141761124357611243612c69565b8181038181111561124357611243612c69565b60208152600061228260208301846123fd565b60006020808385031215612ce857600080fd5b825167ffffffffffffffff811115612cff57600080fd5b8301601f81018513612d1057600080fd5b8051612d1e6128f2826128ad565b81815260609182028301840191848201919088841115612d3d57600080fd5b938501935b83851015612d995780858a031215612d5a5760008081fd5b612d62612661565b8551612d6d81612238565b81528587015187820152604080870151612d8681612238565b9082015283529384019391850191612d42565b50979650505050505050565b8082018082111561124357611243612c69565b73ffffffffffffffffffffffffffffffffffffffff831681526040602082015260006122be60408301846123fd565b7f5072696f726974794f72646572207769746e6573732900000000000000000000815260008351612e1f816016850160208801612324565b835190830190612e36816016840160208801612324565b01601601949350505050565b6000610140612e72838a51805173ffffffffffffffffffffffffffffffffffffffff168252602090810151910152565b6020890151604084015260408901516060840152612eb36080840189805173ffffffffffffffffffffffffffffffffffffffff168252602090810151910152565b73ffffffffffffffffffffffffffffffffffffffff871660c08401528560e084015280610100840152612ee881840186612348565b9050828103610120840152612efd8185612348565b999850505050505050505056fe5072696f72697479496e707574286164647265737320746f6b656e2c75696e7432353620616d6f756e742c75696e74323536206d70735065725072696f7269747946656557656929546f6b656e5065726d697373696f6e73286164647265737320746f6b656e2c75696e7432353620616d6f756e74294f72646572496e666f28616464726573732072656163746f722c6164647265737320737761707065722c75696e74323536206e6f6e63652c75696e7432353620646561646c696e652c61646472657373206164646974696f6e616c56616c69646174696f6e436f6e74726163742c6279746573206164646974696f6e616c56616c69646174696f6e44617461295072696f726974794f7574707574286164647265737320746f6b656e2c75696e7432353620616d6f756e742c75696e74323536206d70735065725072696f726974794665655765692c6164647265737320726563697069656e7429a26469706673582212200157f640b2a364169513823e9bc04e1403e405f2593efb4a28be4df19b3c545364736f6c63430008180033"; + +type PriorityOrderReactorConstructorParams = + | [signer?: Signer] + | ConstructorParameters; + +const isSuperArgs = ( + xs: PriorityOrderReactorConstructorParams +): xs is ConstructorParameters => xs.length > 1; + +export class PriorityOrderReactor__factory extends ContractFactory { + constructor(...args: PriorityOrderReactorConstructorParams) { + if (isSuperArgs(args)) { + super(...args); + } else { + super(_abi, _bytecode, args[0]); + } + } + + override deploy( + _permit2: PromiseOrValue, + _protocolFeeOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise { + return super.deploy( + _permit2, + _protocolFeeOwner, + overrides || {} + ) as Promise; + } + override getDeployTransaction( + _permit2: PromiseOrValue, + _protocolFeeOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): TransactionRequest { + return super.getDeployTransaction( + _permit2, + _protocolFeeOwner, + overrides || {} + ); + } + override attach(address: string): PriorityOrderReactor { + return super.attach(address) as PriorityOrderReactor; + } + override connect(signer: Signer): PriorityOrderReactor__factory { + return super.connect(signer) as PriorityOrderReactor__factory; + } + + static readonly bytecode = _bytecode; + static readonly abi = _abi; + static createInterface(): PriorityOrderReactorInterface { + return new utils.Interface(_abi) as PriorityOrderReactorInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): PriorityOrderReactor { + return new Contract( + address, + _abi, + signerOrProvider + ) as PriorityOrderReactor; + } +} diff --git a/sdks/uniswapx-sdk/src/contracts/factories/index.ts b/sdks/uniswapx-sdk/src/contracts/factories/index.ts index c825d580c..8dbcf994e 100644 --- a/sdks/uniswapx-sdk/src/contracts/factories/index.ts +++ b/sdks/uniswapx-sdk/src/contracts/factories/index.ts @@ -6,6 +6,7 @@ export { ExclusiveFillerValidation__factory } from "./ExclusiveFillerValidation_ export { MockERC20__factory } from "./MockERC20__factory"; export { OrderQuoter__factory } from "./OrderQuoter__factory"; export { Permit2__factory } from "./Permit2__factory"; +export { PriorityOrderReactor__factory } from "./PriorityOrderReactor__factory"; export { RelayOrderReactor__factory } from "./RelayOrderReactor__factory"; export { SwapRouter02Executor__factory } from "./SwapRouter02Executor__factory"; export { V2DutchOrderReactor__factory } from "./V2DutchOrderReactor__factory"; diff --git a/sdks/uniswapx-sdk/src/contracts/index.ts b/sdks/uniswapx-sdk/src/contracts/index.ts index f150a40f2..3306d859b 100644 --- a/sdks/uniswapx-sdk/src/contracts/index.ts +++ b/sdks/uniswapx-sdk/src/contracts/index.ts @@ -6,6 +6,7 @@ export type { ExclusiveFillerValidation } from "./ExclusiveFillerValidation"; export type { MockERC20 } from "./MockERC20"; export type { OrderQuoter } from "./OrderQuoter"; export type { Permit2 } from "./Permit2"; +export type { PriorityOrderReactor } from "./PriorityOrderReactor"; export type { RelayOrderReactor } from "./RelayOrderReactor"; export type { SwapRouter02Executor } from "./SwapRouter02Executor"; export type { V2DutchOrderReactor } from "./V2DutchOrderReactor"; @@ -17,6 +18,7 @@ export { ExclusiveFillerValidation__factory } from "./factories/ExclusiveFillerV export { MockERC20__factory } from "./factories/MockERC20__factory"; export { OrderQuoter__factory } from "./factories/OrderQuoter__factory"; export { Permit2__factory } from "./factories/Permit2__factory"; +export { PriorityOrderReactor__factory } from "./factories/PriorityOrderReactor__factory"; export { RelayOrderReactor__factory } from "./factories/RelayOrderReactor__factory"; export { SwapRouter02Executor__factory } from "./factories/SwapRouter02Executor__factory"; export { V2DutchOrderReactor__factory } from "./factories/V2DutchOrderReactor__factory"; diff --git a/sdks/uniswapx-sdk/src/order/PriorityOrder.test.ts b/sdks/uniswapx-sdk/src/order/PriorityOrder.test.ts new file mode 100644 index 000000000..a52364cf5 --- /dev/null +++ b/sdks/uniswapx-sdk/src/order/PriorityOrder.test.ts @@ -0,0 +1,114 @@ +import { BigNumber, ethers } from "ethers"; + +import { + CosignedPriorityOrder, + CosignedPriorityOrderInfo, + OrderNotFillable, + //UnsignedPriorityOrder, + //UnsignedPriorityOrderInfo, +} from "./PriorityOrder"; + +const BLOCK = BigNumber.from(100); + +const NOW = Math.floor(new Date().getTime() / 1000); +const RAW_AMOUNT = BigNumber.from("1000000"); +const INPUT_TOKEN = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"; +const OUTPUT_TOKEN = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"; + +describe("PriorityOrder", () => { + const getFullOrderInfo = ( + data: Partial + ): CosignedPriorityOrderInfo => { + return Object.assign( + { + deadline: NOW + 1000, + reactor: ethers.constants.AddressZero, + swapper: ethers.constants.AddressZero, + nonce: BigNumber.from(10), + additionalValidationContract: ethers.constants.AddressZero, + additionalValidationData: "0x", + cosigner: ethers.constants.AddressZero, + auctionStartBlock: BLOCK, + baselinePriorityFeeWei: BigNumber.from(0), + input: { + token: INPUT_TOKEN, + amount: RAW_AMOUNT, + mpsPerPriorityFeeWei: BigNumber.from(0), + }, + outputs: [ + { + token: OUTPUT_TOKEN, + amount: RAW_AMOUNT, + mpsPerPriorityFeeWei: BigNumber.from(10), + recipient: ethers.constants.AddressZero, + }, + ], + cosignerData: { + auctionTargetBlock: BLOCK.sub(2), + }, + cosignature: "0x", + }, + data + ); + }; + + it("parses a serialized order", () => { + const orderInfo = getFullOrderInfo({}); + const order = new CosignedPriorityOrder(orderInfo, 1); + const serialized = order.serialize(); + const parsed = CosignedPriorityOrder.parse(serialized, 1); + expect(parsed.info).toEqual(orderInfo); + }); + + it("valid signature over order", async () => { + const fullOrderInfo = getFullOrderInfo({}); + const order = new CosignedPriorityOrder(fullOrderInfo, 1); + const wallet = ethers.Wallet.createRandom(); + + const { domain, types, values } = order.permitData(); + const signature = await wallet._signTypedData(domain, types, values); + expect(order.getSigner(signature)).toEqual(await wallet.getAddress()); + }); + + describe("resolve", () => { + it("throws when resolving if current block < auctionTargetBlock", () => { + let order = new CosignedPriorityOrder(getFullOrderInfo({}), 1); + expect(() => + order.resolve({ + priorityFee: BigNumber.from(1), + currentBlock: BLOCK.sub(10), + }) + ).toThrowError(new OrderNotFillable("Target block in the future")); + + order = new CosignedPriorityOrder( + getFullOrderInfo({ + cosignerData: { + auctionTargetBlock: BigNumber.from(0), + }, + }), + 1 + ); + + expect(() => + order.resolve({ + priorityFee: BigNumber.from(1), + currentBlock: BLOCK.sub(1), + }) + ).toThrowError(new OrderNotFillable("Start block in the future")); + }); + + it("resolves at currentBlock", () => { + const order = new CosignedPriorityOrder(getFullOrderInfo({}), 1); + const resolved = order.resolve({ + priorityFee: BigNumber.from(1), + currentBlock: BLOCK, + }); + expect(resolved.input.token).toEqual(order.info.input.token); + expect(resolved.input.amount).toEqual(order.info.input.amount); + expect(resolved.outputs[0].token).toEqual(order.info.outputs[0].token); + expect(resolved.outputs[0].amount).toEqual( + order.info.outputs[0].amount.add(1) + ); + }); + }); +}); diff --git a/sdks/uniswapx-sdk/src/order/PriorityOrder.ts b/sdks/uniswapx-sdk/src/order/PriorityOrder.ts new file mode 100644 index 000000000..037692f04 --- /dev/null +++ b/sdks/uniswapx-sdk/src/order/PriorityOrder.ts @@ -0,0 +1,602 @@ +import { SignatureLike } from "@ethersproject/bytes"; +import { + PermitTransferFrom, + PermitTransferFromData, + SignatureTransfer, + Witness, +} from "@uniswap/permit2-sdk"; +import { BigNumber, ethers } from "ethers"; + +import { MPS } from "../constants"; +import { getPermit2, ResolvedUniswapXOrder } from "../utils"; + +import { + OffChainOrder, + OrderInfo, + PriorityInput, + PriorityInputJSON, + PriorityOrderResolutionOptions, + PriorityOutput, + PriorityOutputJSON, +} from "./types"; +import { CustomOrderValidation, parseValidation } from "./validation"; + +export class OrderNotFillable extends Error { + constructor(message: string) { + super(message); + this.name = "OrderNotFillable"; + } +} + +export type PriorityCosignerData = { + auctionTargetBlock: BigNumber; +}; + +export type UnsignedPriorityOrderInfo = OrderInfo & { + cosigner: string; + auctionStartBlock: BigNumber; + baselinePriorityFeeWei: BigNumber; + input: PriorityInput; + outputs: PriorityOutput[]; +}; + +export type CosignedPriorityOrderInfo = UnsignedPriorityOrderInfo & { + cosignerData: PriorityCosignerData; + cosignature: string; +}; + +export type UnsignedPriorityOrderInfoJSON = Omit< + UnsignedPriorityOrderInfo, + "nonce" | "input" | "outputs" | "auctionStartBlock" | "baselinePriorityFeeWei" +> & { + nonce: string; + cosigner: string; + auctionStartBlock: string; + baselinePriorityFeeWei: string; + input: PriorityInputJSON; + outputs: PriorityOutputJSON[]; +}; + +export type CosignedPriorityOrderInfoJSON = UnsignedPriorityOrderInfoJSON & { + cosignerData: { + auctionTargetBlock: string; + }; + cosignature: string; +}; + +type PriorityWitnessInfo = { + info: OrderInfo; + cosigner: string; + auctionStartBlock: BigNumber; + baselinePriorityFeeWei: BigNumber; + input: PriorityInput; + outputs: PriorityOutput[]; +}; + +const PRIORITY_COSIGNER_DATA_TUPLE_ABI = "tuple(uint256)"; + +const PRIORITY_ORDER_TYPES = { + PriorityOrder: [ + { name: "info", type: "OrderInfo" }, + { name: "cosigner", type: "address" }, + { name: "auctionStartBlock", type: "uint256" }, + { name: "baselinePriorityFeeWei", type: "uint256" }, + { name: "input", type: "PriorityInput" }, + { name: "outputs", type: "PriorityOutput[]" }, + ], + OrderInfo: [ + { name: "reactor", type: "address" }, + { name: "swapper", type: "address" }, + { name: "nonce", type: "uint256" }, + { name: "deadline", type: "uint256" }, + { name: "additionalValidationContract", type: "address" }, + { name: "additionalValidationData", type: "bytes" }, + ], + PriorityInput: [ + { name: "token", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "mpsPerPriorityFeeWei", type: "uint256" }, + ], + PriorityOutput: [ + { name: "token", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "mpsPerPriorityFeeWei", type: "uint256" }, + { name: "recipient", type: "address" }, + ], +}; + +const PRIORITY_ORDER_ABI = [ + "tuple(" + + [ + "tuple(address,address,uint256,uint256,address,bytes)", // OrderInfo + "address", // cosigner + "uint256", // auctionStartBlock + "uint256", // baselinePriorityFeeWei + "tuple(address,uint256,uint256)", // input + "tuple(address,uint256,uint256,address)[]", // outputs + "tuple(uint256)", // cosignerData + "bytes", // cosignature + ].join(",") + + ")", +]; + +export class UnsignedPriorityOrder implements OffChainOrder { + public permit2Address: string; + + constructor( + public readonly info: UnsignedPriorityOrderInfo, + public readonly chainId: number, + _permit2Address?: string + ) { + this.permit2Address = getPermit2(chainId, _permit2Address); + } + + static fromJSON( + json: UnsignedPriorityOrderInfoJSON, + chainId: number, + _permit2Address?: string + ): UnsignedPriorityOrder { + return new UnsignedPriorityOrder( + { + ...json, + cosigner: json.cosigner, + auctionStartBlock: BigNumber.from(json.auctionStartBlock), + baselinePriorityFeeWei: BigNumber.from(json.baselinePriorityFeeWei), + nonce: BigNumber.from(json.nonce), + input: { + token: json.input.token, + amount: BigNumber.from(json.input.amount), + mpsPerPriorityFeeWei: BigNumber.from(json.input.mpsPerPriorityFeeWei), + }, + outputs: json.outputs.map((output) => ({ + token: output.token, + amount: BigNumber.from(output.amount), + mpsPerPriorityFeeWei: BigNumber.from(output.mpsPerPriorityFeeWei), + recipient: output.recipient, + })), + }, + chainId, + _permit2Address + ); + } + + static parse( + encoded: string, + chainId: number, + permit2?: string + ): UnsignedPriorityOrder { + return new UnsignedPriorityOrder( + parseSerializedOrder(encoded), + chainId, + permit2 + ); + } + + /** + * @inheritdoc order + */ + toJSON(): UnsignedPriorityOrderInfoJSON & { + permit2Address: string; + chainId: number; + } { + return { + chainId: this.chainId, + permit2Address: this.permit2Address, + reactor: this.info.reactor, + swapper: this.info.swapper, + nonce: this.info.nonce.toString(), + deadline: this.info.deadline, + additionalValidationContract: this.info.additionalValidationContract, + additionalValidationData: this.info.additionalValidationData, + cosigner: this.info.cosigner, + auctionStartBlock: this.info.auctionStartBlock.toString(), + baselinePriorityFeeWei: this.info.baselinePriorityFeeWei.toString(), + input: { + token: this.info.input.token, + amount: this.info.input.amount.toString(), + mpsPerPriorityFeeWei: this.info.input.mpsPerPriorityFeeWei.toString(), + }, + outputs: this.info.outputs.map((output) => ({ + token: output.token, + amount: output.amount.toString(), + mpsPerPriorityFeeWei: output.mpsPerPriorityFeeWei.toString(), + recipient: output.recipient, + })), + }; + } + + /** + * @inheritdoc order + */ + serialize(): string { + const abiCoder = new ethers.utils.AbiCoder(); + return abiCoder.encode(PRIORITY_ORDER_ABI, [ + [ + [ + this.info.reactor, + this.info.swapper, + this.info.nonce, + this.info.deadline, + this.info.additionalValidationContract, + this.info.additionalValidationData, + ], + this.info.cosigner, + this.info.auctionStartBlock, + this.info.baselinePriorityFeeWei, + [ + this.info.input.token, + this.info.input.amount, + this.info.input.mpsPerPriorityFeeWei, + ], + this.info.outputs.map((output) => [ + output.token, + output.amount, + output.mpsPerPriorityFeeWei, + output.recipient, + ]), + // use empty default for cosignerData and cosignature + [0], + "0x", + ], + ]); + } + + /** + * @inheritdoc Order + */ + getSigner(signature: SignatureLike): string { + return ethers.utils.computeAddress( + ethers.utils.recoverPublicKey( + SignatureTransfer.hash( + this.toPermit(), + this.permit2Address, + this.chainId, + this.witness() + ), + signature + ) + ); + } + + /** + * @inheritdoc Order + */ + permitData(): PermitTransferFromData { + return SignatureTransfer.getPermitData( + this.toPermit(), + this.permit2Address, + this.chainId, + this.witness() + ) as PermitTransferFromData; + } + + /** + * @inheritdoc Order + */ + hash(): string { + return ethers.utils._TypedDataEncoder + .from(PRIORITY_ORDER_TYPES) + .hash(this.witnessInfo()); + } + + /** + * Returns the resolved order with the given options + * @return The resolved order + */ + resolve(_options: PriorityOrderResolutionOptions): ResolvedUniswapXOrder { + // no cosigner data so no resolution possible + throw new Error("Method not implemented."); + } + + /** + * Returns the parsed validation + * @return The parsed validation data for the order + */ + get validation(): CustomOrderValidation { + return parseValidation(this.info); + } + + private toPermit(): PermitTransferFrom { + return { + permitted: { + token: this.info.input.token, + amount: this.info.input.amount, + }, + spender: this.info.reactor, + nonce: this.info.nonce, + deadline: this.info.deadline, + }; + } + + private witnessInfo(): PriorityWitnessInfo { + return { + info: { + reactor: this.info.reactor, + swapper: this.info.swapper, + nonce: this.info.nonce, + deadline: this.info.deadline, + additionalValidationContract: this.info.additionalValidationContract, + additionalValidationData: this.info.additionalValidationData, + }, + cosigner: this.info.cosigner, + auctionStartBlock: this.info.auctionStartBlock, + baselinePriorityFeeWei: this.info.baselinePriorityFeeWei, + input: this.info.input, + outputs: this.info.outputs, + }; + } + + private witness(): Witness { + return { + witness: this.witnessInfo(), + witnessTypeName: "PriorityOrder", + witnessType: PRIORITY_ORDER_TYPES, + }; + } + + /** + * Full order hash that should be signed over by the cosigner + */ + cosignatureHash(cosignerData: PriorityCosignerData): string { + const abiCoder = new ethers.utils.AbiCoder(); + + return ethers.utils.solidityKeccak256( + ["bytes32", "bytes"], + [ + this.hash(), + abiCoder.encode( + [PRIORITY_COSIGNER_DATA_TUPLE_ABI], + [[cosignerData.auctionTargetBlock]] + ), + ] + ); + } +} + +export class CosignedPriorityOrder extends UnsignedPriorityOrder { + // build a cosigned order from an unsigned order plus cosigner data + static fromUnsignedOrder( + order: UnsignedPriorityOrder, + cosignerData: PriorityCosignerData, + cosignature: string + ): CosignedPriorityOrder { + return new CosignedPriorityOrder( + { + ...order.info, + cosignerData, + cosignature, + }, + order.chainId, + order.permit2Address + ); + } + + // build a cosigned order from json + static fromJSON( + json: CosignedPriorityOrderInfoJSON, + chainId: number, + _permit2Address?: string + ): CosignedPriorityOrder { + return new CosignedPriorityOrder( + { + ...json, + nonce: BigNumber.from(json.nonce), + cosigner: json.cosigner, + auctionStartBlock: BigNumber.from(json.auctionStartBlock), + baselinePriorityFeeWei: BigNumber.from(json.baselinePriorityFeeWei), + input: { + token: json.input.token, + amount: BigNumber.from(json.input.amount), + mpsPerPriorityFeeWei: BigNumber.from(json.input.mpsPerPriorityFeeWei), + }, + outputs: json.outputs.map((output) => ({ + token: output.token, + amount: BigNumber.from(output.amount), + mpsPerPriorityFeeWei: BigNumber.from(output.mpsPerPriorityFeeWei), + recipient: output.recipient, + })), + cosignerData: { + auctionTargetBlock: BigNumber.from( + json.cosignerData.auctionTargetBlock + ), + }, + cosignature: json.cosignature, + }, + chainId, + _permit2Address + ); + } + + // build a cosigned order from serialized + static parse( + encoded: string, + chainId: number, + permit2?: string + ): CosignedPriorityOrder { + return new CosignedPriorityOrder( + parseSerializedOrder(encoded), + chainId, + permit2 + ); + } + + constructor( + public readonly info: CosignedPriorityOrderInfo, + public readonly chainId: number, + _permit2Address?: string + ) { + super(info, chainId, _permit2Address); + } + + /** + * @inheritdoc order + */ + toJSON(): CosignedPriorityOrderInfoJSON & { + permit2Address: string; + chainId: number; + } { + return { + ...super.toJSON(), + cosignerData: { + auctionTargetBlock: + this.info.cosignerData.auctionTargetBlock.toString(), + }, + cosignature: this.info.cosignature, + }; + } + + /** + * @inheritdoc Order + */ + resolve(options: PriorityOrderResolutionOptions): ResolvedUniswapXOrder { + if (options.currentBlock) { + if ( + this.info.cosignerData.auctionTargetBlock.gt(0) && + options.currentBlock.lt(this.info.cosignerData.auctionTargetBlock) + ) { + throw new OrderNotFillable("Target block in the future"); + } else if (options.currentBlock.lt(this.info.auctionStartBlock)) { + throw new OrderNotFillable("Start block in the future"); + } + } + return { + input: { + token: this.info.input.token, + amount: scaleInput(this.info.input, options.priorityFee), + }, + outputs: scaleOutputs(this.info.outputs, options.priorityFee), + }; + } + + /** + * @inheritdoc order + */ + serialize(): string { + const abiCoder = new ethers.utils.AbiCoder(); + return abiCoder.encode(PRIORITY_ORDER_ABI, [ + [ + [ + this.info.reactor, + this.info.swapper, + this.info.nonce, + this.info.deadline, + this.info.additionalValidationContract, + this.info.additionalValidationData, + ], + this.info.cosigner, + this.info.auctionStartBlock, + this.info.baselinePriorityFeeWei, + [ + this.info.input.token, + this.info.input.amount, + this.info.input.mpsPerPriorityFeeWei, + ], + this.info.outputs.map((output) => [ + output.token, + output.amount, + output.mpsPerPriorityFeeWei, + output.recipient, + ]), + [this.info.cosignerData.auctionTargetBlock], + this.info.cosignature, + ], + ]); + } + + /** + * recovers co-signer address from cosignature and full order hash + * @returns The address which co-signed the order + */ + recoverCosigner(): string { + return ethers.utils.verifyMessage( + this.cosignatureHash(this.info.cosignerData), + this.info.cosignature + ); + } +} + +function parseSerializedOrder(serialized: string): CosignedPriorityOrderInfo { + const abiCoder = new ethers.utils.AbiCoder(); + const decoded = abiCoder.decode(PRIORITY_ORDER_ABI, serialized); + const [ + [ + [ + reactor, + swapper, + nonce, + deadline, + additionalValidationContract, + additionalValidationData, + ], + cosigner, + auctionStartBlock, + baselinePriorityFeeWei, + [token, amount, mpsPerPriorityFeeWei], + outputs, + [auctionTargetBlock], + cosignature, + ], + ] = decoded; + + return { + reactor, + swapper, + nonce, + deadline: deadline.toNumber(), + additionalValidationContract, + additionalValidationData, + cosigner, + auctionStartBlock, + baselinePriorityFeeWei, + input: { + token, + amount, + mpsPerPriorityFeeWei, + }, + outputs: outputs.map( + ([token, amount, mpsPerPriorityFeeWei, recipient]: [ + string, + BigNumber, + BigNumber, + string + ]) => { + return { + token, + amount, + mpsPerPriorityFeeWei, + recipient, + }; + } + ), + cosignerData: { + auctionTargetBlock, + }, + cosignature, + }; +} + +function scaleInput(input: PriorityInput, priorityFee: BigNumber): BigNumber { + if (priorityFee.mul(input.mpsPerPriorityFeeWei).gte(MPS)) { + return BigNumber.from(0); + } + return input.amount + .mul(MPS.sub(priorityFee.mul(input.mpsPerPriorityFeeWei))) + .div(MPS); +} + +function scaleOutputs( + outputs: PriorityOutput[], + priorityFee: BigNumber +): PriorityOutput[] { + return outputs.map((output) => { + const product = output.amount.mul( + MPS.add(priorityFee.mul(output.mpsPerPriorityFeeWei)) + ); + const mod = product.mod(MPS); + const div = product.div(MPS); + return { + ...output, + amount: mod.eq(0) ? div : div.add(1), + }; + }); +} diff --git a/sdks/uniswapx-sdk/src/order/index.ts b/sdks/uniswapx-sdk/src/order/index.ts index f6c948bb4..310ae5220 100644 --- a/sdks/uniswapx-sdk/src/order/index.ts +++ b/sdks/uniswapx-sdk/src/order/index.ts @@ -1,8 +1,10 @@ import { DutchOrder } from "./DutchOrder"; +import { CosignedPriorityOrder, UnsignedPriorityOrder } from "./PriorityOrder"; import { RelayOrder } from "./RelayOrder"; import { CosignedV2DutchOrder, UnsignedV2DutchOrder } from "./V2DutchOrder"; export * from "./DutchOrder"; +export * from "./PriorityOrder"; export * from "./RelayOrder"; export * from "./types"; export * from "./validation"; @@ -11,6 +13,8 @@ export * from "./V2DutchOrder"; export type UniswapXOrder = | DutchOrder | UnsignedV2DutchOrder - | CosignedV2DutchOrder; + | CosignedV2DutchOrder + | UnsignedPriorityOrder + | CosignedPriorityOrder; export type Order = UniswapXOrder | RelayOrder; diff --git a/sdks/uniswapx-sdk/src/order/types.ts b/sdks/uniswapx-sdk/src/order/types.ts index 84a769d54..aaadeb3f2 100644 --- a/sdks/uniswapx-sdk/src/order/types.ts +++ b/sdks/uniswapx-sdk/src/order/types.ts @@ -56,6 +56,11 @@ export type OrderResolutionOptions = { filler?: string; }; +export type PriorityOrderResolutionOptions = { + priorityFee: BigNumber; + currentBlock?: BigNumber; +}; + export type DutchOutput = { readonly token: string; readonly startAmount: BigNumber; @@ -78,3 +83,25 @@ export type DutchInputJSON = Omit & { startAmount: string; endAmount: string; }; + +export type PriorityInput = { + readonly token: string; + readonly amount: BigNumber; + readonly mpsPerPriorityFeeWei: BigNumber; +}; + +export type PriorityOutput = PriorityInput & { + readonly recipient: string; +}; + +export type PriorityInputJSON = Omit< + PriorityInput, + "amount" | "mpsPerPriorityFeeWei" +> & { + amount: string; + mpsPerPriorityFeeWei: string; +}; + +export type PriorityOutputJSON = PriorityInputJSON & { + recipient: string; +};