diff --git a/config.localhost.json b/config.localhost.json index 99a147df..5750236c 100644 --- a/config.localhost.json +++ b/config.localhost.json @@ -11,7 +11,7 @@ "executor-private-keys": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80,0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d,0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a,0x7c852118294e51e653712a81e05800f419141751be58f605c371e15141b007a6", "utility-private-key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", "entrypoints": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789,0x0000000071727De22E5E9d8BAf0edAc6f37da032", - "entrypoint-simulation-contract": "0x74cb5e4ee81b86e70f9045036a1c5477de69ee87", + "deploy-simulations-contract": true, "enable-debug-endpoints": true, "safe-mode": false, "mempool-max-parallel-ops": 5, diff --git a/contracts/lib/account-abstraction b/contracts/lib/account-abstraction new file mode 160000 index 00000000..abff2aca --- /dev/null +++ b/contracts/lib/account-abstraction @@ -0,0 +1 @@ +Subproject commit abff2aca61a8f0934e533d0d352978055fddbd96 diff --git a/contracts/lib/forge-std b/contracts/lib/forge-std new file mode 160000 index 00000000..f73c73d2 --- /dev/null +++ b/contracts/lib/forge-std @@ -0,0 +1 @@ +Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 diff --git a/contracts/lib/openzeppelin-contracts b/contracts/lib/openzeppelin-contracts new file mode 160000 index 00000000..fd81a96f --- /dev/null +++ b/contracts/lib/openzeppelin-contracts @@ -0,0 +1 @@ +Subproject commit fd81a96f01cc42ef1c9a5399364968d0e07e9e90 diff --git a/scripts/config.local.json b/scripts/config.local.json index 22a6350e..b67780ea 100644 --- a/scripts/config.local.json +++ b/scripts/config.local.json @@ -10,7 +10,7 @@ "executor-private-keys": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", "utility-private-key": "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", "entrypoints": "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789,0x0000000071727De22E5E9d8BAf0edAc6f37da032", - "entrypoint-simulation-contract": "0xAE6035bEE0802C969265C8A3193CE8878c99A66A", + "entrypoint-simulation-contract": "0xBbe8A301FbDb2a4CD58c4A37c262ecef8f889c47", "enable-debug-endpoints": true, "expiration-check": false, "safe-mode": false, diff --git a/scripts/localDeployer/constants.ts b/scripts/localDeployer/constants.ts index 94fd5bbb..308aac82 100644 --- a/scripts/localDeployer/constants.ts +++ b/scripts/localDeployer/constants.ts @@ -10,9 +10,9 @@ export const ENTRY_POINT_V07_CREATECALL: Hex = export const SIMPLE_ACCOUNT_FACTORY_V07_CREATECALL: Hex = "0x000000000000000000000000000000000000000000000000000000000000000060a060405234801561001057600080fd5b506040516129e13803806129e183398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b612011806109d083390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b6080516108f06100e060003960008181604b01528181610114015261025801526108f06000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780635fbfb9cf146100965780638cb84e18146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a436600461039d565b6100bc565b61006d6100b736600461039d565b6101ee565b6000806100c984846101ee565b905073ffffffffffffffffffffffffffffffffffffffff81163b80156100f1575090506101e8565b60405173ffffffffffffffffffffffffffffffffffffffff8616602482015284907f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052516101b790610390565b6101c2929190610406565b8190604051809103906000f59050801580156101e2573d6000803e3d6000fd5b50925050505b92915050565b60006103578260001b6040518060200161020790610390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081905273ffffffffffffffffffffffffffffffffffffffff871660248201527f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052905161030093929101610406565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261033c9291602001610474565b6040516020818303038152906040528051906020012061035e565b9392505050565b60006103578383306000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b610417806104a483390190565b600080604083850312156103b057600080fd5b823573ffffffffffffffffffffffffffffffffffffffff811681146103d457600080fd5b946020939093013593505050565b60005b838110156103fd5781810151838201526020016103e5565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104418160608501602087016103e2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104868184602088016103e2565b83519083019061049a8183602088016103e2565b0194935050505056fe608060405260405161041738038061041783398101604081905261002291610268565b61002c8282610033565b5050610352565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b9190610336565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b03808211156102af57600080fd5b818501915085601f8301126102c357600080fd5b8151818111156102d5576102d561022e565b604051601f8201601f19908116603f011681019083821181831017156102fd576102fd61022e565b8160405282815288602084870101111561031657600080fd5b610327836020830160208801610244565b80955050505050509250929050565b60008251610348818460208701610244565b9190910192915050565b60b7806103606000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220d7f23a80daebb5531c9e4a18d87e812fca112e5df7e56433218edcc12bbe415d64736f6c63430008170033a2646970667358221220f5be4d2659f1a124e46d76b875ad5264a1c62d421946ca067d6132fa6cc4309964736f6c6343000817003360c0604052306080523480156200001557600080fd5b50604051620020113803806200201183398101604081905262000038916200010a565b6001600160a01b03811660a0526200004f62000056565b506200013c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000a75760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620001075780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156200011d57600080fd5b81516001600160a01b03811681146200013557600080fd5b9392505050565b60805160a051611e70620001a160003960008181610320015281816106f00152818161079e0152818161092601528181610b6301528181610baa01528181610d6a015261121e015260008181610f3301528181610f5c015261117d0152611e706000f3fe6080604052600436106101125760003560e01c80638da5cb5b116100a5578063bc197c8111610074578063c4d66de811610059578063c4d66de8146103c1578063d087d288146103e1578063f23a6e61146103f657600080fd5b8063bc197c8114610364578063c399ec88146103ac57600080fd5b80638da5cb5b14610269578063ad3cb1cc146102bb578063b0d691fe14610311578063b61d27f61461034457600080fd5b80634a58db19116100e15780634a58db19146102195780634d44560d146102215780634f1ef2861461024157806352d1902d1461025457600080fd5b806301ffc9a71461011e578063150b7a021461015357806319822f7c146101c957806347e1da2a146101f757600080fd5b3661011957005b600080fd5b34801561012a57600080fd5b5061013e61013936600461179b565b61043c565b60405190151581526020015b60405180910390f35b34801561015f57600080fd5b5061019861016e366004611848565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161014a565b3480156101d557600080fd5b506101e96101e43660046118bb565b610521565b60405190815260200161014a565b34801561020357600080fd5b50610217610212366004611954565b610547565b005b6102176106ee565b34801561022d57600080fd5b5061021761023c3660046119ee565b610794565b61021761024f366004611a49565b610843565b34801561026057600080fd5b506101e9610862565b34801561027557600080fd5b506000546102969073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014a565b3480156102c757600080fd5b506103046040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161014a9190611b4f565b34801561031d57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610296565b34801561035057600080fd5b5061021761035f366004611ba0565b610891565b34801561037057600080fd5b5061019861037f366004611bfc565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b3480156103b857600080fd5b506101e96108e0565b3480156103cd57600080fd5b506102176103dc366004611cbb565b610997565b3480156103ed57600080fd5b506101e9610b16565b34801561040257600080fd5b50610198610411366004611cd8565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a020000000000000000000000000000000000000000000000000000000014806104cf57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061051b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600061052b610b92565b6105358484610c33565b905061054082610ce7565b9392505050565b61054f610d52565b8481148015610565575082158061056557508281145b6105d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f77726f6e67206172726179206c656e677468730000000000000000000000000060448201526064015b60405180910390fd5b600083900361067c5760005b858110156106765761066e8787838181106105f9576105f9611d42565b905060200201602081019061060e9190611cbb565b600085858581811061062257610622611d42565b90506020028101906106349190611d71565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e1392505050565b6001016105dc565b506106e6565b60005b858110156106e4576106dc87878381811061069c5761069c611d42565b90506020020160208101906106b19190611cbb565b8686848181106106c3576106c3611d42565b9050602002013585858581811061062257610622611d42565b60010161067f565b505b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561077957600080fd5b505af115801561078d573d6000803e3d6000fd5b5050505050565b61079c610e90565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561082f57600080fd5b505af11580156106e6573d6000803e3d6000fd5b61084b610f1b565b6108548261101f565b61085e8282611027565b5050565b600061086c611165565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610899610d52565b6108da848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e1392505050565b50505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611dd6565b905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156109e25750825b905060008267ffffffffffffffff1660011480156109ff5750303b155b905081158015610a0d575080155b15610a44576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610aa55784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b610aae866111d4565b83156106e65784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610951565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016105c7565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610cae81610c74610100870187611d71565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061126892505050565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610cda57600191505061051b565b5060009392505050565b50565b8015610ce45760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d806000811461078d576040519150601f19603f3d011682016040523d82523d6000602084013e61078d565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480610dad575060005473ffffffffffffffffffffffffffffffffffffffff1633145b610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e7460448201526064016105c7565b6000808473ffffffffffffffffffffffffffffffffffffffff168484604051610e3c9190611def565b60006040518083038185875af1925050503d8060008114610e79576040519150601f19603f3d011682016040523d82523d6000602084013e610e7e565b606091505b50915091508161078d57805160208201fd5b60005473ffffffffffffffffffffffffffffffffffffffff16331480610eb557503330145b610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064016105c7565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480610fe857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610fcf7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610c31576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ce4610e90565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156110ac575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526110a991810190611dd6565b60015b6110fa576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016105c7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611156576040517faa1d49a4000000000000000000000000000000000000000000000000000000008152600481018290526024016105c7565b6111608383611292565b505050565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610c31576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560405191927f0000000000000000000000000000000000000000000000000000000000000000909116917f47e55c76e7a6f1fd8996a1da8008c1ea29699cca35e7bcd057f2dec313b6e5de9190a350565b60008060008061127886866112f5565b9250925092506112888282611342565b5090949350505050565b61129b82611446565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156112ed576111608282611515565b61085e611598565b6000806000835160410361132f5760208401516040850151606086015160001a611321888285856115d0565b95509550955050505061133b565b50508151600091506002905b9250925092565b600082600381111561135657611356611e0b565b0361135f575050565b600182600381111561137357611373611e0b565b036113aa576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156113be576113be611e0b565b036113f8576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024016105c7565b600382600381111561140c5761140c611e0b565b0361085e576040517fd78bce0c000000000000000000000000000000000000000000000000000000008152600481018290526024016105c7565b8073ffffffffffffffffffffffffffffffffffffffff163b6000036114af576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105c7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405161153f9190611def565b600060405180830381855af49150503d806000811461157a576040519150601f19603f3d011682016040523d82523d6000602084013e61157f565b606091505b509150915061158f8583836116ca565b95945050505050565b3415610c31576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561160b57506000915060039050826116c0565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561165f573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166116b6575060009250600191508290506116c0565b9250600091508190505b9450945094915050565b6060826116df576116da82611759565b610540565b8151158015611703575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611752576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016105c7565b5080610540565b8051156117695780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602082840312156117ad57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461054057600080fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610ce457600080fd5b60008083601f84011261181157600080fd5b50813567ffffffffffffffff81111561182957600080fd5b60208301915083602082850101111561184157600080fd5b9250929050565b60008060008060006080868803121561186057600080fd5b853561186b816117dd565b9450602086013561187b816117dd565b935060408601359250606086013567ffffffffffffffff81111561189e57600080fd5b6118aa888289016117ff565b969995985093965092949392505050565b6000806000606084860312156118d057600080fd5b833567ffffffffffffffff8111156118e757600080fd5b840161012081870312156118fa57600080fd5b95602085013595506040909401359392505050565b60008083601f84011261192157600080fd5b50813567ffffffffffffffff81111561193957600080fd5b6020830191508360208260051b850101111561184157600080fd5b6000806000806000806060878903121561196d57600080fd5b863567ffffffffffffffff8082111561198557600080fd5b6119918a838b0161190f565b909850965060208901359150808211156119aa57600080fd5b6119b68a838b0161190f565b909650945060408901359150808211156119cf57600080fd5b506119dc89828a0161190f565b979a9699509497509295939492505050565b60008060408385031215611a0157600080fd5b8235611a0c816117dd565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060408385031215611a5c57600080fd5b8235611a67816117dd565b9150602083013567ffffffffffffffff80821115611a8457600080fd5b818501915085601f830112611a9857600080fd5b813581811115611aaa57611aaa611a1a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611af057611af0611a1a565b81604052828152886020848701011115611b0957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015611b46578181015183820152602001611b2e565b50506000910152565b6020815260008251806020840152611b6e816040850160208701611b2b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008060008060608587031215611bb657600080fd5b8435611bc1816117dd565b935060208501359250604085013567ffffffffffffffff811115611be457600080fd5b611bf0878288016117ff565b95989497509550505050565b60008060008060008060008060a0898b031215611c1857600080fd5b8835611c23816117dd565b97506020890135611c33816117dd565b9650604089013567ffffffffffffffff80821115611c5057600080fd5b611c5c8c838d0161190f565b909850965060608b0135915080821115611c7557600080fd5b611c818c838d0161190f565b909650945060808b0135915080821115611c9a57600080fd5b50611ca78b828c016117ff565b999c989b5096995094979396929594505050565b600060208284031215611ccd57600080fd5b8135610540816117dd565b60008060008060008060a08789031215611cf157600080fd5b8635611cfc816117dd565b95506020870135611d0c816117dd565b94506040870135935060608701359250608087013567ffffffffffffffff811115611d3657600080fd5b6119dc89828a016117ff565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611da657600080fd5b83018035915067ffffffffffffffff821115611dc157600080fd5b60200191503681900382131561184157600080fd5b600060208284031215611de857600080fd5b5051919050565b60008251611e01818460208701611b2b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220646ccd794d1cd309da39b56bcfe1238dae05a9d8106dddf47fe099a78d7801e864736f6c634300081700330000000000000000000000000000000071727de22e5e9d8baf0edac6f37da032" -// Will deploy entryPointSimulations (required for V0.7) to 0xAE6035bEE0802C969265C8A3193CE8878c99A66A +// Will deploy entryPointSimulations (required for V0.7) to 0xBbe8A301FbDb2a4CD58c4A37c262ecef8f889c47 export const ENTRY_POINT_SIMULATIONS_CREATECALL: Hex = - "0x000000000000000000000000000000000000000000000000000000000000000060808060405234608257613b828181016001600160401b03811183821017606c5782916103ff833903906000f08015606057600080546001600160a01b0319166001600160a01b039290921691909117905560405161037790816100888239f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c63c18f52261461002757600080fd5b34610281576040366003190112610281576004356001600160a01b038116908190036102815760243567ffffffffffffffff81116102815736602382011215610281578060040135610078816102be565b91610086604051938461029c565b8183526024602084019260051b820101903682116102815760248101925b82841061020957845185876100b8836102be565b926100c6604051948561029c565b8084526100d5601f19916102be565b0160005b8181106101f857505060005b825181101561019057600190606060008061013b858060a01b0382541661014961010f878b610317565b51604051938491602083019463428557b160e11b865260248401526040604484015260648301906102d6565b03601f19810184528361029c565b82885a935193f115610172575b6101608287610317565b5261016b8186610317565b50016100e5565b503d604051906020818301016040528082526000602083013e610156565b836040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106101c957505050500390f35b919360019193955060206101e88192603f198a820301865288516102d6565b96019201920185949391926101ba565b8060606020809388010152016100d9565b833567ffffffffffffffff8111610281578201366043820112156102815760248101359167ffffffffffffffff831161028657604051610253601f8501601f19166020018261029c565b83815236604484860101116102815760006020858196604483970183860137830101528152019301926100a4565b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761028657604052565b67ffffffffffffffff81116102865760051b60200190565b919082519283825260005b848110610302575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016102e1565b805182101561032b5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea26469706673582212201244199039b2b0a6d5a53b57f2e9cb9758351b7b37d051717a76d47613efe56164736f6c634300081a003360c080604052346100cc5760016002556101888181016001600160401b038111838210176100b65782916139fa833903906000f080156100aa576080523060a0526100486100d1565b600081526020810190600082528060206100606100d1565b600081520152600380546001600160a01b0319169055516004555160055560405161390990816100f1823960805181505060a0518181816108ef01528181611d3c0152611eb30152f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b60408051919082016001600160401b038111838210176100b65760405256fe60806040526004361015610023575b361561001957600080fd5b610021612477565b005b60003560e01c80630396cb60146101835780630bd28e3b1461017e5780630da82661146101795780630dbfc6bd146101745780630f019dea1461016f5780631b2e01b81461016a578063205c28781461016557806322cdde4c14610160578063263934db1461015b57806330ec25d11461015657806335567e1a14610151578063444034731461014c5780635287ce12146101475780635787f48b146101425780635895273b1461013d57806370a0823114610138578063b760faf914610133578063bb9fe6bf1461012e578063c23a5cea14610129578063c3bce00914610124578063fc7e286d1461011f5763fe2171cb0361000e576112fc565b611271565b611244565b611142565b611040565b611015565b610fd8565b610fa3565b610f1e565b610de0565b610d71565b610d08565b610c8a565b610b7c565b610b5c565b610a3e565b6109db565b61083d565b610779565b610554565b610360565b60203660031901126103455760043563ffffffff811690818103610345576103407fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01916103226102436102336101eb3360018060a01b03166000526000602052604060002090565b966101f7811515611351565b61022460018901549161021d6102148463ffffffff9060781c1690565b63ffffffff1690565b111561139d565b60081c6001600160701b031690565b6001600160701b0334911661141c565b9461024f861515611429565b6102626001600160701b0387111561146a565b5461026b61045e565b908152600160208201526001600160701b038616604082015263ffffffff8316606082015260006080820181905233815260208190526040902081518155602082015160019091018054604084015160608501516080909501516001600160c81b031990921660ff941515949094169390931760089390931b6effffffffffffffffffffffffffff00169290921760789390931b63ffffffff60781b169290921760989190911b65ffffffffffff60981b16179055565b6040805194855263ffffffff90911660208501523393918291820190565b0390a2005b600080fd5b602435906001600160c01b038216820361034557565b34610345576020366003190112610345576004356001600160c01b0381168103610345573360009081526001602090815260408083206001600160c01b039094168352929052206103b181546114a7565b9055005b634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b038211176103e657604052565b6103b5565b604081019081106001600160401b038211176103e657604052565b606081019081106001600160401b038211176103e657604052565b61014081019081106001600160401b038211176103e657604052565b90601f801991011681019081106001600160401b038211176103e657604052565b6040519061046d60a08361043d565b565b6040519061046d6101408361043d565b6040519061046d60608361043d565b6040519061046d6101008361043d565b6040519061046d60408361043d565b6001600160401b0381116103e657601f01601f191660200190565b9291926104d4826104ad565b916104e2604051938461043d565b829481845281830111610345578281602093846000960137010152565b9080601f830112156103455781602061051a933591016104c8565b90565b6001600160a01b0381160361034557565b6024359061046d8261051d565b610104359061046d8261051d565b359061046d8261051d565b3461034557610220366003190112610345576004356001600160401b038111610345576105859036906004016104ff565b3660231901906101c0821261034557610140604051926105a4846103cb565b12610345576105b161046f565b6105b961052e565b815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260e43560c08201526105f361053b565b60e0820152610124356101008201526101443561012082015282526101643560208301526101843560408301526101a43560608301526101c43560808301526101e435916001600160401b038311610345576106566106619336906004016104ff565b9061020435926114cd565b60408051928352602083019190915290f35b0390f35b9181601f84011215610345578235916001600160401b038311610345576020808501948460051b01011161034557565b602060031982011261034557600435906001600160401b038211610345576106d191600401610677565b9091565b60005b8381106106e85750506000910152565b81810151838201526020016106d8565b90602091610711815180928185528580860191016106d5565b601f01601f1916010190565b9061010060e061051a93805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c0810151151560c08501520151918160e082015201906106f8565b346103455761079061078a366106a7565b9061170f565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106107c857505050500390f35b919360019193955060206107e78192603f198a8203018652885161071d565b96019201920185949391926107b9565b9181601f84011215610345578235916001600160401b038311610345576020838186019501011161034557565b60409061051a93921515815281602082015201906106f8565b346103455760803660031901126103455760043561085a8161051d565b6024356108668161051d565b6044356001600160401b038111610345576108859036906004016107f7565b926108c0606435936108b2600095606097604051968794634440347360e01b602087015260248601611777565b03601f19810184528361043d565b6001600160a01b0316803b156103455760405163428557b160e11b8152916000918391829084908290610920907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600484016117a2565b03925af190816109c0575b506109bb57505061093a6117e5565b61094c6109478251611815565b61185c565b9060045b815181101561099557806109776109696001938561188e565b516001600160f81b03191690565b61098e61098383611815565b9160001a918661188e565b5301610950565b50506109aa90602080825183010191016118e1565b905b61067360405192839283610824565b6109ac565b806109cf60006109d59361043d565b80611035565b3861092b565b34610345576040366003190112610345576020610a356004356109fd8161051d565b610a0561034a565b6001600160a01b0390911660009081526001845260408082206001600160c01b0390931682526020929092522090565b54604051908152f35b3461034557604036600319011261034557600435610a5b8161051d565b602435336000526000602052604060002091825492838311610ae3576000808481948294610a8c610021988a611833565b9055604080516001600160a01b03831681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a26001600160a01b03165af1610add6117e5565b50611917565b60405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606490fd5b602060031982011261034557600435906001600160401b038211610345576101209082900360031901126103455760040190565b34610345576020610b74610b6f36610b28565b611958565b604051908152f35b3461034557610673610bbd610bb1610bb7610b96366106a7565b809391610ba161160f565b50610bab82611663565b5061170f565b91611824565b906116fb565b5160405191829160208352602083019061071d565b9061051a9060e06080610c24818651610140865280516101408701526020810151610160870152604081015161018087015260608101516101a0870152015160a06101c08601526101e08501906106f8565b60208087015180518683015201516040850152946040810151805160608601526020015160808501526060810151805160a08601526020015160c0850152015191019080516001600160a01b031682526020908101518051828401520151604090910152565b3461034557610ca1610c9b366106a7565b90611ae9565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b828210610cd957505050500390f35b91936001919395506020610cf88192603f198a82030186528851610bd2565b9601920192018594939192610cca565b34610345576040366003190112610345576020600435610d278161051d565b610d2f61034a565b6001600160a01b0390911660009081526001835260408082206001600160c01b03841683526020529020546040805192901b67ffffffffffffffff1916178152f35b3461034557606036600319011261034557600435610d8e8161051d565b6024356001600160401b0381116103455760009182610db2819336906004016107f7565b9190926044359383604051948592833781018381520393f1610dd26117e5565b9015610dda57005b60208101fd5b3461034557602036600319011261034557600435610dfd8161051d565b60006080604051610e0d816103cb565b828152826020820152826040820152826060820152015260018060a01b031660005260006020526106736040600020610e9c65ffffffffffff600160405193610e55856103cb565b80548552015460ff8116151560208501526001600160701b038160081c16604085015263ffffffff8160781c16606085015260981c16608083019065ffffffffffff169052565b60405191829182919091608065ffffffffffff8160a0840195805185526020810151151560208601526001600160701b03604082015116604086015263ffffffff6060820151166060860152015116910152565b6080604061051a936020845280516020850152602081015115158285015201519160608082015201906106f8565b346103455760c0366003190112610345576004356001600160401b03811161034557610f4e903690600401610677565b906024356001600160401b03811161034557606060031982360301126103455761067392610f9792604435610f828161051d565b606435916084359360a4359560040191611c9e565b60405191829182610ef0565b3461034557610673610fc4610fb736610b28565b610fbf61160f565b611ffd565b60405191829160208352602083019061071d565b3461034557602036600319011261034557600435610ff58161051d565b60018060a01b031660005260006020526020604060002054604051908152f35b6020366003190112610345576100216004356110308161051d565b6120ae565b600091031261034557565b34610345576000366003190112610345573360005260006020526001604060002001805463ffffffff8160781c1615611110576110ac61109e6102148361109261108d6110d39660ff1690565b612104565b60781c63ffffffff1690565b65ffffffffffff4216612144565b825460ff65ffffffffffff60981b01191665ffffffffffff60981b609883901b1617909255565b60405165ffffffffffff909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a908060208101610340565b60405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606490fd5b346103455760203660031901126103455761002160008080806004356111678161051d565b336000908152602081905260409020600101906111ef8254926111de65ffffffffffff6111ca6111b06111a4886001600160701b039060081c1690565b6001600160701b031690565b966111bc881515612162565b60981c65ffffffffffff1690565b166111d68115156121a5565b4210156121f1565b8054610100600160c81b0319169055565b604080516001600160a01b03831681526020810184905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a26001600160a01b03165af161123e6117e5565b5061223d565b346103455761067361125d61125836610b28565b612311565b604051918291602083526020830190610bd2565b346103455760203660031901126103455760043561128e8161051d565b6001600160a01b031660009081526020818152604091829020805460019190910154835191825260ff8116151592820192909252600882901c6001600160701b031692810192909252607881901c63ffffffff16606083015260981c65ffffffffffff16608082015260a090f35b346103455761131e61130d366106a7565b809291611318611a62565b50611ae9565b600019820191821161134c5761067391611337916116fb565b51604051918291602083526020830190610bd2565b6113e9565b1561135857565b60405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c61790000000000006044820152606490fd5b156113a457565b60405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90611388820180921161134c57565b906001820180921161134c57565b9190820180921161134c57565b1561143057565b60405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b6044820152606490fd5b1561147157565b60405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b6044820152606490fd5b600019811461134c5760010190565b60409061051a9392815281602082015201906106f8565b91908051936060850151946114e5603f5a0260061c90565b61271060a0830151880101116115b3576106d1956000958051611515575b5050505a900360808201510192612512565b82516115339261152f9290916001600160a01b0316612480565b1590565b61153f575b8080611503565b90935061154a612492565b805161155c575b505060019238611538565b602083810151835193909101516040516001600160a01b039094169391927f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201929182916115a991836114b6565b0390a33880611551565b60408051631101335b60e11b8152600060048201526024810191909152600f60448201526e41413935206f7574206f662067617360881b6064820152608490fd5b0390fd5b6001600160401b0381116103e65760051b60200190565b6040519061010082018281106001600160401b038211176103e657604052606060e08360008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152565b9061166d826115f8565b61167a604051918261043d565b828152809261168b601f19916115f8565b019060005b82811061169c57505050565b6020906116a761160f565b82828501015201611690565b634e487b7160e01b600052603260045260246000fd5b90359061011e1981360301821215610345570190565b908210156116f65761051a9160051b8101906116c9565b6116b3565b80518210156116f65760209160051b010190565b61171882611663565b9160005b8181106117295750505090565b8061173a610fb760019385876116df565b61174482876116fb565b5261174f81866116fb565b500161171c565b908060209392818452848401376000828201840152601f01601f1916010190565b9493929160409261179d9260018060a01b03168752606060208801526060870191611756565b930152565b6001600160a01b03909116815260406020820181905261051a929101906106f8565b6040513d6000823e3d90fd5b604051906117df60208361043d565b60008252565b3d15611810573d906117f6826104ad565b91611804604051938461043d565b82523d6000602084013e565b606090565b60031981019190821161134c57565b60001981019190821161134c57565b9190820391821161134c57565b6040519061184f60208361043d565b6000808352366020840137565b90611866826104ad565b611873604051918261043d565b8281528092611884601f19916104ad565b0190602036910137565b9081518110156116f6570160200190565b81601f820112156103455780516118b5816104ad565b926118c3604051948561043d565b818452602082840101116103455761051a91602080850191016106d5565b9190916040818403126103455780518015158103610345579260208201516001600160401b0381116103455761051a920161189f565b1561191e57565b60405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606490fd5b6020810135611a1a61196d6040840184611c3b565b90816040519182372091611a0c6119876060860186611c3b565b90816040519182372060c086013560a087013560808801356119b56119af60e08b018b611c3b565b90613600565b604080519a356001600160a01b031660208c01908152908b019790975260608a0198909852608089019390935260a088019290925260c087019190915260e086015261010085019390935292918290610120820190565b03601f19810183528261043d565b51902060408051602081019283523091810191909152466060820152611a438160808101611a0c565b51902090565b60405190611a56826103eb565b60006020838281520152565b60405190611a6f826103cb565b81604051611a7c816103cb565b60008152600060208201526000604082015260006060820152606060808201528152611aa6611a49565b6020820152611ab3611a49565b6040820152611ac0611a49565b6060820152608060405191611ad4836103eb565b60008352611ae0611a49565b60208401520152565b611af2826115f8565b91611b00604051938461043d565b808352601f19611b0f826115f8565b0160005b818110611b5957505060005b818110611b2c5750505090565b80611b3d61125860019385876116df565b611b4782876116fb565b52611b5281866116fb565b5001611b1f565b602090611b64611a62565b82828801015201611b13565b908092918237016000815290565b60405190611b8b82610406565b606060408360008152600060208201520152565b60405190611bac826103cb565b6000608083604051611bbd81610421565b83815283602082015283604082015283606082015283838201528360a08201528360c08201528360e0820152836101008201528361012082015281528260208201528260408201528260608201520152565b91908110156116f65760051b81013590605e1981360301821215610345570190565b3561051a8161051d565b903590601e198136030182121561034557018035906001600160401b0382116103455760200191813603831361034557565b6001600160a01b039182168152911660208201526080604082018190529093929160609161179d91908601906106f8565b9694969591939295611cae611b7e565b5060005b828110611f5a57505050611cc683806116c9565b93611d06611cee611ce7611cdc60208801611c31565b966040810190611c3b565b36916104c8565b95611cf7611b9f565b90611d0181612735565b612846565b5050506001600160a01b03841615611f2f5760008315611e875750600190611d3a611d2f6117d0565b989291935b8561141c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169881905b84611d738885611833565b10611e5c575a611d82886113ff565b11611e3c5791869593918a95938c8b611d9c858d9c61141c565b60011c9a8b996040519c8d938493630780cef560e11b85526004850193611dc294611c6d565b03815a6000948591f1988915611e3757600090819a611e11575b5015611dfc57505050611dee84611824565b95915b939092949591611d68565b93965094611e0b91975061140e565b94611df1565b90611e2f929a503d8091833e611e27818361043d565b8101906118e1565b989038611ddc565b6117c4565b637162685f60e11b60005260048290526024879052604483905260646000fd5b97509750509250509450611e7f9150611e7361047f565b93845215156020840152565b604082015290565b92505a9085848689611eae5a604051630780cef560e11b8152958694859460048601611c6d565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1908115611e3757858092611f08575b5050611efe611d3a9195935a90611833565b9498929193611d34565b611efe9650611d3a925090611f26913d8091833e611e27818361043d565b95909591611eec565b95505050505050611f3e611840565b611f4661047f565b906000825260006020830152604082015290565b600190611f65611b9f565b611f90611f73838787611c0f565b91611f86611f8184806116c9565b612735565b611d0183806116c9565b50505060208101611faf611fa382611c31565b6001600160a01b031690565b15611ff65760009182611fd0611fc58294611c31565b926040810190611c3b565b9190611fe160405180948193611b70565b03925af150611fee6117e5565b505b01611cb2565b5050611ff0565b50600280541461207d57600280556080612037612018611b9f565b9261202281612735565b8361202d8183612846565b9491929093612b2d565b94909501519461204561048e565b958652602086015260408501526060840152608083015260a0820152600060c082015261207061208e565b60e0820152906001600255565b633ee5aeb560e01b60005260046000fd5b6040519061209d60408361043d565b6002825261060f60f31b6020830152565b60015b600581106120fc57507f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206120e73484612da4565b6040519081526001600160a01b0390931692a2565b6001016120b1565b1561210b57565b60405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b6044820152606490fd5b9065ffffffffffff8091169116019065ffffffffffff821161134c57565b1561216957565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b6044820152606490fd5b156121ac57565b60405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606490fd5b156121f857565b60405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606490fd5b1561224457565b60405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606490fd5b906014116103455790601490565b356bffffffffffffffffffffffff198116929190601482106122b7575050565b6bffffffffffffffffffffffff1960149290920360031b82901b16169150565b604051906122e4826103eb565b6003546001600160a01b03168252604051602083612301836103eb565b6004548352600554828401520152565b612319611a62565b50612322611b9f565b9061232c81612735565b6123368282612846565b509190926123448385612bcc565b805160e00151612361906001600160a01b0316612d38565b612d38565b8151519092906123919061237d906001600160a01b0316612d38565b91612386611a49565b506040810190611c3b565b906014821061246b576123b36123ad6123b99361235c93612289565b90612297565b60601c90565b9160018060a01b0386169460808201519660606040840151930151926123dd61045e565b98895260208901526040880152606087015260808601526123fc6122d7565b9380151580612460575b61242e575b5061241461045e565b948552602085015260408401526060830152608082015290565b90935061243a81612d38565b61245461244561049e565b6001600160a01b039093168352565b6020820152923861240b565b506001811415612406565b50506123b96000612d38565b61046d336120ae565b9060009283809360208451940192f190565b3d61080081116124b7575b604051906020818301016040528082526000602083013e90565b5061080061249d565b600311156124ca57565b634e487b7160e01b600052602160045260246000fd5b909493929460038110156124ca576060926125089183526080602084015260808301906106f8565b9460408201520152565b9093916000935a9286519261252684612d7a565b60e085015190916001600160a01b0390911690818061260e57505084516001600160a01b03169050925b5a8603019360a060608201519101510190608089019182518603908181116125f9575b505084029160408901928351948186106000146125cf575050806125986002926124c0565b036125b457505061046d925080956125af81612e96565b612dcb565b9150915061046d925a90039051019051856125af8297612e96565b9061046d9750809a94506125e892935080950390612da4565b506125f2816124c0565b1590612e31565b9195916064919003600a020401933880612573565b9491815161261e575b5050612550565b612627856124c0565b600285031561261757919098505a9160a0870151813b156103455784600091878361266e958f60405197889687958693637c627b2160e01b8552828d0291600486016124e0565b0393f19081612708575b5061270157506020898101518a518051920151917ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f4792906001600160a01b03166126bf612492565b6040516001600160a01b039092169482916126da91836114b6565b0390a36126f35a870360808b01510180998b6002612512565b50505b5a9003963880612617565b97506126f6565b806109cf60006127179361043d565b38612678565b90604061051a926000815281602082015201906106f8565b6040516135a560f21b602082019081523060601b6022830152600160f81b6036830152601782526127be92919061276d60378361043d565b60018060a01b0391519020166bffffffffffffffffffffffff60a01b600654161760065561279e6040820182611c3b565b916127b66127ab82611c31565b9160e0810190611c3b565b939092612ed8565b80516127c75750565b604051631101335b60e11b81529081906115f4906004830161271d565b156127eb57565b60405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606490fd5b9060738202918083046073149015171561134c57565b90916000915a9380519161285a8382612fe3565b61286381611958565b60208301526040830151956128af6effffffffffffffffffffffffffffff8860c08701511760608701511760808701511760a087015117610100870151176101208701511711156127e4565b6128da84610100604082015160608301510160808301510160a08301510160c0830151019101510290565b6128e8888286866000613127565b85519098906129099061152f906001600160a01b03166020890151906132df565b6129ea575a83031161299b576060905a60e096909601516001600160a01b0316612968575b61295c9360a061051a9794879460809460406129619a015260608601525a9003910135019101525a90611833565b612830565b6064900490565b965050928260808360a061051a976129898b6129619961295c99600061338a565b9b90959850935094975050935061292e565b60408051631101335b60e11b8152600060048201526024810191909152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152608490fd5b9035601e19823603018112156103455701602081359101916001600160401b03821161034557813603831361034557565b61051a91612a8881612a7b84610549565b6001600160a01b03169052565b60208201356020820152612b1e612b12612ad9612abe612aab6040870187612a39565b6101206040880152610120870191611756565b612acb6060870187612a39565b908683036060880152611756565b6080850135608085015260a085013560a085015260c085013560c0850152612b0460e0860186612a39565b9085830360e0870152611756565b92610100810190612a39565b91610100818503910152611756565b905a90606081015190612b436060850185611c3b565b600060038211612bc4575b6001600160e01b031916638dd7712f60e01b03612bb3575050612b9a612bae6106d1956020840151604051938492638dd7712f60e01b6020850152604060248501526064840190612a6a565b90604483015203601f19810183528261043d565b6114cd565b6106d1955090612bae9136916104c8565b508135612b4e565b612bd59061351b565b906001600160a01b0316612cf257612ca357612bf09061351b565b906001600160a01b0316612c5d57612c0457565b60408051631101335b60e11b8152600060048201526024810191909152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f742064756064820152606560f81b608482015260a490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b90612d41611a49565b9160018060a01b0316600052600060205263ffffffff6001604060002001546001600160701b038160081c16845260781c166020830152565b610120610100820151910151808214612da057480180821015612d9b575090565b905090565b5090565b60018060a01b031660005260006020526040600020805491820180921161134c5781905590565b9190917f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f6080602083015192519460018060a01b0386511694602060018060a01b0360e089015116970151916040519283526000602084015260408301526060820152a4565b9060807f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f91602084015193519560018060a01b0387511695602060018060a01b0360e08a015116980151926040519384521515602084015260408301526060820152a4565b60208101519051907f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e60208060018060a01b03855116940151604051908152a3565b50929192159081612f8d575b50612f50576014811015612efd575b505061051a6117d0565b601411610345573560601c3b15612f15573880612ef3565b604051612f2360408261043d565b601b81527f41413330207061796d6173746572206e6f74206465706c6f7965640000000000602082015290565b5050604051612f6060408261043d565b601981527f41413230206163636f756e74206e6f74206465706c6f79656400000000000000602082015290565b90503b1538612ee4565b15612f9e57565b60405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606490fd5b61306890613000612ff382611c31565b6001600160a01b03168452565b602081013560208401526130246080820135906001600160801b038260801c921690565b6060850152604084015260a081013560c084015261305260c0820135906001600160801b038260801c921690565b61010085015261012084015260e0810190611c3b565b9081156130a45761308c8260e092613087603461046d97961015612f97565b61360b565b60a085015260808401526001600160a01b0316910152565b505060a081600060e0819401528260808201520152565b90816020910312610345575190565b6130e260409295949395606083526060830190612a6a565b9460208201520152565b60a09061051a9392815260606020820152600d60608201526c10504c8cc81c995d995c9d1959609a1b608082015281604082015201906106f8565b949291939060206131ad9186519361317360e061314a875160018060a01b031690565b966131658b8d61315d6040890189611c3b565b929091613669565b01516001600160a01b031690565b6001600160a01b0316159760009290896132a1575b8401516040516306608bdf60e21b8152958694859360009385939291600485016130ca565b03926001600160a01b03881690f160009181613270575b506131ef57856131d2612492565b6040516365c8fd4d60e01b81529182916115f491600484016130ec565b9492936131fb57505050565b6001600160a01b03166000908152602081905260409020918254908183116132235750039055565b60408051631101335b60e11b815260048101929092526024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152608490fd5b61329391925060203d60201161329a575b61328b818361043d565b8101906130bb565b90386131c4565b503d613281565b6001600160a01b038716600090815260208190526040902090935054878111156132d45750600084815b94915050613188565b8460009189036132cb565b6001600160a01b0316600090815260016020908152604080832084821c845290915290208054916001600160401b0391613318846114a7565b9055161490565b91906040838203126103455782516001600160401b0381116103455760209161334991850161189f565b92015190565b60a09061051a9392815260606020820152600d60608201526c10504cccc81c995d995c9d1959609a1b608082015281604082015201906106f8565b929390915a815160e08101516001600160a01b031660008181526020819052604090209295909290919080548981106134cc5760206080600096948c96946133f59c9d8995039055015196015191604051998a95869485936314add44b60e21b8552600485016130ca565b03926001600160a01b031686f193846000916000966134a5575b5061343a578561341d612492565b6040516365c8fd4d60e01b81529182916115f4916004840161334f565b9491925a9003116134485750565b60408051631101335b60e11b815260048101929092526024820152602760448201527f41413336206f766572207061796d6173746572566572696669636174696f6e47606482015266185cd31a5b5a5d60ca1b608482015260a490fd5b9095506134c591503d806000833e6134bd818361043d565b81019061331f565b943861340f565b60408051631101335b60e11b8152600481018b90526024810191909152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152608490fd5b80156135f75760006040805161353081610406565b828152826020820152015265ffffffffffff8160a01c1680156135ea575b6135cc906135b36135656135706135658660d01c90565b65ffffffffffff1690565b9261358b61357c61047f565b6001600160a01b039097168752565b6135a16020870194859065ffffffffffff169052565b65ffffffffffff166040860181905290565b42119081156135cf575b5091516001600160a01b031690565b91565b516135e2915065ffffffffffff16613565565b4210386135bd565b5065ffffffffffff61354e565b50600090600090565b816040519182372090565b9091826014116103455781359183602411610345576014810135936034116103455760609290921c92608090811c9260240135901c90565b90816020910312610345575161051a8161051d565b91602061051a938181520191611756565b92909181613678575b50505050565b8251516001600160a01b031693843b613886576006546000906020906136a6906001600160a01b0316611fa3565b60408751015160405180948193632b870d1b60e11b8352826136cc8b8b60048401613658565b0393f1908115611e3757600091613857575b506001600160a01b038116958615613808576001600160a01b0316958690036137b9573b1561376c57506123b36123ad7fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d9361373993612289565b602083810151935160e00151604080516001600160a01b039485168152939091169183019190915290a338808080613672565b60408051631101335b60e11b815260048101929092526024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018490526024810191909152602060448201527f4141313420696e6974436f6465206d7573742072657475726e2073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018590526024810191909152601b60448201527f4141313320696e6974436f6465206661696c6564206f72204f4f4700000000006064820152608490fd5b613879915060203d60201161387f575b613871818361043d565b810190613643565b386136de565b503d613867565b60408051631101335b60e11b815260048101929092526024820152601f60448201527f414131302073656e64657220616c726561647920636f6e7374727563746564006064820152608490fdfea2646970667358221220410dc6bd44472a2709fd674311474a749918a8c3dd38c8e316e19d5ae2faaadf64736f6c634300081a00336080806040523460155761016d908161001b8239f35b600080fdfe6080600436101561000f57600080fd5b60003560e01c63570e1a361461002457600080fd5b346101325760203660031901126101325760043567ffffffffffffffff8111610132573660238201121561013257806004013567ffffffffffffffff8111610132573660248284010111610132576000928160141161012e5760131982019167ffffffffffffffff831161011a57600b8101601f19908116603f0116820167ffffffffffffffff8111838210176101065760246020959387600c819795829560405286845289840196603889018837830101525193013560601c5af1905190156100fe575b6040516001600160a01b039091168152602090f35b5060006100e9565b634e487b7160e01b86526041600452602486fd5b634e487b7160e01b85526041600452602485fd5b8380fd5b600080fdfea26469706673582212208d3d15f1a1651d00f2ed3b618a50717a7de16a758bd696cf961337d90cc7bf3764736f6c634300081a0033" + "0x000000000000000000000000000000000000000000000000000000000000000060808060405234608257613b908181016001600160401b03811183821017606c5782916103ff833903906000f08015606057600080546001600160a01b0319166001600160a01b039290921691909117905560405161037790816100888239f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c63c18f52261461002757600080fd5b34610281576040366003190112610281576004356001600160a01b038116908190036102815760243567ffffffffffffffff81116102815736602382011215610281578060040135610078816102be565b91610086604051938461029c565b8183526024602084019260051b820101903682116102815760248101925b82841061020957845185876100b8836102be565b926100c6604051948561029c565b8084526100d5601f19916102be565b0160005b8181106101f857505060005b825181101561019057600190606060008061013b858060a01b0382541661014961010f878b610317565b51604051938491602083019463428557b160e11b865260248401526040604484015260648301906102d6565b03601f19810184528361029c565b82885a935193f115610172575b6101608287610317565b5261016b8186610317565b50016100e5565b503d604051906020818301016040528082526000602083013e610156565b836040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106101c957505050500390f35b919360019193955060206101e88192603f198a820301865288516102d6565b96019201920185949391926101ba565b8060606020809388010152016100d9565b833567ffffffffffffffff8111610281578201366043820112156102815760248101359167ffffffffffffffff831161028657604051610253601f8501601f19166020018261029c565b83815236604484860101116102815760006020858196604483970183860137830101528152019301926100a4565b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761028657604052565b67ffffffffffffffff81116102865760051b60200190565b919082519283825260005b848110610302575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016102e1565b805182101561032b5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220188cb9342176e096561b856f8b3751f67e4246534755fbbec3b1c61b597809e164736f6c634300081a003360c080604052346100cc5760016002556101888181016001600160401b038111838210176100b6578291613a08833903906000f080156100aa576080523060a0526100486100d1565b600081526020810190600082528060206100606100d1565b600081520152600380546001600160a01b0319169055516004555160055560405161391790816100f1823960805181505060a0518181816108ef01528181611d4a0152611ec10152f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b60408051919082016001600160401b038111838210176100b65760405256fe60806040526004361015610023575b361561001957600080fd5b610021612485565b005b60003560e01c80630396cb60146101835780630bd28e3b1461017e5780630da82661146101795780630dbfc6bd146101745780630f019dea1461016f5780631b2e01b81461016a578063205c28781461016557806322cdde4c14610160578063263934db1461015b57806330ec25d11461015657806335567e1a14610151578063444034731461014c5780635287ce12146101475780635787f48b146101425780635895273b1461013d57806370a0823114610138578063b760faf914610133578063bb9fe6bf1461012e578063c23a5cea14610129578063c3bce00914610124578063fc7e286d1461011f5763fe2171cb0361000e5761130a565b61127f565b611252565b611150565b61104e565b611023565b610fe6565b610fb1565b610f2c565b610dee565b610d71565b610d08565b610c8a565b610b7c565b610b5c565b610a3e565b6109db565b61083d565b610779565b610554565b610360565b60203660031901126103455760043563ffffffff811690818103610345576103407fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01916103226102436102336101eb3360018060a01b03166000526000602052604060002090565b966101f781151561135f565b61022460018901549161021d6102148463ffffffff9060781c1690565b63ffffffff1690565b11156113ab565b60081c6001600160701b031690565b6001600160701b0334911661142a565b9461024f861515611437565b6102626001600160701b03871115611478565b5461026b61045e565b908152600160208201526001600160701b038616604082015263ffffffff8316606082015260006080820181905233815260208190526040902081518155602082015160019091018054604084015160608501516080909501516001600160c81b031990921660ff941515949094169390931760089390931b6effffffffffffffffffffffffffff00169290921760789390931b63ffffffff60781b169290921760989190911b65ffffffffffff60981b16179055565b6040805194855263ffffffff90911660208501523393918291820190565b0390a2005b600080fd5b602435906001600160c01b038216820361034557565b34610345576020366003190112610345576004356001600160c01b0381168103610345573360009081526001602090815260408083206001600160c01b039094168352929052206103b181546114b5565b9055005b634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b038211176103e657604052565b6103b5565b604081019081106001600160401b038211176103e657604052565b606081019081106001600160401b038211176103e657604052565b61014081019081106001600160401b038211176103e657604052565b90601f801991011681019081106001600160401b038211176103e657604052565b6040519061046d60a08361043d565b565b6040519061046d6101408361043d565b6040519061046d60608361043d565b6040519061046d6101008361043d565b6040519061046d60408361043d565b6001600160401b0381116103e657601f01601f191660200190565b9291926104d4826104ad565b916104e2604051938461043d565b829481845281830111610345578281602093846000960137010152565b9080601f830112156103455781602061051a933591016104c8565b90565b6001600160a01b0381160361034557565b6024359061046d8261051d565b610104359061046d8261051d565b359061046d8261051d565b3461034557610220366003190112610345576004356001600160401b038111610345576105859036906004016104ff565b3660231901906101c0821261034557610140604051926105a4846103cb565b12610345576105b161046f565b6105b961052e565b815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260e43560c08201526105f361053b565b60e0820152610124356101008201526101443561012082015282526101643560208301526101843560408301526101a43560608301526101c43560808301526101e435916001600160401b038311610345576106566106619336906004016104ff565b9061020435926114db565b60408051928352602083019190915290f35b0390f35b9181601f84011215610345578235916001600160401b038311610345576020808501948460051b01011161034557565b602060031982011261034557600435906001600160401b038211610345576106d191600401610677565b9091565b60005b8381106106e85750506000910152565b81810151838201526020016106d8565b90602091610711815180928185528580860191016106d5565b601f01601f1916010190565b9061010060e061051a93805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c0810151151560c08501520151918160e082015201906106f8565b346103455761079061078a366106a7565b9061171d565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106107c857505050500390f35b919360019193955060206107e78192603f198a8203018652885161071d565b96019201920185949391926107b9565b9181601f84011215610345578235916001600160401b038311610345576020838186019501011161034557565b60409061051a93921515815281602082015201906106f8565b346103455760803660031901126103455760043561085a8161051d565b6024356108668161051d565b6044356001600160401b038111610345576108859036906004016107f7565b926108c0606435936108b2600095606097604051968794634440347360e01b602087015260248601611785565b03601f19810184528361043d565b6001600160a01b0316803b156103455760405163428557b160e11b8152916000918391829084908290610920907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600484016117b0565b03925af190816109c0575b506109bb57505061093a6117f3565b61094c6109478251611823565b61186a565b9060045b815181101561099557806109776109696001938561189c565b516001600160f81b03191690565b61098e61098383611823565b9160001a918661189c565b5301610950565b50506109aa90602080825183010191016118ef565b905b61067360405192839283610824565b6109ac565b806109cf60006109d59361043d565b80611043565b3861092b565b34610345576040366003190112610345576020610a356004356109fd8161051d565b610a0561034a565b6001600160a01b0390911660009081526001845260408082206001600160c01b0390931682526020929092522090565b54604051908152f35b3461034557604036600319011261034557600435610a5b8161051d565b602435336000526000602052604060002091825492838311610ae3576000808481948294610a8c610021988a611841565b9055604080516001600160a01b03831681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a26001600160a01b03165af1610add6117f3565b50611925565b60405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606490fd5b602060031982011261034557600435906001600160401b038211610345576101209082900360031901126103455760040190565b34610345576020610b74610b6f36610b28565b611966565b604051908152f35b3461034557610673610bbd610bb1610bb7610b96366106a7565b809391610ba161161d565b50610bab82611671565b5061171d565b91611832565b90611709565b5160405191829160208352602083019061071d565b9061051a9060e06080610c24818651610140865280516101408701526020810151610160870152604081015161018087015260608101516101a0870152015160a06101c08601526101e08501906106f8565b60208087015180518683015201516040850152946040810151805160608601526020015160808501526060810151805160a08601526020015160c0850152015191019080516001600160a01b031682526020908101518051828401520151604090910152565b3461034557610ca1610c9b366106a7565b90611af7565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b828210610cd957505050500390f35b91936001919395506020610cf88192603f198a82030186528851610bd2565b9601920192018594939192610cca565b34610345576040366003190112610345576020600435610d278161051d565b610d2f61034a565b6001600160a01b0390911660009081526001835260408082206001600160c01b03841683526020529020546040805192901b67ffffffffffffffff1916178152f35b3461034557606036600319011261034557600435610d8e8161051d565b6024356001600160401b0381116103455760009182610db2819336906004016107f7565b919092610dbe60443590565b9383604051948592833781018381520393f1610dd86117f3565b9015610de057005b805190811561034557602001fd5b3461034557602036600319011261034557600435610e0b8161051d565b60006080604051610e1b816103cb565b828152826020820152826040820152826060820152015260018060a01b031660005260006020526106736040600020610eaa65ffffffffffff600160405193610e63856103cb565b80548552015460ff8116151560208501526001600160701b038160081c16604085015263ffffffff8160781c16606085015260981c16608083019065ffffffffffff169052565b60405191829182919091608065ffffffffffff8160a0840195805185526020810151151560208601526001600160701b03604082015116604086015263ffffffff6060820151166060860152015116910152565b6080604061051a936020845280516020850152602081015115158285015201519160608082015201906106f8565b346103455760c0366003190112610345576004356001600160401b03811161034557610f5c903690600401610677565b906024356001600160401b03811161034557606060031982360301126103455761067392610fa592604435610f908161051d565b606435916084359360a4359560040191611cac565b60405191829182610efe565b3461034557610673610fd2610fc536610b28565b610fcd61161d565b61200b565b60405191829160208352602083019061071d565b34610345576020366003190112610345576004356110038161051d565b60018060a01b031660005260006020526020604060002054604051908152f35b60203660031901126103455761002160043561103e8161051d565b6120bc565b600091031261034557565b34610345576000366003190112610345573360005260006020526001604060002001805463ffffffff8160781c161561111e576110ba6110ac610214836110a061109b6110e19660ff1690565b612112565b60781c63ffffffff1690565b65ffffffffffff4216612152565b825460ff65ffffffffffff60981b01191665ffffffffffff60981b609883901b1617909255565b60405165ffffffffffff909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a908060208101610340565b60405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606490fd5b346103455760203660031901126103455761002160008080806004356111758161051d565b336000908152602081905260409020600101906111fd8254926111ec65ffffffffffff6111d86111be6111b2886001600160701b039060081c1690565b6001600160701b031690565b966111ca881515612170565b60981c65ffffffffffff1690565b166111e48115156121b3565b4210156121ff565b8054610100600160c81b0319169055565b604080516001600160a01b03831681526020810184905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a26001600160a01b03165af161124c6117f3565b5061224b565b346103455761067361126b61126636610b28565b61231f565b604051918291602083526020830190610bd2565b346103455760203660031901126103455760043561129c8161051d565b6001600160a01b031660009081526020818152604091829020805460019190910154835191825260ff8116151592820192909252600882901c6001600160701b031692810192909252607881901c63ffffffff16606083015260981c65ffffffffffff16608082015260a090f35b346103455761132c61131b366106a7565b809291611326611a70565b50611af7565b600019820191821161135a576106739161134591611709565b51604051918291602083526020830190610bd2565b6113f7565b1561136657565b60405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c61790000000000006044820152606490fd5b156113b257565b60405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90611388820180921161135a57565b906001820180921161135a57565b9190820180921161135a57565b1561143e57565b60405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b6044820152606490fd5b1561147f57565b60405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b6044820152606490fd5b600019811461135a5760010190565b60409061051a9392815281602082015201906106f8565b91908051936060850151946114f3603f5a0260061c90565b61271060a0830151880101116115c1576106d1956000958051611523575b5050505a900360808201510192612520565b82516115419261153d9290916001600160a01b031661248e565b1590565b61154d575b8080611511565b9093506115586124a0565b805161156a575b505060019238611546565b602083810151835193909101516040516001600160a01b039094169391927f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201929182916115b791836114c4565b0390a3388061155f565b60408051631101335b60e11b8152600060048201526024810191909152600f60448201526e41413935206f7574206f662067617360881b6064820152608490fd5b0390fd5b6001600160401b0381116103e65760051b60200190565b6040519061010082018281106001600160401b038211176103e657604052606060e08360008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152565b9061167b82611606565b611688604051918261043d565b8281528092611699601f1991611606565b019060005b8281106116aa57505050565b6020906116b561161d565b8282850101520161169e565b634e487b7160e01b600052603260045260246000fd5b90359061011e1981360301821215610345570190565b908210156117045761051a9160051b8101906116d7565b6116c1565b80518210156117045760209160051b010190565b61172682611671565b9160005b8181106117375750505090565b80611748610fc560019385876116ed565b6117528287611709565b5261175d8186611709565b500161172a565b908060209392818452848401376000828201840152601f01601f1916010190565b949392916040926117ab9260018060a01b03168752606060208801526060870191611764565b930152565b6001600160a01b03909116815260406020820181905261051a929101906106f8565b6040513d6000823e3d90fd5b604051906117ed60208361043d565b60008252565b3d1561181e573d90611804826104ad565b91611812604051938461043d565b82523d6000602084013e565b606090565b60031981019190821161135a57565b60001981019190821161135a57565b9190820391821161135a57565b6040519061185d60208361043d565b6000808352366020840137565b90611874826104ad565b611881604051918261043d565b8281528092611892601f19916104ad565b0190602036910137565b908151811015611704570160200190565b81601f820112156103455780516118c3816104ad565b926118d1604051948561043d565b818452602082840101116103455761051a91602080850191016106d5565b9190916040818403126103455780518015158103610345579260208201516001600160401b0381116103455761051a92016118ad565b1561192c57565b60405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606490fd5b6020810135611a2861197b6040840184611c49565b90816040519182372091611a1a6119956060860186611c49565b90816040519182372060c086013560a087013560808801356119c36119bd60e08b018b611c49565b9061360e565b604080519a356001600160a01b031660208c01908152908b019790975260608a0198909852608089019390935260a088019290925260c087019190915260e086015261010085019390935292918290610120820190565b03601f19810183528261043d565b51902060408051602081019283523091810191909152466060820152611a518160808101611a1a565b51902090565b60405190611a64826103eb565b60006020838281520152565b60405190611a7d826103cb565b81604051611a8a816103cb565b60008152600060208201526000604082015260006060820152606060808201528152611ab4611a57565b6020820152611ac1611a57565b6040820152611ace611a57565b6060820152608060405191611ae2836103eb565b60008352611aee611a57565b60208401520152565b611b0082611606565b91611b0e604051938461043d565b808352601f19611b1d82611606565b0160005b818110611b6757505060005b818110611b3a5750505090565b80611b4b61126660019385876116ed565b611b558287611709565b52611b608186611709565b5001611b2d565b602090611b72611a70565b82828801015201611b21565b908092918237016000815290565b60405190611b9982610406565b606060408360008152600060208201520152565b60405190611bba826103cb565b6000608083604051611bcb81610421565b83815283602082015283604082015283606082015283838201528360a08201528360c08201528360e0820152836101008201528361012082015281528260208201528260408201528260608201520152565b91908110156117045760051b81013590605e1981360301821215610345570190565b3561051a8161051d565b903590601e198136030182121561034557018035906001600160401b0382116103455760200191813603831361034557565b6001600160a01b03918216815291166020820152608060408201819052909392916060916117ab91908601906106f8565b9694969591939295611cbc611b8c565b5060005b828110611f6857505050611cd483806116d7565b93611d14611cfc611cf5611cea60208801611c3f565b966040810190611c49565b36916104c8565b95611d05611bad565b90611d0f81612743565b612854565b5050506001600160a01b03841615611f3d5760008315611e955750600190611d48611d3d6117de565b989291935b8561142a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169881905b84611d818885611841565b10611e6a575a611d908861140d565b11611e4a5791869593918a95938c8b611daa858d9c61142a565b60011c9a8b996040519c8d938493630780cef560e11b85526004850193611dd094611c7b565b03815a6000948591f1988915611e4557600090819a611e1f575b5015611e0a57505050611dfc84611832565b95915b939092949591611d76565b93965094611e1991975061141c565b94611dff565b90611e3d929a503d8091833e611e35818361043d565b8101906118ef565b989038611dea565b6117d2565b637162685f60e11b60005260048290526024879052604483905260646000fd5b97509750509250509450611e8d9150611e8161047f565b93845215156020840152565b604082015290565b92505a9085848689611ebc5a604051630780cef560e11b8152958694859460048601611c7b565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1908115611e4557858092611f16575b5050611f0c611d489195935a90611841565b9498929193611d42565b611f0c9650611d48925090611f34913d8091833e611e35818361043d565b95909591611efa565b95505050505050611f4c61184e565b611f5461047f565b906000825260006020830152604082015290565b600190611f73611bad565b611f9e611f81838787611c1d565b91611f94611f8f84806116d7565b612743565b611d0f83806116d7565b50505060208101611fbd611fb182611c3f565b6001600160a01b031690565b156120045760009182611fde611fd38294611c3f565b926040810190611c49565b9190611fef60405180948193611b7e565b03925af150611ffc6117f3565b505b01611cc0565b5050611ffe565b50600280541461208b57600280556080612045612026611bad565b9261203081612743565b8361203b8183612854565b9491929093612b3b565b94909501519461205361048e565b958652602086015260408501526060840152608083015260a0820152600060c082015261207e61209c565b60e0820152906001600255565b633ee5aeb560e01b60005260046000fd5b604051906120ab60408361043d565b6002825261060f60f31b6020830152565b60015b6005811061210a57507f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206120f53484612db2565b6040519081526001600160a01b0390931692a2565b6001016120bf565b1561211957565b60405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b6044820152606490fd5b9065ffffffffffff8091169116019065ffffffffffff821161135a57565b1561217757565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b6044820152606490fd5b156121ba57565b60405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606490fd5b1561220657565b60405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606490fd5b1561225257565b60405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606490fd5b906014116103455790601490565b356bffffffffffffffffffffffff198116929190601482106122c5575050565b6bffffffffffffffffffffffff1960149290920360031b82901b16169150565b604051906122f2826103eb565b6003546001600160a01b0316825260405160208361230f836103eb565b6004548352600554828401520152565b612327611a70565b50612330611bad565b9061233a81612743565b6123448282612854565b509190926123528385612bda565b805160e0015161236f906001600160a01b0316612d46565b612d46565b81515190929061239f9061238b906001600160a01b0316612d46565b91612394611a57565b506040810190611c49565b9060148210612479576123c16123bb6123c79361236a93612297565b906122a5565b60601c90565b9160018060a01b0386169460808201519660606040840151930151926123eb61045e565b988952602089015260408801526060870152608086015261240a6122e5565b938015158061246e575b61243c575b5061242261045e565b948552602085015260408401526060830152608082015290565b90935061244881612d46565b61246261245361049e565b6001600160a01b039093168352565b60208201529238612419565b506001811415612414565b50506123c76000612d46565b61046d336120bc565b9060009283809360208451940192f190565b3d61080081116124c5575b604051906020818301016040528082526000602083013e90565b506108006124ab565b600311156124d857565b634e487b7160e01b600052602160045260246000fd5b909493929460038110156124d8576060926125169183526080602084015260808301906106f8565b9460408201520152565b9093916000935a9286519261253484612d88565b60e085015190916001600160a01b0390911690818061261c57505084516001600160a01b03169050925b5a8603019360a06060820151910151019060808901918251860390818111612607575b505084029160408901928351948186106000146125dd575050806125a66002926124ce565b036125c257505061046d925080956125bd81612ea4565b612dd9565b9150915061046d925a90039051019051856125bd8297612ea4565b9061046d9750809a94506125f692935080950390612db2565b50612600816124ce565b1590612e3f565b9195916064919003600a020401933880612581565b9491815161262c575b505061255e565b612635856124ce565b600285031561262557919098505a9160a0870151813b156103455784600091878361267c958f60405197889687958693637c627b2160e01b8552828d0291600486016124ee565b0393f19081612716575b5061270f57506020898101518a518051920151917ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f4792906001600160a01b03166126cd6124a0565b6040516001600160a01b039092169482916126e891836114c4565b0390a36127015a870360808b01510180998b6002612520565b50505b5a9003963880612625565b9750612704565b806109cf60006127259361043d565b38612686565b90604061051a926000815281602082015201906106f8565b6040516135a560f21b602082019081523060601b6022830152600160f81b6036830152601782526127cc92919061277b60378361043d565b60018060a01b0391519020166bffffffffffffffffffffffff60a01b60065416176006556127ac6040820182611c49565b916127c46127b982611c3f565b9160e0810190611c49565b939092612ee6565b80516127d55750565b604051631101335b60e11b8152908190611602906004830161272b565b156127f957565b60405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606490fd5b9060738202918083046073149015171561135a57565b90916000915a938051916128688382612ff1565b61287181611966565b60208301526040830151956128bd6effffffffffffffffffffffffffffff8860c08701511760608701511760808701511760a087015117610100870151176101208701511711156127f2565b6128e884610100604082015160608301510160808301510160a08301510160c0830151019101510290565b6128f6888286866000613135565b85519098906129179061153d906001600160a01b03166020890151906132ed565b6129f8575a8303116129a9576060905a60e096909601516001600160a01b0316612976575b61296a9360a061051a97948794608094604061296f9a015260608601525a9003910135019101525a90611841565b61283e565b6064900490565b965050928260808360a061051a976129978b61296f9961296a996000613398565b9b90959850935094975050935061293c565b60408051631101335b60e11b8152600060048201526024810191909152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152608490fd5b9035601e19823603018112156103455701602081359101916001600160401b03821161034557813603831361034557565b61051a91612a9681612a8984610549565b6001600160a01b03169052565b60208201356020820152612b2c612b20612ae7612acc612ab96040870187612a47565b6101206040880152610120870191611764565b612ad96060870187612a47565b908683036060880152611764565b6080850135608085015260a085013560a085015260c085013560c0850152612b1260e0860186612a47565b9085830360e0870152611764565b92610100810190612a47565b91610100818503910152611764565b905a90606081015190612b516060850185611c49565b600060038211612bd2575b6001600160e01b031916638dd7712f60e01b03612bc1575050612ba8612bbc6106d1956020840151604051938492638dd7712f60e01b6020850152604060248501526064840190612a78565b90604483015203601f19810183528261043d565b6114db565b6106d1955090612bbc9136916104c8565b508135612b5c565b612be390613529565b906001600160a01b0316612d0057612cb157612bfe90613529565b906001600160a01b0316612c6b57612c1257565b60408051631101335b60e11b8152600060048201526024810191909152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f742064756064820152606560f81b608482015260a490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b90612d4f611a57565b9160018060a01b0316600052600060205263ffffffff6001604060002001546001600160701b038160081c16845260781c166020830152565b610120610100820151910151808214612dae57480180821015612da9575090565b905090565b5090565b60018060a01b031660005260006020526040600020805491820180921161135a5781905590565b9190917f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f6080602083015192519460018060a01b0386511694602060018060a01b0360e089015116970151916040519283526000602084015260408301526060820152a4565b9060807f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f91602084015193519560018060a01b0387511695602060018060a01b0360e08a015116980151926040519384521515602084015260408301526060820152a4565b60208101519051907f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e60208060018060a01b03855116940151604051908152a3565b50929192159081612f9b575b50612f5e576014811015612f0b575b505061051a6117de565b601411610345573560601c3b15612f23573880612f01565b604051612f3160408261043d565b601b81527f41413330207061796d6173746572206e6f74206465706c6f7965640000000000602082015290565b5050604051612f6e60408261043d565b601981527f41413230206163636f756e74206e6f74206465706c6f79656400000000000000602082015290565b90503b1538612ef2565b15612fac57565b60405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606490fd5b6130769061300e61300182611c3f565b6001600160a01b03168452565b602081013560208401526130326080820135906001600160801b038260801c921690565b6060850152604084015260a081013560c084015261306060c0820135906001600160801b038260801c921690565b61010085015261012084015260e0810190611c49565b9081156130b25761309a8260e092613095603461046d97961015612fa5565b613619565b60a085015260808401526001600160a01b0316910152565b505060a081600060e0819401528260808201520152565b90816020910312610345575190565b6130f060409295949395606083526060830190612a78565b9460208201520152565b60a09061051a9392815260606020820152600d60608201526c10504c8cc81c995d995c9d1959609a1b608082015281604082015201906106f8565b949291939060206131bb9186519361318160e0613158875160018060a01b031690565b966131738b8d61316b6040890189611c49565b929091613677565b01516001600160a01b031690565b6001600160a01b0316159760009290896132af575b8401516040516306608bdf60e21b8152958694859360009385939291600485016130d8565b03926001600160a01b03881690f16000918161327e575b506131fd57856131e06124a0565b6040516365c8fd4d60e01b815291829161160291600484016130fa565b94929361320957505050565b6001600160a01b03166000908152602081905260409020918254908183116132315750039055565b60408051631101335b60e11b815260048101929092526024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152608490fd5b6132a191925060203d6020116132a8575b613299818361043d565b8101906130c9565b90386131d2565b503d61328f565b6001600160a01b038716600090815260208190526040902090935054878111156132e25750600084815b94915050613196565b8460009189036132d9565b6001600160a01b0316600090815260016020908152604080832084821c845290915290208054916001600160401b0391613326846114b5565b9055161490565b91906040838203126103455782516001600160401b038111610345576020916133579185016118ad565b92015190565b60a09061051a9392815260606020820152600d60608201526c10504cccc81c995d995c9d1959609a1b608082015281604082015201906106f8565b929390915a815160e08101516001600160a01b031660008181526020819052604090209295909290919080548981106134da5760206080600096948c96946134039c9d8995039055015196015191604051998a95869485936314add44b60e21b8552600485016130d8565b03926001600160a01b031686f193846000916000966134b3575b50613448578561342b6124a0565b6040516365c8fd4d60e01b8152918291611602916004840161335d565b9491925a9003116134565750565b60408051631101335b60e11b815260048101929092526024820152602760448201527f41413336206f766572207061796d6173746572566572696669636174696f6e47606482015266185cd31a5b5a5d60ca1b608482015260a490fd5b9095506134d391503d806000833e6134cb818361043d565b81019061332d565b943861341d565b60408051631101335b60e11b8152600481018b90526024810191909152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152608490fd5b80156136055760006040805161353e81610406565b828152826020820152015265ffffffffffff8160a01c1680156135f8575b6135da906135c161357361357e6135738660d01c90565b65ffffffffffff1690565b9261359961358a61047f565b6001600160a01b039097168752565b6135af6020870194859065ffffffffffff169052565b65ffffffffffff166040860181905290565b42119081156135dd575b5091516001600160a01b031690565b91565b516135f0915065ffffffffffff16613573565b4210386135cb565b5065ffffffffffff61355c565b50600090600090565b816040519182372090565b9091826014116103455781359183602411610345576014810135936034116103455760609290921c92608090811c9260240135901c90565b90816020910312610345575161051a8161051d565b91602061051a938181520191611764565b92909181613686575b50505050565b8251516001600160a01b031693843b613894576006546000906020906136b4906001600160a01b0316611fb1565b60408751015160405180948193632b870d1b60e11b8352826136da8b8b60048401613666565b0393f1908115611e4557600091613865575b506001600160a01b038116958615613816576001600160a01b0316958690036137c7573b1561377a57506123c16123bb7fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d9361374793612297565b602083810151935160e00151604080516001600160a01b039485168152939091169183019190915290a338808080613680565b60408051631101335b60e11b815260048101929092526024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018490526024810191909152602060448201527f4141313420696e6974436f6465206d7573742072657475726e2073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018590526024810191909152601b60448201527f4141313320696e6974436f6465206661696c6564206f72204f4f4700000000006064820152608490fd5b613887915060203d60201161388d575b61387f818361043d565b810190613651565b386136ec565b503d613875565b60408051631101335b60e11b815260048101929092526024820152601f60448201527f414131302073656e64657220616c726561647920636f6e7374727563746564006064820152608490fdfea26469706673582212204bace728028e4808d0f0305687605c92acf3fb9a79388e9df617d0a21670961464736f6c634300081a00336080806040523460155761016d908161001b8239f35b600080fdfe6080600436101561000f57600080fd5b60003560e01c63570e1a361461002457600080fd5b346101325760203660031901126101325760043567ffffffffffffffff8111610132573660238201121561013257806004013567ffffffffffffffff8111610132573660248284010111610132576000928160141161012e5760131982019167ffffffffffffffff831161011a57600b8101601f19908116603f0116820167ffffffffffffffff8111838210176101065760246020959387600c819795829560405286845289840196603889018837830101525193013560601c5af1905190156100fe575b6040516001600160a01b039091168152602090f35b5060006100e9565b634e487b7160e01b86526041600452602486fd5b634e487b7160e01b85526041600452602485fd5b8380fd5b600080fdfea26469706673582212208d3d15f1a1651d00f2ed3b618a50717a7de16a758bd696cf961337d90cc7bf3764736f6c634300081a0033" /* ========= SAFE RELATED ========= */ diff --git a/scripts/localDeployer/index.ts b/scripts/localDeployer/index.ts index 9442870b..e04f4695 100644 --- a/scripts/localDeployer/index.ts +++ b/scripts/localDeployer/index.ts @@ -1,37 +1,37 @@ import { http, - createTestClient, - createWalletClient, - createPublicClient, type Address, - type Hex + type Hex, + createPublicClient, + createTestClient, + createWalletClient } from "viem" import { mnemonicToAccount } from "viem/accounts" import { foundry } from "viem/chains" import { - MULTICALL3_BYTECODE, + BICONOMY_ACCOUNT_V2_LOGIC_CREATECALL, + BICONOMY_DEFAULT_FALLBACK_HANDLER_CREATECALL, + BICONOMY_ECDSA_OWNERSHIP_REGISTRY_MOUDULE_CREATECALL, + BICONOMY_FACTORY_CREATECALL, + BICONOMY_SINGLETON_FACTORY_BYTECODE, ENTRY_POINT_SIMULATIONS_CREATECALL, ENTRY_POINT_V06_CREATECALL, ENTRY_POINT_V07_CREATECALL, + KERNEL_ACCOUNT_V2_2_LOGIC_CREATECALL, + KERNEL_ECDSA_VALIDATOR_CREATECALL, + KERNEL_FACTORY_CREATECALL, + MULTICALL3_BYTECODE, + SAFE_MULTI_SEND_CALL_ONLY_CREATECALL, SAFE_MULTI_SEND_CREATECALL, - SAFE_V06_MODULE_CREATECALL, - SAFE_V07_MODULE_SETUP_CREATECALL, SAFE_PROXY_FACTORY_CREATECALL, SAFE_SINGLETON_CREATECALL, SAFE_SINGLETON_FACTORY_BYTECODE, - SIMPLE_ACCOUNT_FACTORY_V06_CREATECALL, - SIMPLE_ACCOUNT_FACTORY_V07_CREATECALL, + SAFE_V06_MODULE_CREATECALL, SAFE_V06_MODULE_SETUP_CREATECALL, SAFE_V07_MODULE_CREATECALL, - BICONOMY_SINGLETON_FACTORY_BYTECODE, - BICONOMY_ECDSA_OWNERSHIP_REGISTRY_MOUDULE_CREATECALL, - BICONOMY_ACCOUNT_V2_LOGIC_CREATECALL, - BICONOMY_FACTORY_CREATECALL, - KERNEL_ACCOUNT_V2_2_LOGIC_CREATECALL, - KERNEL_ECDSA_VALIDATOR_CREATECALL, - KERNEL_FACTORY_CREATECALL, - BICONOMY_DEFAULT_FALLBACK_HANDLER_CREATECALL, - SAFE_MULTI_SEND_CALL_ONLY_CREATECALL + SAFE_V07_MODULE_SETUP_CREATECALL, + SIMPLE_ACCOUNT_FACTORY_V06_CREATECALL, + SIMPLE_ACCOUNT_FACTORY_V07_CREATECALL } from "./constants" const DETERMINISTIC_DEPLOYER = "0x4e59b44847b379578588920ca78fbf26c0b4956c" @@ -301,7 +301,7 @@ const main = async () => { "0x988C135a1049Ce61730724afD342fb7C56CD2776", "0x0000000071727De22E5E9d8BAf0edAc6f37da032", "0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985", - "0xAE6035bEE0802C969265C8A3193CE8878c99A66A", + "0xBbe8A301FbDb2a4CD58c4A37c262ecef8f889c47", "0x2dd68b007B46fBe91B9A7c3EDa5A7a1063cB5b47", "0x75cf11467937ce3F2f357CE24ffc3DBF8fD5c226", "0x8EcD4ec46D4D2a6B64fE960B3D64e8B94B2234eb", diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md index 214a04a7..f38c289b 100644 --- a/src/CHANGELOG.md +++ b/src/CHANGELOG.md @@ -1,5 +1,11 @@ # @pimlico/alto +## 0.0.7 + +### Patch Changes + +- 8588fbd30e111228d5d9422f538b0633357166d7: Improved calldata gas estimations for v0.7 userOperations + ## 0.0.6 ### Patch Changes diff --git a/src/cli/config/bundler.ts b/src/cli/config/bundler.ts index 00c94d70..79271b50 100644 --- a/src/cli/config/bundler.ts +++ b/src/cli/config/bundler.ts @@ -1,9 +1,9 @@ import { type ApiVersion, addressSchema, + bundlerRequestSchema, commaSeperatedAddressPattern, - hexData32Schema, - bundlerRequestSchema + hexData32Schema } from "@alto/types" import type { Hex } from "viem" import { type Account, privateKeyToAccount } from "viem/accounts" diff --git a/src/cli/customTransport.ts b/src/cli/customTransport.ts index 52387c0c..7a30b201 100644 --- a/src/cli/customTransport.ts +++ b/src/cli/customTransport.ts @@ -4,9 +4,15 @@ import { type HttpTransportConfig, RpcRequestError, UrlRequiredError, - createTransport + createTransport, + toFunctionSelector, + getAbiItem, + isHex, + slice, + Hex } from "viem" -import { rpc } from "viem/utils" +import { formatAbiItem, rpc } from "viem/utils" +import { EntryPointV06Abi } from "../types/contracts" export type RpcRequest = { jsonrpc?: "2.0" | undefined @@ -15,6 +21,33 @@ export type RpcRequest = { id?: number | undefined } +const EXECUTION_RESULT_SELECTOR = toFunctionSelector( + formatAbiItem( + getAbiItem({ + abi: EntryPointV06Abi, + name: "ExecutionResult" + }) + ) +) + +const VALIDATION_RESULT_SELECTOR = toFunctionSelector( + formatAbiItem( + getAbiItem({ + abi: EntryPointV06Abi, + name: "ValidationResult" + }) + ) +) + +const FAILED_OP_SELECTOR = toFunctionSelector( + formatAbiItem( + getAbiItem({ + abi: EntryPointV06Abi, + name: "FailedOp" + }) + ) +) + export function customTransport( /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */ url_: string, @@ -54,24 +87,45 @@ export function customTransport( const [{ error, result }] = await fn(body) if (error) { - logger.error( + let loggerFn = logger.error.bind(logger) + + if (isHex(error?.data) && error?.data?.length > 10) { + const errorSelector = slice(error?.data, 0, 4) + + if ( + [ + EXECUTION_RESULT_SELECTOR, + VALIDATION_RESULT_SELECTOR, + FAILED_OP_SELECTOR + ].includes(errorSelector as Hex) + ) { + loggerFn = logger.info.bind(logger) + } + } + + loggerFn( { - error, + err: error, body }, - "Received error response" + "received error response" ) + throw new RpcRequestError({ body, error: { ...error, // 24 Aug 2024, etherlink throws -32003 error code for eth_call - code: (method === 'eth_call' && error.code === -32003) ? 3 : error.code, + code: + method === "eth_call" && + error.code === -32003 + ? 3 + : error.code }, url: url }) } - logger.info({ body, result }, "Received response") + logger.info({ body, result }, "received response") return result }, retryCount, diff --git a/src/cli/deploySimulationsContract.ts b/src/cli/deploySimulationsContract.ts new file mode 100644 index 00000000..d7220465 --- /dev/null +++ b/src/cli/deploySimulationsContract.ts @@ -0,0 +1,49 @@ +import { PimlicoEntryPointSimulationsDeployBytecode } from "@alto/types" +import { + type Chain, + createWalletClient, + type Hex, + http, + type PublicClient, + type Transport +} from "viem" +import type { CamelCasedProperties } from "./parseArgs" +import type { IOptions } from "@alto/cli" + +export const deploySimulationsContract = async ({ + args, + publicClient +}: { + args: CamelCasedProperties + publicClient: PublicClient +}): Promise => { + const utilityPrivateKey = args.utilityPrivateKey + if (!utilityPrivateKey) { + throw new Error( + "Cannot deploy entryPoint simulations without utility-private-key" + ) + } + + const walletClient = createWalletClient({ + transport: http(args.rpcUrl), + account: utilityPrivateKey + }) + + const deployHash = await walletClient.deployContract({ + chain: publicClient.chain, + abi: [], + bytecode: PimlicoEntryPointSimulationsDeployBytecode + }) + + const receipt = await publicClient.getTransactionReceipt({ + hash: deployHash + }) + + const simulationsContract = receipt.contractAddress + + if (simulationsContract === null || simulationsContract === undefined) { + throw new Error("Failed to deploy simulationsContract") + } + + return simulationsContract +} diff --git a/src/cli/handler.ts b/src/cli/handler.ts index dd80ac60..1f4d195d 100644 --- a/src/cli/handler.ts +++ b/src/cli/handler.ts @@ -1,50 +1,28 @@ import { SenderManager } from "@alto/executor" +import { GasPriceManager } from "@alto/handlers" import { createMetrics, initDebugLogger, - initProductionLogger, - type Logger + initProductionLogger } from "@alto/utils" import { Registry } from "prom-client" import { + type Chain, createPublicClient, createWalletClient, - type Chain, - type PublicClient, - type Transport, - http, formatEther } from "viem" -import { fromZodError } from "zod-validation-error" -import { - optionArgsSchema, - type IBundlerArgs, - type IOptions, - type IOptionsInput -} from "./config" +import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor" +import type { IOptionsInput } from "./config" import { customTransport } from "./customTransport" import { setupServer } from "./setupServer" -import { PimlicoEntryPointSimulationsDeployBytecode } from "../types/contracts" -import { UtilityWalletMonitor } from "../executor/utilityWalletMonitor" -import { GasPriceManager } from "@alto/handlers" +import { type AltoConfig, createConfig } from "../createConfig" +import { parseArgs } from "./parseArgs" +import { deploySimulationsContract } from "./deploySimulationsContract" -const parseArgs = (args: IOptionsInput): IOptions => { - // validate every arg, make type safe so if i add a new arg i have to validate it - const parsing = optionArgsSchema.safeParse(args) - if (!parsing.success) { - const error = fromZodError(parsing.error) - throw new Error(error.message) - } - - return parsing.data -} - -const preFlightChecks = async ( - publicClient: PublicClient, - parsedArgs: IBundlerArgs -): Promise => { - for (const entrypoint of parsedArgs.entrypoints) { - const entryPointCode = await publicClient.getBytecode({ +const preFlightChecks = async (config: AltoConfig): Promise => { + for (const entrypoint of config.entrypoints) { + const entryPointCode = await config.publicClient.getBytecode({ address: entrypoint }) if (entryPointCode === "0x") { @@ -52,9 +30,9 @@ const preFlightChecks = async ( } } - if (parsedArgs["entrypoint-simulation-contract"]) { - const simulations = parsedArgs["entrypoint-simulation-contract"] - const simulationsCode = await publicClient.getBytecode({ + if (config.entrypointSimulationContract) { + const simulations = config.entrypointSimulationContract + const simulationsCode = await config.publicClient.getBytecode({ address: simulations }) if (simulationsCode === undefined || simulationsCode === "0x") { @@ -65,125 +43,77 @@ const preFlightChecks = async ( } } -export async function bundlerHandler(args: IOptionsInput): Promise { - const parsedArgs = parseArgs(args) - - let logger: Logger - if (parsedArgs.json) { - logger = initProductionLogger(parsedArgs["log-level"]) - } else { - logger = initDebugLogger(parsedArgs["log-level"]) - } - - const rootLogger = logger.child( - { module: "root" }, - { level: parsedArgs["log-level"] } - ) +export async function bundlerHandler(args_: IOptionsInput): Promise { + const args = parseArgs(args_) + const logger = args.json + ? initProductionLogger(args.logLevel) + : initDebugLogger(args.logLevel) const getChainId = async () => { const client = createPublicClient({ - transport: customTransport(parsedArgs["rpc-url"], { + transport: customTransport(args.rpcUrl, { logger: logger.child( { module: "public_client" }, { - level: - parsedArgs["public-client-log-level"] || - parsedArgs["log-level"] + level: args.publicClientLogLevel || args.logLevel } ) }) }) return await client.getChainId() } + const chainId = await getChainId() const chain: Chain = { id: chainId, - name: args["network-name"], + name: args.networkName, nativeCurrency: { name: "ETH", symbol: "ETH", decimals: 18 }, rpcUrls: { - default: { http: [args["rpc-url"]] }, - public: { http: [args["rpc-url"]] } + default: { http: [args.rpcUrl] }, + public: { http: [args.rpcUrl] } } } - const client = createPublicClient({ - transport: customTransport(args["rpc-url"], { + const publicClient = createPublicClient({ + transport: customTransport(args.rpcUrl, { logger: logger.child( { module: "public_client" }, { - level: - parsedArgs["public-client-log-level"] || - parsedArgs["log-level"] + level: args.publicClientLogLevel || args.logLevel } ) }), chain }) - // if flag is set, use utility wallet to deploy the simulations contract - if (parsedArgs["deploy-simulations-contract"]) { - if (!parsedArgs["utility-private-key"]) { - throw new Error( - "Cannot deploy entryPoint simulations without utility-private-key" + const walletClient = createWalletClient({ + transport: customTransport(args.sendTransactionRpcUrl ?? args.rpcUrl, { + logger: logger.child( + { module: "wallet_client" }, + { + level: args.walletClientLogLevel || args.logLevel + } ) - } - - const walletClient = createWalletClient({ - transport: http(args["rpc-url"]), - account: parsedArgs["utility-private-key"] - }) - - const deployHash = await walletClient.deployContract({ - chain, - abi: [], - bytecode: PimlicoEntryPointSimulationsDeployBytecode - }) + }), + chain + }) - const receipt = await client.getTransactionReceipt({ - hash: deployHash + // if flag is set, use utility wallet to deploy the simulations contract + if (args.deploySimulationsContract) { + args.entrypointSimulationContract = await deploySimulationsContract({ + args, + publicClient }) - - const simulationsContract = receipt.contractAddress - - if (simulationsContract === null) { - throw new Error("Failed to deploy simulationsContract") - } - - parsedArgs["entrypoint-simulation-contract"] = simulationsContract } - // TODO: THIS IS TEMPORARY, REMOVE AFTER THIS PR IS DEPLOYED + ENV VARS ARE SET - parsedArgs["entrypoint-simulation-contract"] = - "0xAE6035bEE0802C969265C8A3193CE8878c99A66A" - - if (chainId === 19411) { - // geo-testnet - parsedArgs["entrypoint-simulation-contract"] = - "0x98F36cDFCE8cF2AB75d8E164b99060f9e41775Dd" - } + const config = createConfig({ ...args, logger, publicClient, walletClient }) - const gasPriceManager = new GasPriceManager( - chain, - client, - parsedArgs["legacy-transactions"], - logger.child( - { module: "gas_price_manager" }, - { - level: - parsedArgs["public-client-log-level"] || - parsedArgs["log-level"] - } - ), - parsedArgs["gas-price-bump"], - parsedArgs["gas-price-expiry"], - parsedArgs["gas-price-refresh-interval"], - parsedArgs["chain-type"] - ) + const gasPriceManager = new GasPriceManager(config) await gasPriceManager.init() @@ -194,70 +124,32 @@ export async function bundlerHandler(args: IOptionsInput): Promise { }) const metrics = createMetrics(registry) - await preFlightChecks(client, parsedArgs) - - const walletClient = createWalletClient({ - transport: customTransport( - parsedArgs["send-transaction-rpc-url"] ?? args["rpc-url"], - { - logger: logger.child( - { module: "wallet_client" }, - { - level: - parsedArgs["wallet-client-log-level"] || - parsedArgs["log-level"] - } - ) - } - ), - chain - }) + await preFlightChecks(config) - const senderManager = new SenderManager( - parsedArgs["executor-private-keys"], - parsedArgs["utility-private-key"], - logger.child( - { module: "executor" }, - { - level: - parsedArgs["executor-log-level"] || parsedArgs["log-level"] - } - ), + const senderManager = new SenderManager({ + config, metrics, - parsedArgs["legacy-transactions"], - gasPriceManager, - parsedArgs["max-executors"] - ) + gasPriceManager + }) - const utilityWalletAddress = parsedArgs["utility-private-key"]?.address + const utilityWalletAddress = config.utilityPrivateKey?.address - if (utilityWalletAddress && parsedArgs["utility-wallet-monitor"]) { - const utilityWalletMonitor = new UtilityWalletMonitor( - client, - parsedArgs["utility-wallet-monitor-interval"], - utilityWalletAddress, + if (utilityWalletAddress && config.utilityWalletMonitor) { + const utilityWalletMonitor = new UtilityWalletMonitor({ + config, metrics, - logger.child( - { module: "utility_wallet_monitor" }, - { - level: parsedArgs["log-level"] - } - ) - ) + utilityWalletAddress + }) await utilityWalletMonitor.start() } metrics.executorWalletsMinBalance.set( - Number.parseFloat(formatEther(parsedArgs["min-executor-balance"] || 0n)) + Number.parseFloat(formatEther(config.minExecutorBalance || 0n)) ) await setupServer({ - client, - walletClient, - parsedArgs, - logger, - rootLogger, + config, registry, metrics, senderManager, diff --git a/src/cli/instrumentation.ts b/src/cli/instrumentation.ts index 0382b728..f6e667b9 100644 --- a/src/cli/instrumentation.ts +++ b/src/cli/instrumentation.ts @@ -3,6 +3,7 @@ import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto" import { FastifyInstrumentation } from "@opentelemetry/instrumentation-fastify" import { HttpInstrumentation } from "@opentelemetry/instrumentation-http" import { PinoInstrumentation } from "@opentelemetry/instrumentation-pino" +import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici" import { NodeSDK } from "@opentelemetry/sdk-node" import { ParentBasedSampler, @@ -10,7 +11,6 @@ import { SamplingDecision } from "@opentelemetry/sdk-trace-base" import { SemanticAttributes } from "@opentelemetry/semantic-conventions" -import { UndiciInstrumentation } from "@opentelemetry/instrumentation-undici" class CustomSampler implements Sampler { shouldSample( diff --git a/src/cli/parseArgs.ts b/src/cli/parseArgs.ts new file mode 100644 index 00000000..f7a5d259 --- /dev/null +++ b/src/cli/parseArgs.ts @@ -0,0 +1,47 @@ +import { type IOptions, optionArgsSchema, type IOptionsInput } from "@alto/cli" +import { fromZodError } from "zod-validation-error" + +type CamelCase = + S extends `${infer P1}-${infer P2}${infer P3}` + ? `${P1}${Uppercase}${CamelCase}` + : S extends `${infer P1}_${infer P2}${infer P3}` + ? `${P1}${Uppercase}${CamelCase}` + : S + +export type CamelCasedProperties = { + [K in keyof T as CamelCase>]: T[K] +} + +function toCamelCase(str: string): string { + return str.replace(/([-_][a-z])/g, (group) => + group.toUpperCase().replace("-", "").replace("_", "") + ) +} + +function convertKeysToCamelCase( + obj: T +): CamelCasedProperties { + return Object.keys(obj).reduce( + (acc, key) => { + const camelCaseKey = toCamelCase( + key + ) as keyof CamelCasedProperties + ;(acc as any)[camelCaseKey] = obj[key as keyof T] + + return acc + }, + {} as CamelCasedProperties + ) +} + +export const parseArgs = ( + args: IOptionsInput +): CamelCasedProperties => { + const parsing = optionArgsSchema.safeParse(args) + if (!parsing.success) { + const error = fromZodError(parsing.error) + throw new Error(error.message) + } + + return convertKeysToCamelCase(parsing.data) +} diff --git a/src/cli/setupServer.ts b/src/cli/setupServer.ts index 8d7ab8d9..281b0f58 100644 --- a/src/cli/setupServer.ts +++ b/src/cli/setupServer.ts @@ -1,16 +1,16 @@ import type { SenderManager } from "@alto/executor" import { Executor, ExecutorManager } from "@alto/executor" import { - type GasPriceManager, CompressionHandler, - EventManager + EventManager, + type GasPriceManager } from "@alto/handlers" import { + type InterfaceReputationManager, MemoryMempool, Monitor, NullReputationManager, - ReputationManager, - type InterfaceReputationManager + ReputationManager } from "@alto/mempool" import { NonceQueuer, @@ -20,102 +20,43 @@ import { UnsafeValidator } from "@alto/rpc" import type { InterfaceValidator } from "@alto/types" -import type { Logger, Metrics } from "@alto/utils" +import type { Metrics } from "@alto/utils" import type { Registry } from "prom-client" -import type { Chain, PublicClient, Transport, WalletClient } from "viem" -import type { IBundleCompressionArgs, IOptions } from "./config" +import type { AltoConfig } from "../createConfig" -const getReputationManager = ({ - client, - parsedArgs, - logger -}: { - client: PublicClient - parsedArgs: IOptions - logger: Logger -}): InterfaceReputationManager => { - if (parsedArgs["safe-mode"]) { - return new ReputationManager( - client, - parsedArgs.entrypoints, - BigInt(parsedArgs["min-entity-stake"]), - BigInt(parsedArgs["min-entity-unstake-delay"]), - logger.child( - { module: "reputation_manager" }, - { - level: - parsedArgs["reputation-manager-log-level"] || - parsedArgs["log-level"] - } - ) - ) +const getReputationManager = ( + config: AltoConfig +): InterfaceReputationManager => { + if (config.safeMode) { + return new ReputationManager(config) } return new NullReputationManager() } const getValidator = ({ - client, - parsedArgs, - logger, + config, senderManager, metrics, gasPriceManager }: { - client: PublicClient - parsedArgs: IOptions - logger: Logger + config: AltoConfig senderManager: SenderManager metrics: Metrics gasPriceManager: GasPriceManager - walletClient: WalletClient }): InterfaceValidator => { - const utilityWalletAddress = - parsedArgs["utility-private-key"]?.address || - "0x4337000c2828F5260d8921fD25829F606b9E8680" - - if (parsedArgs["safe-mode"]) { - return new SafeValidator( - client, + if (config.safeMode) { + return new SafeValidator({ + config, senderManager, - logger.child( - { module: "rpc" }, - { - level: - parsedArgs["rpc-log-level"] || parsedArgs["log-level"] - } - ), metrics, - gasPriceManager, - parsedArgs["chain-type"], - parsedArgs["block-tag-support"], - utilityWalletAddress, - parsedArgs["binary-search-tolerance-delta"], - parsedArgs["binary-search-gas-allowance"], - parsedArgs["entrypoint-simulation-contract"], - parsedArgs["fixed-gas-limit-for-estimation"], - parsedArgs.tenderly, - parsedArgs["balance-override"] - ) + gasPriceManager + }) } - return new UnsafeValidator( - client, - logger.child( - { module: "rpc" }, - { level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"] } - ), + return new UnsafeValidator({ + config, metrics, - gasPriceManager, - parsedArgs["chain-type"], - parsedArgs["block-tag-support"], - utilityWalletAddress, - parsedArgs["binary-search-tolerance-delta"], - parsedArgs["binary-search-gas-allowance"], - parsedArgs["entrypoint-simulation-contract"], - parsedArgs["fixed-gas-limit-for-estimation"], - parsedArgs.tenderly, - parsedArgs["balance-override"], - parsedArgs["expiration-check"] - ) + gasPriceManager + }) } const getMonitor = (): Monitor => { @@ -123,209 +64,134 @@ const getMonitor = (): Monitor => { } const getMempool = ({ + config, monitor, reputationManager, validator, - client, - parsedArgs, - logger, metrics, eventManager }: { + config: AltoConfig monitor: Monitor reputationManager: InterfaceReputationManager validator: InterfaceValidator - client: PublicClient - parsedArgs: IOptions - logger: Logger metrics: Metrics eventManager: EventManager }): MemoryMempool => { - return new MemoryMempool( + return new MemoryMempool({ + config, monitor, reputationManager, validator, - client, - parsedArgs["safe-mode"], - logger.child( - { module: "mempool" }, - { - level: - parsedArgs["mempool-log-level"] || parsedArgs["log-level"] - } - ), metrics, - parsedArgs["mempool-max-parallel-ops"], - parsedArgs["mempool-max-queued-ops"], - parsedArgs["enforce-unique-senders-per-bundle"], eventManager - ) + }) } const getEventManager = ({ - endpoint, - chainId, - logger, + config, metrics }: { - endpoint?: string - chainId: number - logger: Logger + config: AltoConfig metrics: Metrics }) => { - return new EventManager(endpoint, chainId, logger, metrics) + return new EventManager({ config, metrics }) } -const getCompressionHandler = async ({ - client, - parsedArgs -}: { - client: PublicClient - parsedArgs: IBundleCompressionArgs -}): Promise => { +const getCompressionHandler = async ( + config: AltoConfig +): Promise => { let compressionHandler: CompressionHandler | null = null if ( - parsedArgs["bundle-bulker-address"] !== undefined && - parsedArgs["per-op-inflator-address"] !== undefined + config.bundleBulkerAddress !== undefined && + config.perOpInflatorAddress !== undefined ) { compressionHandler = await CompressionHandler.createAsync( - parsedArgs["bundle-bulker-address"], - parsedArgs["per-op-inflator-address"], - client + config.bundleBulkerAddress, + config.perOpInflatorAddress, + config.publicClient ) } return compressionHandler } const getExecutor = ({ - client, - walletClient, + config, senderManager, reputationManager, - parsedArgs, - logger, metrics, compressionHandler, gasPriceManager, eventManager }: { - client: PublicClient - walletClient: WalletClient + config: AltoConfig senderManager: SenderManager reputationManager: InterfaceReputationManager - parsedArgs: IOptions - logger: Logger metrics: Metrics compressionHandler: CompressionHandler | null gasPriceManager: GasPriceManager eventManager: EventManager }): Executor => { - return new Executor( - client, - walletClient, + return new Executor({ + config, senderManager, reputationManager, - parsedArgs.entrypoints, - logger.child( - { module: "executor" }, - { - level: - parsedArgs["executor-log-level"] || parsedArgs["log-level"] - } - ), metrics, compressionHandler, gasPriceManager, - eventManager, - !parsedArgs.tenderly, - parsedArgs["legacy-transactions"], - parsedArgs["fixed-gas-limit-for-estimation"], - parsedArgs["block-tag-support"], - parsedArgs["local-gas-limit-calculation"], - parsedArgs["no-profit-bundling"] - ) + eventManager + }) } const getExecutorManager = ({ + config, executor, mempool, monitor, reputationManager, - client, - parsedArgs, - logger, metrics, gasPriceManager, eventManager }: { + config: AltoConfig executor: Executor mempool: MemoryMempool monitor: Monitor reputationManager: InterfaceReputationManager - client: PublicClient - parsedArgs: IOptions - logger: Logger metrics: Metrics gasPriceManager: GasPriceManager eventManager: EventManager }) => { - return new ExecutorManager( + return new ExecutorManager({ + config, executor, - parsedArgs.entrypoints, mempool, monitor, reputationManager, - client, - parsedArgs["polling-interval"], - logger.child( - { module: "executor" }, - { - level: - parsedArgs["executor-log-level"] || parsedArgs["log-level"] - } - ), metrics, - parsedArgs["bundle-mode"], - parsedArgs["max-bundle-wait"], - parsedArgs["max-gas-per-bundle"], gasPriceManager, - eventManager, - parsedArgs["aa95-gas-multiplier"], - parsedArgs["max-block-range"] - ) + eventManager + }) } const getNonceQueuer = ({ + config, mempool, - client, - parsedArgs, - logger, eventManager }: { + config: AltoConfig mempool: MemoryMempool - client: PublicClient - parsedArgs: IOptions - logger: Logger eventManager: EventManager }) => { - return new NonceQueuer( + return new NonceQueuer({ + config, mempool, - client, - logger.child( - { module: "nonce_queuer" }, - { - level: - parsedArgs["nonce-queuer-log-level"] || - parsedArgs["log-level"] - } - ), - parsedArgs["block-tag-support"], eventManager - ) + }) } const getRpcHandler = ({ - client, + config, validator, mempool, executor, @@ -333,14 +199,12 @@ const getRpcHandler = ({ nonceQueuer, executorManager, reputationManager, - parsedArgs, - logger, metrics, compressionHandler, gasPriceManager, eventManager }: { - client: PublicClient + config: AltoConfig validator: InterfaceValidator mempool: MemoryMempool executor: Executor @@ -348,16 +212,13 @@ const getRpcHandler = ({ nonceQueuer: NonceQueuer executorManager: ExecutorManager reputationManager: InterfaceReputationManager - parsedArgs: IOptions - logger: Logger metrics: Metrics compressionHandler: CompressionHandler | null eventManager: EventManager gasPriceManager: GasPriceManager }) => { - return new RpcHandler( - parsedArgs.entrypoints, - client, + return new RpcHandler({ + config, validator, mempool, executor, @@ -365,139 +226,82 @@ const getRpcHandler = ({ nonceQueuer, executorManager, reputationManager, - parsedArgs.tenderly ?? false, - parsedArgs["max-block-range"], - logger.child( - { module: "rpc" }, - { level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"] } - ), metrics, - parsedArgs["enable-debug-endpoints"], compressionHandler, - parsedArgs["legacy-transactions"], gasPriceManager, - parsedArgs["gas-price-multipliers"], - parsedArgs["chain-type"], - parsedArgs["paymaster-gas-limit-multiplier"], - eventManager, - parsedArgs["enable-instant-bundling-endpoint"], - parsedArgs["dangerous-skip-user-operation-validation"] - ) + eventManager + }) } const getServer = ({ + config, rpcEndpoint, - parsedArgs, - logger, registry, metrics }: { + config: AltoConfig rpcEndpoint: RpcHandler - parsedArgs: IOptions - logger: Logger registry: Registry metrics: Metrics }) => { - return new Server( + return new Server({ + config, rpcEndpoint, - parsedArgs["api-version"], - parsedArgs["default-api-version"], - parsedArgs.port, - parsedArgs.timeout, - parsedArgs["websocket-max-payload-size"], - parsedArgs.websocket, - logger.child( - { module: "rpc" }, - { level: parsedArgs["rpc-log-level"] || parsedArgs["log-level"] } - ), registry, - metrics, - parsedArgs["rpc-methods"] - ) + metrics + }) } export const setupServer = async ({ - client, - walletClient, - parsedArgs, - logger, - rootLogger, + config, registry, metrics, senderManager, gasPriceManager }: { - client: PublicClient - walletClient: WalletClient - parsedArgs: IOptions - logger: Logger - rootLogger: Logger + config: AltoConfig registry: Registry metrics: Metrics senderManager: SenderManager gasPriceManager: GasPriceManager }) => { const validator = getValidator({ - client, - logger, - parsedArgs, + config, senderManager, metrics, - gasPriceManager, - walletClient - }) - const reputationManager = getReputationManager({ - client, - parsedArgs, - logger + gasPriceManager }) + const reputationManager = getReputationManager(config) + + const compressionHandler = await getCompressionHandler(config) - const compressionHandler = await getCompressionHandler({ - client, - parsedArgs - }) const eventManager = getEventManager({ - endpoint: parsedArgs["redis-queue-endpoint"], - chainId: client.chain.id, - logger, + config, metrics }) - if (parsedArgs["refilling-wallets"]) { - await senderManager.validateAndRefillWallets( - client, - walletClient, - parsedArgs["min-executor-balance"] - ) + if (config.refillingWallets) { + await senderManager.validateAndRefillWallets() setInterval(async () => { - await senderManager.validateAndRefillWallets( - client, - walletClient, - parsedArgs["min-executor-balance"] - ) - }, parsedArgs["executor-refill-interval"] * 1000) + await senderManager.validateAndRefillWallets() + }, config.executorRefillInterval * 1000) } const monitor = getMonitor() const mempool = getMempool({ + config, monitor, reputationManager, validator, - client, - parsedArgs, - logger, metrics, eventManager }) const executor = getExecutor({ - client, - walletClient, + config, senderManager, reputationManager, - parsedArgs, - logger, metrics, compressionHandler, gasPriceManager, @@ -505,28 +309,24 @@ export const setupServer = async ({ }) const executorManager = getExecutorManager({ + config, executor, mempool, monitor, reputationManager, - client, - parsedArgs, - logger, metrics, gasPriceManager, eventManager }) const nonceQueuer = getNonceQueuer({ + config, mempool, - client, - parsedArgs, - logger, eventManager }) const rpcEndpoint = getRpcHandler({ - client, + config, validator, mempool, executor, @@ -534,26 +334,28 @@ export const setupServer = async ({ nonceQueuer, executorManager, reputationManager, - parsedArgs, - logger, metrics, compressionHandler, gasPriceManager, eventManager }) - if (parsedArgs["flush-stuck-transactions-during-startup"]) { + if (config.flushStuckTransactionsDuringStartup) { executor.flushStuckTransactions() } + const rootLogger = config.getLogger( + { module: "root" }, + { level: config.logLevel } + ) + rootLogger.info( `Initialized ${senderManager.wallets.length} executor wallets` ) const server = getServer({ + config, rpcEndpoint, - parsedArgs, - logger, registry, metrics }) diff --git a/src/createConfig.ts b/src/createConfig.ts new file mode 100644 index 00000000..6b4e8335 --- /dev/null +++ b/src/createConfig.ts @@ -0,0 +1,28 @@ +import type { IOptions } from "@alto/cli" +import type { CamelCasedProperties } from "./cli/parseArgs" +import type { Bindings, ChildLoggerOptions, Logger } from "pino" +import type { Chain, PublicClient, Transport, WalletClient } from "viem" + +export type AltoConfig = Readonly> & { + getLogger: ( + bindings: Bindings, + options?: ChildLoggerOptions + ) => Logger + readonly publicClient: PublicClient + readonly walletClient: WalletClient +} + +export function createConfig( + config: CamelCasedProperties & { + logger: Logger + publicClient: PublicClient + walletClient: WalletClient + } +): AltoConfig { + const { logger, ...rest } = config + + return { + ...rest, + getLogger: (bindings, options) => logger.child(bindings, options) + } +} diff --git a/src/executor/executor.ts b/src/executor/executor.ts index c3471fd1..2f0278c4 100644 --- a/src/executor/executor.ts +++ b/src/executor/executor.ts @@ -2,28 +2,28 @@ import type { DefaultFilterOpsAndEstimateGasParams, SenderManager } from "@alto/executor" +import type { + CompressionHandler, + EventManager, + GasPriceManager +} from "@alto/handlers" import type { InterfaceReputationManager } from "@alto/mempool" import { - type TransactionInfo, type Address, - type UserOperation, type BundleResult, type CompressedUserOperation, - type HexData32, - deriveUserOperation, EntryPointV06Abi, EntryPointV07Abi, + type HexData32, + type PackedUserOperation, + type TransactionInfo, + type UserOperation, type UserOperationV06, type UserOperationV07, - type PackedUserOperation, - type UserOperationWithHash + type UserOperationWithHash, + deriveUserOperation } from "@alto/types" import type { Logger, Metrics } from "@alto/utils" -import type { - GasPriceManager, - CompressionHandler, - EventManager -} from "@alto/handlers" import { getRequiredPrefund, getUserOperationHash, @@ -33,10 +33,10 @@ import { scaleBigIntByPercent, toPackedUserOperation } from "@alto/utils" -// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used import * as sentry from "@sentry/node" import { Mutex } from "async-mutex" import { + type Account, FeeCapTooLowError, InsufficientFundsError, IntrinsicGasTooLowError, @@ -52,13 +52,14 @@ import { TransactionExecutionError } from "viem" import { + type CompressedFilterOpsAndEstimateGasParams, createCompressedCalldata, filterOpsAndEstimateGas, flushStuckTransaction, - simulatedOpsToResults, - type CompressedFilterOpsAndEstimateGasParams + simulatedOpsToResults } from "./utils" import type { SendTransactionErrorType } from "viem" +import type { AltoConfig } from "../createConfig" export interface GasEstimateResult { preverificationGas: bigint @@ -80,59 +81,46 @@ export type ReplaceTransactionResult = export class Executor { // private unWatch: WatchBlocksReturnType | undefined - - publicClient: PublicClient - walletClient: WalletClient - entryPoints: Address[] + config: AltoConfig senderManager: SenderManager logger: Logger metrics: Metrics - simulateTransaction: boolean - legacyTransactions: boolean - fixedGasLimitForEstimation?: bigint - localGasLimitCalculation: boolean reputationManager: InterfaceReputationManager compressionHandler: CompressionHandler | null gasPriceManager: GasPriceManager - blockTagSupport: boolean mutex: Mutex eventManager: EventManager - noProfitBundling: boolean // if true, bundle such that all beneficiary fees go towards tx gasFees - - constructor( - publicClient: PublicClient, - walletClient: WalletClient, - senderManager: SenderManager, - reputationManager: InterfaceReputationManager, - entryPoints: Address[], - logger: Logger, - metrics: Metrics, - compressionHandler: CompressionHandler | null, - gasPriceManager: GasPriceManager, - eventManager: EventManager, - simulateTransaction = false, - legacyTransactions = false, - fixedGasLimitForEstimation?: bigint, - blockTagSupport = true, - localGasLimitCalculation = false, - noProfitBundling = false - ) { - this.publicClient = publicClient - this.walletClient = walletClient + + constructor({ + config, + senderManager, + reputationManager, + metrics, + compressionHandler, + gasPriceManager, + eventManager + }: { + config: AltoConfig + senderManager: SenderManager + reputationManager: InterfaceReputationManager + metrics: Metrics + compressionHandler: CompressionHandler | null + gasPriceManager: GasPriceManager + eventManager: EventManager + }) { + this.config = config this.senderManager = senderManager this.reputationManager = reputationManager - this.logger = logger + this.logger = config.getLogger( + { module: "executor" }, + { + level: config.executorLogLevel || config.logLevel + } + ) this.metrics = metrics - this.simulateTransaction = simulateTransaction - this.legacyTransactions = legacyTransactions - this.fixedGasLimitForEstimation = fixedGasLimitForEstimation - this.localGasLimitCalculation = localGasLimitCalculation this.compressionHandler = compressionHandler this.gasPriceManager = gasPriceManager this.eventManager = eventManager - this.blockTagSupport = blockTagSupport - this.entryPoints = entryPoints - this.noProfitBundling = noProfitBundling this.mutex = new Mutex() } @@ -183,7 +171,7 @@ export class Executor { userOperationHash: getUserOperationHash( op, transactionInfo.entryPoint, - this.walletClient.chain.id + this.config.walletClient.chain.id ), entryPoint: opInfo.entryPoint } @@ -222,8 +210,8 @@ export class Executor { abi: isUserOpVersion06 ? EntryPointV06Abi : EntryPointV07Abi, address: entryPoint, client: { - public: this.publicClient, - wallet: this.walletClient + public: this.config.publicClient, + wallet: this.config.walletClient } }) @@ -235,7 +223,7 @@ export class Executor { const compressionHandler = this.getCompressionHandler() callContext = { - publicClient: this.publicClient, + publicClient: this.config.publicClient, bundleBulker: compressionHandler.bundleBulkerAddress, perOpInflatorId: compressionHandler.perOpInflatorId, type: "compressed" @@ -250,9 +238,9 @@ export class Executor { newRequest.nonce, newRequest.maxFeePerGas, newRequest.maxPriorityFeePerGas, - this.blockTagSupport ? "latest" : undefined, - this.legacyTransactions, - this.fixedGasLimitForEstimation, + this.config.blockTagSupport ? "latest" : undefined, + this.config.legacyTransactions, + this.config.fixedGasLimitForEstimation, this.reputationManager, this.logger ) @@ -301,7 +289,7 @@ export class Executor { return opInfo }) - if (this.localGasLimitCalculation) { + if (this.config.localGasLimitCalculation) { gasLimit = opsToBundle.reduce((acc, opInfo) => { const userOperation = deriveUserOperation( opInfo.mempoolUserOperation @@ -403,8 +391,8 @@ export class Executor { "replacing transaction" ) - const txHash = await this.walletClient.sendTransaction( - this.legacyTransactions + const txHash = await this.config.walletClient.sendTransaction( + this.config.legacyTransactions ? { ...newRequest, gasPrice: newRequest.maxFeePerGas, @@ -418,7 +406,7 @@ export class Executor { opsToBundle.map((opToBundle) => { const op = deriveUserOperation(opToBundle.mempoolUserOperation) - const chainId = this.publicClient.chain?.id + const chainId = this.config.publicClient.chain?.id const opHash = getUserOperationHash( op, opToBundle.entryPoint, @@ -507,8 +495,8 @@ export class Executor { const gasPrice = await this.gasPriceManager.getGasPrice() const promises = wallets.map((wallet) => { flushStuckTransaction( - this.publicClient, - this.walletClient, + this.config.publicClient, + this.config.walletClient, wallet, gasPrice.maxFeePerGas * 5n, this.logger @@ -607,7 +595,7 @@ export class Executor { userOperationHash: getUserOperationHash( op, entryPoint, - this.walletClient.chain.id + this.config.walletClient.chain.id ) } }) @@ -631,8 +619,8 @@ export class Executor { abi: isUserOpVersion06 ? EntryPointV06Abi : EntryPointV07Abi, address: entryPoint, client: { - public: this.publicClient, - wallet: this.walletClient + public: this.config.publicClient, + wallet: this.config.walletClient } }) @@ -645,7 +633,7 @@ export class Executor { const gasPriceParameters = await this.gasPriceManager.getGasPrice() childLogger.debug({ gasPriceParameters }, "got gas price") - const nonce = await this.publicClient.getTransactionCount({ + const nonce = await this.config.publicClient.getTransactionCount({ address: wallet.address, blockTag: "pending" }) @@ -664,9 +652,9 @@ export class Executor { nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, - this.blockTagSupport ? "pending" : undefined, - this.legacyTransactions, - this.fixedGasLimitForEstimation, + this.config.blockTagSupport ? "pending" : undefined, + this.config.legacyTransactions, + this.config.fixedGasLimitForEstimation, this.reputationManager, childLogger ) @@ -740,7 +728,7 @@ export class Executor { let transactionHash: HexData32 try { - const isLegacyTransaction = this.legacyTransactions + const isLegacyTransaction = this.config.legacyTransactions const gasOptions = isLegacyTransaction ? { gasPrice: gasPriceParameters.maxFeePerGas } @@ -750,7 +738,7 @@ export class Executor { gasPriceParameters.maxPriorityFeePerGas } - if (this.noProfitBundling) { + if (this.config.noProfitBundling) { const gasPrice = totalBeneficiaryFees / gasLimit if (isLegacyTransaction) { gasOptions.gasPrice = gasPrice @@ -813,7 +801,7 @@ export class Executor { if ( e?.details - .toLowerCase() + ?.toLowerCase() .includes("replacement transaction underpriced") ) { childLogger.error( @@ -897,7 +885,7 @@ export class Executor { ] }), gas: gasLimit, - chain: this.walletClient.chain, + chain: this.config.walletClient.chain, maxFeePerGas: gasPriceParameters.maxFeePerGas, maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas, nonce: nonce @@ -947,14 +935,14 @@ export class Executor { const gasPriceParameters = await this.gasPriceManager.getGasPrice() childLogger.debug({ gasPriceParameters }, "got gas price") - const nonce = await this.publicClient.getTransactionCount({ + const nonce = await this.config.publicClient.getTransactionCount({ address: wallet.address, blockTag: "pending" }) childLogger.trace({ nonce }, "got nonce") const callContext: CompressedFilterOpsAndEstimateGasParams = { - publicClient: this.publicClient, + publicClient: this.config.publicClient, bundleBulker: compressionHandler.bundleBulkerAddress, perOpInflatorId: compressionHandler.perOpInflatorId, type: "compressed" @@ -970,16 +958,16 @@ export class Executor { userOperationHash: getUserOperationHash( compressedOp.inflatedOp, entryPoint, - this.walletClient.chain.id + this.config.walletClient.chain.id ) } }), nonce, gasPriceParameters.maxFeePerGas, gasPriceParameters.maxPriorityFeePerGas, - this.blockTagSupport ? "pending" : undefined, - this.legacyTransactions, - this.fixedGasLimitForEstimation, + this.config.blockTagSupport ? "pending" : undefined, + this.config.legacyTransactions, + this.config.fixedGasLimitForEstimation, this.reputationManager, childLogger ) @@ -993,7 +981,7 @@ export class Executor { const userOpHash = getUserOperationHash( compressedOp.inflatedOp, entryPoint, - this.walletClient.chain.id + this.config.walletClient.chain.id ) return { @@ -1033,7 +1021,7 @@ export class Executor { let transactionHash: HexData32 try { - const gasOptions = this.legacyTransactions + const gasOptions = this.config.legacyTransactions ? { gasPrice: gasPriceParameters.maxFeePerGas } @@ -1051,7 +1039,7 @@ export class Executor { ) // need to use sendTransaction to target BundleBulker's fallback - transactionHash = await this.walletClient.sendTransaction({ + transactionHash = await this.config.walletClient.sendTransaction({ account: wallet, to: compressionHandler.bundleBulkerAddress, data: createCompressedCalldata( @@ -1115,7 +1103,7 @@ export class Executor { ), gas: gasLimit, account: wallet, - chain: this.walletClient.chain, + chain: this.config.walletClient.chain, maxFeePerGas: gasPriceParameters.maxFeePerGas, maxPriorityFeePerGas: gasPriceParameters.maxPriorityFeePerGas, nonce: nonce diff --git a/src/executor/executorManager.ts b/src/executor/executorManager.ts index 57d888e6..ec897064 100644 --- a/src/executor/executorManager.ts +++ b/src/executor/executorManager.ts @@ -1,4 +1,3 @@ -import type { Metrics, Logger, BundlingStatus } from "@alto/utils" import type { EventManager, GasPriceManager } from "@alto/handlers" import type { InterfaceReputationManager, @@ -8,35 +7,34 @@ import type { import { type BundleResult, type BundlingMode, + type CompressedUserOperation, + EntryPointV06Abi, type HexData32, type MempoolUserOperation, type SubmittedUserOperation, type TransactionInfo, - deriveUserOperation, - isCompressedType, type UserOperation, - type CompressedUserOperation, type UserOperationInfo, - EntryPointV06Abi + deriveUserOperation, + isCompressedType } from "@alto/types" +import type { BundlingStatus, Logger, Metrics } from "@alto/utils" import { getAAError, getBundleStatus, parseUserOperationReceipt } from "@alto/utils" import { - getAbiItem, - type TransactionReceipt, - TransactionReceiptNotFoundError, type Address, type Block, - type Chain, type Hash, - type PublicClient, - type Transport, - type WatchBlocksReturnType + type TransactionReceipt, + TransactionReceiptNotFoundError, + type WatchBlocksReturnType, + getAbiItem } from "viem" import type { Executor, ReplaceTransactionResult } from "./executor" +import type { AltoConfig } from "../createConfig" function getTransactionsFromUserOperationEntries( entries: SubmittedUserOperation[] @@ -51,63 +49,58 @@ function getTransactionsFromUserOperationEntries( } export class ExecutorManager { - private entryPoints: Address[] + private config: AltoConfig private executor: Executor private mempool: MemoryMempool private monitor: Monitor - private publicClient: PublicClient - private pollingInterval: number private logger: Logger private metrics: Metrics private reputationManager: InterfaceReputationManager private unWatch: WatchBlocksReturnType | undefined private currentlyHandlingBlock = false private timer?: NodeJS.Timer - private bundlerFrequency: number - private maxGasLimitPerBundle: bigint private gasPriceManager: GasPriceManager private eventManager: EventManager - private aa95ResubmitMultiplier: bigint rpcMaxBlockRange: number | undefined - constructor( - executor: Executor, - entryPoints: Address[], - mempool: MemoryMempool, - monitor: Monitor, - reputationManager: InterfaceReputationManager, - publicClient: PublicClient, - pollingInterval: number, - logger: Logger, - metrics: Metrics, - bundleMode: BundlingMode, - bundlerFrequency: number, - maxGasLimitPerBundle: bigint, - gasPriceManager: GasPriceManager, - eventManager: EventManager, - aa95ResubmitMultiplier: bigint, - rpcMaxBlockRange: number | undefined - ) { - this.entryPoints = entryPoints + constructor({ + config, + executor, + mempool, + monitor, + reputationManager, + metrics, + gasPriceManager, + eventManager + }: { + config: AltoConfig + executor: Executor + mempool: MemoryMempool + monitor: Monitor + reputationManager: InterfaceReputationManager + metrics: Metrics + gasPriceManager: GasPriceManager + eventManager: EventManager + }) { + this.config = config this.reputationManager = reputationManager this.executor = executor this.mempool = mempool this.monitor = monitor - this.publicClient = publicClient - this.pollingInterval = pollingInterval - this.logger = logger + this.logger = config.getLogger( + { module: "executor_manager" }, + { + level: config.executorLogLevel || config.logLevel + } + ) this.metrics = metrics - this.bundlerFrequency = bundlerFrequency - this.maxGasLimitPerBundle = maxGasLimitPerBundle this.gasPriceManager = gasPriceManager this.eventManager = eventManager - this.aa95ResubmitMultiplier = aa95ResubmitMultiplier - this.rpcMaxBlockRange = rpcMaxBlockRange - if (bundleMode === "auto") { + if (this.config.bundleMode === "auto") { this.timer = setInterval(async () => { await this.bundle() - }, bundlerFrequency) as NodeJS.Timer + }, this.config.maxBundleWait) as NodeJS.Timer } } @@ -115,7 +108,7 @@ export class ExecutorManager { if (bundleMode === "auto" && !this.timer) { this.timer = setInterval(async () => { await this.bundle() - }, this.bundlerFrequency) as NodeJS.Timer + }, this.config.maxBundleWait) as NodeJS.Timer } else if (bundleMode === "manual" && this.timer) { clearInterval(this.timer) this.timer = undefined @@ -123,7 +116,7 @@ export class ExecutorManager { } async bundleNow(): Promise { - const ops = await this.mempool.process(this.maxGasLimitPerBundle, 1) + const ops = await this.mempool.process(this.config.maxGasPerBundle, 1) if (ops.length === 0) { throw new Error("no ops to bundle") } @@ -140,7 +133,7 @@ export class ExecutorManager { const txHashes: Hash[] = [] await Promise.all( - this.entryPoints.map(async (entryPoint) => { + this.config.entrypoints.map(async (entryPoint) => { const ops = opEntryPointMap.get(entryPoint) if (ops) { const txHash = await this.sendToExecutor(entryPoint, ops) @@ -297,7 +290,10 @@ export class ExecutorManager { const opsToBundle: UserOperationInfo[][] = [] while (true) { - const ops = await this.mempool.process(this.maxGasLimitPerBundle, 1) + const ops = await this.mempool.process( + this.config.maxGasPerBundle, + 1 + ) if (ops?.length > 0) { opsToBundle.push(ops) } else { @@ -326,7 +322,7 @@ export class ExecutorManager { } await Promise.all( - this.entryPoints.map(async (entryPoint) => { + this.config.entrypoints.map(async (entryPoint) => { const userOperations = opEntryPointMap.get(entryPoint) if (userOperations) { await this.sendToExecutor( @@ -349,7 +345,7 @@ export class ExecutorManager { if (this.unWatch) { return } - this.unWatch = this.publicClient.watchBlocks({ + this.unWatch = this.config.publicClient.watchBlocks({ onBlock: handleBlock, // onBlock: async (block) => { // // Use an arrow function to ensure correct binding of `this` @@ -368,7 +364,7 @@ export class ExecutorManager { }, emitMissed: false, includeTransactions: false, - pollingInterval: this.pollingInterval + pollingInterval: this.config.pollingInterval }) this.logger.debug("started watching blocks") @@ -405,7 +401,7 @@ export class ExecutorManager { ...(await getBundleStatus( isVersion06, transactionHash, - this.publicClient, + this.config.publicClient, this.logger, entryPoint )) @@ -498,7 +494,7 @@ export class ExecutorManager { bundlingStatus.isAA95 ) { // resubmit with more gas when bundler encounters AA95 - const multiplier = this.aa95ResubmitMultiplier + const multiplier = this.config.aa95GasMultiplier transactionInfo.transactionRequest.gas = (transactionInfo.transactionRequest.gas * multiplier) / 100n transactionInfo.transactionRequest.nonce += 1 @@ -535,7 +531,7 @@ export class ExecutorManager { transactionHash: Hash blockNumber: bigint }) { - const unwatch = this.publicClient.watchBlockNumber({ + const unwatch = this.config.publicClient.watchBlockNumber({ onBlockNumber: async (currentBlockNumber) => { if (currentBlockNumber > blockNumber + 1n) { const userOperationReceipt = @@ -606,7 +602,7 @@ export class ExecutorManager { let fromBlock: bigint | undefined = undefined let toBlock: "latest" | undefined = undefined if (this.rpcMaxBlockRange !== undefined) { - const latestBlock = await this.publicClient.getBlockNumber() + const latestBlock = await this.config.publicClient.getBlockNumber() fromBlock = latestBlock - BigInt(this.rpcMaxBlockRange) if (fromBlock < 0n) { fromBlock = 0n @@ -614,8 +610,8 @@ export class ExecutorManager { toBlock = "latest" } - const filterResult = await this.publicClient.getLogs({ - address: this.entryPoints, + const filterResult = await this.config.publicClient.getLogs({ + address: this.config.entrypoints, event: userOperationEventAbiItem, fromBlock, toBlock, @@ -665,7 +661,7 @@ export class ExecutorManager { while (true) { try { const transactionReceipt = - await this.publicClient.getTransactionReceipt({ + await this.config.publicClient.getTransactionReceipt({ hash: txHash }) @@ -675,9 +671,10 @@ export class ExecutorManager { undefined if (effectiveGasPrice === undefined) { - const tx = await this.publicClient.getTransaction({ - hash: txHash - }) + const tx = + await this.config.publicClient.getTransaction({ + hash: txHash + }) effectiveGasPrice = tx.gasPrice ?? undefined } @@ -735,7 +732,7 @@ export class ExecutorManager { } await Promise.all( - this.entryPoints.map(async (entryPoint) => { + this.config.entrypoints.map(async (entryPoint) => { const ops = opEntryPointMap.get(entryPoint) if (ops) { diff --git a/src/executor/senderManager.ts b/src/executor/senderManager.ts index f6fa7ad3..4bd7a2a8 100644 --- a/src/executor/senderManager.ts +++ b/src/executor/senderManager.ts @@ -1,22 +1,20 @@ +import type { GasPriceManager } from "@alto/handlers" import { - CallEngineAbi, type Address, + CallEngineAbi, type HexData, type HexData32 } from "@alto/types" import type { Logger, Metrics } from "@alto/utils" -import type { GasPriceManager } from "@alto/handlers" import { Semaphore } from "async-mutex" import { - formatEther, - getContract, type Account, - type Chain, type PublicClient, type TransactionReceipt, - type Transport, - type WalletClient + formatEther, + getContract } from "viem" +import type { AltoConfig } from "../createConfig" const waitForTransactionReceipt = async ( publicClient: PublicClient, @@ -30,24 +28,35 @@ const waitForTransactionReceipt = async ( } export class SenderManager { + private config: AltoConfig wallets: Account[] utilityAccount: Account | undefined availableWallets: Account[] - private logger: Logger private metrics: Metrics - private legacyTransactions: boolean private semaphore: Semaphore private gasPriceManager: GasPriceManager + private logger: Logger + + constructor({ + config, + metrics, + gasPriceManager + }: { + config: AltoConfig + metrics: Metrics + gasPriceManager: GasPriceManager + }) { + this.config = config + this.logger = config.getLogger( + { module: "executor" }, + { + level: config.executorLogLevel || config.logLevel + } + ) + + const maxSigners = config.maxExecutors + const wallets = config.executorPrivateKeys - constructor( - wallets: Account[], - utilityAccount: Account | undefined, - logger: Logger, - metrics: Metrics, - legacyTransactions: boolean, - gasPriceManager: GasPriceManager, - maxSigners?: number - ) { if (maxSigners !== undefined && wallets.length > maxSigners) { this.wallets = wallets.slice(0, maxSigners) this.availableWallets = wallets.slice(0, maxSigners) @@ -56,10 +65,8 @@ export class SenderManager { this.availableWallets = wallets } - this.utilityAccount = utilityAccount - this.logger = logger + this.utilityAccount = this.config.utilityPrivateKey this.metrics = metrics - this.legacyTransactions = legacyTransactions metrics.walletsAvailable.set(this.availableWallets.length) metrics.walletsTotal.set(this.wallets.length) this.semaphore = new Semaphore(this.availableWallets.length) @@ -67,16 +74,14 @@ export class SenderManager { } // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: - async validateAndRefillWallets( - publicClient: PublicClient, - walletClient: WalletClient, - minBalance?: bigint - ): Promise { + async validateAndRefillWallets(): Promise { + const minBalance = this.config.minExecutorBalance + if (!(minBalance && this.utilityAccount)) { return } - const utilityWalletBalance = await publicClient.getBalance({ + const utilityWalletBalance = await this.config.publicClient.getBalance({ address: this.utilityAccount.address }) @@ -84,7 +89,7 @@ export class SenderManager { const balanceRequestPromises = this.availableWallets.map( async (wallet) => { - const balance = await publicClient.getBalance({ + const balance = await this.config.publicClient.getBalance({ address: wallet.address }) @@ -136,9 +141,9 @@ export class SenderManager { await this.gasPriceManager.getGasPrice() if ( - walletClient.chain.id === 59140 || - walletClient.chain.id === 137 || - walletClient.chain.id === 10 + this.config.walletClient.chain.id === 59140 || + this.config.walletClient.chain.id === 137 || + this.config.walletClient.chain.id === 10 ) { const instructions = [] for (const [address, missingBalance] of Object.entries( @@ -152,9 +157,9 @@ export class SenderManager { } let refillAddress: `0x${string}` - if (walletClient.chain.id === 59140) { + if (this.config.walletClient.chain.id === 59140) { refillAddress = "0xEad1aC3DF6F96b91491d6396F4d1610C5638B4Db" - } else if (walletClient.chain.id === 137) { + } else if (this.config.walletClient.chain.id === 137) { refillAddress = "0x3402DB43152dAB9ab72fa805fdD5f391cD3E3822" } else { refillAddress = "0x3402DB43152dAB9ab72fa805fdD5f391cD3E3822" @@ -164,8 +169,8 @@ export class SenderManager { abi: CallEngineAbi, address: refillAddress, client: { - public: publicClient, - wallet: walletClient + public: this.config.publicClient, + wallet: this.config.walletClient } }) const tx = await callEngine.write.execute([instructions], { @@ -175,7 +180,7 @@ export class SenderManager { maxPriorityFeePerGas: maxPriorityFeePerGas * 2n }) - await waitForTransactionReceipt(publicClient, tx) + await waitForTransactionReceipt(this.config.publicClient, tx) for (const [address, missingBalance] of Object.entries( balancesMissing @@ -189,23 +194,26 @@ export class SenderManager { for (const [address, missingBalance] of Object.entries( balancesMissing )) { - const tx = await walletClient.sendTransaction({ + const tx = await this.config.walletClient.sendTransaction({ account: this.utilityAccount, // @ts-ignore to: address, value: missingBalance, - maxFeePerGas: this.legacyTransactions + maxFeePerGas: this.config.legacyTransactions ? undefined : maxFeePerGas, - maxPriorityFeePerGas: this.legacyTransactions + maxPriorityFeePerGas: this.config.legacyTransactions ? undefined : maxPriorityFeePerGas, - gasPrice: this.legacyTransactions + gasPrice: this.config.legacyTransactions ? maxFeePerGas : undefined }) - await waitForTransactionReceipt(publicClient, tx) + await waitForTransactionReceipt( + this.config.publicClient, + tx + ) this.logger.info( { tx, executor: address, missingBalance }, "refilled wallet" diff --git a/src/executor/utilityWalletMonitor.ts b/src/executor/utilityWalletMonitor.ts index b2a956ef..41f92ae7 100644 --- a/src/executor/utilityWalletMonitor.ts +++ b/src/executor/utilityWalletMonitor.ts @@ -1,31 +1,38 @@ import type { Logger, Metrics } from "@alto/utils" -import { formatEther, type Hex, type PublicClient } from "viem" +import { type Hex, formatEther } from "viem" +import type { AltoConfig } from "../createConfig" +import type { Address } from "abitype" export class UtilityWalletMonitor { - private publicClient: PublicClient - private monitorInterval: number + private config: AltoConfig private utilityWalletAddress: Hex private timer: NodeJS.Timer | undefined private metrics: Metrics private logger: Logger - constructor( - publicClient: PublicClient, - monitorInterval: number, - utilityWalletAddress: Hex, - metrics: Metrics, - logger: Logger - ) { - this.publicClient = publicClient - this.monitorInterval = monitorInterval + constructor({ + config, + metrics, + utilityWalletAddress + }: { + config: AltoConfig + metrics: Metrics + utilityWalletAddress: Address + }) { + this.config = config this.utilityWalletAddress = utilityWalletAddress this.metrics = metrics - this.logger = logger + this.logger = config.getLogger( + { module: "utility_wallet_monitor" }, + { + level: config.logLevel + } + ) } private async updateMetrics() { try { - const balance = await this.publicClient.getBalance({ + const balance = await this.config.publicClient.getBalance({ address: this.utilityWalletAddress }) @@ -49,7 +56,7 @@ export class UtilityWalletMonitor { this.timer = setInterval( this.updateMetrics.bind(this), - this.monitorInterval + this.config.utilityWalletMonitorInterval ) as NodeJS.Timer } diff --git a/src/executor/utils.ts b/src/executor/utils.ts index e262c1c4..824186f3 100644 --- a/src/executor/utils.ts +++ b/src/executor/utils.ts @@ -1,5 +1,3 @@ -// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used -import * as sentry from "@sentry/node" import type { InterfaceReputationManager } from "@alto/mempool" import { type BundleResult, @@ -19,11 +17,13 @@ import { import type { Logger } from "@alto/utils" import { getRevertErrorData, - scaleBigIntByPercent, isVersion06, parseViemError, + scaleBigIntByPercent, toPackedUserOperation } from "@alto/utils" +// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used +import * as sentry from "@sentry/node" import { type Account, type Address, diff --git a/src/handlers/eventManager.ts b/src/handlers/eventManager.ts index 2acfcb13..e5a6589f 100644 --- a/src/handlers/eventManager.ts +++ b/src/handlers/eventManager.ts @@ -1,28 +1,35 @@ -// biome-ignore lint/style/noNamespaceImport: explicitly make it clear when sentry is used +import type { Logger, Metrics } from "@alto/utils" import * as sentry from "@sentry/node" import Redis from "ioredis" import type { Hex } from "viem" import type { OpEventType } from "../types/schemas" -import type { Logger, Metrics } from "@alto/utils" +import type { AltoConfig } from "../createConfig" export class EventManager { - private redis: Redis | undefined private chainId: number + private redis: Redis | undefined private logger: Logger private metrics: Metrics - constructor( - endpoint: string | undefined, - chainId: number, - logger: Logger, + constructor({ + config, + metrics + }: { + config: AltoConfig metrics: Metrics - ) { - this.chainId = chainId - this.logger = logger + }) { + this.chainId = config.publicClient.chain.id + + this.logger = config.getLogger( + { module: "event_manager" }, + { + level: config.logLevel + } + ) this.metrics = metrics - if (endpoint) { - this.redis = new Redis(endpoint) + if (config.redisQueueEndpoint) { + this.redis = new Redis(config.redisQueueEndpoint) return } diff --git a/src/handlers/gasPriceManager.ts b/src/handlers/gasPriceManager.ts index fda81f13..4d0094ba 100644 --- a/src/handlers/gasPriceManager.ts +++ b/src/handlers/gasPriceManager.ts @@ -1,20 +1,20 @@ import { - RpcError, - gasStationResult, type GasPriceParameters, - type ChainType + RpcError, + gasStationResult } from "@alto/types" -import { maxBigInt, minBigInt, type Logger } from "@alto/utils" +import { type Logger, maxBigInt, minBigInt } from "@alto/utils" import * as sentry from "@sentry/node" -import { parseGwei, type Chain, type PublicClient, maxUint128 } from "viem" +import { type PublicClient, maxUint128, parseGwei } from "viem" import { + avalanche, celo, celoAlfajores, dfk, - avalanche, polygon, polygonMumbai } from "viem/chains" +import type { AltoConfig } from "../createConfig" enum ChainId { Goerli = 5, @@ -129,10 +129,7 @@ class ArbitrumManager { } export class GasPriceManager { - private chain: Chain - private publicClient: PublicClient - private legacyTransactions: boolean - private logger: Logger + private readonly config: AltoConfig private queueBaseFeePerGas: { timestamp: number; baseFeePerGas: bigint }[] = [] // Store pairs of [price, timestamp] private queueMaxFeePerGas: { timestamp: number; maxFeePerGas: bigint }[] = @@ -141,40 +138,29 @@ export class GasPriceManager { timestamp: number maxPriorityFeePerGas: bigint }[] = [] // Store pairs of [price, timestamp] - private maxQueueSize - private gasBumpMultiplier: bigint - private gasPriceRefreshIntervalInSeconds: number - private chainType: ChainType public arbitrumManager: ArbitrumManager + private maxQueueSize: number + private logger: Logger - constructor( - chain: Chain, - publicClient: PublicClient, - legacyTransactions: boolean, - logger: Logger, - gasBumpMultiplier: bigint, - gasPriceTimeValidityInSeconds: number, - gasPriceRefreshIntervalInSeconds: number, - chainType: ChainType - ) { - this.maxQueueSize = gasPriceTimeValidityInSeconds - this.chain = chain - this.publicClient = publicClient - this.legacyTransactions = legacyTransactions - this.logger = logger - this.gasBumpMultiplier = gasBumpMultiplier - this.gasPriceRefreshIntervalInSeconds = gasPriceRefreshIntervalInSeconds - this.chainType = chainType + constructor(config: AltoConfig) { + this.config = config + this.logger = config.getLogger( + { module: "gas_price_manager" }, + { + level: config.publicClientLogLevel || config.logLevel + } + ) + this.maxQueueSize = this.config.gasPriceExpiry // Periodically update gas prices if specified - if (this.gasPriceRefreshIntervalInSeconds > 0) { + if (this.config.gasPriceRefreshInterval > 0) { setInterval(() => { - if (this.legacyTransactions === false) { + if (this.config.legacyTransactions === false) { this.updateBaseFee() } this.updateGasPrice() - }, this.gasPriceRefreshIntervalInSeconds * 1000) + }, this.config.gasPriceRefreshInterval * 1000) } this.arbitrumManager = new ArbitrumManager(this.maxQueueSize) @@ -183,7 +169,7 @@ export class GasPriceManager { public init() { return Promise.all([ this.updateGasPrice(), - this.legacyTransactions === false + this.config.legacyTransactions === false ? this.updateBaseFee() : Promise.resolve() ]) @@ -203,7 +189,9 @@ export class GasPriceManager { } private async getPolygonGasPriceParameters(): Promise { - const gasStationUrl = getGasStationUrl(this.chain.id) + const gasStationUrl = getGasStationUrl( + this.config.publicClient.chain.id + ) try { const data = await (await fetch(gasStationUrl)).json() // take the standard speed here, SDK options will define the extra tip @@ -222,11 +210,11 @@ export class GasPriceManager { private bumpTheGasPrice( gasPriceParameters: GasPriceParameters ): GasPriceParameters { - const bumpAmount = this.gasBumpMultiplier + const bumpAmount = this.config.gasPriceBump const maxPriorityFeePerGas = maxBigInt( gasPriceParameters.maxPriorityFeePerGas, - this.getDefaultGasFee(this.chain.id) + this.getDefaultGasFee(this.config.publicClient.chain.id) ) const maxFeePerGas = maxBigInt( gasPriceParameters.maxFeePerGas, @@ -238,7 +226,10 @@ export class GasPriceManager { maxPriorityFeePerGas: (maxPriorityFeePerGas * bumpAmount) / 100n } - if (this.chain.id === celo.id || this.chain.id === celoAlfajores.id) { + if ( + this.config.publicClient.chain.id === celo.id || + this.config.publicClient.chain.id === celoAlfajores.id + ) { const maxFee = maxBigInt( result.maxFeePerGas, result.maxPriorityFeePerGas @@ -249,7 +240,7 @@ export class GasPriceManager { } } - if (this.chain.id === dfk.id) { + if (this.config.publicClient.chain.id === dfk.id) { const maxFeePerGas = maxBigInt(5_000_000_000n, result.maxFeePerGas) const maxPriorityFeePerGas = maxBigInt( 5_000_000_000n, @@ -263,7 +254,7 @@ export class GasPriceManager { } // set a minimum maxPriorityFee & maxFee to 1.5gwei on avalanche (because eth_maxPriorityFeePerGas returns 0) - if (this.chain.id === avalanche.id) { + if (this.config.publicClient.chain.id === avalanche.id) { const maxFeePerGas = maxBigInt( parseGwei("1.5"), result.maxFeePerGas @@ -332,8 +323,8 @@ export class GasPriceManager { private async getLegacyTransactionGasPrice(): Promise { let gasPrice: bigint | undefined try { - const gasInfo = await this.publicClient.estimateFeesPerGas({ - chain: this.chain, + const gasInfo = await this.config.publicClient.estimateFeesPerGas({ + chain: this.config.publicClient.chain, type: "legacy" }) gasPrice = gasInfo.gasPrice @@ -349,7 +340,7 @@ export class GasPriceManager { if (gasPrice === undefined) { this.logger.warn("gasPrice is undefined, using fallback value") try { - gasPrice = await this.publicClient.getGasPrice() + gasPrice = await this.config.publicClient.getGasPrice() } catch (e) { this.logger.error("failed to get fallback gasPrice") sentry.captureException(e) @@ -368,8 +359,8 @@ export class GasPriceManager { let maxPriorityFeePerGas: bigint | undefined try { - const fees = await this.publicClient.estimateFeesPerGas({ - chain: this.chain + const fees = await this.config.publicClient.estimateFeesPerGas({ + chain: this.config.publicClient.chain }) maxFeePerGas = fees.maxFeePerGas maxPriorityFeePerGas = fees.maxPriorityFeePerGas @@ -390,7 +381,7 @@ export class GasPriceManager { try { maxPriorityFeePerGas = await this.getFallBackMaxPriorityFeePerGas( - this.publicClient, + this.config.publicClient, maxFeePerGas ?? 0n ) } catch (e) { @@ -404,7 +395,7 @@ export class GasPriceManager { this.logger.warn("maxFeePerGas is undefined, using fallback value") try { maxFeePerGas = - (await this.getNextBaseFee(this.publicClient)) + + (await this.getNextBaseFee(this.config.publicClient)) + maxPriorityFeePerGas } catch (e) { this.logger.error("failed to get fallback maxFeePerGas") @@ -481,8 +472,8 @@ export class GasPriceManager { let maxPriorityFeePerGas = 0n if ( - this.chain.id === polygon.id || - this.chain.id === polygonMumbai.id + this.config.publicClient.chain.id === polygon.id || + this.config.publicClient.chain.id === polygonMumbai.id ) { const polygonEstimate = await this.getPolygonGasPriceParameters() if (polygonEstimate) { @@ -504,7 +495,7 @@ export class GasPriceManager { } } - if (this.legacyTransactions) { + if (this.config.legacyTransactions) { const gasPrice = this.bumpTheGasPrice( await this.getLegacyTransactionGasPrice() ) @@ -536,7 +527,7 @@ export class GasPriceManager { } private async updateBaseFee(): Promise { - const latestBlock = await this.publicClient.getBlock() + const latestBlock = await this.config.publicClient.getBlock() if (latestBlock.baseFeePerGas === null) { throw new RpcError("block does not have baseFeePerGas") } @@ -548,13 +539,13 @@ export class GasPriceManager { } public getBaseFee() { - if (this.legacyTransactions) { + if (this.config.legacyTransactions) { throw new RpcError( "baseFee is not available for legacy transactions" ) } - if (this.gasPriceRefreshIntervalInSeconds === 0) { + if (this.config.gasPriceRefreshInterval === 0) { return this.updateBaseFee() } @@ -579,7 +570,7 @@ export class GasPriceManager { } public getGasPrice() { - if (this.gasPriceRefreshIntervalInSeconds === 0) { + if (this.config.gasPriceRefreshInterval === 0) { return this.updateGasPrice() } @@ -634,7 +625,7 @@ export class GasPriceManager { let lowestMaxFeePerGas = await this.getMinMaxFeePerGas() let lowestMaxPriorityFeePerGas = await this.getMinMaxPriorityFeePerGas() - if (this.chainType === "hedera") { + if (this.config.chainType === "hedera") { lowestMaxFeePerGas /= 10n ** 9n lowestMaxPriorityFeePerGas /= 10n ** 9n } diff --git a/src/mempool/mempool.ts b/src/mempool/mempool.ts index 57508289..6539b05b 100644 --- a/src/mempool/mempool.ts +++ b/src/mempool/mempool.ts @@ -1,9 +1,10 @@ -import type { Metrics } from "@alto/utils" +import type { EventManager } from "@alto/handlers" // import { MongoClient, Collection, Filter } from "mongodb" // import { PublicClient, getContract } from "viem" // import { EntryPointAbi } from "../types/EntryPoint" import { EntryPointV06Abi, + EntryPointV07Abi, type InterfaceValidator, type MempoolUserOperation, type ReferencedCodeHashes, @@ -15,12 +16,11 @@ import { type UserOperationInfo, ValidationErrors, type ValidationResult, - deriveUserOperation, - EntryPointV07Abi + deriveUserOperation } from "@alto/types" import type { HexData32 } from "@alto/types" +import type { Metrics } from "@alto/utils" import type { Logger } from "@alto/utils" -import type { EventManager } from "@alto/handlers" import { getAddressFromInitCodeOrPaymasterAndData, getNonceKeyAndValue, @@ -28,60 +28,52 @@ import { isVersion06, isVersion07 } from "@alto/utils" -import { - type Address, - type Chain, - type PublicClient, - type Transport, - getAddress, - getContract -} from "viem" +import { type Address, getAddress, getContract } from "viem" import type { Monitor } from "./monitoring" import { type InterfaceReputationManager, ReputationStatuses } from "./reputationManager" import { MemoryStore } from "./store" +import type { AltoConfig } from "../createConfig" export class MemoryMempool { + private config: AltoConfig private monitor: Monitor - private publicClient: PublicClient private reputationManager: InterfaceReputationManager private store: MemoryStore private throttledEntityBundleCount: number private logger: Logger private validator: InterfaceValidator - private safeMode: boolean - private parallelUserOpsMaxSize: number - private queuedUserOpsMaxSize: number - private onlyUniqueSendersPerBundle: boolean private eventManager: EventManager - constructor( - monitor: Monitor, - reputationManager: InterfaceReputationManager, - validator: InterfaceValidator, - publicClient: PublicClient, - safeMode: boolean, - logger: Logger, - metrics: Metrics, - parallelUserOpsMaxSize: number, - queuedUserOpsMaxSize: number, - onlyUniqueSendersPerBundle: boolean, - eventManager: EventManager, - throttledEntityBundleCount?: number - ) { + constructor({ + config, + monitor, + reputationManager, + validator, + metrics, + eventManager + }: { + config: AltoConfig + monitor: Monitor + reputationManager: InterfaceReputationManager + validator: InterfaceValidator + metrics: Metrics + eventManager: EventManager + }) { + this.config = config this.reputationManager = reputationManager this.monitor = monitor this.validator = validator - this.publicClient = publicClient - this.safeMode = safeMode - this.logger = logger - this.store = new MemoryStore(logger, metrics) - this.parallelUserOpsMaxSize = parallelUserOpsMaxSize - this.queuedUserOpsMaxSize = queuedUserOpsMaxSize - this.onlyUniqueSendersPerBundle = onlyUniqueSendersPerBundle - this.throttledEntityBundleCount = throttledEntityBundleCount ?? 4 + this.logger = config.getLogger( + { module: "mempool" }, + { + level: config.logLevel + } + ) + this.store = new MemoryStore(this.logger, metrics) + this.throttledEntityBundleCount = 4 // we don't have any config for this as of now this.eventManager = eventManager } @@ -152,11 +144,11 @@ export class MemoryMempool { this.store.removeProcessing(userOpHash) } - // biome-ignore lint/suspicious/useAwait: keep async to adhere to interface - async checkEntityMultipleRoleViolation(op: UserOperation): Promise { - if (!this.safeMode) { - return + checkEntityMultipleRoleViolation(op: UserOperation): Promise { + if (!this.config.safeMode) { + return Promise.resolve() } + const knownEntities = this.getKnownEntities() if ( @@ -197,6 +189,7 @@ export class MemoryMempool { ValidationErrors.OpcodeValidation ) } + return Promise.resolve() } getKnownEntities(): { @@ -253,7 +246,7 @@ export class MemoryMempool { const opHash = getUserOperationHash( op, entryPoint, - this.publicClient.chain.id + this.config.publicClient.chain.id ) const outstandingOps = [...this.store.dumpOutstanding()] @@ -374,7 +367,7 @@ export class MemoryMempool { return userOp.sender === op.sender }).length - if (parallelUserOperationsCount > this.parallelUserOpsMaxSize) { + if (parallelUserOperationsCount > this.config.mempoolMaxParallelOps) { return [ false, "AA25 invalid account nonce: Maximum number of parallel user operations for that is allowed for this sender reached" @@ -394,7 +387,7 @@ export class MemoryMempool { return userOp.sender === op.sender && opNonceKey === nonceKey }).length - if (queuedUserOperationsCount > this.queuedUserOpsMaxSize) { + if (queuedUserOperationsCount > this.config.mempoolMaxQueuedOps) { return [ false, "AA25 invalid account nonce: Maximum number of queued user operations reached for this sender and nonce key" @@ -443,7 +436,7 @@ export class MemoryMempool { storageMap: StorageMap }> { const op = deriveUserOperation(opInfo.mempoolUserOperation) - if (!this.safeMode) { + if (!this.config.safeMode) { return { skip: false, paymasterDeposit, @@ -530,7 +523,10 @@ export class MemoryMempool { } } - if (senders.has(op.sender) && this.onlyUniqueSendersPerBundle) { + if ( + senders.has(op.sender) && + this.config.enforceUniqueSendersPerBundle + ) { this.logger.trace( { sender: op.sender, @@ -614,7 +610,7 @@ export class MemoryMempool { abi: isUserOpV06 ? EntryPointV06Abi : EntryPointV07Abi, address: opInfo.entryPoint, client: { - public: this.publicClient + public: this.config.publicClient } }) paymasterDeposit[paymaster] = @@ -776,7 +772,7 @@ export class MemoryMempool { ? EntryPointV06Abi : EntryPointV07Abi, client: { - public: this.publicClient + public: this.config.publicClient } }) diff --git a/src/mempool/reputationManager.ts b/src/mempool/reputationManager.ts index 042d7006..c0c9235e 100644 --- a/src/mempool/reputationManager.ts +++ b/src/mempool/reputationManager.ts @@ -12,7 +12,8 @@ import { getAddressFromInitCodeOrPaymasterAndData, isVersion06 } from "@alto/utils" -import { type Address, type PublicClient, getAddress, getContract } from "viem" +import { type Address, getAddress, getContract } from "viem" +import type { AltoConfig } from "../createConfig" export interface InterfaceReputationManager { checkReputation( @@ -172,9 +173,7 @@ export class NullReputationManager implements InterfaceReputationManager { } export class ReputationManager implements InterfaceReputationManager { - private publicClient: PublicClient - private minStake: bigint - private minUnstakeDelay: bigint + private config: AltoConfig private entityCount: { [address: Address]: bigint } = {} private throttledEntityMinMempoolCount: bigint private maxMempoolUserOperationsPerSender: bigint @@ -188,40 +187,28 @@ export class ReputationManager implements InterfaceReputationManager { private bundlerReputationParams: ReputationParams private logger: Logger - constructor( - publicClient: PublicClient, - entryPoints: Address[], - minStake: bigint, - minUnstakeDelay: bigint, - logger: Logger, - maxMempoolUserOperationsPerNewUnstakedEntity?: bigint, - throttledEntityMinMempoolCount?: bigint, - inclusionRateFactor?: bigint, - maxMempoolUserOperationsPerSender?: bigint, - blackList?: Address[], - whiteList?: Address[], - bundlerReputationParams?: ReputationParams - ) { - this.publicClient = publicClient - this.minStake = minStake - this.minUnstakeDelay = minUnstakeDelay - this.logger = logger - this.maxMempoolUserOperationsPerNewUnstakedEntity = - maxMempoolUserOperationsPerNewUnstakedEntity ?? 10n - this.inclusionRateFactor = inclusionRateFactor ?? 10n - this.throttledEntityMinMempoolCount = - throttledEntityMinMempoolCount ?? 4n - this.maxMempoolUserOperationsPerSender = - maxMempoolUserOperationsPerSender ?? 4n - this.bundlerReputationParams = - bundlerReputationParams ?? BundlerReputationParams - for (const address of blackList || []) { - this.blackList.add(address) - } - for (const address of whiteList || []) { - this.whitelist.add(address) - } - for (const entryPoint of entryPoints) { + constructor(config: AltoConfig) { + this.config = config + this.logger = config.getLogger( + { module: "reputation_manager" }, + { + level: config.reputationManagerLogLevel || config.logLevel + } + ) + this.maxMempoolUserOperationsPerNewUnstakedEntity = 10n + this.inclusionRateFactor = 10n + this.throttledEntityMinMempoolCount = 4n + this.maxMempoolUserOperationsPerSender = 4n + this.bundlerReputationParams = BundlerReputationParams + + // Currently we don't have any args for blacklist and whitelist + // for (const address of blackList || []) { + // this.blackList.add(address) + // } + // for (const address of whiteList || []) { + // this.whitelist.add(address) + // } + for (const entryPoint of config.entrypoints) { this.entries[entryPoint] = {} } } @@ -279,7 +266,7 @@ export class ReputationManager implements InterfaceReputationManager { abi: EntryPointV06Abi, address: entryPoint, client: { - public: this.publicClient + public: this.config.publicClient } }) const stakeInfo = await entryPointContract.read.getDepositInfo([ @@ -290,7 +277,8 @@ export class ReputationManager implements InterfaceReputationManager { const unstakeDelaySec = BigInt(stakeInfo.unstakeDelaySec) const isStaked = - stake >= this.minStake && unstakeDelaySec >= this.minUnstakeDelay + stake >= this.config.minEntityStake && + unstakeDelaySec >= this.config.minEntityUnstakeDelay return { stakeInfo: { @@ -663,10 +651,10 @@ export class ReputationManager implements InterfaceReputationManager { } this.checkBanned(entryPoint, entityType, stakeInfo) - if (stakeInfo.stake < this.minStake) { + if (stakeInfo.stake < this.config.minEntityStake) { if (stakeInfo.stake === 0n) { throw new RpcError( - `${entityType} ${stakeInfo.addr} is unstaked and must stake minimum ${this.minStake} to use pimlico`, + `${entityType} ${stakeInfo.addr} is unstaked and must stake minimum ${this.config.minEntityStake} to use pimlico`, ValidationErrors.InsufficientStake ) } @@ -677,7 +665,7 @@ export class ReputationManager implements InterfaceReputationManager { ) } - if (stakeInfo.unstakeDelaySec < this.minUnstakeDelay) { + if (stakeInfo.unstakeDelaySec < this.config.minEntityUnstakeDelay) { throw new RpcError( `${entityType} ${stakeInfo.addr} does not have enough unstake delay to use pimlico`, ValidationErrors.InsufficientStake diff --git a/src/mempool/store.ts b/src/mempool/store.ts index 3857e61d..7d8d23dd 100644 --- a/src/mempool/store.ts +++ b/src/mempool/store.ts @@ -1,9 +1,9 @@ -import type { Metrics } from "@alto/utils" import type { HexData32, SubmittedUserOperation, UserOperationInfo } from "@alto/types" +import type { Metrics } from "@alto/utils" import type { Logger } from "@alto/utils" export class MemoryStore { diff --git a/src/package.json b/src/package.json index 85bad0cd..69080472 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@pimlico/alto", - "version": "0.0.6", + "version": "0.0.7", "description": "A performant and modular ERC-4337 Bundler written in Typescript", "repository": "https://github.com/pimlicolabs/alto.git", "author": "Pimlico", diff --git a/src/rpc/estimation/gasEstimationHandler.ts b/src/rpc/estimation/gasEstimationHandler.ts index cd87753d..201bf3de 100644 --- a/src/rpc/estimation/gasEstimationHandler.ts +++ b/src/rpc/estimation/gasEstimationHandler.ts @@ -1,86 +1,62 @@ import type { UserOperation } from "@alto/types" import type { StateOverrides, UserOperationV07 } from "@alto/types" -import type { Hex } from "viem" -import type { SimulateHandleOpResult } from "./types" import { deepHexlify, isVersion06 } from "@alto/utils" -import { type Address, type PublicClient, toHex } from "viem" +import type { Hex } from "viem" +import { type Address, toHex } from "viem" import { GasEstimatorV06 } from "./gasEstimationsV06" import { GasEstimatorV07 } from "./gasEstimationsV07" +import type { SimulateHandleOpResult } from "./types" +import type { AltoConfig } from "../../createConfig" export const EXECUTE_SIMULATOR_BYTECODE = "0x60806040526004361061012e5760003560e01c806372b37bca116100ab578063b760faf91161006f578063b760faf914610452578063bb9fe6bf14610465578063c23a5cea1461047a578063d6383f941461049a578063ee219423146104ba578063fc7e286d146104da57600080fd5b806372b37bca146103bd5780638f41ec5a146103dd578063957122ab146103f25780639b249f6914610412578063a61935311461043257600080fd5b8063205c2878116100f2578063205c28781461020157806335567e1a146102215780634b1d7cf5146102415780635287ce121461026157806370a082311461037e57600080fd5b80630396cb60146101435780630bd28e3b146101565780631b2e01b8146101765780631d732756146101c15780631fad948c146101e157600080fd5b3661013e5761013c3361058f565b005b600080fd5b61013c6101513660046131c9565b6105f6565b34801561016257600080fd5b5061013c61017136600461320b565b610885565b34801561018257600080fd5b506101ae610191366004613246565b600160209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b3480156101cd57600080fd5b506101ae6101dc366004613440565b6108bc565b3480156101ed57600080fd5b5061013c6101fc366004613549565b610a2f565b34801561020d57600080fd5b5061013c61021c36600461359f565b610bab565b34801561022d57600080fd5b506101ae61023c366004613246565b610d27565b34801561024d57600080fd5b5061013c61025c366004613549565b610d6d565b34801561026d57600080fd5b5061032661027c3660046135cb565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506001600160a01b031660009081526020818152604091829020825160a08101845281546001600160701b038082168352600160701b820460ff16151594830194909452600160781b90049092169282019290925260019091015463ffffffff81166060830152640100000000900465ffffffffffff16608082015290565b6040805182516001600160701b03908116825260208085015115159083015283830151169181019190915260608083015163ffffffff169082015260809182015165ffffffffffff169181019190915260a0016101b8565b34801561038a57600080fd5b506101ae6103993660046135cb565b6001600160a01b03166000908152602081905260409020546001600160701b031690565b3480156103c957600080fd5b5061013c6103d83660046135e8565b6111b0565b3480156103e957600080fd5b506101ae600181565b3480156103fe57600080fd5b5061013c61040d366004613643565b611289565b34801561041e57600080fd5b5061013c61042d3660046136c7565b611386565b34801561043e57600080fd5b506101ae61044d366004613721565b611441565b61013c6104603660046135cb565b61058f565b34801561047157600080fd5b5061013c611483565b34801561048657600080fd5b5061013c6104953660046135cb565b6115ac565b3480156104a657600080fd5b5061013c6104b5366004613755565b6117e4565b3480156104c657600080fd5b5061013c6104d5366004613721565b6118df565b3480156104e657600080fd5b506105496104f53660046135cb565b600060208190529081526040902080546001909101546001600160701b0380831692600160701b810460ff1692600160781b9091049091169063ffffffff811690640100000000900465ffffffffffff1685565b604080516001600160701b0396871681529415156020860152929094169183019190915263ffffffff16606082015265ffffffffffff909116608082015260a0016101b8565b6105998134611abb565b6001600160a01b03811660008181526020818152604091829020805492516001600160701b03909316835292917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c491015b60405180910390a25050565b33600090815260208190526040902063ffffffff821661065d5760405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c617900000000000060448201526064015b60405180910390fd5b600181015463ffffffff90811690831610156106bb5760405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606401610654565b80546000906106db903490600160781b90046001600160701b03166137cc565b9050600081116107225760405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b6044820152606401610654565b6001600160701b0381111561076a5760405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b6044820152606401610654565b6040805160a08101825283546001600160701b0390811682526001602080840182815286841685870190815263ffffffff808b16606088019081526000608089018181523380835296829052908a902098518954955194518916600160781b02600160781b600160e81b0319951515600160701b026effffffffffffffffffffffffffffff199097169190991617949094179290921695909517865551949092018054925165ffffffffffff166401000000000269ffffffffffffffffffff19909316949093169390931717905590517fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c0190610878908490879091825263ffffffff16602082015260400190565b60405180910390a2505050565b3360009081526001602090815260408083206001600160c01b038516845290915281208054916108b4836137df565b919050555050565b6000805a90503330146109115760405162461bcd60e51b815260206004820152601760248201527f4141393220696e7465726e616c2063616c6c206f6e6c790000000000000000006044820152606401610654565b8451604081015160608201518101611388015a101561093b5763deaddead60e01b60005260206000fd5b8751600090156109cf576000610958846000015160008c86611b57565b9050806109cd57600061096c610800611b6f565b8051909150156109c75784600001516001600160a01b03168a602001517f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a2018760200151846040516109be929190613848565b60405180910390a35b60019250505b505b600088608001515a8603019050610a216000838b8b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250889250611b9b915050565b9a9950505050505050505050565b610a37611e92565b816000816001600160401b03811115610a5257610a5261327b565b604051908082528060200260200182016040528015610a8b57816020015b610a7861313f565b815260200190600190039081610a705790505b50905060005b82811015610b04576000828281518110610aad57610aad613861565b60200260200101519050600080610ae8848a8a87818110610ad057610ad0613861565b9050602002810190610ae29190613877565b85611ee9565b91509150610af984838360006120d4565b505050600101610a91565b506040516000907fbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f972908290a160005b83811015610b8e57610b8281888884818110610b5157610b51613861565b9050602002810190610b639190613877565b858481518110610b7557610b75613861565b6020026020010151612270565b90910190600101610b33565b50610b998482612397565b505050610ba66001600255565b505050565b33600090815260208190526040902080546001600160701b0316821115610c145760405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606401610654565b8054610c2a9083906001600160701b0316613898565b81546001600160701b0319166001600160701b0391909116178155604080516001600160a01b03851681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb910160405180910390a26000836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610cd6576040519150601f19603f3d011682016040523d82523d6000602084013e610cdb565b606091505b5050905080610d215760405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606401610654565b50505050565b6001600160a01b03821660009081526001602090815260408083206001600160c01b038516845290915290819020549082901b67ffffffffffffffff1916175b92915050565b610d75611e92565b816000805b82811015610ee95736868683818110610d9557610d95613861565b9050602002810190610da791906138ab565b9050366000610db683806138c1565b90925090506000610dcd60408501602086016135cb565b90506000196001600160a01b03821601610e295760405162461bcd60e51b815260206004820152601760248201527f4141393620696e76616c69642061676772656761746f720000000000000000006044820152606401610654565b6001600160a01b03811615610ec6576001600160a01b03811663e3563a4f8484610e56604089018961390a565b6040518563ffffffff1660e01b8152600401610e759493929190613ab5565b60006040518083038186803b158015610e8d57600080fd5b505afa925050508015610e9e575060015b610ec65760405163086a9f7560e41b81526001600160a01b0382166004820152602401610654565b610ed082876137cc565b9550505050508080610ee1906137df565b915050610d7a565b506000816001600160401b03811115610f0457610f0461327b565b604051908082528060200260200182016040528015610f3d57816020015b610f2a61313f565b815260200190600190039081610f225790505b506040519091507fbb47ee3e183a558b1a2ff0874b079f3fc5478b7454eacf2bfc5af2ff5878f97290600090a16000805b848110156110525736888883818110610f8957610f89613861565b9050602002810190610f9b91906138ab565b9050366000610faa83806138c1565b90925090506000610fc160408501602086016135cb565b90508160005b81811015611039576000898981518110610fe357610fe3613861565b602002602001015190506000806110068b898987818110610ad057610ad0613861565b91509150611016848383896120d4565b8a611020816137df565b9b50505050508080611031906137df565b915050610fc7565b505050505050808061104a906137df565b915050610f6e565b50600080915060005b8581101561116b573689898381811061107657611076613861565b905060200281019061108891906138ab565b905061109a60408201602083016135cb565b6001600160a01b03167f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d60405160405180910390a23660006110dc83806138c1565b90925090508060005b81811015611153576111278885858481811061110357611103613861565b90506020028101906111159190613877565b8b8b81518110610b7557610b75613861565b61113190886137cc565b96508761113d816137df565b985050808061114b906137df565b9150506110e5565b50505050508080611163906137df565b91505061105b565b506040516000907f575ff3acadd5ab348fe1855e217e0f3678f8d767d7494c9f9fefbee2e17cca4d908290a26111a18682612397565b5050505050610ba66001600255565b735ff137d4b0fdcd49dca30c7cf57e578a026d278933146111d057600080fd5b60005a9050600080866001600160a01b03168487876040516111f3929190613b32565b60006040518083038160008787f1925050503d8060008114611231576040519150601f19603f3d011682016040523d82523d6000602084013e611236565b606091505b509150915060005a6112489085613898565b90506000836112575782611268565b604051806020016040528060008152505b9050838183604051636c6238f160e01b815260040161065493929190613b42565b8315801561129f57506001600160a01b0383163b155b156112ec5760405162461bcd60e51b815260206004820152601960248201527f41413230206163636f756e74206e6f74206465706c6f796564000000000000006044820152606401610654565b601481106113645760006113036014828486613b6d565b61130c91613b97565b60601c9050803b6000036113625760405162461bcd60e51b815260206004820152601b60248201527f41413330207061796d6173746572206e6f74206465706c6f79656400000000006044820152606401610654565b505b60405162461bcd60e51b81526020600482015260006024820152604401610654565b604051632b870d1b60e11b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063570e1a36906113d79086908690600401613bcc565b6020604051808303816000875af11580156113f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141a9190613be0565b604051633653dc0360e11b81526001600160a01b0382166004820152909150602401610654565b600061144c82612490565b6040805160208101929092523090820152466060820152608001604051602081830303815290604052805190602001209050919050565b3360009081526020819052604081206001810154909163ffffffff90911690036114dc5760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606401610654565b8054600160701b900460ff166115285760405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b6044820152606401610654565b60018101546000906115409063ffffffff1642613bfd565b60018301805469ffffffffffff00000000191664010000000065ffffffffffff841690810291909117909155835460ff60701b1916845560405190815290915033907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a906020016105ea565b3360009081526020819052604090208054600160781b90046001600160701b0316806116115760405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b6044820152606401610654565b6001820154640100000000900465ffffffffffff166116725760405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606401610654565b60018201544264010000000090910465ffffffffffff1611156116d75760405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606401610654565b60018201805469ffffffffffffffffffff191690558154600160781b600160e81b0319168255604080516001600160a01b03851681526020810183905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3910160405180910390a26000836001600160a01b03168260405160006040518083038185875af1925050503d806000811461178e576040519150601f19603f3d011682016040523d82523d6000602084013e611793565b606091505b5050905080610d215760405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606401610654565b6117ec61313f565b6117f5856124a9565b60008061180460008885611ee9565b9150915060006118148383612583565b905061181f43600052565b600061182d60008a87612270565b905061183843600052565b600060606001600160a01b038a16156118ae57896001600160a01b03168989604051611865929190613b32565b6000604051808303816000865af19150503d80600081146118a2576040519150601f19603f3d011682016040523d82523d6000602084013e6118a7565b606091505b5090925090505b866080015183856020015186604001518585604051630116f59360e71b815260040161065496959493929190613c23565b6118e761313f565b6118f0826124a9565b6000806118ff60008585611ee9565b915091506000611916846000015160a0015161264f565b8451519091506000906119289061264f565b9050611947604051806040016040528060008152602001600081525090565b36600061195760408a018a61390a565b90925090506000601482101561196e576000611989565b61197c601460008486613b6d565b61198591613b97565b60601c5b90506119948161264f565b935050505060006119a58686612583565b9050600081600001519050600060016001600160a01b0316826001600160a01b031614905060006040518060c001604052808b6080015181526020018b6040015181526020018315158152602001856020015165ffffffffffff168152602001856040015165ffffffffffff168152602001611a228c6060015190565b905290506001600160a01b03831615801590611a4857506001600160a01b038316600114155b15611a9a5760006040518060400160405280856001600160a01b03168152602001611a728661264f565b81525090508187878a84604051633ebb2d3960e21b8152600401610654959493929190613cc5565b8086868960405163e0cff05f60e01b81526004016106549493929190613d45565b6001600160a01b03821660009081526020819052604081208054909190611aec9084906001600160701b03166137cc565b90506001600160701b03811115611b385760405162461bcd60e51b815260206004820152601060248201526f6465706f736974206f766572666c6f7760801b6044820152606401610654565b81546001600160701b0319166001600160701b03919091161790555050565b6000806000845160208601878987f195945050505050565b60603d82811115611b7d5750815b604051602082018101604052818152816000602083013e9392505050565b6000805a855190915060009081611bb18261269e565b60a08301519091506001600160a01b038116611bd05782519350611d77565b809350600088511115611d7757868202955060028a6002811115611bf657611bf6613d9c565b14611c6857606083015160405163a9a2340960e01b81526001600160a01b0383169163a9a2340991611c30908e908d908c90600401613db2565b600060405180830381600088803b158015611c4a57600080fd5b5087f1158015611c5e573d6000803e3d6000fd5b5050505050611d77565b606083015160405163a9a2340960e01b81526001600160a01b0383169163a9a2340991611c9d908e908d908c90600401613db2565b600060405180830381600088803b158015611cb757600080fd5b5087f193505050508015611cc9575060015b611d7757611cd5613de9565b806308c379a003611d2e5750611ce9613e05565b80611cf45750611d30565b8b81604051602001611d069190613e8e565b60408051601f1981840301815290829052631101335b60e11b82526106549291600401613848565b505b8a604051631101335b60e11b81526004016106549181526040602082018190526012908201527110504d4c081c1bdcdd13dc081c995d995c9d60721b606082015260800190565b5a85038701965081870295508589604001511015611de0578a604051631101335b60e11b815260040161065491815260406020808301829052908201527f414135312070726566756e642062656c6f772061637475616c476173436f7374606082015260800190565b6040890151869003611df28582611abb565b6000808c6002811115611e0757611e07613d9c565b1490508460a001516001600160a01b031685600001516001600160a01b03168c602001517f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f8860200151858d8f604051611e7a949392919093845291151560208401526040830152606082015260800190565b60405180910390a45050505050505095945050505050565b6002805403611ee35760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610654565b60028055565b60008060005a8451909150611efe86826126ce565b611f0786611441565b6020860152604081015160608201516080830151171760e087013517610100870135176effffffffffffffffffffffffffffff811115611f895760405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606401610654565b600080611f95846127c7565b9050611fa38a8a8a84612814565b85516020870151919950919350611fba9190612a4c565b6120105789604051631101335b60e11b8152600401610654918152604060208201819052601a908201527f4141323520696e76616c6964206163636f756e74206e6f6e6365000000000000606082015260800190565b61201943600052565b60a08401516060906001600160a01b0316156120415761203c8b8b8b8587612a99565b975090505b60005a87039050808b60a0013510156120a6578b604051631101335b60e11b8152600401610654918152604060208201819052601e908201527f41413430206f76657220766572696669636174696f6e4761734c696d69740000606082015260800190565b60408a018390528160608b015260c08b01355a8803018a608001818152505050505050505050935093915050565b6000806120e085612cbc565b91509150816001600160a01b0316836001600160a01b0316146121465785604051631101335b60e11b81526004016106549181526040602082018190526014908201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b606082015260800190565b801561219e5785604051631101335b60e11b81526004016106549181526040602082018190526017908201527f414132322065787069726564206f72206e6f7420647565000000000000000000606082015260800190565b60006121a985612cbc565b925090506001600160a01b038116156122055786604051631101335b60e11b81526004016106549181526040602082018190526014908201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b606082015260800190565b81156122675786604051631101335b60e11b81526004016106549181526040602082018190526021908201527f41413332207061796d61737465722065787069726564206f72206e6f742064756060820152606560f81b608082015260a00190565b50505050505050565b6000805a90506000612283846060015190565b905030631d732756612298606088018861390a565b87856040518563ffffffff1660e01b81526004016122b99493929190613ecc565b6020604051808303816000875af19250505080156122f4575060408051601f3d908101601f191682019092526122f191810190613f7f565b60015b61238b57600060206000803e50600051632152215360e01b81016123565786604051631101335b60e11b8152600401610654918152604060208201819052600f908201526e41413935206f7574206f662067617360881b606082015260800190565b600085608001515a6123689086613898565b61237291906137cc565b9050612382886002888685611b9b565b9450505061238e565b92505b50509392505050565b6001600160a01b0382166123ed5760405162461bcd60e51b815260206004820152601860248201527f4141393020696e76616c69642062656e656669636961727900000000000000006044820152606401610654565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461243a576040519150601f19603f3d011682016040523d82523d6000602084013e61243f565b606091505b5050905080610ba65760405162461bcd60e51b815260206004820152601f60248201527f41413931206661696c65642073656e6420746f2062656e6566696369617279006044820152606401610654565b600061249b82612d0f565b805190602001209050919050565b3063957122ab6124bc604084018461390a565b6124c960208601866135cb565b6124d761012087018761390a565b6040518663ffffffff1660e01b81526004016124f7959493929190613f98565b60006040518083038186803b15801561250f57600080fd5b505afa925050508015612520575060015b6125805761252c613de9565b806308c379a0036125745750612540613e05565b8061254b5750612576565b80511561257057600081604051631101335b60e11b8152600401610654929190613848565b5050565b505b3d6000803e3d6000fd5b50565b60408051606081018252600080825260208201819052918101829052906125a984612de2565b905060006125b684612de2565b82519091506001600160a01b0381166125cd575080515b602080840151604080860151928501519085015191929165ffffffffffff80831690851610156125fb578193505b8065ffffffffffff168365ffffffffffff161115612617578092505b5050604080516060810182526001600160a01b03909416845265ffffffffffff92831660208501529116908201529250505092915050565b604080518082018252600080825260208083018281526001600160a01b03959095168252819052919091208054600160781b90046001600160701b031682526001015463ffffffff1690915290565b60c081015160e0820151600091908082036126ba575092915050565b6126c682488301612e53565b949350505050565b6126db60208301836135cb565b6001600160a01b0316815260208083013590820152608080830135604083015260a0830135606083015260c0808401359183019190915260e080840135918301919091526101008301359082015236600061273a61012085018561390a565b909250905080156127ba5760148110156127965760405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606401610654565b6127a4601460008385613b6d565b6127ad91613b97565b60601c60a0840152610d21565b600060a084015250505050565b60a081015160009081906001600160a01b03166127e55760016127e8565b60035b60ff16905060008360800151828560600151028560400151010190508360c00151810292505050919050565b60008060005a8551805191925090612839898861283460408c018c61390a565b612e6b565b60a082015161284743600052565b60006001600160a01b03821661288f576001600160a01b0383166000908152602081905260409020546001600160701b03168881116128885780890361288b565b60005b9150505b606084015160208a0151604051633a871cdd60e01b81526001600160a01b03861692633a871cdd9290916128c9918f918790600401613fce565b60206040518083038160008887f193505050508015612905575060408051601f3d908101601f1916820190925261290291810190613f7f565b60015b61298f57612911613de9565b806308c379a0036129425750612925613e05565b806129305750612944565b8b81604051602001611d069190613ff3565b505b8a604051631101335b60e11b8152600401610654918152604060208201819052601690820152754141323320726576657274656420286f72204f4f472960501b606082015260800190565b95506001600160a01b038216612a39576001600160a01b038316600090815260208190526040902080546001600160701b0316808a1115612a1c578c604051631101335b60e11b81526004016106549181526040602082018190526017908201527f41413231206469646e2774207061792070726566756e64000000000000000000606082015260800190565b81546001600160701b031916908a90036001600160701b03161790555b5a85039650505050505094509492505050565b6001600160a01b038216600090815260016020908152604080832084821c80855292528220805484916001600160401b038316919085612a8b836137df565b909155501495945050505050565b82516060818101519091600091848111612af55760405162461bcd60e51b815260206004820152601f60248201527f4141343120746f6f206c6974746c6520766572696669636174696f6e476173006044820152606401610654565b60a08201516001600160a01b038116600090815260208190526040902080548784039291906001600160701b031689811015612b7d578c604051631101335b60e11b8152600401610654918152604060208201819052601e908201527f41413331207061796d6173746572206465706f73697420746f6f206c6f770000606082015260800190565b8981038260000160006101000a8154816001600160701b0302191690836001600160701b03160217905550826001600160a01b031663f465c77e858e8e602001518e6040518563ffffffff1660e01b8152600401612bdd93929190613fce565b60006040518083038160008887f193505050508015612c1e57506040513d6000823e601f3d908101601f19168201604052612c1b919081019061402a565b60015b612ca857612c2a613de9565b806308c379a003612c5b5750612c3e613e05565b80612c495750612c5d565b8d81604051602001611d0691906140b5565b505b8c604051631101335b60e11b8152600401610654918152604060208201819052601690820152754141333320726576657274656420286f72204f4f472960501b606082015260800190565b909e909d509b505050505050505050505050565b60008082600003612cd257506000928392509050565b6000612cdd84612de2565b9050806040015165ffffffffffff16421180612d045750806020015165ffffffffffff1642105b905194909350915050565b6060813560208301356000612d2f612d2a604087018761390a565b61312c565b90506000612d43612d2a606088018861390a565b9050608086013560a087013560c088013560e08901356101008a01356000612d72612d2a6101208e018e61390a565b604080516001600160a01b039c909c1660208d01528b81019a909a5260608b019890985250608089019590955260a088019390935260c087019190915260e08601526101008501526101208401526101408084019190915281518084039091018152610160909201905292915050565b60408051606081018252600080825260208201819052918101919091528160a081901c65ffffffffffff8116600003612e1e575065ffffffffffff5b604080516060810182526001600160a01b03909316835260d09490941c602083015265ffffffffffff16928101929092525090565b6000818310612e625781612e64565b825b9392505050565b8015610d21578251516001600160a01b0381163b15612ed65784604051631101335b60e11b8152600401610654918152604060208201819052601f908201527f414131302073656e64657220616c726561647920636f6e737472756374656400606082015260800190565b835160600151604051632b870d1b60e11b81526000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163570e1a369190612f2e9088908890600401613bcc565b60206040518083038160008887f1158015612f4d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612f729190613be0565b90506001600160a01b038116612fd45785604051631101335b60e11b8152600401610654918152604060208201819052601b908201527f4141313320696e6974436f6465206661696c6564206f72204f4f470000000000606082015260800190565b816001600160a01b0316816001600160a01b03161461303e5785604051631101335b60e11b815260040161065491815260406020808301829052908201527f4141313420696e6974436f6465206d7573742072657475726e2073656e646572606082015260800190565b806001600160a01b03163b6000036130a15785604051631101335b60e11b815260040161065491815260406020808301829052908201527f4141313520696e6974436f6465206d757374206372656174652073656e646572606082015260800190565b60006130b06014828688613b6d565b6130b991613b97565b60601c9050826001600160a01b031686602001517fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d83896000015160a0015160405161311b9291906001600160a01b0392831681529116602082015260400190565b60405180910390a350505050505050565b6000604051828085833790209392505050565b6040518060a001604052806131a460405180610100016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001600081525090565b8152602001600080191681526020016000815260200160008152602001600081525090565b6000602082840312156131db57600080fd5b813563ffffffff81168114612e6457600080fd5b80356001600160c01b038116811461320657600080fd5b919050565b60006020828403121561321d57600080fd5b612e64826131ef565b6001600160a01b038116811461258057600080fd5b803561320681613226565b6000806040838503121561325957600080fd5b823561326481613226565b9150613272602084016131ef565b90509250929050565b634e487b7160e01b600052604160045260246000fd5b60a081018181106001600160401b03821117156132b0576132b061327b565b60405250565b61010081018181106001600160401b03821117156132b0576132b061327b565b601f8201601f191681016001600160401b03811182821017156132fb576132fb61327b565b6040525050565b60006001600160401b0382111561331b5761331b61327b565b50601f01601f191660200190565b600081830361018081121561333d57600080fd5b60405161334981613291565b8092506101008083121561335c57600080fd5b604051925061336a836132b6565b6133738561323b565b8352602085013560208401526040850135604084015260608501356060840152608085013560808401526133a960a0860161323b565b60a084015260c085013560c084015260e085013560e084015282825280850135602083015250610120840135604082015261014084013560608201526101608401356080820152505092915050565b60008083601f84011261340a57600080fd5b5081356001600160401b0381111561342157600080fd5b60208301915083602082850101111561343957600080fd5b9250929050565b6000806000806101c0858703121561345757600080fd5b84356001600160401b038082111561346e57600080fd5b818701915087601f83011261348257600080fd5b813561348d81613302565b60405161349a82826132d6565b8281528a60208487010111156134af57600080fd5b826020860160208301376000602084830101528098505050506134d58860208901613329565b94506101a08701359150808211156134ec57600080fd5b506134f9878288016133f8565b95989497509550505050565b60008083601f84011261351757600080fd5b5081356001600160401b0381111561352e57600080fd5b6020830191508360208260051b850101111561343957600080fd5b60008060006040848603121561355e57600080fd5b83356001600160401b0381111561357457600080fd5b61358086828701613505565b909450925050602084013561359481613226565b809150509250925092565b600080604083850312156135b257600080fd5b82356135bd81613226565b946020939093013593505050565b6000602082840312156135dd57600080fd5b8135612e6481613226565b600080600080606085870312156135fe57600080fd5b843561360981613226565b935060208501356001600160401b0381111561362457600080fd5b613630878288016133f8565b9598909750949560400135949350505050565b60008060008060006060868803121561365b57600080fd5b85356001600160401b038082111561367257600080fd5b61367e89838a016133f8565b90975095506020880135915061369382613226565b909350604087013590808211156136a957600080fd5b506136b6888289016133f8565b969995985093965092949392505050565b600080602083850312156136da57600080fd5b82356001600160401b038111156136f057600080fd5b6136fc858286016133f8565b90969095509350505050565b6000610160828403121561371b57600080fd5b50919050565b60006020828403121561373357600080fd5b81356001600160401b0381111561374957600080fd5b6126c684828501613708565b6000806000806060858703121561376b57600080fd5b84356001600160401b038082111561378257600080fd5b61378e88838901613708565b9550602087013591506137a082613226565b909350604086013590808211156134ec57600080fd5b634e487b7160e01b600052601160045260246000fd5b80820180821115610d6757610d676137b6565b6000600182016137f1576137f16137b6565b5060010190565b60005b838110156138135781810151838201526020016137fb565b50506000910152565b600081518084526138348160208601602086016137f8565b601f01601f19169290920160200192915050565b8281526040602082015260006126c6604083018461381c565b634e487b7160e01b600052603260045260246000fd5b6000823561015e1983360301811261388e57600080fd5b9190910192915050565b81810381811115610d6757610d676137b6565b60008235605e1983360301811261388e57600080fd5b6000808335601e198436030181126138d857600080fd5b8301803591506001600160401b038211156138f257600080fd5b6020019150600581901b360382131561343957600080fd5b6000808335601e1984360301811261392157600080fd5b8301803591506001600160401b0382111561393b57600080fd5b60200191503681900382131561343957600080fd5b6000808335601e1984360301811261396757600080fd5b83016020810192503590506001600160401b0381111561398657600080fd5b80360382131561343957600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006101606139dd846139d08561323b565b6001600160a01b03169052565b602083013560208501526139f46040840184613950565b826040870152613a078387018284613995565b92505050613a186060840184613950565b8583036060870152613a2b838284613995565b925050506080830135608085015260a083013560a085015260c083013560c085015260e083013560e0850152610100808401358186015250610120613a7281850185613950565b86840383880152613a84848284613995565b9350505050610140613a9881850185613950565b86840383880152613aaa848284613995565b979650505050505050565b6040808252810184905260006060600586901b830181019083018783805b89811015613b1b57868503605f190184528235368c900361015e19018112613af9578283fd5b613b05868d83016139be565b9550506020938401939290920191600101613ad3565b505050508281036020840152613aaa818587613995565b8183823760009101908152919050565b8315158152606060208201526000613b5d606083018561381c565b9050826040830152949350505050565b60008085851115613b7d57600080fd5b83861115613b8a57600080fd5b5050820193919092039150565b6bffffffffffffffffffffffff198135818116916014851015613bc45780818660140360031b1b83161692505b505092915050565b6020815260006126c6602083018486613995565b600060208284031215613bf257600080fd5b8151612e6481613226565b65ffffffffffff818116838216019080821115613c1c57613c1c6137b6565b5092915050565b868152856020820152600065ffffffffffff8087166040840152808616606084015250831515608083015260c060a0830152613c6260c083018461381c565b98975050505050505050565b80518252602081015160208301526040810151151560408301526000606082015165ffffffffffff8082166060860152806080850151166080860152505060a082015160c060a08501526126c660c085018261381c565b6000610140808352613cd981840189613c6e565b915050613cf3602083018780518252602090810151910152565b845160608301526020948501516080830152835160a08301529284015160c082015281516001600160a01b031660e0820152908301518051610100830152909201516101209092019190915292915050565b60e081526000613d5860e0830187613c6e565b9050613d71602083018680518252602090810151910152565b8351606083015260208401516080830152825160a0830152602083015160c083015295945050505050565b634e487b7160e01b600052602160045260246000fd5b600060038510613dd257634e487b7160e01b600052602160045260246000fd5b84825260606020830152613b5d606083018561381c565b600060033d1115613e025760046000803e5060005160e01c5b90565b600060443d1015613e135790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715613e4257505050505090565b8285019150815181811115613e5a5750505050505090565b843d8701016020828501011115613e745750505050505090565b613e83602082860101876132d6565b509095945050505050565b75020a09a98103837b9ba27b8103932bb32b93a32b21d160551b815260008251613ebf8160168501602087016137f8565b9190910160160192915050565b60006101c0808352613ee18184018789613995565b9050845160018060a01b03808251166020860152602082015160408601526040820151606086015260608201516080860152608082015160a08601528060a08301511660c08601525060c081015160e085015260e08101516101008501525060208501516101208401526040850151610140840152606085015161016084015260808501516101808401528281036101a0840152613aaa818561381c565b600060208284031215613f9157600080fd5b5051919050565b606081526000613fac606083018789613995565b6001600160a01b03861660208401528281036040840152613c62818587613995565b606081526000613fe160608301866139be565b60208301949094525060400152919050565b6e020a09919903932bb32b93a32b21d1608d1b81526000825161401d81600f8501602087016137f8565b91909101600f0192915050565b6000806040838503121561403d57600080fd5b82516001600160401b0381111561405357600080fd5b8301601f8101851361406457600080fd5b805161406f81613302565b60405161407c82826132d6565b82815287602084860101111561409157600080fd5b6140a28360208301602087016137f8565b6020969096015195979596505050505050565b6e020a09999903932bb32b93a32b21d1608d1b81526000825161401d81600f8501602087016137f856fea26469706673582212201892e38d1eac5b99b119bf1333f8e39f72ad5274c5da6bb916f97bef4e7e0afc64736f6c63430008140033" function getStateOverrides({ + addSenderBalanceOverride, userOperation, entryPoint, replacedEntryPoint, stateOverride = {} }: { + addSenderBalanceOverride: boolean entryPoint: Address replacedEntryPoint: boolean stateOverride: StateOverrides userOperation: UserOperation }) { - return replacedEntryPoint - ? { - ...stateOverride, - [userOperation.sender]: { - balance: toHex(100000_000000000000000000n), - ...(stateOverride - ? deepHexlify(stateOverride?.[userOperation.sender]) - : []) - }, - [entryPoint]: { - code: EXECUTE_SIMULATOR_BYTECODE - } - } - : { - ...stateOverride, - [userOperation.sender]: { - balance: toHex(100000_000000000000000000n), - ...(stateOverride - ? deepHexlify(stateOverride?.[userOperation.sender]) - : []) - } - } + const result: StateOverrides = { ...stateOverride } + + if (addSenderBalanceOverride) { + result[userOperation.sender] = { + ...deepHexlify(stateOverride?.[userOperation.sender] || {}), + balance: toHex(100000_000000000000000000n) + } + } + + if (replacedEntryPoint) { + result[entryPoint] = { + ...deepHexlify(stateOverride?.[entryPoint] || {}), + code: EXECUTE_SIMULATOR_BYTECODE + } + } + + return result } export class GasEstimationHandler { gasEstimatorV06: GasEstimatorV06 gasEstimatorV07: GasEstimatorV07 - constructor( - binarySearchToleranceDelta: bigint, - binarySearchGasAllowance: bigint, - publicClient: PublicClient, - chainId: number, - blockTagSupport: boolean, - utilityWalletAddress: Address, - entryPointSimulationsAddress?: Address, - fixedGasLimitForEstimation?: bigint - ) { - this.gasEstimatorV06 = new GasEstimatorV06( - publicClient, - blockTagSupport, - utilityWalletAddress, - fixedGasLimitForEstimation - ) + constructor(config: AltoConfig) { + this.gasEstimatorV06 = new GasEstimatorV06(config) - this.gasEstimatorV07 = new GasEstimatorV07( - binarySearchToleranceDelta, - binarySearchGasAllowance, - chainId, - publicClient, - entryPointSimulationsAddress, - blockTagSupport, - utilityWalletAddress, - fixedGasLimitForEstimation - ) + this.gasEstimatorV07 = new GasEstimatorV07(config) } simulateHandleOp({ userOperation, queuedUserOperations, + addSenderBalanceOverride, entryPoint, replacedEntryPoint, targetAddress, @@ -90,6 +66,7 @@ export class GasEstimationHandler { }: { userOperation: UserOperation queuedUserOperations: UserOperation[] + addSenderBalanceOverride: boolean entryPoint: Address replacedEntryPoint: boolean targetAddress: Address @@ -104,6 +81,7 @@ export class GasEstimationHandler { userOperation, entryPoint, replacedEntryPoint, + addSenderBalanceOverride, stateOverride: stateOverrides }) } diff --git a/src/rpc/estimation/gasEstimationsV06.ts b/src/rpc/estimation/gasEstimationsV06.ts index 5a394e2c..6b25ae7a 100644 --- a/src/rpc/estimation/gasEstimationsV06.ts +++ b/src/rpc/estimation/gasEstimationsV06.ts @@ -1,8 +1,8 @@ import { EntryPointV06Abi, + EntryPointV06SimulationsAbi, RpcError, ValidationErrors, - EntryPointV06SimulationsAbi, executionResultSchema, hexDataSchema } from "@alto/types" @@ -10,30 +10,19 @@ import type { StateOverrides, UserOperationV06 } from "@alto/types" import type { Hex, RpcRequestErrorType } from "viem" import { type Address, - type PublicClient, decodeErrorResult, encodeFunctionData, toHex } from "viem" import { z } from "zod" import type { SimulateHandleOpResult } from "./types" +import type { AltoConfig } from "../../createConfig" export class GasEstimatorV06 { - publicClient: PublicClient - blockTagSupport: boolean - utilityWalletAddress: Address - fixedGasLimitForEstimation?: bigint + private config: AltoConfig - constructor( - publicClient: PublicClient, - blockTagSupport: boolean, - utilityWalletAddress: Address, - fixedGasLimitForEstimation?: bigint - ) { - this.publicClient = publicClient - this.blockTagSupport = blockTagSupport - this.utilityWalletAddress = utilityWalletAddress - this.fixedGasLimitForEstimation = fixedGasLimitForEstimation + constructor(config: AltoConfig) { + this.config = config } async simulateHandleOpV06({ @@ -49,12 +38,13 @@ export class GasEstimatorV06 { entryPoint: Address stateOverrides?: StateOverrides | undefined }): Promise { - const { - publicClient, - blockTagSupport, - utilityWalletAddress, - fixedGasLimitForEstimation - } = this + const publicClient = this.config.publicClient + const blockTagSupport = this.config.blockTagSupport + const utilityWalletAddress = + this.config.utilityPrivateKey?.address ?? + "0x4337000c2828F5260d8921fD25829F606b9E8680" + const fixedGasLimitForEstimation = + this.config.fixedGasLimitForEstimation try { await publicClient.request({ diff --git a/src/rpc/estimation/gasEstimationsV07.ts b/src/rpc/estimation/gasEstimationsV07.ts index b0893b4a..bf07fab8 100644 --- a/src/rpc/estimation/gasEstimationsV07.ts +++ b/src/rpc/estimation/gasEstimationsV07.ts @@ -1,64 +1,41 @@ -import type { Hex } from "viem" import { - type Address, - type PublicClient, - decodeErrorResult, - encodeFunctionData, - toHex, - decodeAbiParameters, - decodeFunctionResult, - toFunctionSelector, - slice -} from "viem" -import { - type StateOverrides, - type UserOperationV07, - type ValidationResultV07, - type ExecutionResult, - type TargetCallResult, EntryPointV07Abi, EntryPointV07SimulationsAbi, + ExecutionErrors, + type ExecutionResult, PimlicoEntryPointSimulationsAbi, + RpcError, + type StateOverrides, + type TargetCallResult, + type UserOperationV07, ValidationErrors, - ExecutionErrors, - targetCallResultSchema, - RpcError + type ValidationResultV07, + targetCallResultSchema } from "@alto/types" import { getUserOperationHash, toPackedUserOperation } from "@alto/utils" +import type { Hex } from "viem" import { - simulationValidationResultStruct, - type SimulateHandleOpResult -} from "./types" + type Address, + decodeAbiParameters, + decodeErrorResult, + decodeFunctionResult, + encodeFunctionData, + slice, + toFunctionSelector, + toHex +} from "viem" import { AccountExecuteAbi } from "../../types/contracts/IAccountExecute" +import { + type SimulateHandleOpResult, + simulationValidationResultStruct +} from "./types" +import type { AltoConfig } from "../../createConfig" export class GasEstimatorV07 { - binarySearchToleranceDelta: bigint - binarySearchGasAllowance: bigint - chainId: number - publicClient: PublicClient - entryPointSimulationsAddress: Address | undefined - blockTagSupport: boolean - utilityWalletAddress: Address - fixedGasLimitForEstimation?: bigint - - constructor( - binarySearchToleranceDelta: bigint, - binarySearchGasAllowance: bigint, - chainId: number, - publicClient: PublicClient, - entryPointSimulationsAddress: Address | undefined, - blockTagSupport: boolean, - utilityWalletAddress: Address, - fixedGasLimitForEstimation?: bigint - ) { - this.binarySearchToleranceDelta = binarySearchToleranceDelta - this.binarySearchGasAllowance = binarySearchGasAllowance - this.chainId = chainId - this.publicClient = publicClient - this.entryPointSimulationsAddress = entryPointSimulationsAddress - this.blockTagSupport = blockTagSupport - this.utilityWalletAddress = utilityWalletAddress - this.fixedGasLimitForEstimation = fixedGasLimitForEstimation + private config: AltoConfig + + constructor(config: AltoConfig) { + this.config = config } async simulateValidation({ @@ -111,7 +88,11 @@ export class GasEstimatorV07 { functionName: "executeUserOp", args: [ packedOp, - getUserOperationHash(op, entryPoint, this.chainId) + getUserOperationHash( + op, + entryPoint, + this.config.publicClient.chain.id + ) ] }) } @@ -135,7 +116,7 @@ export class GasEstimatorV07 { userOperationHash: getUserOperationHash( uop, entryPoint, - this.chainId + this.config.publicClient.chain.id ) })) @@ -152,7 +133,7 @@ export class GasEstimatorV07 { userOperation, queuedUserOperations, entryPoint, - gasAllowance = this.binarySearchGasAllowance, + gasAllowance = this.config.binarySearchGasAllowance, initialMinGas = 0n }: { userOperation: UserOperationV07 @@ -187,7 +168,7 @@ export class GasEstimatorV07 { targetOp, entryPoint, initialMinGas, - this.binarySearchToleranceDelta, + this.config.binarySearchToleranceDelta, gasAllowance ] }) @@ -302,14 +283,35 @@ export class GasEstimatorV07 { queuedUserOperations }) - let cause = await this.callPimlicoEntryPointSimulations({ - entryPoint, - entryPointSimulationsCallData: [ - simulateHandleOpLast, - simulateCallData - ], - stateOverrides - }) + let cause + + if (this.config.chainType === "hedera") { + // due to Hedera specific restrictions, we can't combine these two calls. + const [simulateHandleOpLastCause, simulateCallDataCause] = + await Promise.all([ + this.callPimlicoEntryPointSimulations({ + entryPoint, + entryPointSimulationsCallData: [simulateHandleOpLast], + stateOverrides + }), + this.callPimlicoEntryPointSimulations({ + entryPoint, + entryPointSimulationsCallData: [simulateCallData], + stateOverrides + }) + ]) + + cause = [simulateHandleOpLastCause[0], simulateCallDataCause[0]] + } else { + cause = await this.callPimlicoEntryPointSimulations({ + entryPoint, + entryPointSimulationsCallData: [ + simulateHandleOpLast, + simulateCallData + ], + stateOverrides + }) + } cause = cause.map((data: Hex) => { const decodedDelegateAndError = decodeErrorResult({ @@ -384,13 +386,15 @@ export class GasEstimatorV07 { entryPointSimulationsCallData: Hex[] stateOverrides?: StateOverrides }) { - const { - publicClient, - blockTagSupport, - utilityWalletAddress, - entryPointSimulationsAddress, - fixedGasLimitForEstimation - } = this + const publicClient = this.config.publicClient + const blockTagSupport = this.config.blockTagSupport + const utilityWalletAddress = + this.config.utilityPrivateKey?.address ?? + "0x4337000c2828F5260d8921fD25829F606b9E8680" + const entryPointSimulationsAddress = + this.config.entrypointSimulationContract + const fixedGasLimitForEstimation = + this.config.fixedGasLimitForEstimation if (!entryPointSimulationsAddress) { throw new RpcError( diff --git a/src/rpc/nonceQueuer.ts b/src/rpc/nonceQueuer.ts index 42ec5ce0..527d5bfb 100644 --- a/src/rpc/nonceQueuer.ts +++ b/src/rpc/nonceQueuer.ts @@ -1,8 +1,10 @@ +import type { EventManager } from "@alto/handlers" +import type { MemoryMempool } from "@alto/mempool" import { EntryPointV06Abi, + EntryPointV07Abi, type MempoolUserOperation, - deriveUserOperation, - EntryPointV07Abi + deriveUserOperation } from "@alto/types" import type { Logger } from "@alto/utils" import { @@ -12,15 +14,12 @@ import { } from "@alto/utils" import { type Address, - type Chain, type Hash, type MulticallReturnType, type PublicClient, - type Transport, getContract } from "viem" -import type { MemoryMempool } from "@alto/mempool" -import type { EventManager } from "@alto/handlers" +import type { AltoConfig } from "../createConfig" type QueuedUserOperation = { entryPoint: Address @@ -34,23 +33,28 @@ type QueuedUserOperation = { export class NonceQueuer { queuedUserOperations: QueuedUserOperation[] = [] + config: AltoConfig mempool: MemoryMempool - publicClient: PublicClient logger: Logger - blockTagSupport: boolean eventManager: EventManager - constructor( - mempool: MemoryMempool, - publicClient: PublicClient, - logger: Logger, - blockTagSupport: boolean, + constructor({ + config, + mempool, + eventManager + }: { + config: AltoConfig + mempool: MemoryMempool eventManager: EventManager - ) { + }) { + this.config = config this.mempool = mempool - this.publicClient = publicClient - this.logger = logger - this.blockTagSupport = blockTagSupport + this.logger = config.getLogger( + { module: "nonce_queuer" }, + { + level: config.nonceQueuerLogLevel || config.logLevel + } + ) this.eventManager = eventManager setInterval(() => { @@ -69,7 +73,7 @@ export class NonceQueuer { } const availableOps = await this.getAvailableUserOperations( - this.publicClient + this.config.publicClient ) if (availableOps.length === 0) { @@ -99,7 +103,7 @@ export class NonceQueuer { const hash = getUserOperationHash( deriveUserOperation(mempoolUserOperation), entryPoint, - this.publicClient.chain.id + this.config.publicClient.chain.id ) this.queuedUserOperations.push({ entryPoint, @@ -154,7 +158,7 @@ export class NonceQueuer { args: [userOperation.sender, qop.nonceKey] } }), - blockTag: this.blockTagSupport ? "latest" : undefined + blockTag: this.config.blockTagSupport ? "latest" : undefined }) } catch (error) { this.logger.error( diff --git a/src/rpc/rpcHandler.ts b/src/rpc/rpcHandler.ts index 52e4c276..7d3f9277 100644 --- a/src/rpc/rpcHandler.ts +++ b/src/rpc/rpcHandler.ts @@ -1,4 +1,9 @@ import type { Executor, ExecutorManager } from "@alto/executor" +import type { + CompressionHandler, + EventManager, + GasPriceManager +} from "@alto/handlers" import type { InterfaceReputationManager, MemoryMempool, @@ -8,21 +13,12 @@ import type { ApiVersion, PackedUserOperation, StateOverrides, - UserOperationV06, - GasPriceMultipliers, - ChainType, - UserOperationV07, + TransactionInfo, UserOperationInfo, - TransactionInfo + UserOperationV06, + UserOperationV07 } from "@alto/types" import { - EntryPointV06Abi, - EntryPointV07Abi, - IOpInflatorAbi, - RpcError, - ValidationErrors, - bundlerGetStakeStatusResponseSchema, - deriveUserOperation, type Address, type BundlerClearMempoolResponseResult, type BundlerClearStateResponseResult, @@ -37,27 +33,30 @@ import { type BundlingMode, type ChainIdResponseResult, type CompressedUserOperation, + EntryPointV06Abi, + EntryPointV07Abi, type EstimateUserOperationGasResponseResult, type GetUserOperationByHashResponseResult, type GetUserOperationReceiptResponseResult, type HexData32, + IOpInflatorAbi, type InterfaceValidator, type MempoolUserOperation, type PimlicoGetUserOperationGasPriceResponseResult, type PimlicoGetUserOperationStatusResponseResult, + RpcError, type SendUserOperationResponseResult, type SupportedEntryPointsResponseResult, - type UserOperation + type UserOperation, + ValidationErrors, + bundlerGetStakeStatusResponseSchema, + deriveUserOperation } from "@alto/types" import type { Logger, Metrics } from "@alto/utils" -import type { - GasPriceManager, - CompressionHandler, - EventManager -} from "@alto/handlers" import { calcPreVerificationGas, calcVerificationGasAndCallGasLimit, + deepHexlify, getAAError, getNonceKeyAndValue, getUserOperationHash, @@ -69,21 +68,19 @@ import { toUnpackedUserOperation } from "@alto/utils" import { + type Hex, + type Transaction, TransactionNotFoundError, decodeFunctionData, getAbiItem, getAddress, getContract, - type Chain, - type Hex, - type PublicClient, - type Transaction, - type Transport, slice, toFunctionSelector } from "viem" import { base, baseSepolia, optimism } from "viem/chains" import type { NonceQueuer } from "./nonceQueuer" +import type { AltoConfig } from "../createConfig" export interface IRpcEndpoint { handleMethod( @@ -112,80 +109,65 @@ export interface IRpcEndpoint { } export class RpcHandler implements IRpcEndpoint { - entryPoints: Address[] - publicClient: PublicClient + config: AltoConfig validator: InterfaceValidator mempool: MemoryMempool executor: Executor monitor: Monitor nonceQueuer: NonceQueuer - usingTenderly: boolean rpcMaxBlockRange: number | undefined logger: Logger metrics: Metrics - chainId: number - chainType: ChainType - enableDebugEndpoints: boolean executorManager: ExecutorManager reputationManager: InterfaceReputationManager compressionHandler: CompressionHandler | null - legacyTransactions: boolean - dangerousSkipUserOperationValidation: boolean gasPriceManager: GasPriceManager - gasPriceMultipliers: GasPriceMultipliers - paymasterGasLimitMultiplier: bigint eventManager: EventManager - enableInstantBundlingEndpoint: boolean - - constructor( - entryPoints: Address[], - publicClient: PublicClient, - validator: InterfaceValidator, - mempool: MemoryMempool, - executor: Executor, - monitor: Monitor, - nonceQueuer: NonceQueuer, - executorManager: ExecutorManager, - reputationManager: InterfaceReputationManager, - usingTenderly: boolean, - rpcMaxBlockRange: number | undefined, - logger: Logger, - metrics: Metrics, - enableDebugEndpoints: boolean, - compressionHandler: CompressionHandler | null, - legacyTransactions: boolean, - gasPriceManager: GasPriceManager, - gasPriceMultipliers: GasPriceMultipliers, - chainType: ChainType, - paymasterGasLimitMultiplier: bigint, - eventManager: EventManager, - enableInstantBundlingEndpoint: boolean, - dangerousSkipUserOperationValidation = false - ) { - this.entryPoints = entryPoints - this.publicClient = publicClient + + constructor({ + config, + validator, + mempool, + executor, + monitor, + nonceQueuer, + executorManager, + reputationManager, + metrics, + compressionHandler, + gasPriceManager, + eventManager + }: { + config: AltoConfig + validator: InterfaceValidator + mempool: MemoryMempool + executor: Executor + monitor: Monitor + nonceQueuer: NonceQueuer + executorManager: ExecutorManager + reputationManager: InterfaceReputationManager + metrics: Metrics + compressionHandler: CompressionHandler | null + eventManager: EventManager + gasPriceManager: GasPriceManager + }) { + this.config = config this.validator = validator this.mempool = mempool this.executor = executor this.monitor = monitor this.nonceQueuer = nonceQueuer - this.usingTenderly = usingTenderly - this.rpcMaxBlockRange = rpcMaxBlockRange - this.logger = logger + this.logger = config.getLogger( + { module: "rpc" }, + { + level: config.rpcLogLevel || config.logLevel + } + ) this.metrics = metrics - this.enableDebugEndpoints = enableDebugEndpoints - this.chainId = publicClient.chain.id this.executorManager = executorManager this.reputationManager = reputationManager this.compressionHandler = compressionHandler - this.legacyTransactions = legacyTransactions - this.dangerousSkipUserOperationValidation = - dangerousSkipUserOperationValidation - this.gasPriceMultipliers = gasPriceMultipliers - this.chainType = chainType this.gasPriceManager = gasPriceManager - this.paymasterGasLimitMultiplier = paymasterGasLimitMultiplier - this.enableInstantBundlingEndpoint = enableInstantBundlingEndpoint this.eventManager = eventManager } @@ -320,9 +302,9 @@ export class RpcHandler implements IRpcEndpoint { } ensureEntryPointIsSupported(entryPoint: Address) { - if (!this.entryPoints.includes(entryPoint)) { + if (!this.config.entrypoints.includes(entryPoint)) { throw new Error( - `EntryPoint ${entryPoint} not supported, supported EntryPoints: ${this.entryPoints.join( + `EntryPoint ${entryPoint} not supported, supported EntryPoints: ${this.config.entrypoints.join( ", " )}` ) @@ -330,7 +312,7 @@ export class RpcHandler implements IRpcEndpoint { } ensureDebugEndpointsAreEnabled(methodName: string) { - if (!this.enableDebugEndpoints) { + if (!this.config.enableDebugEndpoints) { throw new RpcError( `${methodName} is only available in development environment` ) @@ -344,7 +326,7 @@ export class RpcHandler implements IRpcEndpoint { entryPoint: Address ) { if ( - this.legacyTransactions && + this.config.legacyTransactions && userOperation.maxFeePerGas !== userOperation.maxPriorityFeePerGas ) { const reason = @@ -379,11 +361,11 @@ export class RpcHandler implements IRpcEndpoint { } eth_chainId(): ChainIdResponseResult { - return BigInt(this.chainId) + return BigInt(this.config.publicClient.chain.id) } eth_supportedEntryPoints(): SupportedEntryPointsResponseResult { - return this.entryPoints + return this.config.entrypoints } async eth_estimateUserOperationGas( @@ -400,15 +382,13 @@ export class RpcHandler implements IRpcEndpoint { ) } - let preVerificationGas = await calcPreVerificationGas( - this.publicClient, + let preVerificationGas = await calcPreVerificationGas({ + config: this.config, userOperation, entryPoint, - this.chainId, - this.chainType, - this.gasPriceManager, - false - ) + gasPriceManager: this.gasPriceManager, + validate: false + }) preVerificationGas = scaleBigIntByPercent(preVerificationGas, 110) // biome-ignore lint/style/noParameterAssign: prepare userOperaiton for simulation @@ -419,10 +399,16 @@ export class RpcHandler implements IRpcEndpoint { callGasLimit: 10_000_000n } - if (this.chainId === base.id) { + if (this.config.publicClient.chain.id === base.id) { userOperation.verificationGasLimit = 5_000_000n } + if (this.config.chainType === "hedera") { + // The eth_call gasLimit is set to 12_500_000 on Hedera. + userOperation.verificationGasLimit = 5_000_000n + userOperation.callGasLimit = 4_500_000n + } + if (isVersion07(userOperation)) { userOperation.paymasterPostOpGasLimit = 2_000_000n userOperation.paymasterVerificationGasLimit = 5_000_000n @@ -482,6 +468,7 @@ export class RpcHandler implements IRpcEndpoint { userOperation, entryPoint, queuedUserOperations, + true, stateOverrides ) @@ -489,7 +476,7 @@ export class RpcHandler implements IRpcEndpoint { calcVerificationGasAndCallGasLimit( userOperation, executionResult.data.executionResult, - this.chainId, + this.config.publicClient.chain.id, executionResult.data.callDataResult ) @@ -510,20 +497,30 @@ export class RpcHandler implements IRpcEndpoint { executionResult.data.executionResult.paymasterPostOpGasLimit || 1n - const multiplier = this.paymasterGasLimitMultiplier + const multiplier = Number(this.config.paymasterGasLimitMultiplier) - paymasterVerificationGasLimit = - (paymasterVerificationGasLimit * multiplier) / 100n + paymasterVerificationGasLimit = scaleBigIntByPercent( + paymasterVerificationGasLimit, + multiplier + ) - paymasterPostOpGasLimit = - (paymasterPostOpGasLimit * multiplier) / 100n + paymasterPostOpGasLimit = scaleBigIntByPercent( + paymasterPostOpGasLimit, + multiplier + ) } - if (this.chainId === base.id || this.chainId === baseSepolia.id) { + if ( + this.config.publicClient.chain.id === base.id || + this.config.publicClient.chain.id === baseSepolia.id + ) { callGasLimit += 10_000n } - if (this.chainId === base.id || this.chainId === optimism.id) { + if ( + this.config.publicClient.chain.id === base.id || + this.config.publicClient.chain.id === optimism.id + ) { callGasLimit = maxBigInt(callGasLimit, 120_000n) } @@ -531,6 +528,25 @@ export class RpcHandler implements IRpcEndpoint { callGasLimit = 0n } + // If a balance override is provided for the sender, perform an additional simulation + // to verify the userOperation succeeds with the specified balance. + if (stateOverrides?.[userOperation.sender]?.balance) { + await this.validator.getExecutionResult( + { + ...userOperation, + preVerificationGas, + verificationGasLimit, + callGasLimit, + paymasterVerificationGasLimit, + paymasterPostOpGasLimit + }, + entryPoint, + queuedUserOperations, + false, + deepHexlify(stateOverrides) + ) + } + if (isVersion07(userOperation)) { return { preVerificationGas, @@ -565,7 +581,7 @@ export class RpcHandler implements IRpcEndpoint { const hash = getUserOperationHash( userOperation, entryPoint, - this.chainId + this.config.publicClient.chain.id ) this.eventManager.emitReceived(hash) @@ -599,10 +615,10 @@ export class RpcHandler implements IRpcEndpoint { name: "UserOperationEvent" }) - let fromBlock: bigint | undefined = undefined - let toBlock: "latest" | undefined = undefined + let fromBlock: bigint | undefined + let toBlock: "latest" | undefined if (this.rpcMaxBlockRange !== undefined) { - const latestBlock = await this.publicClient.getBlockNumber() + const latestBlock = await this.config.publicClient.getBlockNumber() fromBlock = latestBlock - BigInt(this.rpcMaxBlockRange) if (fromBlock < 0n) { fromBlock = 0n @@ -610,8 +626,8 @@ export class RpcHandler implements IRpcEndpoint { toBlock = "latest" } - const filterResult = await this.publicClient.getLogs({ - address: this.entryPoints, + const filterResult = await this.config.publicClient.getLogs({ + address: this.config.entrypoints, event: userOperationEventAbiItem, fromBlock, toBlock, @@ -635,7 +651,9 @@ export class RpcHandler implements IRpcEndpoint { txHash: HexData32 ): Promise => { try { - return await this.publicClient.getTransaction({ hash: txHash }) + return await this.config.publicClient.getTransaction({ + hash: txHash + }) } catch (e) { if (e instanceof TransactionNotFoundError) { return getTransaction(txHash) @@ -794,12 +812,12 @@ export class RpcHandler implements IRpcEndpoint { let { maxFeePerGas, maxPriorityFeePerGas } = await this.gasPriceManager.getGasPrice() - if (this.chainType === "hedera") { + if (this.config.chainType === "hedera") { maxFeePerGas /= 10n ** 9n maxPriorityFeePerGas /= 10n ** 9n } - const { slow, standard, fast } = this.gasPriceMultipliers + const { slow, standard, fast } = this.config.gasPriceMultipliers return { slow: { @@ -829,7 +847,7 @@ export class RpcHandler implements IRpcEndpoint { const opHash = getUserOperationHash( userOperation, entryPoint, - this.chainId + this.config.publicClient.chain.id ) await this.preMempoolChecks( @@ -876,7 +894,7 @@ export class RpcHandler implements IRpcEndpoint { userOperationNonceValue === currentNonceValue + BigInt(queuedUserOperations.length) ) { - if (this.dangerousSkipUserOperationValidation) { + if (this.config.dangerousSkipUserOperationValidation) { const [success, errorReason] = this.mempool.add(op, entryPoint) if (!success) { this.eventManager.emitFailedValidation( @@ -945,7 +963,7 @@ export class RpcHandler implements IRpcEndpoint { userOperation: UserOperation, entryPoint: Address ) { - if (!this.enableInstantBundlingEndpoint) { + if (!this.config.enableInstantBundlingEndpoint) { throw new RpcError( "pimlico_sendUserOperationNow endpoint is not enabled", ValidationErrors.InvalidFields @@ -957,7 +975,7 @@ export class RpcHandler implements IRpcEndpoint { const opHash = getUserOperationHash( userOperation, entryPoint, - this.chainId + this.config.publicClient.chain.id ) await this.preMempoolChecks( @@ -1009,10 +1027,11 @@ export class RpcHandler implements IRpcEndpoint { this.executor.markWalletProcessed(res.value.transactionInfo.executor) // wait for receipt - const receipt = await this.publicClient.waitForTransactionReceipt({ - hash: res.value.transactionInfo.transactionHash, - pollingInterval: 100 - }) + const receipt = + await this.config.publicClient.waitForTransactionReceipt({ + hash: res.value.transactionInfo.transactionHash, + pollingInterval: 100 + }) const userOperationReceipt = parseUserOperationReceipt(opHash, receipt) @@ -1037,7 +1056,7 @@ export class RpcHandler implements IRpcEndpoint { const hash = getUserOperationHash( inflatedOp, entryPoint, - this.chainId + this.config.publicClient.chain.id ) this.eventManager.emitReceived(hash, receivedTimestamp) @@ -1082,7 +1101,7 @@ export class RpcHandler implements IRpcEndpoint { const inflatorId = await this.compressionHandler.getInflatorRegisteredId( inflatorAddress, - this.publicClient + this.config.publicClient ) if (inflatorId === 0) { @@ -1097,7 +1116,7 @@ export class RpcHandler implements IRpcEndpoint { address: inflatorAddress, abi: IOpInflatorAbi, client: { - public: this.publicClient + public: this.config.publicClient } }) @@ -1132,7 +1151,7 @@ export class RpcHandler implements IRpcEndpoint { ? EntryPointV06Abi : EntryPointV07Abi, client: { - public: this.publicClient + public: this.config.publicClient } }) diff --git a/src/rpc/server.ts b/src/rpc/server.ts index 5f0a948c..9cc79383 100644 --- a/src/rpc/server.ts +++ b/src/rpc/server.ts @@ -1,13 +1,15 @@ import { + type ApiVersion, + type JSONRPCResponse, RpcError, ValidationErrors, - bundlerRequestSchema, - jsonRpcSchema, altoVersions, - type ApiVersion, - type JSONRPCResponse + bundlerRequestSchema, + jsonRpcSchema } from "@alto/types" -import type { Logger, Metrics } from "@alto/utils" +import type { Metrics } from "@alto/utils" +import cors from "@fastify/cors" +import websocket from "@fastify/websocket" import * as sentry from "@sentry/node" import Fastify, { type FastifyBaseLogger, @@ -17,12 +19,11 @@ import Fastify, { } from "fastify" import type { Registry } from "prom-client" import { toHex } from "viem" +import type * as WebSocket from "ws" import { fromZodError } from "zod-validation-error" -import type { IRpcEndpoint } from "./rpcHandler" -import websocket from "@fastify/websocket" import RpcReply from "../utils/rpc-reply" -import type * as WebSocket from "ws" -import cors from "@fastify/cors" +import type { IRpcEndpoint } from "./rpcHandler" +import type { AltoConfig } from "../createConfig" // jsonBigIntOverride.ts const originalJsonStringify = JSON.stringify @@ -69,37 +70,40 @@ declare module "fastify" { } export class Server { + private config: AltoConfig private fastify: FastifyInstance private rpcEndpoint: IRpcEndpoint - private port: number private registry: Registry private metrics: Metrics - private apiVersions: ApiVersion[] - private defaultApiVersion: ApiVersion - private supportedRpcMethods: string[] | null - - constructor( - rpcEndpoint: IRpcEndpoint, - apiVersions: ApiVersion[], - defaultApiVersion: ApiVersion, - port: number, - requestTimeout: number | undefined, - websocketMaxPayloadSize: number, - websocketEnabled: boolean, - logger: Logger, - registry: Registry, - metrics: Metrics, - supportedRpcMethods: string[] | null - ) { + + constructor({ + config, + rpcEndpoint, + registry, + metrics + }: { + config: AltoConfig + rpcEndpoint: IRpcEndpoint + registry: Registry + metrics: Metrics + }) { + this.config = config + const logger = config.getLogger( + { module: "rpc" }, + { + level: config.rpcLogLevel || config.logLevel + } + ) + this.fastify = Fastify({ logger: logger as FastifyBaseLogger, // workaround for https://github.com/fastify/fastify/issues/4960 - requestTimeout: requestTimeout, + requestTimeout: config.timeout, disableRequestLogging: true }) this.fastify.register(websocket, { options: { - maxPayload: websocketMaxPayloadSize + maxPayload: config.websocketMaxPayloadSize } }) @@ -138,9 +142,8 @@ export class Server { this.fastify.post("/:version/rpc", this.rpcHttp.bind(this)) this.fastify.post("/", this.rpcHttp.bind(this)) - if (websocketEnabled) { - // biome-ignore lint/suspicious/useAwait: adhere to interface - this.fastify.register(async (fastify) => { + if (config.websocket) { + this.fastify.register((fastify) => { fastify.route({ method: "GET", url: "/:version/rpc", @@ -153,8 +156,7 @@ export class Server { `GET request to /${version}/rpc is not supported, use POST isntead` ) }, - // biome-ignore lint/suspicious/useAwait: adhere to interface - wsHandler: async (socket: WebSocket.WebSocket, request) => { + wsHandler: (socket: WebSocket.WebSocket, request) => { socket.on("message", async (msgBuffer: Buffer) => this.rpcSocket(request, msgBuffer, socket) ) @@ -167,16 +169,12 @@ export class Server { this.fastify.get("/metrics", this.serveMetrics.bind(this)) this.rpcEndpoint = rpcEndpoint - this.port = port this.registry = registry this.metrics = metrics - this.apiVersions = apiVersions - this.defaultApiVersion = defaultApiVersion - this.supportedRpcMethods = supportedRpcMethods } public start(): void { - this.fastify.listen({ port: this.port, host: "0.0.0.0" }) + this.fastify.listen({ port: this.config.port, host: "0.0.0.0" }) } public async stop(): Promise { @@ -227,7 +225,7 @@ export class Server { let requestId: number | null = null const versionParsingResult = altoVersions.safeParse( - (request.params as any)?.version ?? this.defaultApiVersion + (request.params as any)?.version ?? this.config.defaultApiVersion ) if (!versionParsingResult.success) { @@ -240,7 +238,7 @@ export class Server { const apiVersion: ApiVersion = versionParsingResult.data - if (this.apiVersions.indexOf(apiVersion) === -1) { + if (this.config.apiVersion.indexOf(apiVersion) === -1) { throw new RpcError( `unsupported version ${apiVersion}`, ValidationErrors.InvalidFields @@ -307,8 +305,8 @@ export class Server { request.rpcMethod = bundlerRequest.method if ( - this.supportedRpcMethods !== null && - !this.supportedRpcMethods.includes(bundlerRequest.method) + this.config.rpcMethods !== null && + !this.config.rpcMethods.includes(bundlerRequest.method) ) { throw new RpcError( `Method not supported: ${bundlerRequest.method}`, @@ -337,7 +335,15 @@ export class Server { reply.rpcStatus = "success" this.fastify.log.info( { - data: JSON.stringify(jsonRpcResponse), + data: + bundlerRequest.method === + "eth_getUserOperationReceipt" && + jsonRpcResponse.result + ? { + ...jsonRpcResponse, + result: "" + } + : jsonRpcResponse, // do not log the full result for eth_getUserOperationReceipt to reduce log size method: bundlerRequest.method }, "sent reply" diff --git a/src/rpc/validation/SafeValidator.ts b/src/rpc/validation/SafeValidator.ts index 6bb0e7de..ce1a2283 100644 --- a/src/rpc/validation/SafeValidator.ts +++ b/src/rpc/validation/SafeValidator.ts @@ -1,5 +1,6 @@ +import type { SenderManager } from "@alto/executor" +import type { GasPriceManager } from "@alto/handlers" import type { - ChainType, InterfaceValidator, UserOperationV06, UserOperationV07, @@ -10,22 +11,21 @@ import type { ValidationResultWithAggregationV07 } from "@alto/types" import { + type Address, CodeHashGetterAbi, CodeHashGetterBytecode, EntryPointV06Abi, EntryPointV07SimulationsAbi, - RpcError, - ValidationErrors, - type Address, + PimlicoEntryPointSimulationsAbi, type ReferencedCodeHashes, + RpcError, type StakeInfo, type StorageMap, type UserOperation, - type ValidationResultWithAggregation, - PimlicoEntryPointSimulationsAbi + ValidationErrors, + type ValidationResultWithAggregation } from "@alto/types" -import type { Logger, Metrics } from "@alto/utils" -import type { GasPriceManager } from "@alto/handlers" +import type { Metrics } from "@alto/utils" import { calcVerificationGasAndCallGasLimit, getAddressFromInitCodeOrPaymasterAndData, @@ -34,27 +34,24 @@ import { toPackedUserOperation } from "@alto/utils" import { + type ExecutionRevertedError, + type Hex, decodeErrorResult, encodeDeployData, encodeFunctionData, - zeroAddress, - type Chain, - type ExecutionRevertedError, - type Hex, - type PublicClient, - type Transport + zeroAddress } from "viem" import { getSimulateValidationResult } from "../estimation/gasEstimationsV07" import { - bundlerCollectorTracer, type BundlerTracerResult, - type ExitInfo + type ExitInfo, + bundlerCollectorTracer } from "./BundlerCollectorTracerV07" import { tracerResultParserV06 } from "./TracerResultParserV06" import { tracerResultParserV07 } from "./TracerResultParserV07" import { UnsafeValidator } from "./UnsafeValidator" import { debug_traceCall } from "./tracer" -import type { SenderManager } from "@alto/executor" +import type { AltoConfig } from "../../createConfig" export class SafeValidator extends UnsafeValidator @@ -62,37 +59,22 @@ export class SafeValidator { private senderManager: SenderManager - constructor( - publicClient: PublicClient, - senderManager: SenderManager, - logger: Logger, - metrics: Metrics, - gasPriceManager: GasPriceManager, - chainType: ChainType, - blockTagSupport: boolean, - utilityWalletAddress: Address, - binarySearchToleranceDelta: bigint, - binarySearchGasAllowance: bigint, - entryPointSimulationsAddress?: Address, - fixedGasLimitForEstimation?: bigint, - usingTenderly = false, - balanceOverrideEnabled = false - ) { - super( - publicClient, - logger, + constructor({ + config, + senderManager, + metrics, + gasPriceManager + }: { + config: AltoConfig + senderManager: SenderManager + metrics: Metrics + gasPriceManager: GasPriceManager + }) { + super({ + config, metrics, - gasPriceManager, - chainType, - blockTagSupport, - utilityWalletAddress, - binarySearchToleranceDelta, - binarySearchGasAllowance, - entryPointSimulationsAddress, - fixedGasLimitForEstimation, - usingTenderly, - balanceOverrideEnabled - ) + gasPriceManager + }) this.senderManager = senderManager } @@ -126,7 +108,7 @@ export class SafeValidator preOpGas: validationResult.returnInfo.preOpGas, paid: validationResult.returnInfo.prefund }, - this.chainId + this.config.publicClient.chain.id ) let mul = 1n @@ -181,7 +163,7 @@ export class SafeValidator let hash = "" try { - await this.publicClient.call({ + await this.config.publicClient.call({ account: wallet, data: deployData }) @@ -210,7 +192,7 @@ export class SafeValidator referencedContracts?: ReferencedCodeHashes } > { - if (this.usingTenderly) { + if (this.config.tenderly) { return super.getValidationResultV07( userOperation, queuedUserOperations, @@ -281,7 +263,7 @@ export class SafeValidator storageMap: StorageMap } > { - if (this.usingTenderly) { + if (this.config.tenderly) { return super.getValidationResultV06(userOperation, entryPoint) } @@ -359,7 +341,7 @@ export class SafeValidator entryPoint: Address ): Promise<[ValidationResultV06, BundlerTracerResult]> { const tracerResult = await debug_traceCall( - this.publicClient, + this.config.publicClient, { from: zeroAddress, to: entryPoint, @@ -518,11 +500,10 @@ export class SafeValidator }) const entryPointSimulationsAddress = - this.gasEstimationHandler.gasEstimatorV07 - .entryPointSimulationsAddress + this.config.entrypointSimulationContract const tracerResult = await debug_traceCall( - this.publicClient, + this.config.publicClient, { from: zeroAddress, to: entryPointSimulationsAddress, diff --git a/src/rpc/validation/TracerResultParserV06.ts b/src/rpc/validation/TracerResultParserV06.ts index f7384687..639bef9a 100644 --- a/src/rpc/validation/TracerResultParserV06.ts +++ b/src/rpc/validation/TracerResultParserV06.ts @@ -5,9 +5,9 @@ import { SenderCreatorAbi, type StakeInfo, type StorageMap, + type UserOperationV06, ValidationErrors, - type ValidationResult, - type UserOperationV06 + type ValidationResult } from "@alto/types" import type { Abi, AbiFunction } from "abitype" // This file contains references to validation rules, in the format [xxx-###] diff --git a/src/rpc/validation/TracerResultParserV07.ts b/src/rpc/validation/TracerResultParserV07.ts index 22a8b95f..21cb5669 100644 --- a/src/rpc/validation/TracerResultParserV07.ts +++ b/src/rpc/validation/TracerResultParserV07.ts @@ -1,3 +1,14 @@ +import { + EntryPointV07Abi, + PaymasterAbi, + RpcError, + SenderCreatorAbi, + type StakeInfo, + type StorageMap, + type UserOperationV07, + ValidationErrors, + type ValidationResultV07 +} from "@alto/types" import type { Abi, AbiFunction } from "abitype" // This file contains references to validation rules, in the format [xxx-###] // where xxx is OP/STO/COD/EP/SREP/EREP/UREP/ALT, and ### is a number @@ -13,17 +24,6 @@ import { pad } from "viem" import type { BundlerTracerResult } from "./BundlerCollectorTracerV07" -import { - EntryPointV07Abi, - PaymasterAbi, - SenderCreatorAbi, - type UserOperationV07, - type StakeInfo, - type ValidationResultV07, - type StorageMap, - RpcError, - ValidationErrors -} from "@alto/types" interface CallEntry { to: string diff --git a/src/rpc/validation/UnsafeValidator.ts b/src/rpc/validation/UnsafeValidator.ts index 672de353..ab62bf2e 100644 --- a/src/rpc/validation/UnsafeValidator.ts +++ b/src/rpc/validation/UnsafeValidator.ts @@ -1,5 +1,5 @@ +import type { GasPriceManager } from "@alto/handlers" import type { - ChainType, InterfaceValidator, StateOverrides, UserOperationV06, @@ -26,7 +26,6 @@ import { entryPointExecutionErrorSchemaV07 } from "@alto/types" import type { Logger, Metrics } from "@alto/utils" -import type { GasPriceManager } from "@alto/handlers" import { calcPreVerificationGas, calcVerificationGasAndCallGasLimit, @@ -36,10 +35,7 @@ import { import * as sentry from "@sentry/node" import { BaseError, - type Chain, ContractFunctionExecutionError, - type PublicClient, - type Transport, getContract, pad, slice, @@ -49,56 +45,34 @@ import { import { fromZodError } from "zod-validation-error" import { GasEstimationHandler } from "../estimation/gasEstimationHandler" import type { SimulateHandleOpResult } from "../estimation/types" +import type { AltoConfig } from "../../createConfig" export class UnsafeValidator implements InterfaceValidator { - publicClient: PublicClient - logger: Logger + config: AltoConfig metrics: Metrics - usingTenderly: boolean - balanceOverrideEnabled: boolean - expirationCheck: boolean - chainId: number gasPriceManager: GasPriceManager - chainType: ChainType - + logger: Logger gasEstimationHandler: GasEstimationHandler - constructor( - publicClient: PublicClient, - logger: Logger, - metrics: Metrics, - gasPriceManager: GasPriceManager, - chainType: ChainType, - blockTagSupport: boolean, - utilityWalletAddress: Address, - binarySearchToleranceDelta: bigint, - binarySearchGasAllowance: bigint, - entryPointSimulationsAddress?: Address, - fixedGasLimitForEstimation?: bigint, - usingTenderly = false, - balanceOverrideEnabled = false, - expirationCheck = true - ) { - this.publicClient = publicClient - this.logger = logger + constructor({ + config, + metrics, + gasPriceManager + }: { + config: AltoConfig + metrics: Metrics + gasPriceManager: GasPriceManager + }) { + this.config = config this.metrics = metrics - this.usingTenderly = usingTenderly - this.balanceOverrideEnabled = balanceOverrideEnabled - this.expirationCheck = expirationCheck - this.chainId = publicClient.chain.id this.gasPriceManager = gasPriceManager - this.chainType = chainType - - this.gasEstimationHandler = new GasEstimationHandler( - binarySearchToleranceDelta, - binarySearchGasAllowance, - publicClient, - publicClient.chain.id, - blockTagSupport, - utilityWalletAddress, - entryPointSimulationsAddress, - fixedGasLimitForEstimation + this.logger = config.getLogger( + { module: "validator" }, + { + level: config.logLevel + } ) + this.gasEstimationHandler = new GasEstimationHandler(config) } async getSimulationResult( @@ -184,16 +158,18 @@ export class UnsafeValidator implements InterfaceValidator { userOperation: UserOperation, entryPoint: Address, queuedUserOperations: UserOperation[], + addSenderBalanceOverride: boolean, stateOverrides?: StateOverrides ): Promise> { const error = await this.gasEstimationHandler.simulateHandleOp({ userOperation, queuedUserOperations, + addSenderBalanceOverride, + balanceOverrideEnabled: this.config.balanceOverride, entryPoint, replacedEntryPoint: false, targetAddress: zeroAddress, targetCallData: "0x", - balanceOverrideEnabled: this.balanceOverrideEnabled, stateOverrides }) @@ -221,7 +197,7 @@ export class UnsafeValidator implements InterfaceValidator { address: entryPoint, abi: EntryPointV06Abi, client: { - public: this.publicClient + public: this.config.publicClient } }) @@ -252,7 +228,7 @@ export class UnsafeValidator implements InterfaceValidator { simulateValidationResult, this.logger, "validation", - this.usingTenderly + this.config.tenderly )) as ValidationResultV06 | ValidationResultWithAggregationV06), storageMap: {} } @@ -274,7 +250,7 @@ export class UnsafeValidator implements InterfaceValidator { if ( validationResult.returnInfo.validAfter > now - 5 && - this.expirationCheck + this.config.expirationCheck ) { throw new RpcError( "User operation is not valid yet", @@ -284,7 +260,7 @@ export class UnsafeValidator implements InterfaceValidator { if ( validationResult.returnInfo.validUntil < now + 30 && - this.expirationCheck + this.config.expirationCheck ) { throw new RpcError( "expires too soon", @@ -506,15 +482,13 @@ export class UnsafeValidator implements InterfaceValidator { userOperation: UserOperation, entryPoint: Address ) { - const preVerificationGas = await calcPreVerificationGas( - this.publicClient, + const preVerificationGas = await calcPreVerificationGas({ + config: this.config, userOperation, entryPoint, - this.chainId, - this.chainType, - this.gasPriceManager, - true - ) + gasPriceManager: this.gasPriceManager, + validate: true + }) if (preVerificationGas > userOperation.preVerificationGas) { throw new RpcError( @@ -553,7 +527,7 @@ export class UnsafeValidator implements InterfaceValidator { preOpGas: validationResult.returnInfo.preOpGas, paid: validationResult.returnInfo.prefund }, - this.chainId + this.config.publicClient.chain.id ) let mul = 1n diff --git a/src/types/contracts/PimlicoEntryPointSimulations.ts b/src/types/contracts/PimlicoEntryPointSimulations.ts index ff529ee6..3f373374 100644 --- a/src/types/contracts/PimlicoEntryPointSimulations.ts +++ b/src/types/contracts/PimlicoEntryPointSimulations.ts @@ -31,4 +31,4 @@ export const PimlicoEntryPointSimulationsAbi = [ ] export const PimlicoEntryPointSimulationsDeployBytecode = - "0x60806040526040516100109061005f565b604051809103906000f08015801561002c573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b039290921691909117905534801561005957600080fd5b5061006c565b613d318061050783390190565b61048c8061007b6000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c18f522614610030575b600080fd5b61004361003e366004610230565b610059565b60405161005091906103b0565b60405180910390f35b60606000825167ffffffffffffffff811115610077576100776101e9565b6040519080825280602002602001820160405280156100aa57816020015b60608152602001906001900390816100955790505b50905060005b835181101561019d57606060007f850aaf621a3721219c57b79d6077e318862cf95113b5637afaddb124884a5eb060008054906101000a90046001600160a01b031687858151811061010457610104610414565b602002602001015160405160240161011d92919061042a565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091529050600061015f8882845a6101a5565b905080610174576101716000196101bd565b92505b8285858151811061018757610187610414565b60209081029190910101525050506001016100b0565b509392505050565b6000806000845160208601878987f195945050505050565b60603d828111156101cb5750815b604051602082018101604052818152816000602083013e9392505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff81118282101715610228576102286101e9565b604052919050565b600080604080848603121561024457600080fd5b83356001600160a01b038116811461025b57600080fd5b925060208481013567ffffffffffffffff8082111561027957600080fd5b8187019150601f88601f84011261028f57600080fd5b8235828111156102a1576102a16101e9565b8060051b6102b08682016101ff565b918252848101860191868101908c8411156102ca57600080fd5b87870192505b83831015610357578235868111156102e85760008081fd5b8701603f81018e136102fa5760008081fd5b888101358781111561030e5761030e6101e9565b61031f818801601f19168b016101ff565b8181528f8c8385010111156103345760008081fd5b818c84018c83013760009181018b019190915283525091870191908701906102d0565b8099505050505050505050509250929050565b6000815180845260005b8181101561039057602081850181015186830182015201610374565b506000602082860101526020601f19601f83011685010191505092915050565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b8281101561040757603f198886030184526103f585835161036a565b945092850192908501906001016103d9565b5092979650505050505050565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038316815260406020820181905260009061044e9083018461036a565b94935050505056fea26469706673582212207ddd3776bce2d23a4710581621f90634e5e2f38c35b4ba3416ba605ac54ef07b64736f6c6343000817003360a060405260405162000012906200009d565b604051809103906000f0801580156200002f573d6000803e3d6000fd5b506001600160a01b0390811660805260408051808201825260008082528251808401909352808352602080840191825282018390529051600380546001600160a01b031916919094161790925551600455516005553480156200009157600080fd5b506001600255620000ab565b6102138062003b1e83390190565b608051613a5a620000c460003960005050613a5a6000f3fe6080604052600436106101395760003560e01c80635287ce12116100ab578063bb9fe6bf1161006f578063bb9fe6bf14610505578063c23a5cea1461051a578063c3bce0091461053a578063c5f996e614610567578063fc7e286d14610587578063fe2171cb1461062f57600080fd5b80635287ce12146103575780635895273b1461046f57806370a082311461048f578063b760faf9146104c5578063baa22044146104d857600080fd5b80631b2e01b8116100fd5780631b2e01b814610219578063205c28781461025f57806322cdde4c1461027f578063263934db1461029f57806330ec25d1146102cc57806335567e1a146102f957600080fd5b80630396cb601461014e5780630513fbf4146101615780630bd28e3b146101975780630da82661146101b75780630dbfc6bd146101ec57600080fd5b36610149576101473361064f565b005b600080fd5b61014761015c366004612c8c565b610670565b34801561016d57600080fd5b5061018161017c366004612cfd565b610904565b60405161018e9190612e11565b60405180910390f35b3480156101a357600080fd5b506101476101b2366004612e8c565b610a24565b3480156101c357600080fd5b506101d76101d2366004612fd8565b610a5b565b6040805192835260208301919091520161018e565b3480156101f857600080fd5b5061020c610207366004613127565b610b90565b60405161018e91906131c6565b34801561022557600080fd5b5061025161023436600461321d565b600160209081526000928352604080842090915290825290205481565b60405190815260200161018e565b34801561026b57600080fd5b5061014761027a366004613252565b610c4f565b34801561028b57600080fd5b5061025161029a366004613297565b610da0565b3480156102ab57600080fd5b506102bf6102ba366004613127565b610de2565b60405161018e91906132cb565b3480156102d857600080fd5b506102ec6102e7366004613127565b610e79565b60405161018e91906133a7565b34801561030557600080fd5b5061025161031436600461321d565b6001600160a01b039190911660009081526001602090815260408083206001600160c01b0385168452909152908190205491901b67ffffffffffffffff19161790565b34801561036357600080fd5b506104146103723660046133fe565b6040805160a081018252600080825260208201819052918101829052606081018290526080810191909152506001600160a01b031660009081526020818152604091829020825160a0810184528154815260019091015460ff811615159282019290925261010082046001600160701b031692810192909252600160781b810463ffffffff166060830152600160981b900465ffffffffffff16608082015290565b60405161018e9190600060a082019050825182526020830151151560208301526001600160701b03604084015116604083015263ffffffff606084015116606083015265ffffffffffff608084015116608083015292915050565b34801561047b57600080fd5b506102bf61048a366004613297565b610f2e565b34801561049b57600080fd5b506102516104aa3660046133fe565b6001600160a01b031660009081526020819052604090205490565b6101476104d33660046133fe565b61064f565b3480156104e457600080fd5b506104f86104f3366004612cfd565b610fe9565b60405161018e919061341b565b34801561051157600080fd5b50610147611046565b34801561052657600080fd5b506101476105353660046133fe565b61117a565b34801561054657600080fd5b5061055a610555366004613297565b61139e565b60405161018e919061342e565b34801561057357600080fd5b506104f8610582366004613441565b611563565b34801561059357600080fd5b506105ec6105a23660046133fe565b6000602081905290815260409020805460019091015460ff81169061010081046001600160701b031690600160781b810463ffffffff1690600160981b900465ffffffffffff1685565b6040805195865293151560208601526001600160701b039092169284019290925263ffffffff909116606083015265ffffffffffff16608082015260a00161018e565b34801561063b57600080fd5b5061055a61064a366004613127565b61164e565b60015b600581101561066357600101610652565b61066c82611662565b5050565b33600090815260208190526040902063ffffffff82166106d75760405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c617900000000000060448201526064015b60405180910390fd5b600181015463ffffffff600160781b9091048116908316101561073c5760405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d650000000060448201526064016106ce565b600181015460009061075d90349061010090046001600160701b03166134fc565b9050600081116107a45760405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b60448201526064016106ce565b6001600160701b038111156107ec5760405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b60448201526064016106ce565b6040805160a08101825283548152600160208083018281526001600160701b0386811685870190815263ffffffff8a811660608801818152600060808a0181815233808352828a52918c90209a518b55965199909801805494519151965165ffffffffffff16600160981b0265ffffffffffff60981b1997909416600160781b029690961669ffffffffffffffffffff60781b1991909516610100026effffffffffffffffffffffffffff0019991515999099166effffffffffffffffffffffffffffff1990941693909317979097179190911691909117179055835185815290810192909252917fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01910160405180910390a2505050565b60606000866001600160401b0381111561092057610920612ea7565b60405190808252806020026020018201604052801561096d57816020015b6040805160608082018352600080835260208301529181019190915281526020019060019003908161093e5790505b50905060005b87811015610a185760006109ef8a8a848181106109925761099261350f565b90506020028101906109a49190613525565b8989858181106109b6576109b661350f565b90506020020160208101906109cb91906133fe565b8888868181106109dd576109dd61350f565b90506020028101906105829190613546565b905080838381518110610a0457610a0461350f565b602090810291909101015250600101610973565b50979650505050505050565b3360009081526001602090815260408083206001600160c01b03851684529091528120805491610a538361358c565b919050555050565b8251606081015160a08201516000928392909181016127100160405a603f0281610a8757610a876135a5565b041015610ad25760408051631101335b60e11b8152600060048201526024810191909152600f60448201526e41413935206f7574206f662067617360881b60648201526084016106ce565b875160009015610b66576000610aef846000015160008c866116ab565b905080610b64576000610b036108006116c3565b805190915015610b5e5784600001516001600160a01b03168a602001517f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201876020015184604051610b559291906135bb565b60405180910390a35b60019250505b505b600088608001515a8803019050610b7f828a8a846116ef565b955095505050505094509492505050565b60606000826001600160401b03811115610bac57610bac612ea7565b604051908082528060200260200182016040528015610be557816020015b610bd2612ac0565b815260200190600190039081610bca5790505b50905060005b83811015610c45576000610c1c868684818110610c0a57610c0a61350f565b905060200281019061048a9190613525565b905080838381518110610c3157610c3161350f565b602090810291909101015250600101610beb565b5090505b92915050565b3360009081526020819052604090208054821115610caf5760405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c617267650000000000000060448201526064016106ce565b8054610cbc9083906135d4565b8155604080516001600160a01b03851681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb910160405180910390a26000836001600160a01b03168360405160006040518083038185875af1925050503d8060008114610d4f576040519150601f19603f3d011682016040523d82523d6000602084013e610d54565b606091505b5050905080610d9a5760405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b60448201526064016106ce565b50505050565b6000610dab8261191b565b6040805160208101929092523090820152466060820152608001604051602081830303815290604052805190602001209050919050565b610dea612ac0565b6000826001600160401b03811115610e0457610e04612ea7565b604051908082528060200260200182016040528015610e3d57816020015b610e2a612ac0565b815260200190600190039081610e225790505b509050610e4a8484610b90565b905080610e586001856135d4565b81518110610e6857610e6861350f565b602002602001015191505092915050565b60606000826001600160401b03811115610e9557610e95612ea7565b604051908082528060200260200182016040528015610ece57816020015b610ebb612b07565b815260200190600190039081610eb35790505b50905060005b83811015610c45576000610f05868684818110610ef357610ef361350f565b90506020028101906105559190613525565b905080838381518110610f1a57610f1a61350f565b602090810291909101015250600101610ed4565b610f36612ac0565b610f3e611934565b610f46612bbc565b610f4f8361195c565b6000806000610f6060008786611a29565b925092509250600080610f738887611c57565b915091506040518061010001604052808760800151815260200183815260200186815260200185815260200184815260200182815260200160001515815260200160405180604001604052806002815260200161060f60f31b8152508152509650505050505050610fe46001600255565b919050565b60408051606080820183526000808352602083018190529282015290611013888888888888610904565b9050806110216001896135d4565b815181106110315761103161350f565b60200260200101519150509695505050505050565b33600090815260208190526040812060018101549091600160781b90910463ffffffff1690036110a55760405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b60448201526064016106ce565b600181015460ff166110ed5760405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b60448201526064016106ce565b600181015460009061110c90600160781b900463ffffffff16426135e7565b60018301805460ff65ffffffffffff60981b011916600160981b65ffffffffffff841690810260ff19169190911790915560405190815290915033907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a906020015b60405180910390a25050565b336000908152602081905260409020600181015461010090046001600160701b0316806111e05760405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b60448201526064016106ce565b6001820154600160981b900465ffffffffffff166112405760405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b65282920666972737400000060448201526064016106ce565b600182015442600160981b90910465ffffffffffff1611156112a45760405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f7420647565000000000060448201526064016106ce565b600182018054610100600160c81b0319169055604080516001600160a01b03851681526020810183905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda3910160405180910390a26000836001600160a01b03168260405160006040518083038185875af1925050503d8060008114611348576040519150601f19603f3d011682016040523d82523d6000602084013e61134d565b606091505b5050905080610d9a5760405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b65000000000000000060448201526064016106ce565b6113a6612b07565b6113ae612bbc565b6113b78361195c565b6000806113c660008685611a29565b50915091506113d9600083836000611d64565b60006113ec846000015160e00151611f00565b8451519091506000906113fe90611f00565b905061141d604051806040016040528060008152602001600081525090565b36600061142d60408b018b613546565b90925090506000601482101561144457600061145f565b61145260146000848661360d565b61145b91613637565b60601c5b905061146a81611f00565b9350505050600085905060006040518060a0016040528089608001518152602001896040015181526020018881526020018781526020016114ac8a6060015190565b90526040805180820182526003546001600160a01b0390811682528251808401909352600454835260055460208481019190915282019290925291925083161580159061150357506001836001600160a01b031614155b15611530576040518060400160405280846001600160a01b0316815260200161152b85611f00565b905290505b6040805160a081018252928352602083019590955293810192909252506060810192909252608082015295945050505050565b60408051606080820183526000808352602083015291810191909152611587612bbc565b6115908661195c565b61159c60008783611a29565b506000915060609050816001600160a01b0388161561162b5760005a9050886001600160a01b031688886040516115d492919061366c565b6000604051808303816000865af19150503d8060008114611611576040519150601f19603f3d011682016040523d82523d6000602084013e611616565b606091505b5090945092505a61162790826135d4565b9150505b604080516060810182529182529215156020820152918201529695505050505050565b611656612b07565b6000610e4a8484610e79565b600061166e8234611f52565b9050816001600160a01b03167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c48260405161116e91815260200190565b6000806000845160208601878987f195945050505050565b60603d828111156116d15750815b604051602082018101604052818152816000602083013e9392505050565b60008060005a86519091506000908161170782611f85565b60e08301519091506001600160a01b038116611726578251935061183e565b80935060008951111561183e57878202965060028b600281111561174c5761174c61367c565b1461183e5760005a9050816001600160a01b0316637c627b218560a001518e8d8c886040518663ffffffff1660e01b815260040161178d9493929190613692565b600060405180830381600088803b1580156117a757600080fd5b5087f1935050505080156117b9575060015b611838578a5180516020808e01519201516001600160a01b0390911691907ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f4792906118046108006116c3565b6040516118129291906135bb565b60405180910390a38a608001515a870301985061183260028c8c8c6116ef565b90985096505b5a900395505b5a60a0840151606085015160808d01519288039a909a01990190890380821115611871576064600a828403020499909901985b505060408a01518883029750878110156118d75760028c60028111156118995761189961367c565b036118bc578097506118aa8b611fb7565b6118b78b60008a8c612006565b61190c565b8a608001515a87030198508a6040015197506118aa8b611fb7565b8781036118e48682611f52565b506000808e60028111156118fa576118fa61367c565b1490506119098d828c8e612006565b50505b50505050505094509492505050565b600061192682612081565b805190602001209050919050565b600280540361195657604051633ee5aeb560e01b815260040160405180910390fd5b60028055565b6119cf6040516135a560f21b60208201526bffffffffffffffffffffffff193060601b166022820152600160f81b603682015260009060370160408051808303601f190181529190528051602090910120600680546001600160a01b0319166001600160a01b0390921691909117905550565b6000611a006119e16040840184613546565b6119ee60208601866133fe565b6119fb60e0870187613546565b612139565b9050805160001461066c57600081604051631101335b60e11b81526004016106ce9291906135bb565b6000806000805a8551909150611a3f8782612215565b611a4887610da0565b6020870152604081015161012082015161010083015160a08401516080850151606086015160c0870151861717171717176effffffffffffffffffffffffffffff811115611ad85760405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f77000000000000000060448201526064016106ce565b6000611b078460c081015160a08201516080830151606084015160408501516101009095015194010101010290565b9050611b168b8b8b8487612323565b9750611b2a846000015185602001516124ba565b611b80578a604051631101335b60e11b81526004016106ce918152604060208201819052601a908201527f4141323520696e76616c6964206163636f756e74206e6f6e6365000000000000606082015260800190565b825a86031115611bdc578a604051631101335b60e11b81526004016106ce918152604060208201819052601e908201527f41413236206f76657220766572696669636174696f6e4761734c696d69740000606082015260800190565b606060005a60e08701519091506001600160a01b031615611c0857611c038d8d8d86612507565b995091505b60408b018390528160608c015260a08c01355a88030160808c015260645a611c3090836135d4565b611c3b9060736136dc565b611c4591906136f3565b97505050505050505093509350939050565b60008060005a90506000611c6c856060015190565b604051909150366000611c8260608a018a613546565b915091506000816003811115611c9757833591505b506372288ed160e01b6001600160e01b0319821601611d0d5760008a8a60200151604051602401611cc9929190613862565b60408051601f198184030181529190526020810180516001600160e01b0316638dd7712f60e01b1790529050611d01818b888a610a5b565b9099509750611d579050565b611d5183838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508d92508991508a9050610a5b565b90985096505b5050505050509250929050565b600080611d70856126b6565b91509150816001600160a01b0316836001600160a01b031614611dd65785604051631101335b60e11b81526004016106ce9181526040602082018190526014908201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b606082015260800190565b8015611e2e5785604051631101335b60e11b81526004016106ce9181526040602082018190526017908201527f414132322065787069726564206f72206e6f7420647565000000000000000000606082015260800190565b6000611e39856126b6565b925090506001600160a01b03811615611e955786604051631101335b60e11b81526004016106ce9181526040602082018190526014908201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b606082015260800190565b8115611ef75786604051631101335b60e11b81526004016106ce9181526040602082018190526021908201527f41413332207061796d61737465722065787069726564206f72206e6f742064756060820152606560f81b608082015260a00190565b50505050505050565b604080518082018252600080825260208083018281526001600160a01b03959095168252819052919091206001015461010081046001600160701b03168252600160781b900463ffffffff1690915290565b6001600160a01b038216600090815260208190526040812080548290611f799085906134fc565b91829055509392505050565b61010081015161012082015160009190808203611fa3575092915050565b611faf82488301612709565b949350505050565b80518051602080840151928101516040519081526001600160a01b0390921692917f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e910160405180910390a350565b835160e081015181516020808801519301516040516001600160a01b039384169492909316927f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f916120739189908990899093845291151560208401526040830152606082015260800190565b60405180910390a450505050565b60608135602083013560006120a161209c6040870187613546565b612721565b905060006120b561209c6060880188613546565b9050608086013560a087013560c088013560006120d861209c60e08c018c613546565b604080516001600160a01b039a909a1660208b015289810198909852606089019690965250608087019390935260a086019190915260c085015260e08401526101008084019190915281518084039091018152610120909201905292915050565b60608415801561215157506001600160a01b0384163b155b15612190575060408051808201909152601981527f41413230206163636f756e74206e6f74206465706c6f79656400000000000000602082015261220c565b601482106121fb5760006121a7601482858761360d565b6121b091613637565b60601c9050803b6000036121f957505060408051808201909152601b81527f41413330207061796d6173746572206e6f74206465706c6f7965640000000000602082015261220c565b505b506040805160208101909152600081525b95945050505050565b61222260208301836133fe565b6001600160a01b03168152602082810135908201526001600160801b036080808401358281166060850152811c604084015260a084013560c0808501919091528401359182166101008401521c61012082015236600061228560e0850185613546565b909250905080156123085760348110156122e15760405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e644461746100000060448201526064016106ce565b6122eb8282612734565b60a086015260808501526001600160a01b031660e0840152610d9a565b600060e084018190526080840181905260a084015250505050565b8251805160009190612342888761233d60408b018b613546565b61279c565b60e082015160006001600160a01b038216612386576001600160a01b03831660009081526020819052604090205487811161237f57808803612382565b60005b9150505b60208801516040516306608bdf60e21b81526001600160a01b038516916319822f7c9189916123bc918e91908790600401613884565b60206040518083038160008887f1935050505080156123f8575060408051601f3d908101601f191682019092526123f5918101906138a9565b60015b61242357896124086108006116c3565b6040516365c8fd4d60e01b81526004016106ce9291906138c2565b94506001600160a01b0382166124ad576001600160a01b03831660009081526020819052604090208054808911156124a7578b604051631101335b60e11b81526004016106ce9181526040602082018190526017908201527f41413231206469646e2774207061792070726566756e64000000000000000000606082015260800190565b88900390555b5050505095945050505050565b6001600160a01b038216600090815260016020908152604080832084821c80855292528220805484916001600160401b0383169190856124f98361358c565b909155501495945050505050565b60606000805a855160e08101516001600160a01b03811660009081526020819052604090208054939450919290919087811015612590578a604051631101335b60e11b81526004016106ce918152604060208201819052601e908201527f41413331207061796d6173746572206465706f73697420746f6f206c6f770000606082015260800190565b8781038260000181905550600084608001519050836001600160a01b03166352b7512c828d8d602001518d6040518563ffffffff1660e01b81526004016125d993929190613884565b60006040518083038160008887f19350505050801561261a57506040513d6000823e601f3d908101601f1916820160405261261791908101906138ff565b60015b612645578b61262a6108006116c3565b6040516365c8fd4d60e01b81526004016106ce92919061397f565b9098509650805a8703111561190c578b604051631101335b60e11b81526004016106ce9181526040602082018190526027908201527f41413336206f766572207061796d6173746572566572696669636174696f6e47606082015266185cd31a5b5a5d60ca1b608082015260a00190565b600080826000036126cc57506000928392509050565b60006126d784612a4f565b9050806040015165ffffffffffff164211806126fe5750806020015165ffffffffffff1642105b905194909350915050565b6000818310612718578161271a565b825b9392505050565b6000604051828085833790209392505050565b60008080612745601482868861360d565b61274e91613637565b60601c61275f60246014878961360d565b612768916139bc565b60801c61277960346024888a61360d565b612782916139bc565b9194506001600160801b0316925060801c90509250925092565b8015610d9a578251516001600160a01b0381163b156128075784604051631101335b60e11b81526004016106ce918152604060208201819052601f908201527f414131302073656e64657220616c726561647920636f6e737472756374656400606082015260800190565b600061281b6006546001600160a01b031690565b6001600160a01b031663570e1a3686600001516040015186866040518463ffffffff1660e01b81526004016128519291906139f3565b60206040518083038160008887f1158015612870573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128959190613a07565b90506001600160a01b0381166128f75785604051631101335b60e11b81526004016106ce918152604060208201819052601b908201527f4141313320696e6974436f6465206661696c6564206f72204f4f470000000000606082015260800190565b816001600160a01b0316816001600160a01b0316146129615785604051631101335b60e11b81526004016106ce91815260406020808301829052908201527f4141313420696e6974436f6465206d7573742072657475726e2073656e646572606082015260800190565b806001600160a01b03163b6000036129c45785604051631101335b60e11b81526004016106ce91815260406020808301829052908201527f4141313520696e6974436f6465206d757374206372656174652073656e646572606082015260800190565b60006129d3601482868861360d565b6129dc91613637565b60601c9050826001600160a01b031686602001517fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d83896000015160e00151604051612a3e9291906001600160a01b0392831681529116602082015260400190565b60405180910390a350505050505050565b60408051606081018252600080825260208201819052918101919091528160a081901c65ffffffffffff8116600003612a8b575065ffffffffffff5b604080516060810182526001600160a01b03909316835260d09490941c602083015265ffffffffffff16928101929092525090565b604051806101000160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001606081525090565b6040518060a00160405280612b446040518060a0016040528060008152602001600081526020016000815260200160008152602001606081525090565b8152602001612b66604051806040016040528060008152602001600081525090565b8152602001612b88604051806040016040528060008152602001600081525090565b8152602001612baa604051806040016040528060008152602001600081525090565b8152602001612bb7612c54565b905290565b6040518060a00160405280612c2f60405180610140016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b0316815260200160008152602001600081525090565b8152602001600080191681526020016000815260200160008152602001600081525090565b604051806040016040528060006001600160a01b03168152602001612bb7604051806040016040528060008152602001600081525090565b600060208284031215612c9e57600080fd5b813563ffffffff8116811461271a57600080fd5b60008083601f840112612cc457600080fd5b5081356001600160401b03811115612cdb57600080fd5b6020830191508360208260051b8501011115612cf657600080fd5b9250929050565b60008060008060008060608789031215612d1657600080fd5b86356001600160401b0380821115612d2d57600080fd5b612d398a838b01612cb2565b90985096506020890135915080821115612d5257600080fd5b612d5e8a838b01612cb2565b90965094506040890135915080821115612d7757600080fd5b50612d8489828a01612cb2565b979a9699509497509295939492505050565b60005b83811015612db1578181015183820152602001612d99565b50506000910152565b60008151808452612dd2816020860160208601612d96565b601f01601f19169290920160200192915050565b805182526020810151151560208301526000604082015160606040850152611faf6060850182612dba565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015612e6857603f19888603018452612e56858351612de6565b94509285019290850190600101612e3a565b5092979650505050505050565b80356001600160c01b0381168114610fe457600080fd5b600060208284031215612e9e57600080fd5b61271a82612e75565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715612edf57612edf612ea7565b60405290565b60405161014081016001600160401b0381118282101715612edf57612edf612ea7565b604051601f8201601f191681016001600160401b0381118282101715612f3057612f30612ea7565b604052919050565b60006001600160401b03821115612f5157612f51612ea7565b50601f01601f191660200190565b600082601f830112612f7057600080fd5b8135612f83612f7e82612f38565b612f08565b818152846020838601011115612f9857600080fd5b816020850160208301376000918101602001919091529392505050565b6001600160a01b0381168114612fca57600080fd5b50565b8035610fe481612fb5565b600080600080848603610220811215612ff057600080fd5b85356001600160401b038082111561300757600080fd5b61301389838a01612f5f565b9650601f19830192506101c091508183121561302e57600080fd5b613036612ebd565b6101408085121561304657600080fd5b61304e612ee5565b945061305c60208b01612fcd565b855260408a0135602086015260608a0135604086015260808a0135606086015260a08a0135608086015260c08a013560a086015260e08a013560c08601526101006130a8818c01612fcd565b60e08701526101208b81013591870191909152908a013590850152928352610160880135602084015261018088013560408401526101a088013560608401528188013560808401529194506101e0870135918083111561310757600080fd5b505061311587828801612f5f565b94979396509394610200013593505050565b6000806020838503121561313a57600080fd5b82356001600160401b0381111561315057600080fd5b61315c85828601612cb2565b90969095509350505050565b6000610100825184526020830151602085015260408301516040850152606083015160608501526080830151608085015260a083015160a085015260c0830151151560c085015260e08301518160e086015261220c82860182612dba565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015612e6857603f1988860301845261320b858351613168565b945092850192908501906001016131ef565b6000806040838503121561323057600080fd5b823561323b81612fb5565b915061324960208401612e75565b90509250929050565b6000806040838503121561326557600080fd5b823561327081612fb5565b946020939093013593505050565b6000610120828403121561329157600080fd5b50919050565b6000602082840312156132a957600080fd5b81356001600160401b038111156132bf57600080fd5b611faf8482850161327e565b60208152600061271a6020830184613168565b80516101408084528151908401526020810151610160840152604081015161018084015260608101516101a08401526080015160a06101c084015260009061332a6101e0850182612dba565b90506020830151613348602086018280518252602090810151910152565b5060408301518051606086015260208101516080860152506060830151805160a0860152602081015160c0860152506080830151610c4560e086018280516001600160a01b031682526020908101518051828401520151604090910152565b600060208083016020845280855180835260408601915060408160051b87010192506020870160005b82811015612e6857603f198886030184526133ec8583516132de565b945092850192908501906001016133d0565b60006020828403121561341057600080fd5b813561271a81612fb5565b60208152600061271a6020830184612de6565b60208152600061271a60208301846132de565b6000806000806060858703121561345757600080fd5b84356001600160401b038082111561346e57600080fd5b61347a8883890161327e565b95506020870135915061348c82612fb5565b909350604086013590808211156134a257600080fd5b818701915087601f8301126134b657600080fd5b8135818111156134c557600080fd5b8860208285010111156134d757600080fd5b95989497505060200194505050565b634e487b7160e01b600052601160045260246000fd5b80820180821115610c4957610c496134e6565b634e487b7160e01b600052603260045260246000fd5b6000823561011e1983360301811261353c57600080fd5b9190910192915050565b6000808335601e1984360301811261355d57600080fd5b8301803591506001600160401b0382111561357757600080fd5b602001915036819003821315612cf657600080fd5b60006001820161359e5761359e6134e6565b5060010190565b634e487b7160e01b600052601260045260246000fd5b828152604060208201526000611faf6040830184612dba565b81810381811115610c4957610c496134e6565b65ffffffffffff818116838216019080821115613606576136066134e6565b5092915050565b6000808585111561361d57600080fd5b8386111561362a57600080fd5b5050820193919092039150565b6bffffffffffffffffffffffff1981358181169160148510156136645780818660140360031b1b83161692505b505092915050565b8183823760009101908152919050565b634e487b7160e01b600052602160045260246000fd5b6000600386106136b257634e487b7160e01b600052602160045260246000fd5b858252608060208301526136c96080830186612dba565b6040830194909452506060015292915050565b8082028115828204841417610c4957610c496134e6565b60008261371057634e487b7160e01b600052601260045260246000fd5b500490565b6000808335601e1984360301811261372c57600080fd5b83016020810192503590506001600160401b0381111561374b57600080fd5b803603821315612cf657600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006101206137a28461379585612fcd565b6001600160a01b03169052565b602083013560208501526137b96040840184613715565b8260408701526137cc838701828461375a565b925050506137dd6060840184613715565b85830360608701526137f083828461375a565b925050506080830135608085015260a083013560a085015260c083013560c085015261381f60e0840184613715565b85830360e087015261383283828461375a565b9250505061010061384581850185613715565b8684038388015261385784828461375a565b979650505050505050565b6040815260006138756040830185613783565b90508260208301529392505050565b6060815260006138976060830186613783565b60208301949094525060400152919050565b6000602082840312156138bb57600080fd5b5051919050565b82815260606020820152600d60608201526c10504c8cc81c995d995c9d1959609a1b608082015260a060408201526000611faf60a0830184612dba565b6000806040838503121561391257600080fd5b82516001600160401b0381111561392857600080fd5b8301601f8101851361393957600080fd5b8051613947612f7e82612f38565b81815286602083850101111561395c57600080fd5b61396d826020830160208601612d96565b60209590950151949694955050505050565b82815260606020820152600d60608201526c10504cccc81c995d995c9d1959609a1b608082015260a060408201526000611faf60a0830184612dba565b6fffffffffffffffffffffffffffffffff1981358181169160108510156136645760109490940360031b84901b1690921692915050565b602081526000611faf60208301848661375a565b600060208284031215613a1957600080fd5b815161271a81612fb556fea2646970667358221220c6ad4b2b56624cba321cec929c4bdd6329f5811c936f40e8ff5cfb92ef9b433f64736f6c63430008170033608060405234801561001057600080fd5b506101f3806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063570e1a3614610030575b600080fd5b61004361003e3660046100ec565b61005f565b6040516001600160a01b03909116815260200160405180910390f35b60008061006f601482858761015e565b61007891610188565b60601c9050600061008c846014818861015e565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525084519495509360209350849250905082850182875af190506000519350806100e357600093505b50505092915050565b600080602083850312156100ff57600080fd5b823567ffffffffffffffff8082111561011757600080fd5b818501915085601f83011261012b57600080fd5b81358181111561013a57600080fd5b86602082850101111561014c57600080fd5b60209290920196919550909350505050565b6000808585111561016e57600080fd5b8386111561017b57600080fd5b5050820193919092039150565b6bffffffffffffffffffffffff1981358181169160148510156101b55780818660140360031b1b83161692505b50509291505056fea2646970667358221220f5d91be997c659d0ef966f0c016a41e736500c794f93ad11197e128a54287a9964736f6c63430008170033" + "0x60808060405234608257613b908181016001600160401b03811183821017606c5782916103ff833903906000f08015606057600080546001600160a01b0319166001600160a01b039290921691909117905560405161037790816100888239f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c63c18f52261461002757600080fd5b34610281576040366003190112610281576004356001600160a01b038116908190036102815760243567ffffffffffffffff81116102815736602382011215610281578060040135610078816102be565b91610086604051938461029c565b8183526024602084019260051b820101903682116102815760248101925b82841061020957845185876100b8836102be565b926100c6604051948561029c565b8084526100d5601f19916102be565b0160005b8181106101f857505060005b825181101561019057600190606060008061013b858060a01b0382541661014961010f878b610317565b51604051938491602083019463428557b160e11b865260248401526040604484015260648301906102d6565b03601f19810184528361029c565b82885a935193f115610172575b6101608287610317565b5261016b8186610317565b50016100e5565b503d604051906020818301016040528082526000602083013e610156565b836040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106101c957505050500390f35b919360019193955060206101e88192603f198a820301865288516102d6565b96019201920185949391926101ba565b8060606020809388010152016100d9565b833567ffffffffffffffff8111610281578201366043820112156102815760248101359167ffffffffffffffff831161028657604051610253601f8501601f19166020018261029c565b83815236604484860101116102815760006020858196604483970183860137830101528152019301926100a4565b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761028657604052565b67ffffffffffffffff81116102865760051b60200190565b919082519283825260005b848110610302575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016102e1565b805182101561032b5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220188cb9342176e096561b856f8b3751f67e4246534755fbbec3b1c61b597809e164736f6c634300081a003360c080604052346100cc5760016002556101888181016001600160401b038111838210176100b6578291613a08833903906000f080156100aa576080523060a0526100486100d1565b600081526020810190600082528060206100606100d1565b600081520152600380546001600160a01b0319169055516004555160055560405161391790816100f1823960805181505060a0518181816108ef01528181611d4a0152611ec10152f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b60408051919082016001600160401b038111838210176100b65760405256fe60806040526004361015610023575b361561001957600080fd5b610021612485565b005b60003560e01c80630396cb60146101835780630bd28e3b1461017e5780630da82661146101795780630dbfc6bd146101745780630f019dea1461016f5780631b2e01b81461016a578063205c28781461016557806322cdde4c14610160578063263934db1461015b57806330ec25d11461015657806335567e1a14610151578063444034731461014c5780635287ce12146101475780635787f48b146101425780635895273b1461013d57806370a0823114610138578063b760faf914610133578063bb9fe6bf1461012e578063c23a5cea14610129578063c3bce00914610124578063fc7e286d1461011f5763fe2171cb0361000e5761130a565b61127f565b611252565b611150565b61104e565b611023565b610fe6565b610fb1565b610f2c565b610dee565b610d71565b610d08565b610c8a565b610b7c565b610b5c565b610a3e565b6109db565b61083d565b610779565b610554565b610360565b60203660031901126103455760043563ffffffff811690818103610345576103407fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01916103226102436102336101eb3360018060a01b03166000526000602052604060002090565b966101f781151561135f565b61022460018901549161021d6102148463ffffffff9060781c1690565b63ffffffff1690565b11156113ab565b60081c6001600160701b031690565b6001600160701b0334911661142a565b9461024f861515611437565b6102626001600160701b03871115611478565b5461026b61045e565b908152600160208201526001600160701b038616604082015263ffffffff8316606082015260006080820181905233815260208190526040902081518155602082015160019091018054604084015160608501516080909501516001600160c81b031990921660ff941515949094169390931760089390931b6effffffffffffffffffffffffffff00169290921760789390931b63ffffffff60781b169290921760989190911b65ffffffffffff60981b16179055565b6040805194855263ffffffff90911660208501523393918291820190565b0390a2005b600080fd5b602435906001600160c01b038216820361034557565b34610345576020366003190112610345576004356001600160c01b0381168103610345573360009081526001602090815260408083206001600160c01b039094168352929052206103b181546114b5565b9055005b634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b038211176103e657604052565b6103b5565b604081019081106001600160401b038211176103e657604052565b606081019081106001600160401b038211176103e657604052565b61014081019081106001600160401b038211176103e657604052565b90601f801991011681019081106001600160401b038211176103e657604052565b6040519061046d60a08361043d565b565b6040519061046d6101408361043d565b6040519061046d60608361043d565b6040519061046d6101008361043d565b6040519061046d60408361043d565b6001600160401b0381116103e657601f01601f191660200190565b9291926104d4826104ad565b916104e2604051938461043d565b829481845281830111610345578281602093846000960137010152565b9080601f830112156103455781602061051a933591016104c8565b90565b6001600160a01b0381160361034557565b6024359061046d8261051d565b610104359061046d8261051d565b359061046d8261051d565b3461034557610220366003190112610345576004356001600160401b038111610345576105859036906004016104ff565b3660231901906101c0821261034557610140604051926105a4846103cb565b12610345576105b161046f565b6105b961052e565b815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260e43560c08201526105f361053b565b60e0820152610124356101008201526101443561012082015282526101643560208301526101843560408301526101a43560608301526101c43560808301526101e435916001600160401b038311610345576106566106619336906004016104ff565b9061020435926114db565b60408051928352602083019190915290f35b0390f35b9181601f84011215610345578235916001600160401b038311610345576020808501948460051b01011161034557565b602060031982011261034557600435906001600160401b038211610345576106d191600401610677565b9091565b60005b8381106106e85750506000910152565b81810151838201526020016106d8565b90602091610711815180928185528580860191016106d5565b601f01601f1916010190565b9061010060e061051a93805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c0810151151560c08501520151918160e082015201906106f8565b346103455761079061078a366106a7565b9061171d565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106107c857505050500390f35b919360019193955060206107e78192603f198a8203018652885161071d565b96019201920185949391926107b9565b9181601f84011215610345578235916001600160401b038311610345576020838186019501011161034557565b60409061051a93921515815281602082015201906106f8565b346103455760803660031901126103455760043561085a8161051d565b6024356108668161051d565b6044356001600160401b038111610345576108859036906004016107f7565b926108c0606435936108b2600095606097604051968794634440347360e01b602087015260248601611785565b03601f19810184528361043d565b6001600160a01b0316803b156103455760405163428557b160e11b8152916000918391829084908290610920907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600484016117b0565b03925af190816109c0575b506109bb57505061093a6117f3565b61094c6109478251611823565b61186a565b9060045b815181101561099557806109776109696001938561189c565b516001600160f81b03191690565b61098e61098383611823565b9160001a918661189c565b5301610950565b50506109aa90602080825183010191016118ef565b905b61067360405192839283610824565b6109ac565b806109cf60006109d59361043d565b80611043565b3861092b565b34610345576040366003190112610345576020610a356004356109fd8161051d565b610a0561034a565b6001600160a01b0390911660009081526001845260408082206001600160c01b0390931682526020929092522090565b54604051908152f35b3461034557604036600319011261034557600435610a5b8161051d565b602435336000526000602052604060002091825492838311610ae3576000808481948294610a8c610021988a611841565b9055604080516001600160a01b03831681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a26001600160a01b03165af1610add6117f3565b50611925565b60405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606490fd5b602060031982011261034557600435906001600160401b038211610345576101209082900360031901126103455760040190565b34610345576020610b74610b6f36610b28565b611966565b604051908152f35b3461034557610673610bbd610bb1610bb7610b96366106a7565b809391610ba161161d565b50610bab82611671565b5061171d565b91611832565b90611709565b5160405191829160208352602083019061071d565b9061051a9060e06080610c24818651610140865280516101408701526020810151610160870152604081015161018087015260608101516101a0870152015160a06101c08601526101e08501906106f8565b60208087015180518683015201516040850152946040810151805160608601526020015160808501526060810151805160a08601526020015160c0850152015191019080516001600160a01b031682526020908101518051828401520151604090910152565b3461034557610ca1610c9b366106a7565b90611af7565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b828210610cd957505050500390f35b91936001919395506020610cf88192603f198a82030186528851610bd2565b9601920192018594939192610cca565b34610345576040366003190112610345576020600435610d278161051d565b610d2f61034a565b6001600160a01b0390911660009081526001835260408082206001600160c01b03841683526020529020546040805192901b67ffffffffffffffff1916178152f35b3461034557606036600319011261034557600435610d8e8161051d565b6024356001600160401b0381116103455760009182610db2819336906004016107f7565b919092610dbe60443590565b9383604051948592833781018381520393f1610dd86117f3565b9015610de057005b805190811561034557602001fd5b3461034557602036600319011261034557600435610e0b8161051d565b60006080604051610e1b816103cb565b828152826020820152826040820152826060820152015260018060a01b031660005260006020526106736040600020610eaa65ffffffffffff600160405193610e63856103cb565b80548552015460ff8116151560208501526001600160701b038160081c16604085015263ffffffff8160781c16606085015260981c16608083019065ffffffffffff169052565b60405191829182919091608065ffffffffffff8160a0840195805185526020810151151560208601526001600160701b03604082015116604086015263ffffffff6060820151166060860152015116910152565b6080604061051a936020845280516020850152602081015115158285015201519160608082015201906106f8565b346103455760c0366003190112610345576004356001600160401b03811161034557610f5c903690600401610677565b906024356001600160401b03811161034557606060031982360301126103455761067392610fa592604435610f908161051d565b606435916084359360a4359560040191611cac565b60405191829182610efe565b3461034557610673610fd2610fc536610b28565b610fcd61161d565b61200b565b60405191829160208352602083019061071d565b34610345576020366003190112610345576004356110038161051d565b60018060a01b031660005260006020526020604060002054604051908152f35b60203660031901126103455761002160043561103e8161051d565b6120bc565b600091031261034557565b34610345576000366003190112610345573360005260006020526001604060002001805463ffffffff8160781c161561111e576110ba6110ac610214836110a061109b6110e19660ff1690565b612112565b60781c63ffffffff1690565b65ffffffffffff4216612152565b825460ff65ffffffffffff60981b01191665ffffffffffff60981b609883901b1617909255565b60405165ffffffffffff909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a908060208101610340565b60405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606490fd5b346103455760203660031901126103455761002160008080806004356111758161051d565b336000908152602081905260409020600101906111fd8254926111ec65ffffffffffff6111d86111be6111b2886001600160701b039060081c1690565b6001600160701b031690565b966111ca881515612170565b60981c65ffffffffffff1690565b166111e48115156121b3565b4210156121ff565b8054610100600160c81b0319169055565b604080516001600160a01b03831681526020810184905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a26001600160a01b03165af161124c6117f3565b5061224b565b346103455761067361126b61126636610b28565b61231f565b604051918291602083526020830190610bd2565b346103455760203660031901126103455760043561129c8161051d565b6001600160a01b031660009081526020818152604091829020805460019190910154835191825260ff8116151592820192909252600882901c6001600160701b031692810192909252607881901c63ffffffff16606083015260981c65ffffffffffff16608082015260a090f35b346103455761132c61131b366106a7565b809291611326611a70565b50611af7565b600019820191821161135a576106739161134591611709565b51604051918291602083526020830190610bd2565b6113f7565b1561136657565b60405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c61790000000000006044820152606490fd5b156113b257565b60405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90611388820180921161135a57565b906001820180921161135a57565b9190820180921161135a57565b1561143e57565b60405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b6044820152606490fd5b1561147f57565b60405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b6044820152606490fd5b600019811461135a5760010190565b60409061051a9392815281602082015201906106f8565b91908051936060850151946114f3603f5a0260061c90565b61271060a0830151880101116115c1576106d1956000958051611523575b5050505a900360808201510192612520565b82516115419261153d9290916001600160a01b031661248e565b1590565b61154d575b8080611511565b9093506115586124a0565b805161156a575b505060019238611546565b602083810151835193909101516040516001600160a01b039094169391927f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201929182916115b791836114c4565b0390a3388061155f565b60408051631101335b60e11b8152600060048201526024810191909152600f60448201526e41413935206f7574206f662067617360881b6064820152608490fd5b0390fd5b6001600160401b0381116103e65760051b60200190565b6040519061010082018281106001600160401b038211176103e657604052606060e08360008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152565b9061167b82611606565b611688604051918261043d565b8281528092611699601f1991611606565b019060005b8281106116aa57505050565b6020906116b561161d565b8282850101520161169e565b634e487b7160e01b600052603260045260246000fd5b90359061011e1981360301821215610345570190565b908210156117045761051a9160051b8101906116d7565b6116c1565b80518210156117045760209160051b010190565b61172682611671565b9160005b8181106117375750505090565b80611748610fc560019385876116ed565b6117528287611709565b5261175d8186611709565b500161172a565b908060209392818452848401376000828201840152601f01601f1916010190565b949392916040926117ab9260018060a01b03168752606060208801526060870191611764565b930152565b6001600160a01b03909116815260406020820181905261051a929101906106f8565b6040513d6000823e3d90fd5b604051906117ed60208361043d565b60008252565b3d1561181e573d90611804826104ad565b91611812604051938461043d565b82523d6000602084013e565b606090565b60031981019190821161135a57565b60001981019190821161135a57565b9190820391821161135a57565b6040519061185d60208361043d565b6000808352366020840137565b90611874826104ad565b611881604051918261043d565b8281528092611892601f19916104ad565b0190602036910137565b908151811015611704570160200190565b81601f820112156103455780516118c3816104ad565b926118d1604051948561043d565b818452602082840101116103455761051a91602080850191016106d5565b9190916040818403126103455780518015158103610345579260208201516001600160401b0381116103455761051a92016118ad565b1561192c57565b60405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606490fd5b6020810135611a2861197b6040840184611c49565b90816040519182372091611a1a6119956060860186611c49565b90816040519182372060c086013560a087013560808801356119c36119bd60e08b018b611c49565b9061360e565b604080519a356001600160a01b031660208c01908152908b019790975260608a0198909852608089019390935260a088019290925260c087019190915260e086015261010085019390935292918290610120820190565b03601f19810183528261043d565b51902060408051602081019283523091810191909152466060820152611a518160808101611a1a565b51902090565b60405190611a64826103eb565b60006020838281520152565b60405190611a7d826103cb565b81604051611a8a816103cb565b60008152600060208201526000604082015260006060820152606060808201528152611ab4611a57565b6020820152611ac1611a57565b6040820152611ace611a57565b6060820152608060405191611ae2836103eb565b60008352611aee611a57565b60208401520152565b611b0082611606565b91611b0e604051938461043d565b808352601f19611b1d82611606565b0160005b818110611b6757505060005b818110611b3a5750505090565b80611b4b61126660019385876116ed565b611b558287611709565b52611b608186611709565b5001611b2d565b602090611b72611a70565b82828801015201611b21565b908092918237016000815290565b60405190611b9982610406565b606060408360008152600060208201520152565b60405190611bba826103cb565b6000608083604051611bcb81610421565b83815283602082015283604082015283606082015283838201528360a08201528360c08201528360e0820152836101008201528361012082015281528260208201528260408201528260608201520152565b91908110156117045760051b81013590605e1981360301821215610345570190565b3561051a8161051d565b903590601e198136030182121561034557018035906001600160401b0382116103455760200191813603831361034557565b6001600160a01b03918216815291166020820152608060408201819052909392916060916117ab91908601906106f8565b9694969591939295611cbc611b8c565b5060005b828110611f6857505050611cd483806116d7565b93611d14611cfc611cf5611cea60208801611c3f565b966040810190611c49565b36916104c8565b95611d05611bad565b90611d0f81612743565b612854565b5050506001600160a01b03841615611f3d5760008315611e955750600190611d48611d3d6117de565b989291935b8561142a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169881905b84611d818885611841565b10611e6a575a611d908861140d565b11611e4a5791869593918a95938c8b611daa858d9c61142a565b60011c9a8b996040519c8d938493630780cef560e11b85526004850193611dd094611c7b565b03815a6000948591f1988915611e4557600090819a611e1f575b5015611e0a57505050611dfc84611832565b95915b939092949591611d76565b93965094611e1991975061141c565b94611dff565b90611e3d929a503d8091833e611e35818361043d565b8101906118ef565b989038611dea565b6117d2565b637162685f60e11b60005260048290526024879052604483905260646000fd5b97509750509250509450611e8d9150611e8161047f565b93845215156020840152565b604082015290565b92505a9085848689611ebc5a604051630780cef560e11b8152958694859460048601611c7b565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1908115611e4557858092611f16575b5050611f0c611d489195935a90611841565b9498929193611d42565b611f0c9650611d48925090611f34913d8091833e611e35818361043d565b95909591611efa565b95505050505050611f4c61184e565b611f5461047f565b906000825260006020830152604082015290565b600190611f73611bad565b611f9e611f81838787611c1d565b91611f94611f8f84806116d7565b612743565b611d0f83806116d7565b50505060208101611fbd611fb182611c3f565b6001600160a01b031690565b156120045760009182611fde611fd38294611c3f565b926040810190611c49565b9190611fef60405180948193611b7e565b03925af150611ffc6117f3565b505b01611cc0565b5050611ffe565b50600280541461208b57600280556080612045612026611bad565b9261203081612743565b8361203b8183612854565b9491929093612b3b565b94909501519461205361048e565b958652602086015260408501526060840152608083015260a0820152600060c082015261207e61209c565b60e0820152906001600255565b633ee5aeb560e01b60005260046000fd5b604051906120ab60408361043d565b6002825261060f60f31b6020830152565b60015b6005811061210a57507f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206120f53484612db2565b6040519081526001600160a01b0390931692a2565b6001016120bf565b1561211957565b60405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b6044820152606490fd5b9065ffffffffffff8091169116019065ffffffffffff821161135a57565b1561217757565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b6044820152606490fd5b156121ba57565b60405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606490fd5b1561220657565b60405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606490fd5b1561225257565b60405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606490fd5b906014116103455790601490565b356bffffffffffffffffffffffff198116929190601482106122c5575050565b6bffffffffffffffffffffffff1960149290920360031b82901b16169150565b604051906122f2826103eb565b6003546001600160a01b0316825260405160208361230f836103eb565b6004548352600554828401520152565b612327611a70565b50612330611bad565b9061233a81612743565b6123448282612854565b509190926123528385612bda565b805160e0015161236f906001600160a01b0316612d46565b612d46565b81515190929061239f9061238b906001600160a01b0316612d46565b91612394611a57565b506040810190611c49565b9060148210612479576123c16123bb6123c79361236a93612297565b906122a5565b60601c90565b9160018060a01b0386169460808201519660606040840151930151926123eb61045e565b988952602089015260408801526060870152608086015261240a6122e5565b938015158061246e575b61243c575b5061242261045e565b948552602085015260408401526060830152608082015290565b90935061244881612d46565b61246261245361049e565b6001600160a01b039093168352565b60208201529238612419565b506001811415612414565b50506123c76000612d46565b61046d336120bc565b9060009283809360208451940192f190565b3d61080081116124c5575b604051906020818301016040528082526000602083013e90565b506108006124ab565b600311156124d857565b634e487b7160e01b600052602160045260246000fd5b909493929460038110156124d8576060926125169183526080602084015260808301906106f8565b9460408201520152565b9093916000935a9286519261253484612d88565b60e085015190916001600160a01b0390911690818061261c57505084516001600160a01b03169050925b5a8603019360a06060820151910151019060808901918251860390818111612607575b505084029160408901928351948186106000146125dd575050806125a66002926124ce565b036125c257505061046d925080956125bd81612ea4565b612dd9565b9150915061046d925a90039051019051856125bd8297612ea4565b9061046d9750809a94506125f692935080950390612db2565b50612600816124ce565b1590612e3f565b9195916064919003600a020401933880612581565b9491815161262c575b505061255e565b612635856124ce565b600285031561262557919098505a9160a0870151813b156103455784600091878361267c958f60405197889687958693637c627b2160e01b8552828d0291600486016124ee565b0393f19081612716575b5061270f57506020898101518a518051920151917ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f4792906001600160a01b03166126cd6124a0565b6040516001600160a01b039092169482916126e891836114c4565b0390a36127015a870360808b01510180998b6002612520565b50505b5a9003963880612625565b9750612704565b806109cf60006127259361043d565b38612686565b90604061051a926000815281602082015201906106f8565b6040516135a560f21b602082019081523060601b6022830152600160f81b6036830152601782526127cc92919061277b60378361043d565b60018060a01b0391519020166bffffffffffffffffffffffff60a01b60065416176006556127ac6040820182611c49565b916127c46127b982611c3f565b9160e0810190611c49565b939092612ee6565b80516127d55750565b604051631101335b60e11b8152908190611602906004830161272b565b156127f957565b60405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606490fd5b9060738202918083046073149015171561135a57565b90916000915a938051916128688382612ff1565b61287181611966565b60208301526040830151956128bd6effffffffffffffffffffffffffffff8860c08701511760608701511760808701511760a087015117610100870151176101208701511711156127f2565b6128e884610100604082015160608301510160808301510160a08301510160c0830151019101510290565b6128f6888286866000613135565b85519098906129179061153d906001600160a01b03166020890151906132ed565b6129f8575a8303116129a9576060905a60e096909601516001600160a01b0316612976575b61296a9360a061051a97948794608094604061296f9a015260608601525a9003910135019101525a90611841565b61283e565b6064900490565b965050928260808360a061051a976129978b61296f9961296a996000613398565b9b90959850935094975050935061293c565b60408051631101335b60e11b8152600060048201526024810191909152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152608490fd5b9035601e19823603018112156103455701602081359101916001600160401b03821161034557813603831361034557565b61051a91612a9681612a8984610549565b6001600160a01b03169052565b60208201356020820152612b2c612b20612ae7612acc612ab96040870187612a47565b6101206040880152610120870191611764565b612ad96060870187612a47565b908683036060880152611764565b6080850135608085015260a085013560a085015260c085013560c0850152612b1260e0860186612a47565b9085830360e0870152611764565b92610100810190612a47565b91610100818503910152611764565b905a90606081015190612b516060850185611c49565b600060038211612bd2575b6001600160e01b031916638dd7712f60e01b03612bc1575050612ba8612bbc6106d1956020840151604051938492638dd7712f60e01b6020850152604060248501526064840190612a78565b90604483015203601f19810183528261043d565b6114db565b6106d1955090612bbc9136916104c8565b508135612b5c565b612be390613529565b906001600160a01b0316612d0057612cb157612bfe90613529565b906001600160a01b0316612c6b57612c1257565b60408051631101335b60e11b8152600060048201526024810191909152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f742064756064820152606560f81b608482015260a490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b90612d4f611a57565b9160018060a01b0316600052600060205263ffffffff6001604060002001546001600160701b038160081c16845260781c166020830152565b610120610100820151910151808214612dae57480180821015612da9575090565b905090565b5090565b60018060a01b031660005260006020526040600020805491820180921161135a5781905590565b9190917f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f6080602083015192519460018060a01b0386511694602060018060a01b0360e089015116970151916040519283526000602084015260408301526060820152a4565b9060807f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f91602084015193519560018060a01b0387511695602060018060a01b0360e08a015116980151926040519384521515602084015260408301526060820152a4565b60208101519051907f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e60208060018060a01b03855116940151604051908152a3565b50929192159081612f9b575b50612f5e576014811015612f0b575b505061051a6117de565b601411610345573560601c3b15612f23573880612f01565b604051612f3160408261043d565b601b81527f41413330207061796d6173746572206e6f74206465706c6f7965640000000000602082015290565b5050604051612f6e60408261043d565b601981527f41413230206163636f756e74206e6f74206465706c6f79656400000000000000602082015290565b90503b1538612ef2565b15612fac57565b60405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606490fd5b6130769061300e61300182611c3f565b6001600160a01b03168452565b602081013560208401526130326080820135906001600160801b038260801c921690565b6060850152604084015260a081013560c084015261306060c0820135906001600160801b038260801c921690565b61010085015261012084015260e0810190611c49565b9081156130b25761309a8260e092613095603461046d97961015612fa5565b613619565b60a085015260808401526001600160a01b0316910152565b505060a081600060e0819401528260808201520152565b90816020910312610345575190565b6130f060409295949395606083526060830190612a78565b9460208201520152565b60a09061051a9392815260606020820152600d60608201526c10504c8cc81c995d995c9d1959609a1b608082015281604082015201906106f8565b949291939060206131bb9186519361318160e0613158875160018060a01b031690565b966131738b8d61316b6040890189611c49565b929091613677565b01516001600160a01b031690565b6001600160a01b0316159760009290896132af575b8401516040516306608bdf60e21b8152958694859360009385939291600485016130d8565b03926001600160a01b03881690f16000918161327e575b506131fd57856131e06124a0565b6040516365c8fd4d60e01b815291829161160291600484016130fa565b94929361320957505050565b6001600160a01b03166000908152602081905260409020918254908183116132315750039055565b60408051631101335b60e11b815260048101929092526024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152608490fd5b6132a191925060203d6020116132a8575b613299818361043d565b8101906130c9565b90386131d2565b503d61328f565b6001600160a01b038716600090815260208190526040902090935054878111156132e25750600084815b94915050613196565b8460009189036132d9565b6001600160a01b0316600090815260016020908152604080832084821c845290915290208054916001600160401b0391613326846114b5565b9055161490565b91906040838203126103455782516001600160401b038111610345576020916133579185016118ad565b92015190565b60a09061051a9392815260606020820152600d60608201526c10504cccc81c995d995c9d1959609a1b608082015281604082015201906106f8565b929390915a815160e08101516001600160a01b031660008181526020819052604090209295909290919080548981106134da5760206080600096948c96946134039c9d8995039055015196015191604051998a95869485936314add44b60e21b8552600485016130d8565b03926001600160a01b031686f193846000916000966134b3575b50613448578561342b6124a0565b6040516365c8fd4d60e01b8152918291611602916004840161335d565b9491925a9003116134565750565b60408051631101335b60e11b815260048101929092526024820152602760448201527f41413336206f766572207061796d6173746572566572696669636174696f6e47606482015266185cd31a5b5a5d60ca1b608482015260a490fd5b9095506134d391503d806000833e6134cb818361043d565b81019061332d565b943861341d565b60408051631101335b60e11b8152600481018b90526024810191909152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152608490fd5b80156136055760006040805161353e81610406565b828152826020820152015265ffffffffffff8160a01c1680156135f8575b6135da906135c161357361357e6135738660d01c90565b65ffffffffffff1690565b9261359961358a61047f565b6001600160a01b039097168752565b6135af6020870194859065ffffffffffff169052565b65ffffffffffff166040860181905290565b42119081156135dd575b5091516001600160a01b031690565b91565b516135f0915065ffffffffffff16613573565b4210386135cb565b5065ffffffffffff61355c565b50600090600090565b816040519182372090565b9091826014116103455781359183602411610345576014810135936034116103455760609290921c92608090811c9260240135901c90565b90816020910312610345575161051a8161051d565b91602061051a938181520191611764565b92909181613686575b50505050565b8251516001600160a01b031693843b613894576006546000906020906136b4906001600160a01b0316611fb1565b60408751015160405180948193632b870d1b60e11b8352826136da8b8b60048401613666565b0393f1908115611e4557600091613865575b506001600160a01b038116958615613816576001600160a01b0316958690036137c7573b1561377a57506123c16123bb7fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d9361374793612297565b602083810151935160e00151604080516001600160a01b039485168152939091169183019190915290a338808080613680565b60408051631101335b60e11b815260048101929092526024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018490526024810191909152602060448201527f4141313420696e6974436f6465206d7573742072657475726e2073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018590526024810191909152601b60448201527f4141313320696e6974436f6465206661696c6564206f72204f4f4700000000006064820152608490fd5b613887915060203d60201161388d575b61387f818361043d565b810190613651565b386136ec565b503d613875565b60408051631101335b60e11b815260048101929092526024820152601f60448201527f414131302073656e64657220616c726561647920636f6e7374727563746564006064820152608490fdfea26469706673582212204bace728028e4808d0f0305687605c92acf3fb9a79388e9df617d0a21670961464736f6c634300081a00336080806040523460155761016d908161001b8239f35b600080fdfe6080600436101561000f57600080fd5b60003560e01c63570e1a361461002457600080fd5b346101325760203660031901126101325760043567ffffffffffffffff8111610132573660238201121561013257806004013567ffffffffffffffff8111610132573660248284010111610132576000928160141161012e5760131982019167ffffffffffffffff831161011a57600b8101601f19908116603f0116820167ffffffffffffffff8111838210176101065760246020959387600c819795829560405286845289840196603889018837830101525193013560601c5af1905190156100fe575b6040516001600160a01b039091168152602090f35b5060006100e9565b634e487b7160e01b86526041600452602486fd5b634e487b7160e01b85526041600452602485fd5b8380fd5b600080fdfea26469706673582212208d3d15f1a1651d00f2ed3b618a50717a7de16a758bd696cf961337d90cc7bf3764736f6c634300081a0033" diff --git a/src/types/interfaces.ts b/src/types/interfaces.ts index ba1a4b7e..9c607b20 100644 --- a/src/types/interfaces.ts +++ b/src/types/interfaces.ts @@ -1,4 +1,5 @@ import type { Address } from "viem" +import type { SimulateHandleOpResult } from "../rpc/estimation/types" import type { ReferencedCodeHashes } from "./mempool" import type { StateOverrides, @@ -7,13 +8,13 @@ import type { UserOperationV07 } from "./schemas" import type * as validation from "./validation" -import type { SimulateHandleOpResult } from "../rpc/estimation/types" export interface InterfaceValidator { getExecutionResult( userOperation: UserOperation, entryPoint: Address, queuedUserOperations: UserOperation[], + addSenderBalanceOverride: boolean, stateOverrides?: StateOverrides ): Promise> getValidationResultV06( diff --git a/src/types/schemas.ts b/src/types/schemas.ts index e8c90dc0..c8baec47 100644 --- a/src/types/schemas.ts +++ b/src/types/schemas.ts @@ -4,7 +4,7 @@ import type { MempoolUserOperation } from "./mempool" const hexDataPattern = /^0x[0-9A-Fa-f]*$/ const addressPattern = /^0x[0-9,a-f,A-F]{40}$/ -export const hexData32Pattern = /^0x([0-9a-fA-F][0-9a-fA-F]){0,32}$/ +export const hexData32Pattern = /^0x([0-9a-fA-F][0-9a-fA-F]){32}$/ export const commaSeperatedAddressPattern = /^(0x[0-9a-fA-F]{40})(,\s*(0x[0-9a-fA-F]{40}))*$/ @@ -235,8 +235,8 @@ const stateOverridesSchema = z.record( balance: hexNumberSchema.optional(), nonce: hexNumberSchema.optional(), code: hexDataSchema.optional(), - state: z.unknown().optional(), - stateDiff: z.unknown().optional() + state: z.record(hexData32Schema, hexData32Schema).optional(), + stateDiff: z.record(hexData32Schema, hexData32Schema).optional() }) ) diff --git a/src/utils/bigInt.ts b/src/utils/bigInt.ts index 8df024c0..ca40273f 100644 --- a/src/utils/bigInt.ts +++ b/src/utils/bigInt.ts @@ -8,10 +8,10 @@ export const maxBigInt = (a: bigint, b: bigint) => { return a > b ? a : b } -/// Increases a BigInt by a certain percentage. +/// Scale a BigInt by a certain percentage. export const scaleBigIntByPercent = ( value: bigint, percent: number ): bigint => { - return value + (value * BigInt(percent)) / BigInt(100) + return (value * BigInt(percent)) / 100n } diff --git a/src/utils/helpers.ts b/src/utils/helpers.ts index 5d070398..d24de8d5 100644 --- a/src/utils/helpers.ts +++ b/src/utils/helpers.ts @@ -1,8 +1,8 @@ import { type Address, - getAddress, BaseError, - type RawContractError + type RawContractError, + getAddress } from "viem" /// Ensure proper equality by converting both addresses into their checksum type diff --git a/src/utils/rpc-reply.ts b/src/utils/rpc-reply.ts index f175fcb1..72b11f41 100644 --- a/src/utils/rpc-reply.ts +++ b/src/utils/rpc-reply.ts @@ -1,5 +1,5 @@ import type { FastifyReply } from "fastify" -import * as WebSocket from "ws" +import type * as WebSocket from "ws" class RpcReply { private http: FastifyReply | null diff --git a/src/utils/userop.ts b/src/utils/userop.ts index cba42e5d..69fdf852 100644 --- a/src/utils/userop.ts +++ b/src/utils/userop.ts @@ -1,39 +1,39 @@ import { EntryPointV06Abi, - type UserOperationV06, + EntryPointV07Abi, + type GetUserOperationReceiptResponseResult, type HexData32, + type PackedUserOperation, type UserOperation, + type UserOperationV06, type UserOperationV07, - EntryPointV07Abi, - type PackedUserOperation, - type GetUserOperationReceiptResponseResult, logSchema, receiptSchema } from "@alto/types" import * as sentry from "@sentry/node" +import type { Logger } from "pino" import { type Address, type Hex, type PublicClient, + type TransactionReceipt, + concat, + decodeErrorResult, decodeEventLog, encodeAbiParameters, + encodeEventTopics, getAddress, keccak256, - toHex, - concat, - slice, pad, - decodeErrorResult, parseAbi, - encodeEventTopics, - zeroAddress, - type TransactionReceipt, - parseEventLogs + parseEventLogs, + slice, + toHex, + zeroAddress } from "viem" -import { areAddressesEqual } from "./helpers" -import type { Logger } from "pino" import { z } from "zod" import { fromZodError } from "zod-validation-error" +import { areAddressesEqual } from "./helpers" // Type predicate check if the UserOperation is V06. export function isVersion06( diff --git a/src/utils/validation.ts b/src/utils/validation.ts index 6b7beed0..98ac6fd2 100644 --- a/src/utils/validation.ts +++ b/src/utils/validation.ts @@ -1,6 +1,6 @@ +import type { GasPriceManager } from "@alto/handlers" import { type Address, - type ChainType, EntryPointV06Abi, EntryPointV07Abi, type PackedUserOperation, @@ -30,10 +30,10 @@ import { toBytes, toFunctionSelector } from "viem" -import { baseGoerli, baseSepolia, base } from "viem/chains" +import { base, baseGoerli, baseSepolia } from "viem/chains" +import { maxBigInt, minBigInt, scaleBigIntByPercent } from "./bigInt" import { isVersion06, toPackedUserOperation } from "./userop" -import { maxBigInt, minBigInt } from "./bigInt" -import type { GasPriceManager } from "@alto/handlers" +import type { AltoConfig } from "../createConfig" export interface GasOverheads { /** @@ -299,36 +299,41 @@ export function packUserOpV07(op: PackedUserOperation): `0x${string}` { ) } -export async function calcPreVerificationGas( - publicClient: PublicClient, - userOperation: UserOperation, - entryPoint: Address, - chainId: number, - chainType: ChainType, - gasPriceManager: GasPriceManager, - validate: boolean, // when calculating preVerificationGas for validation +export async function calcPreVerificationGas({ + config, + userOperation, + entryPoint, + gasPriceManager, + validate, + overheads +}: { + config: AltoConfig + userOperation: UserOperation + entryPoint: Address + gasPriceManager: GasPriceManager + validate: boolean // when calculating preVerificationGas for validation overheads?: GasOverheads -): Promise { +}): Promise { let preVerificationGas = calcDefaultPreVerificationGas( userOperation, overheads ) - if (chainId === 59140) { + if (config.publicClient.chain.id === 59140) { // linea sepolia preVerificationGas *= 2n - } else if (chainType === "op-stack") { + } else if (config.chainType === "op-stack") { preVerificationGas = await calcOptimismPreVerificationGas( - publicClient, + config.publicClient, userOperation, entryPoint, preVerificationGas, gasPriceManager, validate ) - } else if (chainType === "arbitrum") { + } else if (config.chainType === "arbitrum") { preVerificationGas = await calcArbitrumPreVerificationGas( - publicClient, + config.publicClient, userOperation, entryPoint, preVerificationGas, @@ -351,9 +356,10 @@ export function calcVerificationGasAndCallGasLimit( gasUsed: bigint } ) { - const verificationGasLimit = - ((executionResult.preOpGas - userOperation.preVerificationGas) * 3n) / - 2n + const verificationGasLimit = scaleBigIntByPercent( + executionResult.preOpGas - userOperation.preVerificationGas, + 150 + ) let gasPrice: bigint @@ -375,7 +381,7 @@ export function calcVerificationGasAndCallGasLimit( chainId === baseSepolia.id || chainId === base.id ) { - callGasLimit = (110n * callGasLimit) / 100n + callGasLimit = scaleBigIntByPercent(callGasLimit, 110) } return { verificationGasLimit, callGasLimit } diff --git a/test/e2e/alto-config.json b/test/e2e/alto-config.json index b902497a..77d8d105 100644 --- a/test/e2e/alto-config.json +++ b/test/e2e/alto-config.json @@ -4,7 +4,7 @@ "enable-debug-endpoints": true, "entrypoints": "0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789,0x0000000071727De22E5E9d8BAf0edAc6f37da032", "balance-override-enabled": "true", - "entrypoint-simulation-contract": "0xAE6035bEE0802C969265C8A3193CE8878c99A66A", + "entrypoint-simulation-contract": "0xBbe8A301FbDb2a4CD58c4A37c262ecef8f889c47", "api-version": "v1,v2", "rpc-url": "http://anvil:8545", "min-balance": "0", @@ -19,7 +19,6 @@ "public-client-log-level": "error", "wallet-client-log-level": "error", "polling-interval": 100, - "network-name": "0.0.0.0", "mempool-max-parallel-ops": 10, "mempool-max-queued-ops": 10, "enforce-unique-senders-per-bundle": false, diff --git a/test/e2e/deploy-contracts/constants.ts b/test/e2e/deploy-contracts/constants.ts index 16095272..07f68fc7 100644 --- a/test/e2e/deploy-contracts/constants.ts +++ b/test/e2e/deploy-contracts/constants.ts @@ -10,9 +10,9 @@ export const ENTRY_POINT_V07_CREATECALL: Hex = export const SIMPLE_ACCOUNT_FACTORY_V07_CREATECALL: Hex = "0x000000000000000000000000000000000000000000000000000000000000000060a060405234801561001057600080fd5b506040516129e13803806129e183398101604081905261002f91610088565b8060405161003c9061007b565b6001600160a01b039091168152602001604051809103906000f080158015610068573d6000803e3d6000fd5b506001600160a01b0316608052506100b8565b612011806109d083390190565b60006020828403121561009a57600080fd5b81516001600160a01b03811681146100b157600080fd5b9392505050565b6080516108f06100e060003960008181604b01528181610114015261025801526108f06000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806311464fbe146100465780635fbfb9cf146100965780638cb84e18146100a9575b600080fd5b61006d7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61006d6100a436600461039d565b6100bc565b61006d6100b736600461039d565b6101ee565b6000806100c984846101ee565b905073ffffffffffffffffffffffffffffffffffffffff81163b80156100f1575090506101e8565b60405173ffffffffffffffffffffffffffffffffffffffff8616602482015284907f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529181526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052516101b790610390565b6101c2929190610406565b8190604051809103906000f59050801580156101e2573d6000803e3d6000fd5b50925050505b92915050565b60006103578260001b6040518060200161020790610390565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe082820381018352601f90910116604081905273ffffffffffffffffffffffffffffffffffffffff871660248201527f000000000000000000000000000000000000000000000000000000000000000090604401604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152602080830180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fc4d66de800000000000000000000000000000000000000000000000000000000179052905161030093929101610406565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529082905261033c9291602001610474565b6040516020818303038152906040528051906020012061035e565b9392505050565b60006103578383306000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b610417806104a483390190565b600080604083850312156103b057600080fd5b823573ffffffffffffffffffffffffffffffffffffffff811681146103d457600080fd5b946020939093013593505050565b60005b838110156103fd5781810151838201526020016103e5565b50506000910152565b73ffffffffffffffffffffffffffffffffffffffff8316815260406020820152600082518060408401526104418160608501602087016103e2565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016060019392505050565b600083516104868184602088016103e2565b83519083019061049a8183602088016103e2565b0194935050505056fe608060405260405161041738038061041783398101604081905261002291610268565b61002c8282610033565b5050610352565b61003c82610092565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a280511561008657610081828261010e565b505050565b61008e610185565b5050565b806001600160a01b03163b6000036100cd57604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080846001600160a01b03168460405161012b9190610336565b600060405180830381855af49150503d8060008114610166576040519150601f19603f3d011682016040523d82523d6000602084013e61016b565b606091505b50909250905061017c8583836101a6565b95945050505050565b34156101a45760405163b398979f60e01b815260040160405180910390fd5b565b6060826101bb576101b682610205565b6101fe565b81511580156101d257506001600160a01b0384163b155b156101fb57604051639996b31560e01b81526001600160a01b03851660048201526024016100c4565b50805b9392505050565b8051156102155780518082602001fd5b604051630a12f52160e11b815260040160405180910390fd5b634e487b7160e01b600052604160045260246000fd5b60005b8381101561025f578181015183820152602001610247565b50506000910152565b6000806040838503121561027b57600080fd5b82516001600160a01b038116811461029257600080fd5b60208401519092506001600160401b03808211156102af57600080fd5b818501915085601f8301126102c357600080fd5b8151818111156102d5576102d561022e565b604051601f8201601f19908116603f011681019083821181831017156102fd576102fd61022e565b8160405282815288602084870101111561031657600080fd5b610327836020830160208801610244565b80955050505050509250929050565b60008251610348818460208701610244565b9190910192915050565b60b7806103606000396000f3fe6080604052600a600c565b005b60186014601a565b605e565b565b600060597f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b905090565b3660008037600080366000845af43d6000803e808015607c573d6000f35b3d6000fdfea2646970667358221220d7f23a80daebb5531c9e4a18d87e812fca112e5df7e56433218edcc12bbe415d64736f6c63430008170033a2646970667358221220f5be4d2659f1a124e46d76b875ad5264a1c62d421946ca067d6132fa6cc4309964736f6c6343000817003360c0604052306080523480156200001557600080fd5b50604051620020113803806200201183398101604081905262000038916200010a565b6001600160a01b03811660a0526200004f62000056565b506200013c565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff1615620000a75760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b0390811614620001075780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b6000602082840312156200011d57600080fd5b81516001600160a01b03811681146200013557600080fd5b9392505050565b60805160a051611e70620001a160003960008181610320015281816106f00152818161079e0152818161092601528181610b6301528181610baa01528181610d6a015261121e015260008181610f3301528181610f5c015261117d0152611e706000f3fe6080604052600436106101125760003560e01c80638da5cb5b116100a5578063bc197c8111610074578063c4d66de811610059578063c4d66de8146103c1578063d087d288146103e1578063f23a6e61146103f657600080fd5b8063bc197c8114610364578063c399ec88146103ac57600080fd5b80638da5cb5b14610269578063ad3cb1cc146102bb578063b0d691fe14610311578063b61d27f61461034457600080fd5b80634a58db19116100e15780634a58db19146102195780634d44560d146102215780634f1ef2861461024157806352d1902d1461025457600080fd5b806301ffc9a71461011e578063150b7a021461015357806319822f7c146101c957806347e1da2a146101f757600080fd5b3661011957005b600080fd5b34801561012a57600080fd5b5061013e61013936600461179b565b61043c565b60405190151581526020015b60405180910390f35b34801561015f57600080fd5b5061019861016e366004611848565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161014a565b3480156101d557600080fd5b506101e96101e43660046118bb565b610521565b60405190815260200161014a565b34801561020357600080fd5b50610217610212366004611954565b610547565b005b6102176106ee565b34801561022d57600080fd5b5061021761023c3660046119ee565b610794565b61021761024f366004611a49565b610843565b34801561026057600080fd5b506101e9610862565b34801561027557600080fd5b506000546102969073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161014a565b3480156102c757600080fd5b506103046040518060400160405280600581526020017f352e302e3000000000000000000000000000000000000000000000000000000081525081565b60405161014a9190611b4f565b34801561031d57600080fd5b507f0000000000000000000000000000000000000000000000000000000000000000610296565b34801561035057600080fd5b5061021761035f366004611ba0565b610891565b34801561037057600080fd5b5061019861037f366004611bfc565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b3480156103b857600080fd5b506101e96108e0565b3480156103cd57600080fd5b506102176103dc366004611cbb565b610997565b3480156103ed57600080fd5b506101e9610b16565b34801561040257600080fd5b50610198610411366004611cd8565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a020000000000000000000000000000000000000000000000000000000014806104cf57507fffffffff0000000000000000000000000000000000000000000000000000000082167f4e2312e000000000000000000000000000000000000000000000000000000000145b8061051b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f01ffc9a700000000000000000000000000000000000000000000000000000000145b92915050565b600061052b610b92565b6105358484610c33565b905061054082610ce7565b9392505050565b61054f610d52565b8481148015610565575082158061056557508281145b6105d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f77726f6e67206172726179206c656e677468730000000000000000000000000060448201526064015b60405180910390fd5b600083900361067c5760005b858110156106765761066e8787838181106105f9576105f9611d42565b905060200201602081019061060e9190611cbb565b600085858581811061062257610622611d42565b90506020028101906106349190611d71565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e1392505050565b6001016105dc565b506106e6565b60005b858110156106e4576106dc87878381811061069c5761069c611d42565b90506020020160208101906106b19190611cbb565b8686848181106106c3576106c3611d42565b9050602002013585858581811061062257610622611d42565b60010161067f565b505b505050505050565b7f00000000000000000000000000000000000000000000000000000000000000006040517fb760faf900000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff919091169063b760faf99034906024016000604051808303818588803b15801561077957600080fd5b505af115801561078d573d6000803e3d6000fd5b5050505050565b61079c610e90565b7f00000000000000000000000000000000000000000000000000000000000000006040517f205c287800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052919091169063205c287890604401600060405180830381600087803b15801561082f57600080fd5b505af11580156106e6573d6000803e3d6000fd5b61084b610f1b565b6108548261101f565b61085e8282611027565b5050565b600061086c611165565b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc90565b610899610d52565b6108da848484848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610e1392505050565b50505050565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906370a08231906024015b602060405180830381865afa15801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611dd6565b905090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000810460ff16159067ffffffffffffffff166000811580156109e25750825b905060008267ffffffffffffffff1660011480156109ff5750303b155b905081158015610a0d575080155b15610a44576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b84547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001660011785558315610aa55784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff16680100000000000000001785555b610aae866111d4565b83156106e65784547fffffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffff168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a1505050505050565b6040517f35567e1a0000000000000000000000000000000000000000000000000000000081523060048201526000602482018190529073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016906335567e1a90604401610951565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601c60248201527f6163636f756e743a206e6f742066726f6d20456e747279506f696e740000000060448201526064016105c7565b565b7f19457468657265756d205369676e6564204d6573736167653a0a3332000000006000908152601c829052603c8120610cae81610c74610100870187611d71565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061126892505050565b60005473ffffffffffffffffffffffffffffffffffffffff908116911614610cda57600191505061051b565b5060009392505050565b50565b8015610ce45760405160009033907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90849084818181858888f193505050503d806000811461078d576040519150601f19603f3d011682016040523d82523d6000602084013e61078d565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480610dad575060005473ffffffffffffffffffffffffffffffffffffffff1633145b610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f6163636f756e743a206e6f74204f776e6572206f7220456e747279506f696e7460448201526064016105c7565b6000808473ffffffffffffffffffffffffffffffffffffffff168484604051610e3c9190611def565b60006040518083038185875af1925050503d8060008114610e79576040519150601f19603f3d011682016040523d82523d6000602084013e610e7e565b606091505b50915091508161078d57805160208201fd5b60005473ffffffffffffffffffffffffffffffffffffffff16331480610eb557503330145b610c31576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600a60248201527f6f6e6c79206f776e65720000000000000000000000000000000000000000000060448201526064016105c7565b3073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161480610fe857507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16610fcf7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610c31576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ce4610e90565b8173ffffffffffffffffffffffffffffffffffffffff166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156110ac575060408051601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682019092526110a991810190611dd6565b60015b6110fa576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff831660048201526024016105c7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8114611156576040517faa1d49a4000000000000000000000000000000000000000000000000000000008152600481018290526024016105c7565b6111608383611292565b505050565b3073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001614610c31576040517fe07c8dba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff838116918217835560405191927f0000000000000000000000000000000000000000000000000000000000000000909116917f47e55c76e7a6f1fd8996a1da8008c1ea29699cca35e7bcd057f2dec313b6e5de9190a350565b60008060008061127886866112f5565b9250925092506112888282611342565b5090949350505050565b61129b82611446565b60405173ffffffffffffffffffffffffffffffffffffffff8316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28051156112ed576111608282611515565b61085e611598565b6000806000835160410361132f5760208401516040850151606086015160001a611321888285856115d0565b95509550955050505061133b565b50508151600091506002905b9250925092565b600082600381111561135657611356611e0b565b0361135f575050565b600182600381111561137357611373611e0b565b036113aa576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60028260038111156113be576113be611e0b565b036113f8576040517ffce698f7000000000000000000000000000000000000000000000000000000008152600481018290526024016105c7565b600382600381111561140c5761140c611e0b565b0361085e576040517fd78bce0c000000000000000000000000000000000000000000000000000000008152600481018290526024016105c7565b8073ffffffffffffffffffffffffffffffffffffffff163b6000036114af576040517f4c9c8ce300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201526024016105c7565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60606000808473ffffffffffffffffffffffffffffffffffffffff168460405161153f9190611def565b600060405180830381855af49150503d806000811461157a576040519150601f19603f3d011682016040523d82523d6000602084013e61157f565b606091505b509150915061158f8583836116ca565b95945050505050565b3415610c31576040517fb398979f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a084111561160b57506000915060039050826116c0565b604080516000808252602082018084528a905260ff891692820192909252606081018790526080810186905260019060a0016020604051602081039080840390855afa15801561165f573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166116b6575060009250600191508290506116c0565b9250600091508190505b9450945094915050565b6060826116df576116da82611759565b610540565b8151158015611703575073ffffffffffffffffffffffffffffffffffffffff84163b155b15611752576040517f9996b31500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff851660048201526024016105c7565b5080610540565b8051156117695780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000602082840312156117ad57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461054057600080fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610ce457600080fd5b60008083601f84011261181157600080fd5b50813567ffffffffffffffff81111561182957600080fd5b60208301915083602082850101111561184157600080fd5b9250929050565b60008060008060006080868803121561186057600080fd5b853561186b816117dd565b9450602086013561187b816117dd565b935060408601359250606086013567ffffffffffffffff81111561189e57600080fd5b6118aa888289016117ff565b969995985093965092949392505050565b6000806000606084860312156118d057600080fd5b833567ffffffffffffffff8111156118e757600080fd5b840161012081870312156118fa57600080fd5b95602085013595506040909401359392505050565b60008083601f84011261192157600080fd5b50813567ffffffffffffffff81111561193957600080fd5b6020830191508360208260051b850101111561184157600080fd5b6000806000806000806060878903121561196d57600080fd5b863567ffffffffffffffff8082111561198557600080fd5b6119918a838b0161190f565b909850965060208901359150808211156119aa57600080fd5b6119b68a838b0161190f565b909650945060408901359150808211156119cf57600080fd5b506119dc89828a0161190f565b979a9699509497509295939492505050565b60008060408385031215611a0157600080fd5b8235611a0c816117dd565b946020939093013593505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60008060408385031215611a5c57600080fd5b8235611a67816117dd565b9150602083013567ffffffffffffffff80821115611a8457600080fd5b818501915085601f830112611a9857600080fd5b813581811115611aaa57611aaa611a1a565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908382118183101715611af057611af0611a1a565b81604052828152886020848701011115611b0957600080fd5b8260208601602083013760006020848301015280955050505050509250929050565b60005b83811015611b46578181015183820152602001611b2e565b50506000910152565b6020815260008251806020840152611b6e816040850160208701611b2b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60008060008060608587031215611bb657600080fd5b8435611bc1816117dd565b935060208501359250604085013567ffffffffffffffff811115611be457600080fd5b611bf0878288016117ff565b95989497509550505050565b60008060008060008060008060a0898b031215611c1857600080fd5b8835611c23816117dd565b97506020890135611c33816117dd565b9650604089013567ffffffffffffffff80821115611c5057600080fd5b611c5c8c838d0161190f565b909850965060608b0135915080821115611c7557600080fd5b611c818c838d0161190f565b909650945060808b0135915080821115611c9a57600080fd5b50611ca78b828c016117ff565b999c989b5096995094979396929594505050565b600060208284031215611ccd57600080fd5b8135610540816117dd565b60008060008060008060a08789031215611cf157600080fd5b8635611cfc816117dd565b95506020870135611d0c816117dd565b94506040870135935060608701359250608087013567ffffffffffffffff811115611d3657600080fd5b6119dc89828a016117ff565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112611da657600080fd5b83018035915067ffffffffffffffff821115611dc157600080fd5b60200191503681900382131561184157600080fd5b600060208284031215611de857600080fd5b5051919050565b60008251611e01818460208701611b2b565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220646ccd794d1cd309da39b56bcfe1238dae05a9d8106dddf47fe099a78d7801e864736f6c634300081700330000000000000000000000000000000071727de22e5e9d8baf0edac6f37da032" -// Will deploy entryPointSimulations (required for V0.7) to 0xAE6035bEE0802C969265C8A3193CE8878c99A66A +// Will deploy entryPointSimulations (required for V0.7) to 0xBbe8A301FbDb2a4CD58c4A37c262ecef8f889c47 export const ENTRY_POINT_SIMULATIONS_CREATECALL: Hex = - "0x000000000000000000000000000000000000000000000000000000000000000060808060405234608257613b828181016001600160401b03811183821017606c5782916103ff833903906000f08015606057600080546001600160a01b0319166001600160a01b039290921691909117905560405161037790816100888239f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c63c18f52261461002757600080fd5b34610281576040366003190112610281576004356001600160a01b038116908190036102815760243567ffffffffffffffff81116102815736602382011215610281578060040135610078816102be565b91610086604051938461029c565b8183526024602084019260051b820101903682116102815760248101925b82841061020957845185876100b8836102be565b926100c6604051948561029c565b8084526100d5601f19916102be565b0160005b8181106101f857505060005b825181101561019057600190606060008061013b858060a01b0382541661014961010f878b610317565b51604051938491602083019463428557b160e11b865260248401526040604484015260648301906102d6565b03601f19810184528361029c565b82885a935193f115610172575b6101608287610317565b5261016b8186610317565b50016100e5565b503d604051906020818301016040528082526000602083013e610156565b836040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106101c957505050500390f35b919360019193955060206101e88192603f198a820301865288516102d6565b96019201920185949391926101ba565b8060606020809388010152016100d9565b833567ffffffffffffffff8111610281578201366043820112156102815760248101359167ffffffffffffffff831161028657604051610253601f8501601f19166020018261029c565b83815236604484860101116102815760006020858196604483970183860137830101528152019301926100a4565b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761028657604052565b67ffffffffffffffff81116102865760051b60200190565b919082519283825260005b848110610302575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016102e1565b805182101561032b5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea26469706673582212201244199039b2b0a6d5a53b57f2e9cb9758351b7b37d051717a76d47613efe56164736f6c634300081a003360c080604052346100cc5760016002556101888181016001600160401b038111838210176100b65782916139fa833903906000f080156100aa576080523060a0526100486100d1565b600081526020810190600082528060206100606100d1565b600081520152600380546001600160a01b0319169055516004555160055560405161390990816100f1823960805181505060a0518181816108ef01528181611d3c0152611eb30152f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b60408051919082016001600160401b038111838210176100b65760405256fe60806040526004361015610023575b361561001957600080fd5b610021612477565b005b60003560e01c80630396cb60146101835780630bd28e3b1461017e5780630da82661146101795780630dbfc6bd146101745780630f019dea1461016f5780631b2e01b81461016a578063205c28781461016557806322cdde4c14610160578063263934db1461015b57806330ec25d11461015657806335567e1a14610151578063444034731461014c5780635287ce12146101475780635787f48b146101425780635895273b1461013d57806370a0823114610138578063b760faf914610133578063bb9fe6bf1461012e578063c23a5cea14610129578063c3bce00914610124578063fc7e286d1461011f5763fe2171cb0361000e576112fc565b611271565b611244565b611142565b611040565b611015565b610fd8565b610fa3565b610f1e565b610de0565b610d71565b610d08565b610c8a565b610b7c565b610b5c565b610a3e565b6109db565b61083d565b610779565b610554565b610360565b60203660031901126103455760043563ffffffff811690818103610345576103407fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01916103226102436102336101eb3360018060a01b03166000526000602052604060002090565b966101f7811515611351565b61022460018901549161021d6102148463ffffffff9060781c1690565b63ffffffff1690565b111561139d565b60081c6001600160701b031690565b6001600160701b0334911661141c565b9461024f861515611429565b6102626001600160701b0387111561146a565b5461026b61045e565b908152600160208201526001600160701b038616604082015263ffffffff8316606082015260006080820181905233815260208190526040902081518155602082015160019091018054604084015160608501516080909501516001600160c81b031990921660ff941515949094169390931760089390931b6effffffffffffffffffffffffffff00169290921760789390931b63ffffffff60781b169290921760989190911b65ffffffffffff60981b16179055565b6040805194855263ffffffff90911660208501523393918291820190565b0390a2005b600080fd5b602435906001600160c01b038216820361034557565b34610345576020366003190112610345576004356001600160c01b0381168103610345573360009081526001602090815260408083206001600160c01b039094168352929052206103b181546114a7565b9055005b634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b038211176103e657604052565b6103b5565b604081019081106001600160401b038211176103e657604052565b606081019081106001600160401b038211176103e657604052565b61014081019081106001600160401b038211176103e657604052565b90601f801991011681019081106001600160401b038211176103e657604052565b6040519061046d60a08361043d565b565b6040519061046d6101408361043d565b6040519061046d60608361043d565b6040519061046d6101008361043d565b6040519061046d60408361043d565b6001600160401b0381116103e657601f01601f191660200190565b9291926104d4826104ad565b916104e2604051938461043d565b829481845281830111610345578281602093846000960137010152565b9080601f830112156103455781602061051a933591016104c8565b90565b6001600160a01b0381160361034557565b6024359061046d8261051d565b610104359061046d8261051d565b359061046d8261051d565b3461034557610220366003190112610345576004356001600160401b038111610345576105859036906004016104ff565b3660231901906101c0821261034557610140604051926105a4846103cb565b12610345576105b161046f565b6105b961052e565b815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260e43560c08201526105f361053b565b60e0820152610124356101008201526101443561012082015282526101643560208301526101843560408301526101a43560608301526101c43560808301526101e435916001600160401b038311610345576106566106619336906004016104ff565b9061020435926114cd565b60408051928352602083019190915290f35b0390f35b9181601f84011215610345578235916001600160401b038311610345576020808501948460051b01011161034557565b602060031982011261034557600435906001600160401b038211610345576106d191600401610677565b9091565b60005b8381106106e85750506000910152565b81810151838201526020016106d8565b90602091610711815180928185528580860191016106d5565b601f01601f1916010190565b9061010060e061051a93805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c0810151151560c08501520151918160e082015201906106f8565b346103455761079061078a366106a7565b9061170f565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106107c857505050500390f35b919360019193955060206107e78192603f198a8203018652885161071d565b96019201920185949391926107b9565b9181601f84011215610345578235916001600160401b038311610345576020838186019501011161034557565b60409061051a93921515815281602082015201906106f8565b346103455760803660031901126103455760043561085a8161051d565b6024356108668161051d565b6044356001600160401b038111610345576108859036906004016107f7565b926108c0606435936108b2600095606097604051968794634440347360e01b602087015260248601611777565b03601f19810184528361043d565b6001600160a01b0316803b156103455760405163428557b160e11b8152916000918391829084908290610920907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600484016117a2565b03925af190816109c0575b506109bb57505061093a6117e5565b61094c6109478251611815565b61185c565b9060045b815181101561099557806109776109696001938561188e565b516001600160f81b03191690565b61098e61098383611815565b9160001a918661188e565b5301610950565b50506109aa90602080825183010191016118e1565b905b61067360405192839283610824565b6109ac565b806109cf60006109d59361043d565b80611035565b3861092b565b34610345576040366003190112610345576020610a356004356109fd8161051d565b610a0561034a565b6001600160a01b0390911660009081526001845260408082206001600160c01b0390931682526020929092522090565b54604051908152f35b3461034557604036600319011261034557600435610a5b8161051d565b602435336000526000602052604060002091825492838311610ae3576000808481948294610a8c610021988a611833565b9055604080516001600160a01b03831681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a26001600160a01b03165af1610add6117e5565b50611917565b60405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606490fd5b602060031982011261034557600435906001600160401b038211610345576101209082900360031901126103455760040190565b34610345576020610b74610b6f36610b28565b611958565b604051908152f35b3461034557610673610bbd610bb1610bb7610b96366106a7565b809391610ba161160f565b50610bab82611663565b5061170f565b91611824565b906116fb565b5160405191829160208352602083019061071d565b9061051a9060e06080610c24818651610140865280516101408701526020810151610160870152604081015161018087015260608101516101a0870152015160a06101c08601526101e08501906106f8565b60208087015180518683015201516040850152946040810151805160608601526020015160808501526060810151805160a08601526020015160c0850152015191019080516001600160a01b031682526020908101518051828401520151604090910152565b3461034557610ca1610c9b366106a7565b90611ae9565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b828210610cd957505050500390f35b91936001919395506020610cf88192603f198a82030186528851610bd2565b9601920192018594939192610cca565b34610345576040366003190112610345576020600435610d278161051d565b610d2f61034a565b6001600160a01b0390911660009081526001835260408082206001600160c01b03841683526020529020546040805192901b67ffffffffffffffff1916178152f35b3461034557606036600319011261034557600435610d8e8161051d565b6024356001600160401b0381116103455760009182610db2819336906004016107f7565b9190926044359383604051948592833781018381520393f1610dd26117e5565b9015610dda57005b60208101fd5b3461034557602036600319011261034557600435610dfd8161051d565b60006080604051610e0d816103cb565b828152826020820152826040820152826060820152015260018060a01b031660005260006020526106736040600020610e9c65ffffffffffff600160405193610e55856103cb565b80548552015460ff8116151560208501526001600160701b038160081c16604085015263ffffffff8160781c16606085015260981c16608083019065ffffffffffff169052565b60405191829182919091608065ffffffffffff8160a0840195805185526020810151151560208601526001600160701b03604082015116604086015263ffffffff6060820151166060860152015116910152565b6080604061051a936020845280516020850152602081015115158285015201519160608082015201906106f8565b346103455760c0366003190112610345576004356001600160401b03811161034557610f4e903690600401610677565b906024356001600160401b03811161034557606060031982360301126103455761067392610f9792604435610f828161051d565b606435916084359360a4359560040191611c9e565b60405191829182610ef0565b3461034557610673610fc4610fb736610b28565b610fbf61160f565b611ffd565b60405191829160208352602083019061071d565b3461034557602036600319011261034557600435610ff58161051d565b60018060a01b031660005260006020526020604060002054604051908152f35b6020366003190112610345576100216004356110308161051d565b6120ae565b600091031261034557565b34610345576000366003190112610345573360005260006020526001604060002001805463ffffffff8160781c1615611110576110ac61109e6102148361109261108d6110d39660ff1690565b612104565b60781c63ffffffff1690565b65ffffffffffff4216612144565b825460ff65ffffffffffff60981b01191665ffffffffffff60981b609883901b1617909255565b60405165ffffffffffff909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a908060208101610340565b60405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606490fd5b346103455760203660031901126103455761002160008080806004356111678161051d565b336000908152602081905260409020600101906111ef8254926111de65ffffffffffff6111ca6111b06111a4886001600160701b039060081c1690565b6001600160701b031690565b966111bc881515612162565b60981c65ffffffffffff1690565b166111d68115156121a5565b4210156121f1565b8054610100600160c81b0319169055565b604080516001600160a01b03831681526020810184905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a26001600160a01b03165af161123e6117e5565b5061223d565b346103455761067361125d61125836610b28565b612311565b604051918291602083526020830190610bd2565b346103455760203660031901126103455760043561128e8161051d565b6001600160a01b031660009081526020818152604091829020805460019190910154835191825260ff8116151592820192909252600882901c6001600160701b031692810192909252607881901c63ffffffff16606083015260981c65ffffffffffff16608082015260a090f35b346103455761131e61130d366106a7565b809291611318611a62565b50611ae9565b600019820191821161134c5761067391611337916116fb565b51604051918291602083526020830190610bd2565b6113e9565b1561135857565b60405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c61790000000000006044820152606490fd5b156113a457565b60405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90611388820180921161134c57565b906001820180921161134c57565b9190820180921161134c57565b1561143057565b60405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b6044820152606490fd5b1561147157565b60405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b6044820152606490fd5b600019811461134c5760010190565b60409061051a9392815281602082015201906106f8565b91908051936060850151946114e5603f5a0260061c90565b61271060a0830151880101116115b3576106d1956000958051611515575b5050505a900360808201510192612512565b82516115339261152f9290916001600160a01b0316612480565b1590565b61153f575b8080611503565b90935061154a612492565b805161155c575b505060019238611538565b602083810151835193909101516040516001600160a01b039094169391927f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201929182916115a991836114b6565b0390a33880611551565b60408051631101335b60e11b8152600060048201526024810191909152600f60448201526e41413935206f7574206f662067617360881b6064820152608490fd5b0390fd5b6001600160401b0381116103e65760051b60200190565b6040519061010082018281106001600160401b038211176103e657604052606060e08360008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152565b9061166d826115f8565b61167a604051918261043d565b828152809261168b601f19916115f8565b019060005b82811061169c57505050565b6020906116a761160f565b82828501015201611690565b634e487b7160e01b600052603260045260246000fd5b90359061011e1981360301821215610345570190565b908210156116f65761051a9160051b8101906116c9565b6116b3565b80518210156116f65760209160051b010190565b61171882611663565b9160005b8181106117295750505090565b8061173a610fb760019385876116df565b61174482876116fb565b5261174f81866116fb565b500161171c565b908060209392818452848401376000828201840152601f01601f1916010190565b9493929160409261179d9260018060a01b03168752606060208801526060870191611756565b930152565b6001600160a01b03909116815260406020820181905261051a929101906106f8565b6040513d6000823e3d90fd5b604051906117df60208361043d565b60008252565b3d15611810573d906117f6826104ad565b91611804604051938461043d565b82523d6000602084013e565b606090565b60031981019190821161134c57565b60001981019190821161134c57565b9190820391821161134c57565b6040519061184f60208361043d565b6000808352366020840137565b90611866826104ad565b611873604051918261043d565b8281528092611884601f19916104ad565b0190602036910137565b9081518110156116f6570160200190565b81601f820112156103455780516118b5816104ad565b926118c3604051948561043d565b818452602082840101116103455761051a91602080850191016106d5565b9190916040818403126103455780518015158103610345579260208201516001600160401b0381116103455761051a920161189f565b1561191e57565b60405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606490fd5b6020810135611a1a61196d6040840184611c3b565b90816040519182372091611a0c6119876060860186611c3b565b90816040519182372060c086013560a087013560808801356119b56119af60e08b018b611c3b565b90613600565b604080519a356001600160a01b031660208c01908152908b019790975260608a0198909852608089019390935260a088019290925260c087019190915260e086015261010085019390935292918290610120820190565b03601f19810183528261043d565b51902060408051602081019283523091810191909152466060820152611a438160808101611a0c565b51902090565b60405190611a56826103eb565b60006020838281520152565b60405190611a6f826103cb565b81604051611a7c816103cb565b60008152600060208201526000604082015260006060820152606060808201528152611aa6611a49565b6020820152611ab3611a49565b6040820152611ac0611a49565b6060820152608060405191611ad4836103eb565b60008352611ae0611a49565b60208401520152565b611af2826115f8565b91611b00604051938461043d565b808352601f19611b0f826115f8565b0160005b818110611b5957505060005b818110611b2c5750505090565b80611b3d61125860019385876116df565b611b4782876116fb565b52611b5281866116fb565b5001611b1f565b602090611b64611a62565b82828801015201611b13565b908092918237016000815290565b60405190611b8b82610406565b606060408360008152600060208201520152565b60405190611bac826103cb565b6000608083604051611bbd81610421565b83815283602082015283604082015283606082015283838201528360a08201528360c08201528360e0820152836101008201528361012082015281528260208201528260408201528260608201520152565b91908110156116f65760051b81013590605e1981360301821215610345570190565b3561051a8161051d565b903590601e198136030182121561034557018035906001600160401b0382116103455760200191813603831361034557565b6001600160a01b039182168152911660208201526080604082018190529093929160609161179d91908601906106f8565b9694969591939295611cae611b7e565b5060005b828110611f5a57505050611cc683806116c9565b93611d06611cee611ce7611cdc60208801611c31565b966040810190611c3b565b36916104c8565b95611cf7611b9f565b90611d0181612735565b612846565b5050506001600160a01b03841615611f2f5760008315611e875750600190611d3a611d2f6117d0565b989291935b8561141c565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169881905b84611d738885611833565b10611e5c575a611d82886113ff565b11611e3c5791869593918a95938c8b611d9c858d9c61141c565b60011c9a8b996040519c8d938493630780cef560e11b85526004850193611dc294611c6d565b03815a6000948591f1988915611e3757600090819a611e11575b5015611dfc57505050611dee84611824565b95915b939092949591611d68565b93965094611e0b91975061140e565b94611df1565b90611e2f929a503d8091833e611e27818361043d565b8101906118e1565b989038611ddc565b6117c4565b637162685f60e11b60005260048290526024879052604483905260646000fd5b97509750509250509450611e7f9150611e7361047f565b93845215156020840152565b604082015290565b92505a9085848689611eae5a604051630780cef560e11b8152958694859460048601611c6d565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1908115611e3757858092611f08575b5050611efe611d3a9195935a90611833565b9498929193611d34565b611efe9650611d3a925090611f26913d8091833e611e27818361043d565b95909591611eec565b95505050505050611f3e611840565b611f4661047f565b906000825260006020830152604082015290565b600190611f65611b9f565b611f90611f73838787611c0f565b91611f86611f8184806116c9565b612735565b611d0183806116c9565b50505060208101611faf611fa382611c31565b6001600160a01b031690565b15611ff65760009182611fd0611fc58294611c31565b926040810190611c3b565b9190611fe160405180948193611b70565b03925af150611fee6117e5565b505b01611cb2565b5050611ff0565b50600280541461207d57600280556080612037612018611b9f565b9261202281612735565b8361202d8183612846565b9491929093612b2d565b94909501519461204561048e565b958652602086015260408501526060840152608083015260a0820152600060c082015261207061208e565b60e0820152906001600255565b633ee5aeb560e01b60005260046000fd5b6040519061209d60408361043d565b6002825261060f60f31b6020830152565b60015b600581106120fc57507f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206120e73484612da4565b6040519081526001600160a01b0390931692a2565b6001016120b1565b1561210b57565b60405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b6044820152606490fd5b9065ffffffffffff8091169116019065ffffffffffff821161134c57565b1561216957565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b6044820152606490fd5b156121ac57565b60405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606490fd5b156121f857565b60405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606490fd5b1561224457565b60405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606490fd5b906014116103455790601490565b356bffffffffffffffffffffffff198116929190601482106122b7575050565b6bffffffffffffffffffffffff1960149290920360031b82901b16169150565b604051906122e4826103eb565b6003546001600160a01b03168252604051602083612301836103eb565b6004548352600554828401520152565b612319611a62565b50612322611b9f565b9061232c81612735565b6123368282612846565b509190926123448385612bcc565b805160e00151612361906001600160a01b0316612d38565b612d38565b8151519092906123919061237d906001600160a01b0316612d38565b91612386611a49565b506040810190611c3b565b906014821061246b576123b36123ad6123b99361235c93612289565b90612297565b60601c90565b9160018060a01b0386169460808201519660606040840151930151926123dd61045e565b98895260208901526040880152606087015260808601526123fc6122d7565b9380151580612460575b61242e575b5061241461045e565b948552602085015260408401526060830152608082015290565b90935061243a81612d38565b61245461244561049e565b6001600160a01b039093168352565b6020820152923861240b565b506001811415612406565b50506123b96000612d38565b61046d336120ae565b9060009283809360208451940192f190565b3d61080081116124b7575b604051906020818301016040528082526000602083013e90565b5061080061249d565b600311156124ca57565b634e487b7160e01b600052602160045260246000fd5b909493929460038110156124ca576060926125089183526080602084015260808301906106f8565b9460408201520152565b9093916000935a9286519261252684612d7a565b60e085015190916001600160a01b0390911690818061260e57505084516001600160a01b03169050925b5a8603019360a060608201519101510190608089019182518603908181116125f9575b505084029160408901928351948186106000146125cf575050806125986002926124c0565b036125b457505061046d925080956125af81612e96565b612dcb565b9150915061046d925a90039051019051856125af8297612e96565b9061046d9750809a94506125e892935080950390612da4565b506125f2816124c0565b1590612e31565b9195916064919003600a020401933880612573565b9491815161261e575b5050612550565b612627856124c0565b600285031561261757919098505a9160a0870151813b156103455784600091878361266e958f60405197889687958693637c627b2160e01b8552828d0291600486016124e0565b0393f19081612708575b5061270157506020898101518a518051920151917ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f4792906001600160a01b03166126bf612492565b6040516001600160a01b039092169482916126da91836114b6565b0390a36126f35a870360808b01510180998b6002612512565b50505b5a9003963880612617565b97506126f6565b806109cf60006127179361043d565b38612678565b90604061051a926000815281602082015201906106f8565b6040516135a560f21b602082019081523060601b6022830152600160f81b6036830152601782526127be92919061276d60378361043d565b60018060a01b0391519020166bffffffffffffffffffffffff60a01b600654161760065561279e6040820182611c3b565b916127b66127ab82611c31565b9160e0810190611c3b565b939092612ed8565b80516127c75750565b604051631101335b60e11b81529081906115f4906004830161271d565b156127eb57565b60405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606490fd5b9060738202918083046073149015171561134c57565b90916000915a9380519161285a8382612fe3565b61286381611958565b60208301526040830151956128af6effffffffffffffffffffffffffffff8860c08701511760608701511760808701511760a087015117610100870151176101208701511711156127e4565b6128da84610100604082015160608301510160808301510160a08301510160c0830151019101510290565b6128e8888286866000613127565b85519098906129099061152f906001600160a01b03166020890151906132df565b6129ea575a83031161299b576060905a60e096909601516001600160a01b0316612968575b61295c9360a061051a9794879460809460406129619a015260608601525a9003910135019101525a90611833565b612830565b6064900490565b965050928260808360a061051a976129898b6129619961295c99600061338a565b9b90959850935094975050935061292e565b60408051631101335b60e11b8152600060048201526024810191909152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152608490fd5b9035601e19823603018112156103455701602081359101916001600160401b03821161034557813603831361034557565b61051a91612a8881612a7b84610549565b6001600160a01b03169052565b60208201356020820152612b1e612b12612ad9612abe612aab6040870187612a39565b6101206040880152610120870191611756565b612acb6060870187612a39565b908683036060880152611756565b6080850135608085015260a085013560a085015260c085013560c0850152612b0460e0860186612a39565b9085830360e0870152611756565b92610100810190612a39565b91610100818503910152611756565b905a90606081015190612b436060850185611c3b565b600060038211612bc4575b6001600160e01b031916638dd7712f60e01b03612bb3575050612b9a612bae6106d1956020840151604051938492638dd7712f60e01b6020850152604060248501526064840190612a6a565b90604483015203601f19810183528261043d565b6114cd565b6106d1955090612bae9136916104c8565b508135612b4e565b612bd59061351b565b906001600160a01b0316612cf257612ca357612bf09061351b565b906001600160a01b0316612c5d57612c0457565b60408051631101335b60e11b8152600060048201526024810191909152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f742064756064820152606560f81b608482015260a490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b90612d41611a49565b9160018060a01b0316600052600060205263ffffffff6001604060002001546001600160701b038160081c16845260781c166020830152565b610120610100820151910151808214612da057480180821015612d9b575090565b905090565b5090565b60018060a01b031660005260006020526040600020805491820180921161134c5781905590565b9190917f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f6080602083015192519460018060a01b0386511694602060018060a01b0360e089015116970151916040519283526000602084015260408301526060820152a4565b9060807f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f91602084015193519560018060a01b0387511695602060018060a01b0360e08a015116980151926040519384521515602084015260408301526060820152a4565b60208101519051907f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e60208060018060a01b03855116940151604051908152a3565b50929192159081612f8d575b50612f50576014811015612efd575b505061051a6117d0565b601411610345573560601c3b15612f15573880612ef3565b604051612f2360408261043d565b601b81527f41413330207061796d6173746572206e6f74206465706c6f7965640000000000602082015290565b5050604051612f6060408261043d565b601981527f41413230206163636f756e74206e6f74206465706c6f79656400000000000000602082015290565b90503b1538612ee4565b15612f9e57565b60405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606490fd5b61306890613000612ff382611c31565b6001600160a01b03168452565b602081013560208401526130246080820135906001600160801b038260801c921690565b6060850152604084015260a081013560c084015261305260c0820135906001600160801b038260801c921690565b61010085015261012084015260e0810190611c3b565b9081156130a45761308c8260e092613087603461046d97961015612f97565b61360b565b60a085015260808401526001600160a01b0316910152565b505060a081600060e0819401528260808201520152565b90816020910312610345575190565b6130e260409295949395606083526060830190612a6a565b9460208201520152565b60a09061051a9392815260606020820152600d60608201526c10504c8cc81c995d995c9d1959609a1b608082015281604082015201906106f8565b949291939060206131ad9186519361317360e061314a875160018060a01b031690565b966131658b8d61315d6040890189611c3b565b929091613669565b01516001600160a01b031690565b6001600160a01b0316159760009290896132a1575b8401516040516306608bdf60e21b8152958694859360009385939291600485016130ca565b03926001600160a01b03881690f160009181613270575b506131ef57856131d2612492565b6040516365c8fd4d60e01b81529182916115f491600484016130ec565b9492936131fb57505050565b6001600160a01b03166000908152602081905260409020918254908183116132235750039055565b60408051631101335b60e11b815260048101929092526024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152608490fd5b61329391925060203d60201161329a575b61328b818361043d565b8101906130bb565b90386131c4565b503d613281565b6001600160a01b038716600090815260208190526040902090935054878111156132d45750600084815b94915050613188565b8460009189036132cb565b6001600160a01b0316600090815260016020908152604080832084821c845290915290208054916001600160401b0391613318846114a7565b9055161490565b91906040838203126103455782516001600160401b0381116103455760209161334991850161189f565b92015190565b60a09061051a9392815260606020820152600d60608201526c10504cccc81c995d995c9d1959609a1b608082015281604082015201906106f8565b929390915a815160e08101516001600160a01b031660008181526020819052604090209295909290919080548981106134cc5760206080600096948c96946133f59c9d8995039055015196015191604051998a95869485936314add44b60e21b8552600485016130ca565b03926001600160a01b031686f193846000916000966134a5575b5061343a578561341d612492565b6040516365c8fd4d60e01b81529182916115f4916004840161334f565b9491925a9003116134485750565b60408051631101335b60e11b815260048101929092526024820152602760448201527f41413336206f766572207061796d6173746572566572696669636174696f6e47606482015266185cd31a5b5a5d60ca1b608482015260a490fd5b9095506134c591503d806000833e6134bd818361043d565b81019061331f565b943861340f565b60408051631101335b60e11b8152600481018b90526024810191909152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152608490fd5b80156135f75760006040805161353081610406565b828152826020820152015265ffffffffffff8160a01c1680156135ea575b6135cc906135b36135656135706135658660d01c90565b65ffffffffffff1690565b9261358b61357c61047f565b6001600160a01b039097168752565b6135a16020870194859065ffffffffffff169052565b65ffffffffffff166040860181905290565b42119081156135cf575b5091516001600160a01b031690565b91565b516135e2915065ffffffffffff16613565565b4210386135bd565b5065ffffffffffff61354e565b50600090600090565b816040519182372090565b9091826014116103455781359183602411610345576014810135936034116103455760609290921c92608090811c9260240135901c90565b90816020910312610345575161051a8161051d565b91602061051a938181520191611756565b92909181613678575b50505050565b8251516001600160a01b031693843b613886576006546000906020906136a6906001600160a01b0316611fa3565b60408751015160405180948193632b870d1b60e11b8352826136cc8b8b60048401613658565b0393f1908115611e3757600091613857575b506001600160a01b038116958615613808576001600160a01b0316958690036137b9573b1561376c57506123b36123ad7fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d9361373993612289565b602083810151935160e00151604080516001600160a01b039485168152939091169183019190915290a338808080613672565b60408051631101335b60e11b815260048101929092526024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018490526024810191909152602060448201527f4141313420696e6974436f6465206d7573742072657475726e2073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018590526024810191909152601b60448201527f4141313320696e6974436f6465206661696c6564206f72204f4f4700000000006064820152608490fd5b613879915060203d60201161387f575b613871818361043d565b810190613643565b386136de565b503d613867565b60408051631101335b60e11b815260048101929092526024820152601f60448201527f414131302073656e64657220616c726561647920636f6e7374727563746564006064820152608490fdfea2646970667358221220410dc6bd44472a2709fd674311474a749918a8c3dd38c8e316e19d5ae2faaadf64736f6c634300081a00336080806040523460155761016d908161001b8239f35b600080fdfe6080600436101561000f57600080fd5b60003560e01c63570e1a361461002457600080fd5b346101325760203660031901126101325760043567ffffffffffffffff8111610132573660238201121561013257806004013567ffffffffffffffff8111610132573660248284010111610132576000928160141161012e5760131982019167ffffffffffffffff831161011a57600b8101601f19908116603f0116820167ffffffffffffffff8111838210176101065760246020959387600c819795829560405286845289840196603889018837830101525193013560601c5af1905190156100fe575b6040516001600160a01b039091168152602090f35b5060006100e9565b634e487b7160e01b86526041600452602486fd5b634e487b7160e01b85526041600452602485fd5b8380fd5b600080fdfea26469706673582212208d3d15f1a1651d00f2ed3b618a50717a7de16a758bd696cf961337d90cc7bf3764736f6c634300081a0033" + "0x000000000000000000000000000000000000000000000000000000000000000060808060405234608257613b908181016001600160401b03811183821017606c5782916103ff833903906000f08015606057600080546001600160a01b0319166001600160a01b039290921691909117905560405161037790816100888239f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fdfe6080604052600436101561001257600080fd5b60003560e01c63c18f52261461002757600080fd5b34610281576040366003190112610281576004356001600160a01b038116908190036102815760243567ffffffffffffffff81116102815736602382011215610281578060040135610078816102be565b91610086604051938461029c565b8183526024602084019260051b820101903682116102815760248101925b82841061020957845185876100b8836102be565b926100c6604051948561029c565b8084526100d5601f19916102be565b0160005b8181106101f857505060005b825181101561019057600190606060008061013b858060a01b0382541661014961010f878b610317565b51604051938491602083019463428557b160e11b865260248401526040604484015260648301906102d6565b03601f19810184528361029c565b82885a935193f115610172575b6101608287610317565b5261016b8186610317565b50016100e5565b503d604051906020818301016040528082526000602083013e610156565b836040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106101c957505050500390f35b919360019193955060206101e88192603f198a820301865288516102d6565b96019201920185949391926101ba565b8060606020809388010152016100d9565b833567ffffffffffffffff8111610281578201366043820112156102815760248101359167ffffffffffffffff831161028657604051610253601f8501601f19166020018261029c565b83815236604484860101116102815760006020858196604483970183860137830101528152019301926100a4565b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f8019910116810190811067ffffffffffffffff82111761028657604052565b67ffffffffffffffff81116102865760051b60200190565b919082519283825260005b848110610302575050826000602080949584010152601f8019910116010190565b806020809284010151828286010152016102e1565b805182101561032b5760209160051b010190565b634e487b7160e01b600052603260045260246000fdfea2646970667358221220188cb9342176e096561b856f8b3751f67e4246534755fbbec3b1c61b597809e164736f6c634300081a003360c080604052346100cc5760016002556101888181016001600160401b038111838210176100b6578291613a08833903906000f080156100aa576080523060a0526100486100d1565b600081526020810190600082528060206100606100d1565b600081520152600380546001600160a01b0319169055516004555160055560405161391790816100f1823960805181505060a0518181816108ef01528181611d4a0152611ec10152f35b6040513d6000823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b60408051919082016001600160401b038111838210176100b65760405256fe60806040526004361015610023575b361561001957600080fd5b610021612485565b005b60003560e01c80630396cb60146101835780630bd28e3b1461017e5780630da82661146101795780630dbfc6bd146101745780630f019dea1461016f5780631b2e01b81461016a578063205c28781461016557806322cdde4c14610160578063263934db1461015b57806330ec25d11461015657806335567e1a14610151578063444034731461014c5780635287ce12146101475780635787f48b146101425780635895273b1461013d57806370a0823114610138578063b760faf914610133578063bb9fe6bf1461012e578063c23a5cea14610129578063c3bce00914610124578063fc7e286d1461011f5763fe2171cb0361000e5761130a565b61127f565b611252565b611150565b61104e565b611023565b610fe6565b610fb1565b610f2c565b610dee565b610d71565b610d08565b610c8a565b610b7c565b610b5c565b610a3e565b6109db565b61083d565b610779565b610554565b610360565b60203660031901126103455760043563ffffffff811690818103610345576103407fa5ae833d0bb1dcd632d98a8b70973e8516812898e19bf27b70071ebc8dc52c01916103226102436102336101eb3360018060a01b03166000526000602052604060002090565b966101f781151561135f565b61022460018901549161021d6102148463ffffffff9060781c1690565b63ffffffff1690565b11156113ab565b60081c6001600160701b031690565b6001600160701b0334911661142a565b9461024f861515611437565b6102626001600160701b03871115611478565b5461026b61045e565b908152600160208201526001600160701b038616604082015263ffffffff8316606082015260006080820181905233815260208190526040902081518155602082015160019091018054604084015160608501516080909501516001600160c81b031990921660ff941515949094169390931760089390931b6effffffffffffffffffffffffffff00169290921760789390931b63ffffffff60781b169290921760989190911b65ffffffffffff60981b16179055565b6040805194855263ffffffff90911660208501523393918291820190565b0390a2005b600080fd5b602435906001600160c01b038216820361034557565b34610345576020366003190112610345576004356001600160c01b0381168103610345573360009081526001602090815260408083206001600160c01b039094168352929052206103b181546114b5565b9055005b634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b038211176103e657604052565b6103b5565b604081019081106001600160401b038211176103e657604052565b606081019081106001600160401b038211176103e657604052565b61014081019081106001600160401b038211176103e657604052565b90601f801991011681019081106001600160401b038211176103e657604052565b6040519061046d60a08361043d565b565b6040519061046d6101408361043d565b6040519061046d60608361043d565b6040519061046d6101008361043d565b6040519061046d60408361043d565b6001600160401b0381116103e657601f01601f191660200190565b9291926104d4826104ad565b916104e2604051938461043d565b829481845281830111610345578281602093846000960137010152565b9080601f830112156103455781602061051a933591016104c8565b90565b6001600160a01b0381160361034557565b6024359061046d8261051d565b610104359061046d8261051d565b359061046d8261051d565b3461034557610220366003190112610345576004356001600160401b038111610345576105859036906004016104ff565b3660231901906101c0821261034557610140604051926105a4846103cb565b12610345576105b161046f565b6105b961052e565b815260443560208201526064356040820152608435606082015260a435608082015260c43560a082015260e43560c08201526105f361053b565b60e0820152610124356101008201526101443561012082015282526101643560208301526101843560408301526101a43560608301526101c43560808301526101e435916001600160401b038311610345576106566106619336906004016104ff565b9061020435926114db565b60408051928352602083019190915290f35b0390f35b9181601f84011215610345578235916001600160401b038311610345576020808501948460051b01011161034557565b602060031982011261034557600435906001600160401b038211610345576106d191600401610677565b9091565b60005b8381106106e85750506000910152565b81810151838201526020016106d8565b90602091610711815180928185528580860191016106d5565b601f01601f1916010190565b9061010060e061051a93805184526020810151602085015260408101516040850152606081015160608501526080810151608085015260a081015160a085015260c0810151151560c08501520151918160e082015201906106f8565b346103455761079061078a366106a7565b9061171d565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b8282106107c857505050500390f35b919360019193955060206107e78192603f198a8203018652885161071d565b96019201920185949391926107b9565b9181601f84011215610345578235916001600160401b038311610345576020838186019501011161034557565b60409061051a93921515815281602082015201906106f8565b346103455760803660031901126103455760043561085a8161051d565b6024356108668161051d565b6044356001600160401b038111610345576108859036906004016107f7565b926108c0606435936108b2600095606097604051968794634440347360e01b602087015260248601611785565b03601f19810184528361043d565b6001600160a01b0316803b156103455760405163428557b160e11b8152916000918391829084908290610920907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316600484016117b0565b03925af190816109c0575b506109bb57505061093a6117f3565b61094c6109478251611823565b61186a565b9060045b815181101561099557806109776109696001938561189c565b516001600160f81b03191690565b61098e61098383611823565b9160001a918661189c565b5301610950565b50506109aa90602080825183010191016118ef565b905b61067360405192839283610824565b6109ac565b806109cf60006109d59361043d565b80611043565b3861092b565b34610345576040366003190112610345576020610a356004356109fd8161051d565b610a0561034a565b6001600160a01b0390911660009081526001845260408082206001600160c01b0390931682526020929092522090565b54604051908152f35b3461034557604036600319011261034557600435610a5b8161051d565b602435336000526000602052604060002091825492838311610ae3576000808481948294610a8c610021988a611841565b9055604080516001600160a01b03831681526020810184905233917fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb91a26001600160a01b03165af1610add6117f3565b50611925565b60405162461bcd60e51b815260206004820152601960248201527f576974686472617720616d6f756e7420746f6f206c61726765000000000000006044820152606490fd5b602060031982011261034557600435906001600160401b038211610345576101209082900360031901126103455760040190565b34610345576020610b74610b6f36610b28565b611966565b604051908152f35b3461034557610673610bbd610bb1610bb7610b96366106a7565b809391610ba161161d565b50610bab82611671565b5061171d565b91611832565b90611709565b5160405191829160208352602083019061071d565b9061051a9060e06080610c24818651610140865280516101408701526020810151610160870152604081015161018087015260608101516101a0870152015160a06101c08601526101e08501906106f8565b60208087015180518683015201516040850152946040810151805160608601526020015160808501526060810151805160a08601526020015160c0850152015191019080516001600160a01b031682526020908101518051828401520151604090910152565b3461034557610ca1610c9b366106a7565b90611af7565b6040518091602082016020835281518091526040830190602060408260051b8601019301916000905b828210610cd957505050500390f35b91936001919395506020610cf88192603f198a82030186528851610bd2565b9601920192018594939192610cca565b34610345576040366003190112610345576020600435610d278161051d565b610d2f61034a565b6001600160a01b0390911660009081526001835260408082206001600160c01b03841683526020529020546040805192901b67ffffffffffffffff1916178152f35b3461034557606036600319011261034557600435610d8e8161051d565b6024356001600160401b0381116103455760009182610db2819336906004016107f7565b919092610dbe60443590565b9383604051948592833781018381520393f1610dd86117f3565b9015610de057005b805190811561034557602001fd5b3461034557602036600319011261034557600435610e0b8161051d565b60006080604051610e1b816103cb565b828152826020820152826040820152826060820152015260018060a01b031660005260006020526106736040600020610eaa65ffffffffffff600160405193610e63856103cb565b80548552015460ff8116151560208501526001600160701b038160081c16604085015263ffffffff8160781c16606085015260981c16608083019065ffffffffffff169052565b60405191829182919091608065ffffffffffff8160a0840195805185526020810151151560208601526001600160701b03604082015116604086015263ffffffff6060820151166060860152015116910152565b6080604061051a936020845280516020850152602081015115158285015201519160608082015201906106f8565b346103455760c0366003190112610345576004356001600160401b03811161034557610f5c903690600401610677565b906024356001600160401b03811161034557606060031982360301126103455761067392610fa592604435610f908161051d565b606435916084359360a4359560040191611cac565b60405191829182610efe565b3461034557610673610fd2610fc536610b28565b610fcd61161d565b61200b565b60405191829160208352602083019061071d565b34610345576020366003190112610345576004356110038161051d565b60018060a01b031660005260006020526020604060002054604051908152f35b60203660031901126103455761002160043561103e8161051d565b6120bc565b600091031261034557565b34610345576000366003190112610345573360005260006020526001604060002001805463ffffffff8160781c161561111e576110ba6110ac610214836110a061109b6110e19660ff1690565b612112565b60781c63ffffffff1690565b65ffffffffffff4216612152565b825460ff65ffffffffffff60981b01191665ffffffffffff60981b609883901b1617909255565b60405165ffffffffffff909116815233907ffa9b3c14cc825c412c9ed81b3ba365a5b459439403f18829e572ed53a4180f0a908060208101610340565b60405162461bcd60e51b815260206004820152600a6024820152691b9bdd081cdd185ad95960b21b6044820152606490fd5b346103455760203660031901126103455761002160008080806004356111758161051d565b336000908152602081905260409020600101906111fd8254926111ec65ffffffffffff6111d86111be6111b2886001600160701b039060081c1690565b6001600160701b031690565b966111ca881515612170565b60981c65ffffffffffff1690565b166111e48115156121b3565b4210156121ff565b8054610100600160c81b0319169055565b604080516001600160a01b03831681526020810184905233917fb7c918e0e249f999e965cafeb6c664271b3f4317d296461500e71da39f0cbda391a26001600160a01b03165af161124c6117f3565b5061224b565b346103455761067361126b61126636610b28565b61231f565b604051918291602083526020830190610bd2565b346103455760203660031901126103455760043561129c8161051d565b6001600160a01b031660009081526020818152604091829020805460019190910154835191825260ff8116151592820192909252600882901c6001600160701b031692810192909252607881901c63ffffffff16606083015260981c65ffffffffffff16608082015260a090f35b346103455761132c61131b366106a7565b809291611326611a70565b50611af7565b600019820191821161135a576106739161134591611709565b51604051918291602083526020830190610bd2565b6113f7565b1561136657565b60405162461bcd60e51b815260206004820152601a60248201527f6d757374207370656369667920756e7374616b652064656c61790000000000006044820152606490fd5b156113b257565b60405162461bcd60e51b815260206004820152601c60248201527f63616e6e6f7420646563726561736520756e7374616b652074696d65000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b90611388820180921161135a57565b906001820180921161135a57565b9190820180921161135a57565b1561143e57565b60405162461bcd60e51b81526020600482015260126024820152711b9bc81cdd185ad9481cdc1958da599a595960721b6044820152606490fd5b1561147f57565b60405162461bcd60e51b815260206004820152600e60248201526d7374616b65206f766572666c6f7760901b6044820152606490fd5b600019811461135a5760010190565b60409061051a9392815281602082015201906106f8565b91908051936060850151946114f3603f5a0260061c90565b61271060a0830151880101116115c1576106d1956000958051611523575b5050505a900360808201510192612520565b82516115419261153d9290916001600160a01b031661248e565b1590565b61154d575b8080611511565b9093506115586124a0565b805161156a575b505060019238611546565b602083810151835193909101516040516001600160a01b039094169391927f1c4fada7374c0a9ee8841fc38afe82932dc0f8e69012e927f061a8bae611a201929182916115b791836114c4565b0390a3388061155f565b60408051631101335b60e11b8152600060048201526024810191909152600f60448201526e41413935206f7574206f662067617360881b6064820152608490fd5b0390fd5b6001600160401b0381116103e65760051b60200190565b6040519061010082018281106001600160401b038211176103e657604052606060e08360008152600060208201526000604082015260008382015260006080820152600060a0820152600060c08201520152565b9061167b82611606565b611688604051918261043d565b8281528092611699601f1991611606565b019060005b8281106116aa57505050565b6020906116b561161d565b8282850101520161169e565b634e487b7160e01b600052603260045260246000fd5b90359061011e1981360301821215610345570190565b908210156117045761051a9160051b8101906116d7565b6116c1565b80518210156117045760209160051b010190565b61172682611671565b9160005b8181106117375750505090565b80611748610fc560019385876116ed565b6117528287611709565b5261175d8186611709565b500161172a565b908060209392818452848401376000828201840152601f01601f1916010190565b949392916040926117ab9260018060a01b03168752606060208801526060870191611764565b930152565b6001600160a01b03909116815260406020820181905261051a929101906106f8565b6040513d6000823e3d90fd5b604051906117ed60208361043d565b60008252565b3d1561181e573d90611804826104ad565b91611812604051938461043d565b82523d6000602084013e565b606090565b60031981019190821161135a57565b60001981019190821161135a57565b9190820391821161135a57565b6040519061185d60208361043d565b6000808352366020840137565b90611874826104ad565b611881604051918261043d565b8281528092611892601f19916104ad565b0190602036910137565b908151811015611704570160200190565b81601f820112156103455780516118c3816104ad565b926118d1604051948561043d565b818452602082840101116103455761051a91602080850191016106d5565b9190916040818403126103455780518015158103610345579260208201516001600160401b0381116103455761051a92016118ad565b1561192c57565b60405162461bcd60e51b81526020600482015260126024820152716661696c656420746f20776974686472617760701b6044820152606490fd5b6020810135611a2861197b6040840184611c49565b90816040519182372091611a1a6119956060860186611c49565b90816040519182372060c086013560a087013560808801356119c36119bd60e08b018b611c49565b9061360e565b604080519a356001600160a01b031660208c01908152908b019790975260608a0198909852608089019390935260a088019290925260c087019190915260e086015261010085019390935292918290610120820190565b03601f19810183528261043d565b51902060408051602081019283523091810191909152466060820152611a518160808101611a1a565b51902090565b60405190611a64826103eb565b60006020838281520152565b60405190611a7d826103cb565b81604051611a8a816103cb565b60008152600060208201526000604082015260006060820152606060808201528152611ab4611a57565b6020820152611ac1611a57565b6040820152611ace611a57565b6060820152608060405191611ae2836103eb565b60008352611aee611a57565b60208401520152565b611b0082611606565b91611b0e604051938461043d565b808352601f19611b1d82611606565b0160005b818110611b6757505060005b818110611b3a5750505090565b80611b4b61126660019385876116ed565b611b558287611709565b52611b608186611709565b5001611b2d565b602090611b72611a70565b82828801015201611b21565b908092918237016000815290565b60405190611b9982610406565b606060408360008152600060208201520152565b60405190611bba826103cb565b6000608083604051611bcb81610421565b83815283602082015283604082015283606082015283838201528360a08201528360c08201528360e0820152836101008201528361012082015281528260208201528260408201528260608201520152565b91908110156117045760051b81013590605e1981360301821215610345570190565b3561051a8161051d565b903590601e198136030182121561034557018035906001600160401b0382116103455760200191813603831361034557565b6001600160a01b03918216815291166020820152608060408201819052909392916060916117ab91908601906106f8565b9694969591939295611cbc611b8c565b5060005b828110611f6857505050611cd483806116d7565b93611d14611cfc611cf5611cea60208801611c3f565b966040810190611c49565b36916104c8565b95611d05611bad565b90611d0f81612743565b612854565b5050506001600160a01b03841615611f3d5760008315611e955750600190611d48611d3d6117de565b989291935b8561142a565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169881905b84611d818885611841565b10611e6a575a611d908861140d565b11611e4a5791869593918a95938c8b611daa858d9c61142a565b60011c9a8b996040519c8d938493630780cef560e11b85526004850193611dd094611c7b565b03815a6000948591f1988915611e4557600090819a611e1f575b5015611e0a57505050611dfc84611832565b95915b939092949591611d76565b93965094611e1991975061141c565b94611dff565b90611e3d929a503d8091833e611e35818361043d565b8101906118ef565b989038611dea565b6117d2565b637162685f60e11b60005260048290526024879052604483905260646000fd5b97509750509250509450611e8d9150611e8161047f565b93845215156020840152565b604082015290565b92505a9085848689611ebc5a604051630780cef560e11b8152958694859460048601611c7b565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1908115611e4557858092611f16575b5050611f0c611d489195935a90611841565b9498929193611d42565b611f0c9650611d48925090611f34913d8091833e611e35818361043d565b95909591611efa565b95505050505050611f4c61184e565b611f5461047f565b906000825260006020830152604082015290565b600190611f73611bad565b611f9e611f81838787611c1d565b91611f94611f8f84806116d7565b612743565b611d0f83806116d7565b50505060208101611fbd611fb182611c3f565b6001600160a01b031690565b156120045760009182611fde611fd38294611c3f565b926040810190611c49565b9190611fef60405180948193611b7e565b03925af150611ffc6117f3565b505b01611cc0565b5050611ffe565b50600280541461208b57600280556080612045612026611bad565b9261203081612743565b8361203b8183612854565b9491929093612b3b565b94909501519461205361048e565b958652602086015260408501526060840152608083015260a0820152600060c082015261207e61209c565b60e0820152906001600255565b633ee5aeb560e01b60005260046000fd5b604051906120ab60408361043d565b6002825261060f60f31b6020830152565b60015b6005811061210a57507f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c460206120f53484612db2565b6040519081526001600160a01b0390931692a2565b6001016120bf565b1561211957565b60405162461bcd60e51b8152602060048201526011602482015270616c726561647920756e7374616b696e6760781b6044820152606490fd5b9065ffffffffffff8091169116019065ffffffffffff821161135a57565b1561217757565b60405162461bcd60e51b81526020600482015260146024820152734e6f207374616b6520746f20776974686472617760601b6044820152606490fd5b156121ba57565b60405162461bcd60e51b815260206004820152601d60248201527f6d7573742063616c6c20756e6c6f636b5374616b6528292066697273740000006044820152606490fd5b1561220657565b60405162461bcd60e51b815260206004820152601b60248201527f5374616b65207769746864726177616c206973206e6f742064756500000000006044820152606490fd5b1561225257565b60405162461bcd60e51b815260206004820152601860248201527f6661696c656420746f207769746864726177207374616b6500000000000000006044820152606490fd5b906014116103455790601490565b356bffffffffffffffffffffffff198116929190601482106122c5575050565b6bffffffffffffffffffffffff1960149290920360031b82901b16169150565b604051906122f2826103eb565b6003546001600160a01b0316825260405160208361230f836103eb565b6004548352600554828401520152565b612327611a70565b50612330611bad565b9061233a81612743565b6123448282612854565b509190926123528385612bda565b805160e0015161236f906001600160a01b0316612d46565b612d46565b81515190929061239f9061238b906001600160a01b0316612d46565b91612394611a57565b506040810190611c49565b9060148210612479576123c16123bb6123c79361236a93612297565b906122a5565b60601c90565b9160018060a01b0386169460808201519660606040840151930151926123eb61045e565b988952602089015260408801526060870152608086015261240a6122e5565b938015158061246e575b61243c575b5061242261045e565b948552602085015260408401526060830152608082015290565b90935061244881612d46565b61246261245361049e565b6001600160a01b039093168352565b60208201529238612419565b506001811415612414565b50506123c76000612d46565b61046d336120bc565b9060009283809360208451940192f190565b3d61080081116124c5575b604051906020818301016040528082526000602083013e90565b506108006124ab565b600311156124d857565b634e487b7160e01b600052602160045260246000fd5b909493929460038110156124d8576060926125169183526080602084015260808301906106f8565b9460408201520152565b9093916000935a9286519261253484612d88565b60e085015190916001600160a01b0390911690818061261c57505084516001600160a01b03169050925b5a8603019360a06060820151910151019060808901918251860390818111612607575b505084029160408901928351948186106000146125dd575050806125a66002926124ce565b036125c257505061046d925080956125bd81612ea4565b612dd9565b9150915061046d925a90039051019051856125bd8297612ea4565b9061046d9750809a94506125f692935080950390612db2565b50612600816124ce565b1590612e3f565b9195916064919003600a020401933880612581565b9491815161262c575b505061255e565b612635856124ce565b600285031561262557919098505a9160a0870151813b156103455784600091878361267c958f60405197889687958693637c627b2160e01b8552828d0291600486016124ee565b0393f19081612716575b5061270f57506020898101518a518051920151917ff62676f440ff169a3a9afdbf812e89e7f95975ee8e5c31214ffdef631c5f4792906001600160a01b03166126cd6124a0565b6040516001600160a01b039092169482916126e891836114c4565b0390a36127015a870360808b01510180998b6002612520565b50505b5a9003963880612625565b9750612704565b806109cf60006127259361043d565b38612686565b90604061051a926000815281602082015201906106f8565b6040516135a560f21b602082019081523060601b6022830152600160f81b6036830152601782526127cc92919061277b60378361043d565b60018060a01b0391519020166bffffffffffffffffffffffff60a01b60065416176006556127ac6040820182611c49565b916127c46127b982611c3f565b9160e0810190611c49565b939092612ee6565b80516127d55750565b604051631101335b60e11b8152908190611602906004830161272b565b156127f957565b60405162461bcd60e51b815260206004820152601860248201527f41413934206761732076616c756573206f766572666c6f7700000000000000006044820152606490fd5b9060738202918083046073149015171561135a57565b90916000915a938051916128688382612ff1565b61287181611966565b60208301526040830151956128bd6effffffffffffffffffffffffffffff8860c08701511760608701511760808701511760a087015117610100870151176101208701511711156127f2565b6128e884610100604082015160608301510160808301510160a08301510160c0830151019101510290565b6128f6888286866000613135565b85519098906129179061153d906001600160a01b03166020890151906132ed565b6129f8575a8303116129a9576060905a60e096909601516001600160a01b0316612976575b61296a9360a061051a97948794608094604061296f9a015260608601525a9003910135019101525a90611841565b61283e565b6064900490565b965050928260808360a061051a976129978b61296f9961296a996000613398565b9b90959850935094975050935061293c565b60408051631101335b60e11b8152600060048201526024810191909152601e60448201527f41413236206f76657220766572696669636174696f6e4761734c696d697400006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601a60448201527f4141323520696e76616c6964206163636f756e74206e6f6e63650000000000006064820152608490fd5b9035601e19823603018112156103455701602081359101916001600160401b03821161034557813603831361034557565b61051a91612a9681612a8984610549565b6001600160a01b03169052565b60208201356020820152612b2c612b20612ae7612acc612ab96040870187612a47565b6101206040880152610120870191611764565b612ad96060870187612a47565b908683036060880152611764565b6080850135608085015260a085013560a085015260c085013560c0850152612b1260e0860186612a47565b9085830360e0870152611764565b92610100810190612a47565b91610100818503910152611764565b905a90606081015190612b516060850185611c49565b600060038211612bd2575b6001600160e01b031916638dd7712f60e01b03612bc1575050612ba8612bbc6106d1956020840151604051938492638dd7712f60e01b6020850152604060248501526064840190612a78565b90604483015203601f19810183528261043d565b6114db565b6106d1955090612bbc9136916104c8565b508135612b5c565b612be390613529565b906001600160a01b0316612d0057612cb157612bfe90613529565b906001600160a01b0316612c6b57612c1257565b60408051631101335b60e11b8152600060048201526024810191909152602160448201527f41413332207061796d61737465722065787069726564206f72206e6f742064756064820152606560f81b608482015260a490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0999a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601760448201527f414132322065787069726564206f72206e6f74206475650000000000000000006064820152608490fd5b60408051631101335b60e11b8152600060048201526024810191909152601460448201527320a0991a1039b4b3b730ba3ab9329032b93937b960611b6064820152608490fd5b90612d4f611a57565b9160018060a01b0316600052600060205263ffffffff6001604060002001546001600160701b038160081c16845260781c166020830152565b610120610100820151910151808214612dae57480180821015612da9575090565b905090565b5090565b60018060a01b031660005260006020526040600020805491820180921161135a5781905590565b9190917f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f6080602083015192519460018060a01b0386511694602060018060a01b0360e089015116970151916040519283526000602084015260408301526060820152a4565b9060807f49628fd1471006c1482da88028e9ce4dbb080b815c9b0344d39e5a8e6ec1419f91602084015193519560018060a01b0387511695602060018060a01b0360e08a015116980151926040519384521515602084015260408301526060820152a4565b60208101519051907f67b4fa9642f42120bf031f3051d1824b0fe25627945b27b8a6a65d5761d5482e60208060018060a01b03855116940151604051908152a3565b50929192159081612f9b575b50612f5e576014811015612f0b575b505061051a6117de565b601411610345573560601c3b15612f23573880612f01565b604051612f3160408261043d565b601b81527f41413330207061796d6173746572206e6f74206465706c6f7965640000000000602082015290565b5050604051612f6e60408261043d565b601981527f41413230206163636f756e74206e6f74206465706c6f79656400000000000000602082015290565b90503b1538612ef2565b15612fac57565b60405162461bcd60e51b815260206004820152601d60248201527f4141393320696e76616c6964207061796d6173746572416e64446174610000006044820152606490fd5b6130769061300e61300182611c3f565b6001600160a01b03168452565b602081013560208401526130326080820135906001600160801b038260801c921690565b6060850152604084015260a081013560c084015261306060c0820135906001600160801b038260801c921690565b61010085015261012084015260e0810190611c49565b9081156130b25761309a8260e092613095603461046d97961015612fa5565b613619565b60a085015260808401526001600160a01b0316910152565b505060a081600060e0819401528260808201520152565b90816020910312610345575190565b6130f060409295949395606083526060830190612a78565b9460208201520152565b60a09061051a9392815260606020820152600d60608201526c10504c8cc81c995d995c9d1959609a1b608082015281604082015201906106f8565b949291939060206131bb9186519361318160e0613158875160018060a01b031690565b966131738b8d61316b6040890189611c49565b929091613677565b01516001600160a01b031690565b6001600160a01b0316159760009290896132af575b8401516040516306608bdf60e21b8152958694859360009385939291600485016130d8565b03926001600160a01b03881690f16000918161327e575b506131fd57856131e06124a0565b6040516365c8fd4d60e01b815291829161160291600484016130fa565b94929361320957505050565b6001600160a01b03166000908152602081905260409020918254908183116132315750039055565b60408051631101335b60e11b815260048101929092526024820152601760448201527f41413231206469646e2774207061792070726566756e640000000000000000006064820152608490fd5b6132a191925060203d6020116132a8575b613299818361043d565b8101906130c9565b90386131d2565b503d61328f565b6001600160a01b038716600090815260208190526040902090935054878111156132e25750600084815b94915050613196565b8460009189036132d9565b6001600160a01b0316600090815260016020908152604080832084821c845290915290208054916001600160401b0391613326846114b5565b9055161490565b91906040838203126103455782516001600160401b038111610345576020916133579185016118ad565b92015190565b60a09061051a9392815260606020820152600d60608201526c10504cccc81c995d995c9d1959609a1b608082015281604082015201906106f8565b929390915a815160e08101516001600160a01b031660008181526020819052604090209295909290919080548981106134da5760206080600096948c96946134039c9d8995039055015196015191604051998a95869485936314add44b60e21b8552600485016130d8565b03926001600160a01b031686f193846000916000966134b3575b50613448578561342b6124a0565b6040516365c8fd4d60e01b8152918291611602916004840161335d565b9491925a9003116134565750565b60408051631101335b60e11b815260048101929092526024820152602760448201527f41413336206f766572207061796d6173746572566572696669636174696f6e47606482015266185cd31a5b5a5d60ca1b608482015260a490fd5b9095506134d391503d806000833e6134cb818361043d565b81019061332d565b943861341d565b60408051631101335b60e11b8152600481018b90526024810191909152601e60448201527f41413331207061796d6173746572206465706f73697420746f6f206c6f7700006064820152608490fd5b80156136055760006040805161353e81610406565b828152826020820152015265ffffffffffff8160a01c1680156135f8575b6135da906135c161357361357e6135738660d01c90565b65ffffffffffff1690565b9261359961358a61047f565b6001600160a01b039097168752565b6135af6020870194859065ffffffffffff169052565b65ffffffffffff166040860181905290565b42119081156135dd575b5091516001600160a01b031690565b91565b516135f0915065ffffffffffff16613573565b4210386135cb565b5065ffffffffffff61355c565b50600090600090565b816040519182372090565b9091826014116103455781359183602411610345576014810135936034116103455760609290921c92608090811c9260240135901c90565b90816020910312610345575161051a8161051d565b91602061051a938181520191611764565b92909181613686575b50505050565b8251516001600160a01b031693843b613894576006546000906020906136b4906001600160a01b0316611fb1565b60408751015160405180948193632b870d1b60e11b8352826136da8b8b60048401613666565b0393f1908115611e4557600091613865575b506001600160a01b038116958615613816576001600160a01b0316958690036137c7573b1561377a57506123c16123bb7fd51a9c61267aa6196961883ecf5ff2da6619c37dac0fa92122513fb32c032d2d9361374793612297565b602083810151935160e00151604080516001600160a01b039485168152939091169183019190915290a338808080613680565b60408051631101335b60e11b815260048101929092526024820152602060448201527f4141313520696e6974436f6465206d757374206372656174652073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018490526024810191909152602060448201527f4141313420696e6974436f6465206d7573742072657475726e2073656e6465726064820152608490fd5b60408051631101335b60e11b8152600481018590526024810191909152601b60448201527f4141313320696e6974436f6465206661696c6564206f72204f4f4700000000006064820152608490fd5b613887915060203d60201161388d575b61387f818361043d565b810190613651565b386136ec565b503d613875565b60408051631101335b60e11b815260048101929092526024820152601f60448201527f414131302073656e64657220616c726561647920636f6e7374727563746564006064820152608490fdfea26469706673582212204bace728028e4808d0f0305687605c92acf3fb9a79388e9df617d0a21670961464736f6c634300081a00336080806040523460155761016d908161001b8239f35b600080fdfe6080600436101561000f57600080fd5b60003560e01c63570e1a361461002457600080fd5b346101325760203660031901126101325760043567ffffffffffffffff8111610132573660238201121561013257806004013567ffffffffffffffff8111610132573660248284010111610132576000928160141161012e5760131982019167ffffffffffffffff831161011a57600b8101601f19908116603f0116820167ffffffffffffffff8111838210176101065760246020959387600c819795829560405286845289840196603889018837830101525193013560601c5af1905190156100fe575b6040516001600160a01b039091168152602090f35b5060006100e9565b634e487b7160e01b86526041600452602486fd5b634e487b7160e01b85526041600452602485fd5b8380fd5b600080fdfea26469706673582212208d3d15f1a1651d00f2ed3b618a50717a7de16a758bd696cf961337d90cc7bf3764736f6c634300081a0033" /* ========= V06 CORE ========= */ diff --git a/test/e2e/deploy-contracts/index.ts b/test/e2e/deploy-contracts/index.ts index 94fb7227..479e6ea9 100644 --- a/test/e2e/deploy-contracts/index.ts +++ b/test/e2e/deploy-contracts/index.ts @@ -1,14 +1,14 @@ import { http, type Address, + concat, createPublicClient, createWalletClient, - getContract, encodeAbiParameters, - concat, + getContract, getCreate2Address, - sliceHex, - parseAbi + parseAbi, + sliceHex } from "viem" import { mnemonicToAccount } from "viem/accounts" import { foundry } from "viem/chains" @@ -223,7 +223,7 @@ const main = async () => { "0x4e59b44847b379578588920ca78fbf26c0b4956c", "0x0000000071727De22E5E9d8BAf0edAc6f37da032", "0x91E60e0613810449d098b0b5Ec8b51A0FE8c8985", - "0xAE6035bEE0802C969265C8A3193CE8878c99A66A", // 0.7 Simulations Contract + "0xBbe8A301FbDb2a4CD58c4A37c262ecef8f889c47", // 0.7 Simulations Contract BUNDLE_BULKER_ADDRESS, PER_OP_INFLATOR_ADDRESS, SIMPLE_INFLATOR_ADDRESS diff --git a/test/e2e/src/revertingContract.ts b/test/e2e/src/revertingContract.ts index 9b655586..ea596c68 100644 --- a/test/e2e/src/revertingContract.ts +++ b/test/e2e/src/revertingContract.ts @@ -1,6 +1,7 @@ // Utils for interacting with the contract located in alto/contracts/TestUtils/AlwaysReverting.sol import { + http, type Address, type Hex, concat, @@ -8,11 +9,10 @@ import { decodeErrorResult, encodeFunctionData, getCreate2Address, - http, parseAbi } from "viem" -import { ANVIL_RPC } from "./constants" import { foundry } from "viem/chains" +import { ANVIL_RPC } from "./constants" import { getAnvilWalletClient } from "./utils" // source: https://gist.github.com/mouseless-eth/41146d2392a520fbdff33b927fbe4cae diff --git a/test/e2e/src/testPaymaster.ts b/test/e2e/src/testPaymaster.ts index f6935af6..3691595f 100644 --- a/test/e2e/src/testPaymaster.ts +++ b/test/e2e/src/testPaymaster.ts @@ -2,19 +2,19 @@ // This paymaster will sponsor all UserOperations import { + http, type Address, type Hex, concat, createPublicClient, getCreate2Address, - http, pad, parseEther } from "viem" -import { ANVIL_RPC } from "./constants" +import { entryPoint06Address } from "viem/account-abstraction" import { foundry } from "viem/chains" +import { ANVIL_RPC } from "./constants" import { getAnvilWalletClient } from "./utils" -import { entryPoint06Address } from "viem/account-abstraction" const PAYMASTER_V06_BYTECODE: Hex = "0x60a060405234801561001057600080fd5b50604051610a87380380610a8783398101604081905261002f916100c2565b80328061005657604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005f81610072565b506001600160a01b0316608052506100f2565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d457600080fd5b81516001600160a01b03811681146100eb57600080fd5b9392505050565b60805161094961013e6000396000818161015f01528181610251015281816102e801528181610364015281816103f80152818161046f015281816104fc015261063701526109496000f3fe6080604052600436106100a75760003560e01c8063bb9fe6bf11610064578063bb9fe6bf14610181578063c23a5cea14610196578063c399ec88146101b6578063d0e30db0146101d9578063f2fde38b146101e1578063f465c77e1461020157600080fd5b80630396cb60146100ac578063205c2878146100c1578063715018a6146100e15780638da5cb5b146100f6578063a9a234091461012d578063b0d691fe1461014d575b600080fd5b6100bf6100ba366004610737565b61022f565b005b3480156100cd57600080fd5b506100bf6100dc366004610779565b6102ba565b3480156100ed57600080fd5b506100bf61032c565b34801561010257600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b34801561013957600080fd5b506100bf6101483660046107a5565b610340565b34801561015957600080fd5b506101107f000000000000000000000000000000000000000000000000000000000000000081565b34801561018d57600080fd5b506100bf61035a565b3480156101a257600080fd5b506100bf6101b1366004610834565b6103d1565b3480156101c257600080fd5b506101cb610457565b604051908152602001610124565b6100bf6104e7565b3480156101ed57600080fd5b506100bf6101fc366004610834565b610549565b34801561020d57600080fd5b5061022161021c366004610851565b61058c565b6040516101249291906108a5565b6102376105af565b604051621cb65b60e51b815263ffffffff821660048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690630396cb609034906024016000604051808303818588803b15801561029e57600080fd5b505af11580156102b2573d6000803e3d6000fd5b505050505050565b6102c26105af565b60405163040b850f60e31b81526001600160a01b038381166004830152602482018390527f0000000000000000000000000000000000000000000000000000000000000000169063205c287890604401600060405180830381600087803b15801561029e57600080fd5b6103346105af565b61033e60006105dc565b565b61034861062c565b6103548484848461069c565b50505050565b6103626105af565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bb9fe6bf6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156103bd57600080fd5b505af1158015610354573d6000803e3d6000fd5b6103d96105af565b60405163611d2e7560e11b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063c23a5cea90602401600060405180830381600087803b15801561043c57600080fd5b505af1158015610450573d6000803e3d6000fd5b5050505050565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa1580156104be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104e291906108fa565b905090565b60405163b760faf960e01b81523060048201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b760faf99034906024016000604051808303818588803b15801561043c57600080fd5b6105516105af565b6001600160a01b03811661058057604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b610589816105dc565b50565b6060600061059861062c565b6105a38585856106d4565b91509150935093915050565b6000546001600160a01b0316331461033e5760405163118cdaa760e01b8152336004820152602401610577565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461033e5760405162461bcd60e51b815260206004820152601560248201527414d95b99195c881b9bdd08115b9d1c9e541bda5b9d605a1b6044820152606401610577565b60405162461bcd60e51b815260206004820152600d60248201526c6d757374206f7665727269646560981b6044820152606401610577565b606060006106e560008060006106ff565b604080516020810190915260008152969095509350505050565b600060d08265ffffffffffff16901b60a08465ffffffffffff16901b8561072757600061072a565b60015b60ff161717949350505050565b60006020828403121561074957600080fd5b813563ffffffff8116811461075d57600080fd5b9392505050565b6001600160a01b038116811461058957600080fd5b6000806040838503121561078c57600080fd5b823561079781610764565b946020939093013593505050565b600080600080606085870312156107bb57600080fd5b8435600381106107ca57600080fd5b9350602085013567ffffffffffffffff808211156107e757600080fd5b818701915087601f8301126107fb57600080fd5b81358181111561080a57600080fd5b88602082850101111561081c57600080fd5b95986020929092019750949560400135945092505050565b60006020828403121561084657600080fd5b813561075d81610764565b60008060006060848603121561086657600080fd5b833567ffffffffffffffff81111561087d57600080fd5b8401610160818703121561089057600080fd5b95602085013595506040909401359392505050565b604081526000835180604084015260005b818110156108d357602081870181015160608684010152016108b6565b506000606082850101526060601f19601f8301168401019150508260208301529392505050565b60006020828403121561090c57600080fd5b505191905056fea264697066735822122053527306dfabc8c0f532c474c7e3966caf999d7e7b30655a671e45f0b4b36e0f64736f6c63430008170033" diff --git a/test/e2e/src/utils.ts b/test/e2e/src/utils.ts index 62dc8144..d72d27e3 100644 --- a/test/e2e/src/utils.ts +++ b/test/e2e/src/utils.ts @@ -1,22 +1,19 @@ import { + type SmartAccountClient, + createSmartAccountClient +} from "permissionless" +import { toSimpleSmartAccount } from "permissionless/accounts" +import { createPimlicoClient } from "permissionless/clients/pimlico" +import { + http, + type Chain, type Hex, type Transport, - type Chain, createPublicClient, createTestClient, createWalletClient, - http, parseEther } from "viem" -import { - generatePrivateKey, - mnemonicToAccount, - privateKeyToAccount -} from "viem/accounts" -import { ALTO_RPC, ANVIL_RPC } from "./constants" -import { foundry } from "viem/chains" -import { createPimlicoClient } from "permissionless/clients/pimlico" -import { toSimpleSmartAccount } from "permissionless/accounts" import { type EntryPointVersion, type SmartAccount, @@ -24,9 +21,12 @@ import { entryPoint07Address } from "viem/account-abstraction" import { - type SmartAccountClient, - createSmartAccountClient -} from "permissionless" + generatePrivateKey, + mnemonicToAccount, + privateKeyToAccount +} from "viem/accounts" +import { foundry } from "viem/chains" +import { ALTO_RPC, ANVIL_RPC } from "./constants" const anvilClient = createTestClient({ transport: http(ANVIL_RPC), diff --git a/test/e2e/tests/eth_estimateUserOperationGas.test.ts b/test/e2e/tests/eth_estimateUserOperationGas.test.ts index 4fbc0794..71a45fed 100644 --- a/test/e2e/tests/eth_estimateUserOperationGas.test.ts +++ b/test/e2e/tests/eth_estimateUserOperationGas.test.ts @@ -1,6 +1,6 @@ -import { test, describe, expect, beforeEach } from "vitest" -import { beforeEachCleanUp, getSmartAccountClient } from "../src/utils" import type { EntryPointVersion } from "viem/account-abstraction" +import { beforeEach, describe, expect, test } from "vitest" +import { beforeEachCleanUp, getSmartAccountClient } from "../src/utils" describe.each([ { diff --git a/test/e2e/tests/eth_getUserOperationByHash.test.ts b/test/e2e/tests/eth_getUserOperationByHash.test.ts index d0740c17..aef275ec 100644 --- a/test/e2e/tests/eth_getUserOperationByHash.test.ts +++ b/test/e2e/tests/eth_getUserOperationByHash.test.ts @@ -1,19 +1,19 @@ -import { test, describe, expect, beforeEach } from "vitest" +import { http, createTestClient } from "viem" +import { + type EntryPointVersion, + UserOperationNotFoundError, + UserOperationReceiptNotFoundError, + entryPoint06Address, + entryPoint07Address +} from "viem/account-abstraction" +import { foundry } from "viem/chains" +import { beforeEach, describe, expect, test } from "vitest" +import { ANVIL_RPC } from "../src/constants" import { beforeEachCleanUp, getPimlicoClient, getSmartAccountClient } from "../src/utils" -import { createTestClient, http } from "viem" -import { foundry } from "viem/chains" -import { ANVIL_RPC } from "../src/constants" -import { - type EntryPointVersion, - entryPoint06Address, - entryPoint07Address, - UserOperationNotFoundError, - UserOperationReceiptNotFoundError -} from "viem/account-abstraction" const anvilClient = createTestClient({ chain: foundry, diff --git a/test/e2e/tests/eth_getUserOperationReceipt.test.ts b/test/e2e/tests/eth_getUserOperationReceipt.test.ts index 76bc775f..3a1e99cd 100644 --- a/test/e2e/tests/eth_getUserOperationReceipt.test.ts +++ b/test/e2e/tests/eth_getUserOperationReceipt.test.ts @@ -1,17 +1,17 @@ -import { test, describe, expect, beforeAll, beforeEach } from "vitest" -import { beforeEachCleanUp, getSmartAccountClient } from "../src/utils" import type { Address, Hex } from "viem" -import { - deployRevertingContract, - decodeRevert, - getRevertCall -} from "../src/revertingContract" -import { deployPaymaster } from "../src/testPaymaster" import { type EntryPointVersion, entryPoint06Address, entryPoint07Address } from "viem/account-abstraction" +import { beforeAll, beforeEach, describe, expect, test } from "vitest" +import { + decodeRevert, + deployRevertingContract, + getRevertCall +} from "../src/revertingContract" +import { deployPaymaster } from "../src/testPaymaster" +import { beforeEachCleanUp, getSmartAccountClient } from "../src/utils" describe.each([ { diff --git a/test/e2e/tests/eth_sendUserOperation.test.ts b/test/e2e/tests/eth_sendUserOperation.test.ts index 45a723c8..d4ab8af0 100644 --- a/test/e2e/tests/eth_sendUserOperation.test.ts +++ b/test/e2e/tests/eth_sendUserOperation.test.ts @@ -1,31 +1,31 @@ -import { test, describe, expect, beforeEach } from "vitest" -import { - beforeEachCleanUp, - getSmartAccountClient, - sendBundleNow, - setBundlingMode -} from "../src/utils" -import { foundry } from "viem/chains" +import { encodeNonce } from "permissionless/utils" import { + http, type Hex, createPublicClient, createTestClient, getContract, - http, parseEther, parseGwei } from "viem" -import { ANVIL_RPC } from "../src/constants" -import { ENTRYPOINT_V06_ABI, ENTRYPOINT_V07_ABI } from "./utils/abi" -import { getNonceKeyAndValue } from "./utils/userop" -import { generatePrivateKey } from "viem/accounts" import { type EntryPointVersion, + UserOperationReceiptNotFoundError, entryPoint06Address, - entryPoint07Address, - UserOperationReceiptNotFoundError + entryPoint07Address } from "viem/account-abstraction" -import { encodeNonce } from "permissionless/utils" +import { generatePrivateKey } from "viem/accounts" +import { foundry } from "viem/chains" +import { beforeEach, describe, expect, test } from "vitest" +import { ANVIL_RPC } from "../src/constants" +import { + beforeEachCleanUp, + getSmartAccountClient, + sendBundleNow, + setBundlingMode +} from "../src/utils" +import { ENTRYPOINT_V06_ABI, ENTRYPOINT_V07_ABI } from "./utils/abi" +import { getNonceKeyAndValue } from "./utils/userop" const anvilClient = createTestClient({ chain: foundry, diff --git a/test/e2e/tests/pimlico_getUserOperationGasPrice.test.ts b/test/e2e/tests/pimlico_getUserOperationGasPrice.test.ts index cfce9b39..e2c0a424 100644 --- a/test/e2e/tests/pimlico_getUserOperationGasPrice.test.ts +++ b/test/e2e/tests/pimlico_getUserOperationGasPrice.test.ts @@ -1,10 +1,10 @@ -import { test, describe, expect, beforeAll, beforeEach } from "vitest" -import { beforeEachCleanUp, getPimlicoClient } from "../src/utils" +import type { PimlicoClient } from "permissionless/clients/pimlico" +import { http, createPublicClient } from "viem" +import type { EntryPointVersion } from "viem/account-abstraction" import { foundry } from "viem/chains" -import { createPublicClient, http } from "viem" +import { beforeAll, beforeEach, describe, expect, test } from "vitest" import { ANVIL_RPC } from "../src/constants" -import type { EntryPointVersion } from "viem/account-abstraction" -import type { PimlicoClient } from "permissionless/clients/pimlico" +import { beforeEachCleanUp, getPimlicoClient } from "../src/utils" const publicClient = createPublicClient({ transport: http(ANVIL_RPC), diff --git a/test/e2e/tests/pimlico_sendCompressedUserOperation.test.ts b/test/e2e/tests/pimlico_sendCompressedUserOperation.test.ts index bc39bf6f..02ce3287 100644 --- a/test/e2e/tests/pimlico_sendCompressedUserOperation.test.ts +++ b/test/e2e/tests/pimlico_sendCompressedUserOperation.test.ts @@ -1,28 +1,28 @@ -import { describe, test, beforeAll, expect, beforeEach } from "vitest" -import { - beforeEachCleanUp, - getPimlicoClient, - getSmartAccountClient, - sendBundleNow, - setBundlingMode -} from "../src/utils" +import type { PimlicoClient } from "permissionless/clients/pimlico" import { + http, createPublicClient, createTestClient, getAddress, getContract, - http, parseEther, parseGwei, zeroAddress } from "viem" -import { ANVIL_RPC } from "../src/constants" -import { foundry } from "viem/chains" -import type { PimlicoClient } from "permissionless/clients/pimlico" import { - UserOperationReceiptNotFoundError, - type UserOperation + type UserOperation, + UserOperationReceiptNotFoundError } from "viem/account-abstraction" +import { foundry } from "viem/chains" +import { beforeAll, beforeEach, describe, expect, test } from "vitest" +import { ANVIL_RPC } from "../src/constants" +import { + beforeEachCleanUp, + getPimlicoClient, + getSmartAccountClient, + sendBundleNow, + setBundlingMode +} from "../src/utils" const publicClient = createPublicClient({ transport: http(ANVIL_RPC), diff --git a/test/e2e/tests/pimlico_sendUserOperationNow.test.ts b/test/e2e/tests/pimlico_sendUserOperationNow.test.ts index b7502e2d..14f404a3 100644 --- a/test/e2e/tests/pimlico_sendUserOperationNow.test.ts +++ b/test/e2e/tests/pimlico_sendUserOperationNow.test.ts @@ -1,15 +1,15 @@ -import { describe, test, beforeEach, expect } from "vitest" -import { beforeEachCleanUp, getSmartAccountClient } from "../src/utils" +import { deepHexlify } from "permissionless" +import { http, createClient, parseEther } from "viem" import { - entryPoint06Address, - entryPoint07Address, type EntryPointVersion, type UserOperation, - type UserOperationReceipt + type UserOperationReceipt, + entryPoint06Address, + entryPoint07Address } from "viem/account-abstraction" -import { createClient, http, parseEther } from "viem" -import { deepHexlify } from "permissionless" +import { beforeEach, describe, expect, test } from "vitest" import { ALTO_RPC } from "../src/constants" +import { beforeEachCleanUp, getSmartAccountClient } from "../src/utils" describe.each([ { diff --git a/test/e2e/tests/utils/abi.ts b/test/e2e/tests/utils/abi.ts index 1ef30213..73d4101f 100644 --- a/test/e2e/tests/utils/abi.ts +++ b/test/e2e/tests/utils/abi.ts @@ -1,3 +1,1772 @@ -export const ENTRYPOINT_V06_ABI = [{"inputs":[{"internalType":"uint256","name":"preOpGas","type":"uint256"},{"internalType":"uint256","name":"paid","type":"uint256"},{"internalType":"uint48","name":"validAfter","type":"uint48"},{"internalType":"uint48","name":"validUntil","type":"uint48"},{"internalType":"bool","name":"targetSuccess","type":"bool"},{"internalType":"bytes","name":"targetResult","type":"bytes"}],"name":"ExecutionResult","type":"error"},{"inputs":[{"internalType":"uint256","name":"opIndex","type":"uint256"},{"internalType":"string","name":"reason","type":"string"}],"name":"FailedOp","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"SenderAddressResult","type":"error"},{"inputs":[{"internalType":"address","name":"aggregator","type":"address"}],"name":"SignatureValidationFailed","type":"error"},{"inputs":[{"components":[{"internalType":"uint256","name":"preOpGas","type":"uint256"},{"internalType":"uint256","name":"prefund","type":"uint256"},{"internalType":"bool","name":"sigFailed","type":"bool"},{"internalType":"uint48","name":"validAfter","type":"uint48"},{"internalType":"uint48","name":"validUntil","type":"uint48"},{"internalType":"bytes","name":"paymasterContext","type":"bytes"}],"internalType":"struct IEntryPoint.ReturnInfo","name":"returnInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"senderInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"factoryInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"paymasterInfo","type":"tuple"}],"name":"ValidationResult","type":"error"},{"inputs":[{"components":[{"internalType":"uint256","name":"preOpGas","type":"uint256"},{"internalType":"uint256","name":"prefund","type":"uint256"},{"internalType":"bool","name":"sigFailed","type":"bool"},{"internalType":"uint48","name":"validAfter","type":"uint48"},{"internalType":"uint48","name":"validUntil","type":"uint48"},{"internalType":"bytes","name":"paymasterContext","type":"bytes"}],"internalType":"struct IEntryPoint.ReturnInfo","name":"returnInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"senderInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"factoryInfo","type":"tuple"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"paymasterInfo","type":"tuple"},{"components":[{"internalType":"address","name":"aggregator","type":"address"},{"components":[{"internalType":"uint256","name":"stake","type":"uint256"},{"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"internalType":"struct IStakeManager.StakeInfo","name":"stakeInfo","type":"tuple"}],"internalType":"struct IEntryPoint.AggregatorStakeInfo","name":"aggregatorInfo","type":"tuple"}],"name":"ValidationResultWithAggregation","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"factory","type":"address"},{"indexed":false,"internalType":"address","name":"paymaster","type":"address"}],"name":"AccountDeployed","type":"event"},{"anonymous":false,"inputs":[],"name":"BeforeExecution","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalDeposit","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"aggregator","type":"address"}],"name":"SignatureAggregatorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"name":"StakeLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawTime","type":"uint256"}],"name":"StakeUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"paymaster","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"uint256","name":"actualGasCost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualGasUsed","type":"uint256"}],"name":"UserOperationEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"revertReason","type":"bytes"}],"name":"UserOperationRevertReason","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[],"name":"SIG_VALIDATION_FAILED","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"}],"name":"_validateSenderAndPaymaster","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"unstakeDelaySec","type":"uint32"}],"name":"addStake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deposits","outputs":[{"internalType":"uint112","name":"deposit","type":"uint112"},{"internalType":"bool","name":"staked","type":"bool"},{"internalType":"uint112","name":"stake","type":"uint112"},{"internalType":"uint32","name":"unstakeDelaySec","type":"uint32"},{"internalType":"uint48","name":"withdrawTime","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getDepositInfo","outputs":[{"components":[{"internalType":"uint112","name":"deposit","type":"uint112"},{"internalType":"bool","name":"staked","type":"bool"},{"internalType":"uint112","name":"stake","type":"uint112"},{"internalType":"uint32","name":"unstakeDelaySec","type":"uint32"},{"internalType":"uint48","name":"withdrawTime","type":"uint48"}],"internalType":"struct IStakeManager.DepositInfo","name":"info","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint192","name":"key","type":"uint192"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"initCode","type":"bytes"}],"name":"getSenderAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct UserOperation","name":"userOp","type":"tuple"}],"name":"getUserOpHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct UserOperation[]","name":"userOps","type":"tuple[]"},{"internalType":"contract IAggregator","name":"aggregator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct IEntryPoint.UserOpsPerAggregator[]","name":"opsPerAggregator","type":"tuple[]"},{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"handleAggregatedOps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct UserOperation[]","name":"ops","type":"tuple[]"},{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"handleOps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint192","name":"key","type":"uint192"}],"name":"incrementNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"callData","type":"bytes"},{"components":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"address","name":"paymaster","type":"address"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"}],"internalType":"struct EntryPoint.MemoryUserOp","name":"mUserOp","type":"tuple"},{"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"internalType":"uint256","name":"prefund","type":"uint256"},{"internalType":"uint256","name":"contextOffset","type":"uint256"},{"internalType":"uint256","name":"preOpGas","type":"uint256"}],"internalType":"struct EntryPoint.UserOpInfo","name":"opInfo","type":"tuple"},{"internalType":"bytes","name":"context","type":"bytes"}],"name":"innerHandleOp","outputs":[{"internalType":"uint256","name":"actualGasCost","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint192","name":"","type":"uint192"}],"name":"nonceSequenceNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct UserOperation","name":"op","type":"tuple"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"targetCallData","type":"bytes"}],"name":"simulateHandleOp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct UserOperation","name":"userOp","type":"tuple"}],"name":"simulateValidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"withdrawAddress","type":"address"}],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"withdrawAddress","type":"address"},{"internalType":"uint256","name":"withdrawAmount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] +export const ENTRYPOINT_V06_ABI = [ + { + inputs: [ + { internalType: "uint256", name: "preOpGas", type: "uint256" }, + { internalType: "uint256", name: "paid", type: "uint256" }, + { internalType: "uint48", name: "validAfter", type: "uint48" }, + { internalType: "uint48", name: "validUntil", type: "uint48" }, + { internalType: "bool", name: "targetSuccess", type: "bool" }, + { internalType: "bytes", name: "targetResult", type: "bytes" } + ], + name: "ExecutionResult", + type: "error" + }, + { + inputs: [ + { internalType: "uint256", name: "opIndex", type: "uint256" }, + { internalType: "string", name: "reason", type: "string" } + ], + name: "FailedOp", + type: "error" + }, + { + inputs: [{ internalType: "address", name: "sender", type: "address" }], + name: "SenderAddressResult", + type: "error" + }, + { + inputs: [ + { internalType: "address", name: "aggregator", type: "address" } + ], + name: "SignatureValidationFailed", + type: "error" + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "preOpGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "prefund", + type: "uint256" + }, + { internalType: "bool", name: "sigFailed", type: "bool" }, + { + internalType: "uint48", + name: "validAfter", + type: "uint48" + }, + { + internalType: "uint48", + name: "validUntil", + type: "uint48" + }, + { + internalType: "bytes", + name: "paymasterContext", + type: "bytes" + } + ], + internalType: "struct IEntryPoint.ReturnInfo", + name: "returnInfo", + type: "tuple" + }, + { + components: [ + { internalType: "uint256", name: "stake", type: "uint256" }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "senderInfo", + type: "tuple" + }, + { + components: [ + { internalType: "uint256", name: "stake", type: "uint256" }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "factoryInfo", + type: "tuple" + }, + { + components: [ + { internalType: "uint256", name: "stake", type: "uint256" }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "paymasterInfo", + type: "tuple" + } + ], + name: "ValidationResult", + type: "error" + }, + { + inputs: [ + { + components: [ + { + internalType: "uint256", + name: "preOpGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "prefund", + type: "uint256" + }, + { internalType: "bool", name: "sigFailed", type: "bool" }, + { + internalType: "uint48", + name: "validAfter", + type: "uint48" + }, + { + internalType: "uint48", + name: "validUntil", + type: "uint48" + }, + { + internalType: "bytes", + name: "paymasterContext", + type: "bytes" + } + ], + internalType: "struct IEntryPoint.ReturnInfo", + name: "returnInfo", + type: "tuple" + }, + { + components: [ + { internalType: "uint256", name: "stake", type: "uint256" }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "senderInfo", + type: "tuple" + }, + { + components: [ + { internalType: "uint256", name: "stake", type: "uint256" }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "factoryInfo", + type: "tuple" + }, + { + components: [ + { internalType: "uint256", name: "stake", type: "uint256" }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "paymasterInfo", + type: "tuple" + }, + { + components: [ + { + internalType: "address", + name: "aggregator", + type: "address" + }, + { + components: [ + { + internalType: "uint256", + name: "stake", + type: "uint256" + }, + { + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + internalType: "struct IStakeManager.StakeInfo", + name: "stakeInfo", + type: "tuple" + } + ], + internalType: "struct IEntryPoint.AggregatorStakeInfo", + name: "aggregatorInfo", + type: "tuple" + } + ], + name: "ValidationResultWithAggregation", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "factory", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "paymaster", + type: "address" + } + ], + name: "AccountDeployed", + type: "event" + }, + { anonymous: false, inputs: [], name: "BeforeExecution", type: "event" }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "totalDeposit", + type: "uint256" + } + ], + name: "Deposited", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "aggregator", + type: "address" + } + ], + name: "SignatureAggregatorChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "totalStaked", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + name: "StakeLocked", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "withdrawTime", + type: "uint256" + } + ], + name: "StakeUnlocked", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "withdrawAddress", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256" + } + ], + name: "StakeWithdrawn", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "paymaster", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + indexed: false, + internalType: "bool", + name: "success", + type: "bool" + }, + { + indexed: false, + internalType: "uint256", + name: "actualGasCost", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "actualGasUsed", + type: "uint256" + } + ], + name: "UserOperationEvent", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + indexed: false, + internalType: "bytes", + name: "revertReason", + type: "bytes" + } + ], + name: "UserOperationRevertReason", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "withdrawAddress", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256" + } + ], + name: "Withdrawn", + type: "event" + }, + { + inputs: [], + name: "SIG_VALIDATION_FAILED", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "address", name: "sender", type: "address" }, + { internalType: "bytes", name: "paymasterAndData", type: "bytes" } + ], + name: "_validateSenderAndPaymaster", + outputs: [], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { internalType: "uint32", name: "unstakeDelaySec", type: "uint32" } + ], + name: "addStake", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "depositTo", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "deposits", + outputs: [ + { internalType: "uint112", name: "deposit", type: "uint112" }, + { internalType: "bool", name: "staked", type: "bool" }, + { internalType: "uint112", name: "stake", type: "uint112" }, + { internalType: "uint32", name: "unstakeDelaySec", type: "uint32" }, + { internalType: "uint48", name: "withdrawTime", type: "uint48" } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "getDepositInfo", + outputs: [ + { + components: [ + { + internalType: "uint112", + name: "deposit", + type: "uint112" + }, + { internalType: "bool", name: "staked", type: "bool" }, + { internalType: "uint112", name: "stake", type: "uint112" }, + { + internalType: "uint32", + name: "unstakeDelaySec", + type: "uint32" + }, + { + internalType: "uint48", + name: "withdrawTime", + type: "uint48" + } + ], + internalType: "struct IStakeManager.DepositInfo", + name: "info", + type: "tuple" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { internalType: "address", name: "sender", type: "address" }, + { internalType: "uint192", name: "key", type: "uint192" } + ], + name: "getNonce", + outputs: [{ internalType: "uint256", name: "nonce", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [{ internalType: "bytes", name: "initCode", type: "bytes" }], + name: "getSenderAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct UserOperation", + name: "userOp", + type: "tuple" + } + ], + name: "getUserOpHash", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + internalType: "bytes", + name: "initCode", + type: "bytes" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { + internalType: "bytes", + name: "signature", + type: "bytes" + } + ], + internalType: "struct UserOperation[]", + name: "userOps", + type: "tuple[]" + }, + { + internalType: "contract IAggregator", + name: "aggregator", + type: "address" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct IEntryPoint.UserOpsPerAggregator[]", + name: "opsPerAggregator", + type: "tuple[]" + }, + { + internalType: "address payable", + name: "beneficiary", + type: "address" + } + ], + name: "handleAggregatedOps", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct UserOperation[]", + name: "ops", + type: "tuple[]" + }, + { + internalType: "address payable", + name: "beneficiary", + type: "address" + } + ], + name: "handleOps", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [{ internalType: "uint192", name: "key", type: "uint192" }], + name: "incrementNonce", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { internalType: "bytes", name: "callData", type: "bytes" }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "address", + name: "paymaster", + type: "address" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + } + ], + internalType: "struct EntryPoint.MemoryUserOp", + name: "mUserOp", + type: "tuple" + }, + { + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + internalType: "uint256", + name: "prefund", + type: "uint256" + }, + { + internalType: "uint256", + name: "contextOffset", + type: "uint256" + }, + { + internalType: "uint256", + name: "preOpGas", + type: "uint256" + } + ], + internalType: "struct EntryPoint.UserOpInfo", + name: "opInfo", + type: "tuple" + }, + { internalType: "bytes", name: "context", type: "bytes" } + ], + name: "innerHandleOp", + outputs: [ + { internalType: "uint256", name: "actualGasCost", type: "uint256" } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "uint192", name: "", type: "uint192" } + ], + name: "nonceSequenceNumber", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct UserOperation", + name: "op", + type: "tuple" + }, + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "targetCallData", type: "bytes" } + ], + name: "simulateHandleOp", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct UserOperation", + name: "userOp", + type: "tuple" + } + ], + name: "simulateValidation", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "unlockStake", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address payable", + name: "withdrawAddress", + type: "address" + } + ], + name: "withdrawStake", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address payable", + name: "withdrawAddress", + type: "address" + }, + { internalType: "uint256", name: "withdrawAmount", type: "uint256" } + ], + name: "withdrawTo", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { stateMutability: "payable", type: "receive" } +] -export const ENTRYPOINT_V07_ABI = [{"inputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"ret","type":"bytes"}],"name":"DelegateAndRevert","type":"error"},{"inputs":[{"internalType":"uint256","name":"opIndex","type":"uint256"},{"internalType":"string","name":"reason","type":"string"}],"name":"FailedOp","type":"error"},{"inputs":[{"internalType":"uint256","name":"opIndex","type":"uint256"},{"internalType":"string","name":"reason","type":"string"},{"internalType":"bytes","name":"inner","type":"bytes"}],"name":"FailedOpWithRevert","type":"error"},{"inputs":[{"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"PostOpReverted","type":"error"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"SenderAddressResult","type":"error"},{"inputs":[{"internalType":"address","name":"aggregator","type":"address"}],"name":"SignatureValidationFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"factory","type":"address"},{"indexed":false,"internalType":"address","name":"paymaster","type":"address"}],"name":"AccountDeployed","type":"event"},{"anonymous":false,"inputs":[],"name":"BeforeExecution","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalDeposit","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"revertReason","type":"bytes"}],"name":"PostOpRevertReason","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"aggregator","type":"address"}],"name":"SignatureAggregatorChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalStaked","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unstakeDelaySec","type":"uint256"}],"name":"StakeLocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"withdrawTime","type":"uint256"}],"name":"StakeUnlocked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"StakeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"paymaster","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"uint256","name":"actualGasCost","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"actualGasUsed","type":"uint256"}],"name":"UserOperationEvent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"UserOperationPrefundTooLow","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"revertReason","type":"bytes"}],"name":"UserOperationRevertReason","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"address","name":"withdrawAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint32","name":"unstakeDelaySec","type":"uint32"}],"name":"addStake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"delegateAndRevert","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"depositTo","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deposits","outputs":[{"internalType":"uint256","name":"deposit","type":"uint256"},{"internalType":"bool","name":"staked","type":"bool"},{"internalType":"uint112","name":"stake","type":"uint112"},{"internalType":"uint32","name":"unstakeDelaySec","type":"uint32"},{"internalType":"uint48","name":"withdrawTime","type":"uint48"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getDepositInfo","outputs":[{"components":[{"internalType":"uint256","name":"deposit","type":"uint256"},{"internalType":"bool","name":"staked","type":"bool"},{"internalType":"uint112","name":"stake","type":"uint112"},{"internalType":"uint32","name":"unstakeDelaySec","type":"uint32"},{"internalType":"uint48","name":"withdrawTime","type":"uint48"}],"internalType":"struct IStakeManager.DepositInfo","name":"info","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint192","name":"key","type":"uint192"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"initCode","type":"bytes"}],"name":"getSenderAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bytes32","name":"accountGasLimits","type":"bytes32"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"bytes32","name":"gasFees","type":"bytes32"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct PackedUserOperation","name":"userOp","type":"tuple"}],"name":"getUserOpHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bytes32","name":"accountGasLimits","type":"bytes32"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"bytes32","name":"gasFees","type":"bytes32"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct PackedUserOperation[]","name":"userOps","type":"tuple[]"},{"internalType":"contract IAggregator","name":"aggregator","type":"address"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct IEntryPoint.UserOpsPerAggregator[]","name":"opsPerAggregator","type":"tuple[]"},{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"handleAggregatedOps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"initCode","type":"bytes"},{"internalType":"bytes","name":"callData","type":"bytes"},{"internalType":"bytes32","name":"accountGasLimits","type":"bytes32"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"bytes32","name":"gasFees","type":"bytes32"},{"internalType":"bytes","name":"paymasterAndData","type":"bytes"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct PackedUserOperation[]","name":"ops","type":"tuple[]"},{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"handleOps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint192","name":"key","type":"uint192"}],"name":"incrementNonce","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"callData","type":"bytes"},{"components":[{"components":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"verificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"callGasLimit","type":"uint256"},{"internalType":"uint256","name":"paymasterVerificationGasLimit","type":"uint256"},{"internalType":"uint256","name":"paymasterPostOpGasLimit","type":"uint256"},{"internalType":"uint256","name":"preVerificationGas","type":"uint256"},{"internalType":"address","name":"paymaster","type":"address"},{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"}],"internalType":"struct EntryPoint.MemoryUserOp","name":"mUserOp","type":"tuple"},{"internalType":"bytes32","name":"userOpHash","type":"bytes32"},{"internalType":"uint256","name":"prefund","type":"uint256"},{"internalType":"uint256","name":"contextOffset","type":"uint256"},{"internalType":"uint256","name":"preOpGas","type":"uint256"}],"internalType":"struct EntryPoint.UserOpInfo","name":"opInfo","type":"tuple"},{"internalType":"bytes","name":"context","type":"bytes"}],"name":"innerHandleOp","outputs":[{"internalType":"uint256","name":"actualGasCost","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint192","name":"","type":"uint192"}],"name":"nonceSequenceNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlockStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"withdrawAddress","type":"address"}],"name":"withdrawStake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"withdrawAddress","type":"address"},{"internalType":"uint256","name":"withdrawAmount","type":"uint256"}],"name":"withdrawTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}] +export const ENTRYPOINT_V07_ABI = [ + { + inputs: [ + { internalType: "bool", name: "success", type: "bool" }, + { internalType: "bytes", name: "ret", type: "bytes" } + ], + name: "DelegateAndRevert", + type: "error" + }, + { + inputs: [ + { internalType: "uint256", name: "opIndex", type: "uint256" }, + { internalType: "string", name: "reason", type: "string" } + ], + name: "FailedOp", + type: "error" + }, + { + inputs: [ + { internalType: "uint256", name: "opIndex", type: "uint256" }, + { internalType: "string", name: "reason", type: "string" }, + { internalType: "bytes", name: "inner", type: "bytes" } + ], + name: "FailedOpWithRevert", + type: "error" + }, + { + inputs: [{ internalType: "bytes", name: "returnData", type: "bytes" }], + name: "PostOpReverted", + type: "error" + }, + { inputs: [], name: "ReentrancyGuardReentrantCall", type: "error" }, + { + inputs: [{ internalType: "address", name: "sender", type: "address" }], + name: "SenderAddressResult", + type: "error" + }, + { + inputs: [ + { internalType: "address", name: "aggregator", type: "address" } + ], + name: "SignatureValidationFailed", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "factory", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "paymaster", + type: "address" + } + ], + name: "AccountDeployed", + type: "event" + }, + { anonymous: false, inputs: [], name: "BeforeExecution", type: "event" }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "totalDeposit", + type: "uint256" + } + ], + name: "Deposited", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + indexed: false, + internalType: "bytes", + name: "revertReason", + type: "bytes" + } + ], + name: "PostOpRevertReason", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "aggregator", + type: "address" + } + ], + name: "SignatureAggregatorChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "totalStaked", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "unstakeDelaySec", + type: "uint256" + } + ], + name: "StakeLocked", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "withdrawTime", + type: "uint256" + } + ], + name: "StakeUnlocked", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "withdrawAddress", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256" + } + ], + name: "StakeWithdrawn", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "paymaster", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + indexed: false, + internalType: "bool", + name: "success", + type: "bool" + }, + { + indexed: false, + internalType: "uint256", + name: "actualGasCost", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "actualGasUsed", + type: "uint256" + } + ], + name: "UserOperationEvent", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256" + } + ], + name: "UserOperationPrefundTooLow", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "sender", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + indexed: false, + internalType: "bytes", + name: "revertReason", + type: "bytes" + } + ], + name: "UserOperationRevertReason", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: false, + internalType: "address", + name: "withdrawAddress", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256" + } + ], + name: "Withdrawn", + type: "event" + }, + { + inputs: [ + { internalType: "uint32", name: "unstakeDelaySec", type: "uint32" } + ], + name: "addStake", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "balanceOf", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { internalType: "address", name: "target", type: "address" }, + { internalType: "bytes", name: "data", type: "bytes" } + ], + name: "delegateAndRevert", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "depositTo", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "", type: "address" }], + name: "deposits", + outputs: [ + { internalType: "uint256", name: "deposit", type: "uint256" }, + { internalType: "bool", name: "staked", type: "bool" }, + { internalType: "uint112", name: "stake", type: "uint112" }, + { internalType: "uint32", name: "unstakeDelaySec", type: "uint32" }, + { internalType: "uint48", name: "withdrawTime", type: "uint48" } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [{ internalType: "address", name: "account", type: "address" }], + name: "getDepositInfo", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "deposit", + type: "uint256" + }, + { internalType: "bool", name: "staked", type: "bool" }, + { internalType: "uint112", name: "stake", type: "uint112" }, + { + internalType: "uint32", + name: "unstakeDelaySec", + type: "uint32" + }, + { + internalType: "uint48", + name: "withdrawTime", + type: "uint48" + } + ], + internalType: "struct IStakeManager.DepositInfo", + name: "info", + type: "tuple" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { internalType: "address", name: "sender", type: "address" }, + { internalType: "uint192", name: "key", type: "uint192" } + ], + name: "getNonce", + outputs: [{ internalType: "uint256", name: "nonce", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [{ internalType: "bytes", name: "initCode", type: "bytes" }], + name: "getSenderAddress", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + { + internalType: "bytes32", + name: "accountGasLimits", + type: "bytes32" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "bytes32", + name: "gasFees", + type: "bytes32" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct PackedUserOperation", + name: "userOp", + type: "tuple" + } + ], + name: "getUserOpHash", + outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + internalType: "bytes", + name: "initCode", + type: "bytes" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + }, + { + internalType: "bytes32", + name: "accountGasLimits", + type: "bytes32" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "bytes32", + name: "gasFees", + type: "bytes32" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { + internalType: "bytes", + name: "signature", + type: "bytes" + } + ], + internalType: "struct PackedUserOperation[]", + name: "userOps", + type: "tuple[]" + }, + { + internalType: "contract IAggregator", + name: "aggregator", + type: "address" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct IEntryPoint.UserOpsPerAggregator[]", + name: "opsPerAggregator", + type: "tuple[]" + }, + { + internalType: "address payable", + name: "beneficiary", + type: "address" + } + ], + name: "handleAggregatedOps", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { internalType: "uint256", name: "nonce", type: "uint256" }, + { internalType: "bytes", name: "initCode", type: "bytes" }, + { internalType: "bytes", name: "callData", type: "bytes" }, + { + internalType: "bytes32", + name: "accountGasLimits", + type: "bytes32" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "bytes32", + name: "gasFees", + type: "bytes32" + }, + { + internalType: "bytes", + name: "paymasterAndData", + type: "bytes" + }, + { internalType: "bytes", name: "signature", type: "bytes" } + ], + internalType: "struct PackedUserOperation[]", + name: "ops", + type: "tuple[]" + }, + { + internalType: "address payable", + name: "beneficiary", + type: "address" + } + ], + name: "handleOps", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [{ internalType: "uint192", name: "key", type: "uint192" }], + name: "incrementNonce", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { internalType: "bytes", name: "callData", type: "bytes" }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256" + }, + { + internalType: "uint256", + name: "verificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "callGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "paymasterVerificationGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "paymasterPostOpGasLimit", + type: "uint256" + }, + { + internalType: "uint256", + name: "preVerificationGas", + type: "uint256" + }, + { + internalType: "address", + name: "paymaster", + type: "address" + }, + { + internalType: "uint256", + name: "maxFeePerGas", + type: "uint256" + }, + { + internalType: "uint256", + name: "maxPriorityFeePerGas", + type: "uint256" + } + ], + internalType: "struct EntryPoint.MemoryUserOp", + name: "mUserOp", + type: "tuple" + }, + { + internalType: "bytes32", + name: "userOpHash", + type: "bytes32" + }, + { + internalType: "uint256", + name: "prefund", + type: "uint256" + }, + { + internalType: "uint256", + name: "contextOffset", + type: "uint256" + }, + { + internalType: "uint256", + name: "preOpGas", + type: "uint256" + } + ], + internalType: "struct EntryPoint.UserOpInfo", + name: "opInfo", + type: "tuple" + }, + { internalType: "bytes", name: "context", type: "bytes" } + ], + name: "innerHandleOp", + outputs: [ + { internalType: "uint256", name: "actualGasCost", type: "uint256" } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { internalType: "address", name: "", type: "address" }, + { internalType: "uint192", name: "", type: "uint192" } + ], + name: "nonceSequenceNumber", + outputs: [{ internalType: "uint256", name: "", type: "uint256" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { internalType: "bytes4", name: "interfaceId", type: "bytes4" } + ], + name: "supportsInterface", + outputs: [{ internalType: "bool", name: "", type: "bool" }], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "unlockStake", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address payable", + name: "withdrawAddress", + type: "address" + } + ], + name: "withdrawStake", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address payable", + name: "withdrawAddress", + type: "address" + }, + { internalType: "uint256", name: "withdrawAmount", type: "uint256" } + ], + name: "withdrawTo", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { stateMutability: "payable", type: "receive" } +] diff --git a/test/e2e/tests/utils/userop.ts b/test/e2e/tests/utils/userop.ts index d9ee1653..df97fbd9 100644 --- a/test/e2e/tests/utils/userop.ts +++ b/test/e2e/tests/utils/userop.ts @@ -3,4 +3,4 @@ export const getNonceKeyAndValue = (nonce: bigint) => { const userOperationNonceValue = nonce & 0xffffffffffffffffn // last 64 bits of nonce return [nonceKey, userOperationNonceValue] -} \ No newline at end of file +} diff --git a/test/kinto-e2e/src/index.ts b/test/kinto-e2e/src/index.ts index 037dab9e..ea83e9a3 100644 --- a/test/kinto-e2e/src/index.ts +++ b/test/kinto-e2e/src/index.ts @@ -1,29 +1,29 @@ +import { type Pool, createPool } from "@viem/anvil" +import type { UserOperation } from "permissionless" +import { createPimlicoBundlerClient } from "permissionless/clients/pimlico" import { + http, type Hex, createPublicClient, decodeEventLog, decodeFunctionData, - http, + hexToNumber, parseAbi, parseAbiItem, - slice, - hexToNumber + slice } from "viem" import { handleOpsAbi } from "./abi" -import { type Pool, createPool } from "@viem/anvil" -import type { UserOperation } from "permissionless" -import { createPimlicoBundlerClient } from "permissionless/clients/pimlico" +import { startAlto } from "./setupAlto" import { - KINTO_RPC, + type CompressedOp, KINTO_ENTRYPOINT, + KINTO_RPC, + type OpInfoType, + isCompressed, kintoMainnet, prettyPrintTxHash, - sleep, - type OpInfoType, - type CompressedOp, - isCompressed + sleep } from "./utils" -import { startAlto } from "./setupAlto" const canReplayUserOperation = async ({ anvilPool, diff --git a/test/kinto-e2e/src/setupAlto.ts b/test/kinto-e2e/src/setupAlto.ts index 924cdf45..bd18794a 100644 --- a/test/kinto-e2e/src/setupAlto.ts +++ b/test/kinto-e2e/src/setupAlto.ts @@ -1,6 +1,6 @@ import { spawn } from "node:child_process" +import { http, type Hex, createTestClient, parseEther } from "viem" import { generatePrivateKey, privateKeyToAddress } from "viem/accounts" -import { type Hex, createTestClient, http, parseEther } from "viem" import waitPort from "wait-port" import { sleep } from "./utils" diff --git a/test/kinto-e2e/src/utils.ts b/test/kinto-e2e/src/utils.ts index 05b26adf..7d019df3 100644 --- a/test/kinto-e2e/src/utils.ts +++ b/test/kinto-e2e/src/utils.ts @@ -1,5 +1,5 @@ import type { UserOperation } from "permissionless" -import { defineChain, type Hex, type Hash, type Address } from "viem" +import { type Address, type Hash, type Hex, defineChain } from "viem" export const prettyPrintTxHash = (hash: Hash) => { return `https://kintoscan.io/tx/${hash}`