diff --git a/README.md b/README.md index 625cb52..246c6b7 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ The following is a list of contracts that are deployed by this script. | ERC721ItemsFactory | 0x29BCF1043Ca4B2c95aB28082143587896D39D22D | | ERC1155ItemsFactory | 0x7364fDEFe24385B2b3869504383c94cF083AcbD6 | | ERC721SaleFactory | 0xc412172a99e657609f5f7D4b9Bea37684B8eEE4E | -| ERC1155SaleFactory | 0x52A6E7236A01B72eeb262d58F7270cb9AeD8Db4B | +| ERC1155SaleFactory | 0x07F5E9F05e19A042232591B15b2f3Ab2E033FB80 | | ERC721SoulboundFactory | 0x2fBFF6fd3C978ab1bBd21b878262c5289a14b6c1 | | ERC1155SoulboundFactory | 0xaB069C041FaCAB8f4D747D91EEda5705b5caAB76 | | ERC1155PackFactory | 0x305197A57961CB16Df8D7F829Baf6aaF4bfD0d48 | diff --git a/scripts/factories/token_library/ERC1155SaleFactory.ts b/scripts/factories/token_library/ERC1155SaleFactory.ts index 7924af0..dd93a33 100644 --- a/scripts/factories/token_library/ERC1155SaleFactory.ts +++ b/scripts/factories/token_library/ERC1155SaleFactory.ts @@ -1,7 +1,7 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' -// https://github.com/0xsequence/contracts-library/blob/dc28b8bf2d1dfe49441bde4893900e15712083a2/src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol +// https://github.com/0xsequence/contracts-library/blob/73363994054ad0983ceabebb8b98ad02044a4267/src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol const abi = [ { @@ -62,6 +62,11 @@ const abi = [ }, { inputs: [ + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256' + }, { internalType: 'address', name: 'proxyOwner', @@ -76,6 +81,16 @@ const abi = [ internalType: 'address', name: 'items', type: 'address' + }, + { + internalType: 'address', + name: 'implicitModeValidator', + type: 'address' + }, + { + internalType: 'bytes32', + name: 'implicitModeProjectId', + type: 'bytes32' } ], name: 'deploy', @@ -91,6 +106,11 @@ const abi = [ }, { inputs: [ + { + internalType: 'uint256', + name: 'nonce', + type: 'uint256' + }, { internalType: 'address', name: 'proxyOwner', @@ -105,6 +125,16 @@ const abi = [ internalType: 'address', name: 'items', type: 'address' + }, + { + internalType: 'address', + name: 'implicitModeValidator', + type: 'address' + }, + { + internalType: 'bytes32', + name: 'implicitModeProjectId', + type: 'bytes32' } ], name: 'determineAddress', @@ -170,7 +200,7 @@ export class ERC1155SaleFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( abi, - '608034610121576001600160401b0390601f6155e638819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b82519361321494858101958187108388111761010b576123d2823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611de4853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611c76908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461079057806359659e901461073d578063715018a6146106a05780638da5cb5b1461064b578063d9181cd3146102ee578063e657f693146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561084f565b906100ae6108bd565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b8284346102eb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb57506101e461084f565b906101ed610877565b916055600b6101fa61089a565b845173ffffffffffffffffffffffffffffffffffffffff968716602080830191825292909716604080830191909152815290957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09161025a60608261099b565b519020906102ab86519161026d8361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff9661029f8860015416948a519586938d850198896109ff565b0390810183528261099b565b5190206111eb85516102bf8883018261099b565b81815287810191610a5683395190209085519186830152868201523081520160ff815320915191168152f35b80fd5b5090346101a65760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a65761032761084f565b92610330610877565b61033861089a565b908351946020968787018761037586868490602090939293604083019473ffffffffffffffffffffffffffffffffffffffff809216845216910152565b03976103a77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0998a810183528261099b565b5190208651916103b68361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff91816103f98c6103ed878d88600154169051958694850197886109ff565b038c810183528261099b565b5190206111eb895161040d8d83018261099b565b8181528c810191610a5683398051156105f057518492918af516988915610594578260015416938a3b156105905791608491601f8a95946104988f8e51998a9889977fcf7a1d77000000000000000000000000000000000000000000000000000000008952168c880152602487015260606044870152825192839182606489015288880191016109dc565b01168101030181838b5af1801561058657908591610572575b5050853b1561056e5784517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316918101918252929091166020820152829082908190604001038183885af1801561056457610550575b50507f346f0211197dd599e2e2a8c828f6e7dc39e8a49171ce0a728428e8b778c61eea838251848152a151908152f35b61055a829161093c565b6102eb5780610520565b83513d84823e3d90fd5b8380fd5b61057b9061093c565b61056e5783386104b1565b86513d87823e3d90fd5b8880fd5b6064858c8b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b6064878e808e51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b83346102eb57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb576106d76108bd565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a657826107ca61084f565b6107d26108bd565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561056e5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af1908115610846575061083a575080f35b6108439061093c565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108de57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b67ffffffffffffffff811161095057604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff82111761095057604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761095057604052565b60005b8381106109ef5750506000910152565b81810151838201526020016109df565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610a5082518093602086850191016109dc565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea2646970667358221220a592f27f25373407ca73911ddc0bbaa6ea0e0d6dfcce18bb6b5765f70d2e1a1764736f6c63430008130033a2646970667358221220cacf10d5c818ae8f15d105a3e217b088abc54a07a2101d07f54bee5abff11c7164736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ff9f63e676c96c753988d58c9eed378dc3ae25dde2df2114b6217eba7bb9455964736f6c6343000813003360808060405234610016576131f8908161001c8239f35b600080fdfe61010080604052600436101561001457600080fd5b600080608052803560e01c91826301ffc9a714611ee3575081630869678c14611ead578163119cd50c14611e44578163248a9ca314611e155781632f2ff15d14611d135781633013ce2914611cdd57816336568abe14611c1757816344004cc114611b765781634782f77914611b0a578163485cc955146117e15781634f651ccd1461168657816360e606f6146109ce5781636a326ab1146109685781639010d07c1461091357816391d14854146108bc57816397559600146107a0578163a217fddf14610782578163bad436611461070d57508063ca15c873146106df578063d547741f14610699578063f07f04ff1461028e5763ff81434e1461011857600080fd5b34610288576020806003193601126102885760043567ffffffffffffffff81116102885761014a9036906004016121c5565b919061015583612115565b9261016360405194856120d4565b8084527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061019082612115565b01836080515b828110610272575050506080515b81811061022c57838560405190828201838352815180915283604084019201936080515b8281106101d55784840385f35b9091928260a08261021d6001948a5160808091805184526020810151602085015267ffffffffffffffff80604083015116604086015260608201511660608501520151910152565b019601910194929190946101c8565b8061023b61026d928486613030565b356080515260098552610252604060805120612d81565b61025c8288612cf6565b526102678187612cf6565b50612cc9565b6101a4565b61027a613055565b828289010152018490610196565b60805180fd5b346102885760c06003193601126102885760043567ffffffffffffffff8111610288576102bf9036906004016121c5565b9060243567ffffffffffffffff8111610288576102e09036906004016121c5565b909160443567ffffffffffffffff8111610288576103029036906004016121c5565b929060643567ffffffffffffffff8111610288576103249036906004016121c5565b95909160843567ffffffffffffffff8111610288576103479036906004016121c5565b9460a43567ffffffffffffffff8111610288576103689036906004016121c5565b9590946103736124c9565b828c1480159061068f575b8015610685575b801561067b575b8015610671575b6105eb5760805180995b8d8b106103aa5760805180f35b6103b58b8f83613030565b3591828c15159182610666575b505061063c578a808e8c859e6103d8918b613030565b6103e190613040565b916103ec9188613030565b6103f590613040565b67ffffffffffffffff169067ffffffffffffffff16108015610615575b6105eb578d8f93808f918d8f91868f918f8f918f8f91928f8087848f8f90988e8e859b8f878f818f819f8f839f61044c8580948193613030565b359c61045792613030565b359661046292613030565b61046b90613040565b9661047592613030565b61047e90613040565b9361048892613030565b35936040519561049787612051565b8652602090818701928352604087019467ffffffffffffffff168552606087019367ffffffffffffffff168452608087019586526080515260099052608051604090209451855551600185015560028401915167ffffffffffffffff168254915160401b6fffffffffffffffff000000000000000016917fffffffffffffffffffffffffffffffff00000000000000000000000000000000161717905551906003015561054392613030565b359b61054e92613030565b359a61055992613030565b61056290613040565b9561056c92613030565b61057590613040565b9261057f92613030565b6040805194855260208501959095529383019490945267ffffffffffffffff908116606083015290921660808301523560a08201527f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f969060c090a16105e390612cc9565b9a915061039d565b60046040517f85d4a748000000000000000000000000000000000000000000000000000000008152fd5b50610629610624828d8a613030565b613040565b67ffffffffffffffff4291161115610412565b60046040517f340bc4c9000000000000000000000000000000000000000000000000000000008152fd5b1015905082386103c2565b50868c1415610393565b50878c141561038c565b508a8c1415610385565b50898c141561037e565b34610288576040600319360112610288576106d96004356106b8611fef565b9080608051526106d4600160406080518060205220015461263f565b6127e0565b60805180f35b3461028857602060031936011261028857600435608051526001602052602060406080512054604051908152f35b346102885760806003193601126102885760243567ffffffffffffffff81116102885761073e9036906004016121c5565b6044929192359173ffffffffffffffffffffffffffffffffffffffff8316830361077f576020610775606435858588600435613080565b6040519015158152f35b80fd5b34610288576080518060031936011261077f57602090604051908152f35b346102885760a06003193601126102885760043590602435916044359167ffffffffffffffff9081841680940361077f57506107da61203a565b92608435916107e76124c9565b84169080821080156108b2575b6105eb577f8fd3ac39fbb3d5e9c906dd9ec439dc6e584b8fa3ce02d5b67d589b22b22152a99560a09584608060405161082c81612051565b88815284602082015285604082015286606082015201528560055581600655827fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffff00000000000000006007549360401b1692161717600755836008556040519485526020850152604084015260608301526080820152a160805180f35b50428211156107f4565b346102885760406003193601126102885760ff60406020926108dc611fef565b6004356080515273ffffffffffffffffffffffffffffffffffffffff83608051808852209116825284522054166040519015158152f35b3461028857604060031936011261028857600435608051526001602052602073ffffffffffffffffffffffffffffffffffffffff610958602435604060805120612a97565b9190546040519260031b1c168152f35b346102885760206003193601126102885773ffffffffffffffffffffffffffffffffffffffff610996612017565b61099e6124c9565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600454161760045560805180f35b60e0600319360112610288576109e2612017565b60243567ffffffffffffffff811161028857610a0290369060040161212d565b60443567ffffffffffffffff811161028857610a2290369060040161212d565b916064359167ffffffffffffffff83116102885736602384011215610288578260040135610a4f8161218b565b93610a5d60405195866120d4565b818552366024838301011161028857602482910160208601376020608051918501015273ffffffffffffffffffffffffffffffffffffffff60843516608435036102885767ffffffffffffffff60c4351161028857610ac49391933660c4356004016121c5565b9060c052926080519283928496610ad9612d3e565b60a052610b0767ffffffffffffffff604060a05101511667ffffffffffffffff606060a05101511690613008565b60805160e08190529094905b835160e0511015610d2057610b2a60e05185612cf6565b51968760e05115159182610d15575b505061063c5786610b4c60e05187612cf6565b519181608051526009602052610b66604060805120612d81565b610b8d67ffffffffffffffff60408301511667ffffffffffffffff60608401511690613008565b15610c0557505086610bd45750610bbd90610bb7600199610bb18360a05151612893565b906128d5565b9a6128d5565b96610bc960e051612cc9565b60e052989698610b13565b602490604051907f035acf500000000000000000000000000000000000000000000000000000000082526004820152fd5b9099916080820151908c82610c2b575b5050508291610bb1610bbd94610bb79351612893565b81610c3b91339060c05186613080565b15610c92575060808051339052600260209081528151604080822094909152929052512080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905581610bb18c610c15565b8c604051927f265c66a80000000000000000000000000000000000000000000000000000000084526004840152608060248401528060848401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811161028857829060051b60a4928160c0518585013733604484015260648301528101030190fd5b10159050878c610b39565b88889194939461142d575b5073ffffffffffffffffffffffffffffffffffffffff600454168073ffffffffffffffffffffffffffffffffffffffff60843516036113ef575060a435818110611399575060843573ffffffffffffffffffffffffffffffffffffffff166112e45780340361128d57505b73ffffffffffffffffffffffffffffffffffffffff60035460081c1660805190835182905b8082106110ba575050600654908115158061102c575b610f645750505073ffffffffffffffffffffffffffffffffffffffff60035460081c1690813b156102885760405180927fb48ab8b600000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff86166004830152608060248301528180610e83610e6e610e5c608484018a612d0a565b6003198482030160448501528b612d0a565b6003198382030160648401526080519661279d565b0391608051905af18015610f5757610f06575b7f23519238b590c499a2abcf44a33b5f431ac6ca51c22fad26bc2c3d08b97eaa2173ffffffffffffffffffffffffffffffffffffffff84610efd87610eef87604051958695168552606060208601526060850190612d0a565b908382036040850152612d0a565b0390a160805180f35b919067ffffffffffffffff8311610f265760409290925290610efd610e96565b7f4e487b71000000000000000000000000000000000000000000000000000000006080515260416004526024608051fd5b6040513d608051823e3d90fd5b906020600492604051938480927f18160ddd000000000000000000000000000000000000000000000000000000008252608051905af1918215610f575760805192610ff6575b50610ff2906040519384937fa9227830000000000000000000000000000000000000000000000000000000008552600485016040919493926060820195825260208201520152565b0390fd5b9091506020813d602011611024575b81611012602093836120d4565b81010312610288575190610ff2610faa565b3d9150611005565b506040517f18160ddd000000000000000000000000000000000000000000000000000000008152602081600481608051865af18015610f575784849160805190611082575b61107c9293506128d5565b11610dd1565b5050506020813d6020116110b2575b8161109e602093836120d4565b810103126102885751829081908590611071565b3d9150611091565b90926110c68487612cf6565b5160805152600960205260016040608051200154801515806111ec575b61110c5750611100611106916110f9868b612cf6565b51906128d5565b93612cc9565b90610dbb565b83858a602061111b838c612cf6565b516024604051809681937f2693ebf20000000000000000000000000000000000000000000000000000000083526004830152608051905af1928315610f5757608051936111b6575b50610ff29161117191612cf6565b51926040519384937fa9227830000000000000000000000000000000000000000000000000000000008552600485016040919493926060820195825260208201520152565b9092506020813d6020116111e4575b816111d2602093836120d4565b81010312610288575191610ff2611163565b3d91506111c5565b506111f78588612cf6565b51604051907f2693ebf20000000000000000000000000000000000000000000000000000000082526004820152602081602481608051895af18015610f5757829160805191611256575b50611250906110f9888d612cf6565b116110e3565b9150506020813d602011611285575b81611272602093836120d4565b8101031261028857518190611250611241565b3d9150611265565b6040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260843573ffffffffffffffffffffffffffffffffffffffff1660048201526024810191909152346044820152606490fd5b341561132a5760646040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260805160048201526080516024820152346044820152fd5b61139490604051907f23b872dd00000000000000000000000000000000000000000000000000000000602083015233602483015230604483015260648201526064815261137681612051565b73ffffffffffffffffffffffffffffffffffffffff60843516612dc9565b610d96565b6040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260843573ffffffffffffffffffffffffffffffffffffffff16600482015260248101929092526044820152606490fd5b606491604051917f1eabcfbe000000000000000000000000000000000000000000000000000000008352600483015260248201526080516044820152fd5b608060a05101519081611441575b50610d2b565b336080515260026020526080518260408220915260205260ff6040608051205416158061155e575b156114bc5750336080515260026020526080519060408220915260205260406080512060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055858061143b565b604051917f265c66a80000000000000000000000000000000000000000000000000000000083526004830152608060248301528060848301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610288578160a49160051b8060c051848401373360448301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60648301528101030190fd5b509491959260409491945160208101907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1682527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6034820152603481526115c98161209c565b519020966115d687612115565b976115e4604051998a6120d4565b87895260208901368960051b60c05101116102885760c051905b8960051b60c05101821061167657505095608051965b895188101561166457611627888b612cf6565b51608051818310156116525750906080515260205261164c6040608051205b97612cc9565b96611614565b5260205261164c604060805120611646565b90939650839194979295985014611469565b81358152602091820191016115fe565b346102885760c0600319360112610288576044356024356004356116a861203a565b67ffffffffffffffff6084358181169591928682036102885760a435926116cd6124c9565b8482169788811080156117d7575b6105eb576003610efd967f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f969a6040519361171485612051565b8b85526020850192868452604086019283526060860191825260808601938a85528c60805152600960205260406080512096518755516001870155600286019251167fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffff00000000000000008454935160401b1692161717905551910155604051968796879260a09492979695919760c085019885526020850152604084015267ffffffffffffffff80921660608401521660808201520152565b50428111156116db565b34610288576040600319360112610288576117fa612017565b611802611fef565b6003549060ff8216611ae05774ffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffff0000000000000000000000000000000000000000ff9160081b16911617600355608051805261196860805160209281845273ffffffffffffffffffffffffffffffffffffffff604083209116809252835260805160ff60408220541615611a72575b506080518052600183818095526118ae83604060805120612aaf565b507f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280608051526080518083528460408220915282528060805160ff60408220541615611a05575b50506080515281815261190e83604060805120612aaf565b507f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec80608051526080518083528460408220915282528060805160ff60408220541615611998575b50506080515252604060805120612aaf565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600354161760035560805180f35b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a48087611956565b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a480876118f6565b80526080518084528160408220915283526080516040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790558133917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a483611892565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b3461028857604060031936011261028857611b23612017565b611b2b6121f6565b60805180808093602435905af1611b40612f0c565b5015611b4c5760805180f35b60046040517f750b219c000000000000000000000000000000000000000000000000000000008152fd5b3461028857606060031936011261028857611b8f612017565b611b97611fef565b611b9f6121f6565b604051907fa9059cbb00000000000000000000000000000000000000000000000000000000602083015273ffffffffffffffffffffffffffffffffffffffff8091166024830152604435604483015260448252608082019282841067ffffffffffffffff851117610f26576106d99360405216612dc9565b3461028857604060031936011261028857611c30611fef565b3373ffffffffffffffffffffffffffffffffffffffff821603611c59576106d9906004356127e0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610288576080518060031936011261077f57602073ffffffffffffffffffffffffffffffffffffffff60045416604051908152f35b3461028857604060031936011261028857611da16004356001611d34611fef565b91806080515260805190611d5283604060209480865220015461263f565b80608051526080519384835273ffffffffffffffffffffffffffffffffffffffff60408620911680955282528060805160ff60408220541615611da85750506080515252604060805120612aaf565b5060805180f35b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a48086611956565b346102885760206003193601126102885760043560805152602060016040608051808452200154604051908152f35b34610288576080518060031936011261077f57611e5f613055565b5060a0611e6a612d3e565b611eab604051809260808091805184526020810151602085015267ffffffffffffffff80604083015116604086015260608201511660608501520151910152565bf35b3461028857602060031936011261028857611ec6613055565b5060043560805152600960205260a0611e6a604060805120612d81565b34611feb576020600319360112611feb576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103611fe75760209250807fb68139110000000000000000000000000000000000000000000000000000000014908115611f57575b5015158152f35b7f5a05180f00000000000000000000000000000000000000000000000000000000811491508115611f8a575b5083611f50565b7f7965db0b00000000000000000000000000000000000000000000000000000000811491508115611fbd575b5083611f83565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483611fb6565b8280fd5b5080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361201257565b600080fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361201257565b6064359067ffffffffffffffff8216820361201257565b60a0810190811067ffffffffffffffff82111761206d57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761206d57604052565b6080810190811067ffffffffffffffff82111761206d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761206d57604052565b67ffffffffffffffff811161206d5760051b60200190565b81601f820112156120125780359161214483612115565b9261215260405194856120d4565b808452602092838086019260051b820101928311612012578301905b82821061217c575050505090565b8135815290830190830161216e565b67ffffffffffffffff811161206d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b9181601f840112156120125782359167ffffffffffffffff8311612012576020808501948460051b01011161201257565b3360009081527f20be27040b8e00df40bca0df34743417f3574a156386188f7d7f14369e5ee82b602090815260408083205490927f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec9160ff161561225a5750505050565b61226333612922565b91845190612270826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b8183116123d157505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b8401917f206973206d697373696e6720726f6c652000000000000000000000000000000060378401525180938684019061277a565b010360288101875201856120d4565b519283927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152602483019061279d565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61240e85876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0191906122a1565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f6058ee1f1c102e8ac9ef0c4319964e42c1ab00dfba021f8302fd0802656934ac602090815260408083205490927f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c29160ff161561252d5750505050565b61253633612922565b91845190612543826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b8183116125ce57505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61260b85876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190612574565b600090808252602090828252604092838120338252835260ff8482205416156126685750505050565b61267133612922565b9184519061267e826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b81831161270957505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61274685876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0191906126af565b60005b83811061278d5750506000910152565b818101518382015260200161277d565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936127d98151809281875287808801910161277a565b0116010190565b90604061282b926000908082528160205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff838320541661282e575b8152600160205220612b70565b50565b808252816020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a461281e565b818102929181159184041417156128a657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919082018092116128a657565b9081518110156128f3570160200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040519061292f8261209c565b602a82526020820160403682378251156128f3576030905381516001908110156128f357607860218401536029905b8082116129cc57505061296e5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015612a69577f3031323334353637383961626364656600000000000000000000000000000000901a612a0884866128e2565b5360041c918015612a3b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019061295e565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b80548210156128f35760005260206000200190600090565b91906001830160009082825280602052604082205415600014612b6a5784549468010000000000000000861015612b3d5783612b2d612af8886001604098999a01855584612a97565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014612cc2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91828101818111612c9557825490848201918211612c6857808203612c33575b50505080548015612c0657820191612be98383612a97565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b612c53612c43612af89386612a97565b90549060031b1c92839286612a97565b90558652846020526040862055388080612bd1565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146128a65760010190565b80518210156128f35760209160051b010190565b90815180825260208080930193019160005b828110612d2a575050505090565b835185529381019392810192600101612d1c565b60405190612d4b82612051565b816005548152600654602082015260075467ffffffffffffffff90818116604084015260401c1660608201526080600854910152565b90604051612d8e81612051565b6080600382948054845260018101546020850152600281015467ffffffffffffffff90818116604087015260401c1660608501520154910152565b73ffffffffffffffffffffffffffffffffffffffff1690604051604081019080821067ffffffffffffffff83111761206d57612e49916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af1612e43612f0c565b91612f3c565b805191821591848315612ee8575b505050905015612e645750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b919381809450010312611feb5782015190811515820361077f575080388084612e57565b3d15612f37573d90612f1d8261218b565b91612f2b60405193846120d4565b82523d6000602084013e565b606090565b91929015612fb75750815115612f50575090565b3b15612f595790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015612fca5750805190602001fd5b610ff2906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061279d565b908015918215613026575b50811561301e575090565b905042101590565b4210915038613013565b91908110156128f35760051b0190565b3567ffffffffffffffff811681036120125790565b6040519061306282612051565b60006080838281528260208201528260408201528260608201520152565b91929060009073ffffffffffffffffffffffffffffffffffffffff8316825260209060028252604093848420868552835260ff85852054161597886130cb575b505050505050505090565b909192939597508496989451907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008583019360601b1683526034820152603481526131158161209c565b5190209061312288612115565b9761312f8751998a6120d4565b8089528389019060051b8201913683116131be578490915b8383106131ae57505050509183925b8751841015613199576131698489612cf6565b519081811015613189578552825261318385852093612cc9565b92613156565b9085528252613183858520611100565b945095505050501438808080808080806130c0565b8235815291810191859101613147565b8680fdfea26469706673582212200c951b38aeb19ea68e45ccc53d57fe854abf845aa0d3e3c417ffc2a5e258f8eb64736f6c63430008130033', + '60806040523461002f576100196100146100fa565b610169565b610021610034565b6125d461039782396125d490f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118617b498038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b61473c810181811060018060401b038211176101c5576101a1829161473c61296b843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa26170a785396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610403565b61001e60003561008d565b80631a4b671d146100885780631bce45831461008357806359659e901461007e57806369b3934d14610079578063715018a6146100745780638da5cb5b1461006f5763f2fde38b0361000e576103d0565b61039b565b610368565b61032c565b6102f7565b610215565b6101b4565b60e01c90565b60405190565b600080fd5b600080fd5b90565b6100af816100a3565b036100b657565b600080fd5b905035906100c8826100a6565b565b60018060a01b031690565b6100de906100ca565b90565b6100ea816100d5565b036100f157565b600080fd5b90503590610103826100e1565b565b90565b61011181610105565b0361011857565b600080fd5b9050359061012a82610108565b565b909160c08284031261018c5761014583600084016100bb565b9261015381602085016100f6565b9261016182604083016100f6565b9261018961017284606085016100f6565b9361018081608086016100f6565b9360a00161011d565b90565b61009e565b61019a906100d5565b9052565b91906101b290600060208501940190610191565b565b346101eb576101e76101d66101ca36600461012c565b9493909392919261052f565b6101de610093565b9182918261019e565b0390f35b610099565b9060208282031261020a57610207916000016100f6565b90565b61009e565b60000190565b346102435761022d6102283660046101f0565b61068c565b610235610093565b8061023f8161020f565b0390f35b610099565b600091031261025357565b61009e565b1c90565b60018060a01b031690565b61027790600861027c9302610258565b61025c565b90565b9061028a9154610267565b90565b61029a600160009061027f565b90565b90565b6102b46102af6102b9926100ca565b61029d565b6100ca565b90565b6102c5906102a0565b90565b6102d1906102bc565b90565b6102dd906102c8565b9052565b91906102f5906000602085019401906102d4565b565b3461032757610307366004610248565b61032361031261028d565b61031a610093565b918291826102e1565b0390f35b610099565b346103635761035f61034e61034236600461012c565b949390939291926106fa565b610356610093565b9182918261019e565b0390f35b610099565b3461039657610378366004610248565b61038061087f565b610388610093565b806103928161020f565b0390f35b610099565b346103cb576103ab366004610248565b6103c76103b66108b5565b6103be610093565b9182918261019e565b0390f35b610099565b346103fe576103e86103e33660046101f0565b6109c2565b6103f0610093565b806103fa8161020f565b0390f35b610099565b600080fd5b600090565b610416906100a3565b9052565b61042390610105565b9052565b909594926104739461046261046c9261045860809661044e60a088019c600089019061040d565b6020870190610191565b6040850190610191565b6060830190610191565b019061041a565b565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061049f90610475565b810190811067ffffffffffffffff8211176104b957604052565b61047f565b60200190565b5190565b906104db6104d4610093565b9283610495565b565b67ffffffffffffffff81116104fb576104f7602091610475565b0190565b61047f565b9061051261050d836104dd565b6104c8565b918252565b6105216000610500565b90565b61052c610517565b90565b61056e9291946105909661055f92610545610408565b509395919091610553610093565b96879560208701610427565b60208201810382520382610495565b61058061057a826104c4565b916104be565b209061058a610524565b91610aa1565b90565b6105a49061059f610bba565b6105f9565b565b60001c90565b6105b86105bd916105a6565b61025c565b90565b6105ca90546105ac565b90565b600080fd5b60e01b90565b60009103126105e357565b61009e565b6105f0610093565b3d6000823e3d90fd5b61060b61060660016105c0565b6102c8565b90633659cfe690823b1561068757610643926106386000809461062c610093565b968795869485936105d2565b83526004830161019e565b03925af1801561068257610655575b50565b6106759060003d811161067b575b61066d8183610495565b8101906105d8565b38610652565b503d610663565b6105e8565b6105cd565b61069590610593565b565b6106a0906102a0565b90565b6106ac90610697565b90565b6106b8906102bc565b90565b6106f16106f8946106e76060949897956106dd608086019a6000870190610191565b6020850190610191565b6040830190610191565b019061041a565b565b9061075c9193929361070a610408565b5061073a859161072b86898b9161071f610093565b96879560208701610427565b60208201810382520382610495565b61074c610746826104c4565b916104be565b2090610756610524565b91610cad565b9361076e610769866106a3565b6106af565b906363acc14d93929490823b15610829576000946107aa869261079f94610793610093565b998a98899788966105d2565b8652600486016106bb565b03925af18015610824576107f7575b50806107f17f346f0211197dd599e2e2a8c828f6e7dc39e8a49171ce0a728428e8b778c61eea916107e8610093565b9182918261019e565b0390a190565b6108179060003d811161081d575b61080f8183610495565b8101906105d8565b386107b9565b503d610805565b6105e8565b6105cd565b610836610bba565b61083e61086b565b565b90565b61085761085261085c92610840565b61029d565b6100ca565b90565b61086890610843565b90565b61087d610878600061085f565b610e3c565b565b61088761082e565b565b60018060a01b031690565b6108a06108a5916105a6565b610889565b90565b6108b29054610894565b90565b6108bd610408565b506108c860006108a8565b90565b6108dc906108d7610bba565b610991565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b61094260266040926108de565b61094b816108e7565b0190565b6109659060208101906000818303910152610935565b90565b1561096f57565b610977610093565b62461bcd60e51b81528061098d6004820161094f565b0390fd5b6109c0906109bb816109b46109ae6109a9600061085f565b6100d5565b916100d5565b1415610968565b610e3c565b565b6109cb906108cb565b565b90565b6109dc6109e191610105565b6109cd565b9052565b60601b90565b6109f4906109e5565b90565b610a00906109eb565b90565b610a0f610a14916100d5565b6109f7565b9052565b905090565b60005b838110610a31575050906000910152565b806020918301518185015201610a20565b610a67610a5e92602092610a55816104c4565b94858093610a18565b93849101610a1d565b0190565b60148093610a8f602084610a87610a9796610a9e9b9a986109d0565b018092610a03565b018092610a03565b0190610a42565b90565b610b349291610ade610aed92610ab5610408565b509193610aca610ac560016105c0565b6102c8565b610ad2610093565b95869460208601610a6b565b60208201810382520382610495565b610aff610af9826104c4565b916104be565b2061148a610b0f602082016104c8565b908082526111156020830139610b2d610b27826104c4565b916104be565b2090610ea9565b90565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6b602080926108de565b610b7481610b37565b0190565b610b8e9060208101906000818303910152610b5f565b90565b15610b9857565b610ba0610093565b62461bcd60e51b815280610bb660048201610b78565b0390fd5b610be4610bc56108b5565b610bde610bd8610bd3610eca565b6100d5565b916100d5565b14610b91565b565b610bfa610bf5610bff92610840565b61029d565b6100a3565b90565b610c0b906102a0565b90565b610c1790610c02565b90565b610c23906102a0565b90565b610c2f90610c1a565b90565b610c3b906102bc565b90565b60209181520190565b610c66610c6f602093610c7493610c5d816104c4565b93848093610c3e565b95869101610a1d565b610475565b0190565b610c9d610caa949293610c9360608401956000850190610191565b6020830190610191565b6040818403910152610c47565b90565b610d3d9093929193610cbd610408565b50610cfd8591610cee610cd8610cd360016105c0565b6102c8565b8690610ce2610093565b95869460208601610a6b565b60208201810382520382610495565b610d0f610d09826104c4565b916104be565b2061148a610d1f602082016104c8565b908082526111156020830139610d386000929192610be6565b611062565b92610d57610d52610d4d86610c0e565b610c26565b610c32565b63cf7a1d779190610d70610d6b60016105c0565b6102c8565b9392813b15610de7576000610d9891610da38296610d8c610093565b988997889687956105d2565b855260048501610c78565b03925af18015610de257610db5575b50565b610dd59060003d8111610ddb575b610dcd8183610495565b8101906105d8565b38610db2565b503d610dc3565b6105e8565b6105cd565b60001b90565b90610e0360018060a01b0391610dec565b9181191691161790565b610e16906102bc565b90565b90565b90610e31610e2c610e3892610e0d565b610e19565b8254610df2565b9055565b610e4660006108a8565b610e51826000610e1c565b90610e85610e7f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610e0d565b91610e0d565b91610e8e610093565b80610e988161020f565b0390a3565b610ea6906102bc565b90565b90610ec791610eb6610408565b5090610ec130610e9d565b916110eb565b90565b610ed2610408565b503390565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b610f0c601d6020926108de565b610f1581610ed7565b0190565b610f2f9060208101906000818303910152610eff565b90565b15610f3957565b610f41610093565b62461bcd60e51b815280610f5760048201610f19565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b610f8f602080926108de565b610f9881610f5b565b0190565b610fb29060208101906000818303910152610f83565b90565b15610fbc57565b610fc4610093565b62461bcd60e51b815280610fda60048201610f9c565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61101360196020926108de565b61101c81610fde565b0190565b6110369060208101906000818303910152611006565b90565b1561104057565b611048610093565b62461bcd60e51b81528061105e60048201611020565b0390fd5b91909161106d610408565b5061109461107a30610e9d565b3161108d611087846100a3565b916100a3565b1015610f32565b6110ba6110a0836104c4565b6110b36110ad6000610be6565b916100a3565b1415610fb5565b60208251920190f5906110e9826110e26110dc6110d7600061085f565b6100d5565b916100d5565b1415611039565b565b90605592600b926110fa610408565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a2646970667358221220962edf86734333a2fc843b04b2b69e8cc838168430ee10b6c1270aa546dcf53164736f6c634300081b0033608060405234601c57600e6020565b61471061002c823961471090f35b6026565b60405190565b600080fdfe6101406040526004361015610014575b610f00565b61001f60003561017e565b806301ffc9a7146101795780630bb310de14610174578063248a9ca31461016f57806326f631071461016a5780632f2ff15d1461016557806336568abe14610160578063436013db1461015b57806344004cc1146101565780634782f7791461015157806363acc14d1461014c5780639010d07c1461014757806391d1485414610142578063989d6ed11461013d5780639d043a6614610138578063a217fddf14610133578063bad436611461012e578063ca15c87314610129578063ce6bcda714610124578063d547741f1461011f578063ddced6e71461011a578063ed4c2ac7146101155763fc640a870361000f57610ecb565b610e98565b610e5f565b610cab565b610c75565b610aa3565b610a6a565b610984565b610901565b61083c565b6106fd565b6106c7565b61063f565b6105c4565b610562565b6104f2565b61047b565b610447565b6103e5565b610341565b6102a5565b610210565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b6101ae81610199565b036101b557565b600080fd5b905035906101c7826101a5565b565b906020828203126101e3576101e0916000016101ba565b90565b61018f565b151590565b6101f6906101e8565b9052565b919061020e906000602085019401906101ed565b565b346102405761023c61022b6102263660046101c9565b610f0a565b610233610184565b918291826101fa565b0390f35b61018a565b60018060a01b031690565b61025990610245565b90565b61026581610250565b0361026c57565b600080fd5b9050359061027e8261025c565b565b9060208282031261029a5761029791600001610271565b90565b61018f565b60000190565b346102d3576102bd6102b8366004610280565b611035565b6102c5610184565b806102cf8161029f565b0390f35b61018a565b90565b6102e4816102d8565b036102eb57565b600080fd5b905035906102fd826102db565b565b9060208282031261031957610316916000016102f0565b90565b61018f565b610327906102d8565b9052565b919061033f9060006020850194019061031e565b565b346103715761036d61035c6103573660046102ff565b611093565b610364610184565b9182918261032b565b0390f35b61018a565b90565b61038281610376565b0361038957565b600080fd5b9050359061039b82610379565b565b600080fd5b90816101009103126103b15790565b61039d565b9190610120838203126103e057806103d46103dd926000860161038e565b936020016103a2565b90565b61018f565b34610414576103fe6103f83660046103b6565b906115d3565b610406610184565b806104108161029f565b0390f35b61018a565b9190604083820312610442578061043661043f92600086016102f0565b93602001610271565b90565b61018f565b346104765761046061045a366004610419565b90611608565b610468610184565b806104728161029f565b0390f35b61018a565b346104aa5761049461048e366004610419565b906116c7565b61049c610184565b806104a68161029f565b0390f35b61018a565b90610100828203126104ca576104c7916000016103a2565b90565b61018f565b6104d890610376565b9052565b91906104f0906000602085019401906104cf565b565b346105225761051e61050d6105083660046104af565b61180b565b610515610184565b918291826104dc565b0390f35b61018a565b909160608284031261055d5761055a6105438460008501610271565b936105518160208601610271565b9360400161038e565b90565b61018f565b346105915761057b610575366004610527565b9161188f565b610583610184565b8061058d8161029f565b0390f35b61018a565b91906040838203126105bf57806105b36105bc9260008601610271565b9360200161038e565b90565b61018f565b346105f3576105dd6105d7366004610596565b906119dd565b6105e5610184565b806105ef8161029f565b0390f35b61018a565b60808183031261063a5761060f8260008301610271565b926106376106208460208501610271565b9361062e8160408601610271565b936060016102f0565b90565b61018f565b346106715761065b6106523660046105f8565b92919091611a98565b610663610184565b8061066d8161029f565b0390f35b61018a565b919060408382031261069f578061069361069c92600086016102f0565b9360200161038e565b90565b61018f565b6106ad90610250565b9052565b91906106c5906000602085019401906106a4565b565b346106f8576106f46106e36106dd366004610676565b90611b40565b6106eb610184565b918291826106b1565b0390f35b61018a565b3461072e5761072a610719610713366004610419565b90611b80565b610721610184565b918291826101fa565b0390f35b61018a565b9060208282031261074d5761074a9160000161038e565b90565b61018f565b61075b90610376565b9052565b61076890610250565b9052565b67ffffffffffffffff1690565b6107829061076c565b9052565b61078f906102d8565b9052565b9060e080610823936107ad60008201516000860190610752565b6107bf60208201516020860190610752565b6107d160408201516040860190610752565b6107e36060820151606086019061075f565b6107f560808201516080860190610752565b61080760a082015160a0860190610779565b61081960c082015160c0860190610779565b0151910190610786565b565b919061083a9060006101008501940190610793565b565b3461086c57610868610857610852366004610733565b611df9565b61085f610184565b91829182610825565b0390f35b61018a565b908160c091031261087f5790565b61039d565b908160e09103126108925790565b61039d565b916060838303126108fc576108af8260008501610271565b92602081013567ffffffffffffffff81116108f757836108d0918301610871565b92604082013567ffffffffffffffff81116108f2576108ef9201610884565b90565b610194565b610194565b61018f565b346109325761092e61091d610917366004610897565b9161213a565b610925610184565b9182918261032b565b0390f35b61018a565b600091031261094257565b61018f565b90565b60001b90565b61096461095f61096992610947565b61094a565b6102d8565b90565b6109766000610950565b90565b61098161096c565b90565b346109b457610994366004610937565b6109b061099f610979565b6109a7610184565b9182918261032b565b0390f35b61018a565b600080fd5b600080fd5b600080fd5b909182601f83011215610a025781359167ffffffffffffffff83116109fd5760200192602083028401116109f857565b6109c3565b6109be565b6109b9565b91608083830312610a6557610a1f82600085016102f0565b9260208101359167ffffffffffffffff8311610a6057610a4484610a5d9484016109c8565b939094610a548160408601610271565b936060016102f0565b90565b610194565b61018f565b34610a9e57610a9a610a89610a80366004610a07565b939290926121db565b610a91610184565b918291826101fa565b0390f35b61018a565b34610ad357610acf610abe610ab93660046102ff565b612201565b610ac6610184565b918291826104dc565b0390f35b61018a565b909182601f83011215610b125781359167ffffffffffffffff8311610b0d576020019260208302840111610b0857565b6109c3565b6109be565b6109b9565b90602082820312610b4957600082013567ffffffffffffffff8111610b4457610b409201610ad8565b9091565b610194565b61018f565b5190565b60209181520190565b60200190565b9060e080610bf193610b7b60008201516000860190610752565b610b8d60208201516020860190610752565b610b9f60408201516040860190610752565b610bb16060820151606086019061075f565b610bc360808201516080860190610752565b610bd560a082015160a0860190610779565b610be760c082015160c0860190610779565b0151910190610786565b565b90610c018161010093610b61565b0190565b60200190565b90610c28610c22610c1b84610b4e565b8093610b52565b92610b5b565b9060005b818110610c395750505090565b909192610c52610c4c6001928651610bf3565b94610c05565b9101919091610c2c565b610c729160208201916000818403910152610c0b565b90565b34610ca657610ca2610c91610c8b366004610b17565b9061231b565b610c99610184565b91829182610c5c565b0390f35b61018a565b34610cda57610cc4610cbe366004610419565b9061244f565b610ccc610184565b80610cd68161029f565b0390f35b61018a565b909182601f83011215610d195781359167ffffffffffffffff8311610d14576020019260018302840111610d0f57565b6109c3565b6109be565b6109b9565b909182601f83011215610d585781359167ffffffffffffffff8311610d53576020019260208302840111610d4e57565b6109c3565b6109be565b6109b9565b9061010082820312610e5a57610d768160008401610271565b92602083013567ffffffffffffffff8111610e555782610d97918501610ad8565b929093604081013567ffffffffffffffff8111610e505782610dba918301610ad8565b929093606083013567ffffffffffffffff8111610e4b5782610ddd918501610cdf565b929093608081013567ffffffffffffffff8111610e465782610e00918301610ad8565b929093610e108260a08501610271565b92610e1e8360c0830161038e565b9260e082013567ffffffffffffffff8111610e4157610e3d9201610d1e565b9091565b610194565b610194565b610194565b610194565b610194565b61018f565b610e82610e6d366004610d5d565b9b9a909a9991999892989793979694966125c6565b610e8a610184565b80610e948161029f565b0390f35b34610ec657610eb0610eab3660046102ff565b6126f8565b610eb8610184565b80610ec28161029f565b0390f35b61018a565b34610efb57610edb366004610937565b610ef7610ee6612703565b610eee610184565b918291826104dc565b0390f35b61018a565b600080fd5b600090565b610f12610f05565b506309652ee560e11b610f2d610f2783610199565b91610199565b148015610f51575b908115610f41575b5090565b610f4b9150612753565b38610f3d565b50610f5b81612719565b610f35565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b610f9d90610f98610f93610f60565b612781565b611020565b565b90565b610fb6610fb1610fbb92610245565b610f9f565b610245565b90565b610fc790610fa2565b90565b610fd390610fbe565b90565b90610fe760018060a01b039161094a565b9181191691161790565b610ffa90610fbe565b90565b90565b9061101561101061101c92610ff1565b610ffd565b8254610fd6565b9055565b61102c61103391610fca565b6003611000565b565b61103e90610f84565b565b600090565b61104e906102d8565b90565b9061105b90611045565b600052602052604060002090565b60001c90565b90565b61107e61108391611069565b61106f565b90565b6110909054611072565b90565b60016110ac6110b2926110a4611040565b506000611051565b01611086565b90565b7f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c290565b906110f3916110ee6110e96110b5565b612781565b611536565b565b5490565b634e487b7160e01b600052603260045260246000fd5b600052602060002090565b611123816110f5565b82101561113e5761113560079161110f565b91020190600090565b6110f9565b634e487b7160e01b600052600060045260246000fd5b3561116381610379565b90565b906111736000199161094a565b9181191691161790565b61119161118c61119692610376565b610f9f565b610376565b90565b90565b906111b16111ac6111b89261117d565b611199565b8254611166565b9055565b356111c68161025c565b90565b6111d290610fa2565b90565b6111de906111c9565b90565b90565b906111f96111f4611200926111d5565b6111e1565b8254610fd6565b9055565b61120d8161076c565b0361121457565b600080fd5b3561122381611204565b90565b9061123967ffffffffffffffff9161094a565b9181191691161790565b61125761125261125c9261076c565b610f9f565b61076c565b90565b90565b9061127761127261127e92611243565b61125f565b8254611226565b9055565b60401b90565b906112a36fffffffffffffffff000000000000000091611282565b9181191691161790565b906112c26112bd6112c992611243565b61125f565b8254611288565b9055565b356112d7816102db565b90565b6112e390611069565b90565b906112fb6112f661130292611045565b6112da565b8254611166565b9055565b906113c960e060066113cf9461132b6000820161132560008801611159565b9061119c565b6113446001820161133e60208801611159565b9061119c565b61135d6002820161135760408801611159565b9061119c565b61137660038201611370606088016111bc565b906111e4565b61138f6004820161138960808801611159565b9061119c565b6113a8600582016113a260a08801611219565b90611262565b6113c1600582016113bb60c08801611219565b906112ad565b0192016112cd565b906112e6565b565b91906113e2576113e091611306565b565b611143565b506113f690602081019061038e565b90565b50611408906020810190610271565b90565b9050359061141882611204565b565b5061142990602081019061140b565b90565b5061143b9060208101906102f0565b90565b9060e061150761150f9361146261145860008301836113e7565b6000860190610752565b61147c61147260208301836113e7565b6020860190610752565b61149661148c60408301836113e7565b6040860190610752565b6114b06114a660608301836113f9565b606086019061075f565b6114ca6114c060808301836113e7565b6080860190610752565b6114e46114da60a083018361141a565b60a0860190610779565b6114fe6114f460c083018361141a565b60c0860190610779565b8281019061142c565b910190610786565b565b91602061153492949361152d61012082019660008301906104cf565b019061143e565b565b8061155261154c61154760066110f5565b610376565b91610376565b10156115b35761156182612795565b611577826115716006849061111a565b906113d1565b907fca99d4215142d82293f0f76a74adda843639bbd25bafda25b2714f39c5a23dfd916115ae6115a5610184565b92839283611511565b0390a1565b6115cf906000918291631736b00b60e21b8352600483016104dc565b0390fd5b906115dd916110d9565b565b906115fa916115f56115f082611093565b612781565b6115fc565b565b906116069161286e565b565b90611612916115df565b565b60209181520190565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b611678602f604092611614565b6116818161161d565b0190565b61169b906020810190600081830391015261166b565b90565b156116a557565b6116ad610184565b62461bcd60e51b8152806116c360048201611685565b0390fd5b906116f4916116ef826116e96116e36116de612898565b610250565b91610250565b1461169e565b6128a5565b565b600090565b906117159161171061170b6110b5565b612781565b6117a2565b90565b90565b634e487b7160e01b600052604160045260246000fd5b600052602060002090565b5490565b6117498161173c565b8210156117645761175b600791611731565b91020190600090565b6110f9565b1b90565b908154916801000000000000000083101561179d578261179591600161179b95018155611740565b906113d1565b565b61171b565b919091506117af82612795565b6117b960066110f5565b916117ce6117c76006611718565b829061176d565b82907f8e8d94c6393d76620a50492d4feaac9674722462604d7de8bd3bbd1281e50b80916118066117fd610184565b92839283611511565b0390a1565b61181c906118176116f6565b6116fb565b90565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec90565b9061185e929161185961185461181f565b612781565b611878565b565b61186990610fa2565b90565b61187590611860565b90565b9161188561188d9361186c565b919091612924565b565b9061189a9291611843565b565b906118b6916118b16118ac61181f565b612781565b61198b565b565b905090565b6118c9600080926118b8565b0190565b6118d6906118bd565b90565b601f801991011690565b906118ed906118d9565b810190811067ffffffffffffffff82111761190757604052565b61171b565b9061191f611918610184565b92836118e3565b565b67ffffffffffffffff811161193f5761193b6020916118d9565b0190565b61171b565b9061195661195183611921565b61190c565b918252565b606090565b3d60001461197d576119713d611944565b903d6000602084013e5b565b61198561195b565b9061197b565b60006119ba9281929061199c610184565b90816119a7816118cd565b03925af16119b3611960565b50156101e8565b6119c057565b6000631d42c86760e21b8152806119d96004820161029f565b0390fd5b906119e79161189c565b565b60ff1690565b6119fb611a0091611069565b6119e9565b90565b611a0d90546119ef565b90565b60081b90565b90611a29610100600160a81b0391611a10565b9181191691161790565b90611a48611a43611a4f926111d5565b6111e1565b8254611a16565b9055565b90611a5f60ff9161094a565b9181191691161790565b611a72906101e8565b90565b90565b90611a8d611a88611a9492611a69565b611a75565b8254611a53565b9055565b929092611aa56005611a03565b611b0357611ab7611af5946005611a33565b611ac9611ac261096c565b829061286e565b611adb611ad46110b5565b829061286e565b611aed611ae661181f565b829061286e565b91909161296f565b611b0160016005611a78565b565b600063f92ee8a960e01b815280611b1c6004820161029f565b0390fd5b600090565b90611b2f90611045565b600052602052604060002090565b90565b90611b60611b5b611b6593611b53611b20565b506001611b25565b611b3d565b6129bf565b90565b90611b72906111d5565b600052602052604060002090565b611ba7916000611b9c611ba293611b95610f05565b5082611051565b01611b68565b611a03565b90565b611bb561010061190c565b90565b600090565b600090565b600090565b600090565b611bd4611baa565b9060208080808080808089611be7611bb8565b815201611bf2611bb8565b815201611bfd611bb8565b815201611c08611bbd565b815201611c13611bb8565b815201611c1e611bc2565b815201611c29611bc2565b815201611c34611bc7565b81525050565b611c42611bcc565b90565b90565b611c54611c5991611069565b611c45565b90565b611c669054611c48565b90565b90611c7390610376565b9052565b60018060a01b031690565b611c8e611c9391611069565b611c77565b90565b611ca09054611c82565b90565b90611cad90610250565b9052565b67ffffffffffffffff1690565b611cca611ccf91611069565b611cb1565b90565b611cdc9054611cbe565b90565b90611ce99061076c565b9052565b60401c90565b611cff611d0491611ced565b611cb1565b90565b611d119054611cf3565b90565b90611d1e906102d8565b9052565b90611deb611de26006611d33611baa565b94611d4c611d4360008301611c5c565b60008801611c69565b611d64611d5b60018301611c5c565b60208801611c69565b611d7c611d7360028301611c5c565b60408801611c69565b611d94611d8b60038301611c96565b60608801611ca3565b611dac611da360048301611c5c565b60808801611c69565b611dc4611dbb60058301611cd2565b60a08801611cdf565b611ddc611dd360058301611d07565b60c08801611cdf565b01611086565b60e08401611d14565b565b611df690611d22565b90565b611e01611c3a565b5080611e1e611e18611e1360066110f5565b610376565b91610376565b1015611e3b57611e32611e3891600661111a565b50611ded565b90565b611e57906000918291631736b00b60e21b8352600483016104dc565b0390fd5b60018060a01b031690565b611e72611e7791611069565b611e5b565b90565b611e849054611e66565b90565b611e90906111c9565b90565b600080fd5b60e01b90565b90505190611eab826102db565b565b90602082820312611ec757611ec491600001611e9e565b90565b61018f565b50611edb9060208101906101ba565b90565b611ee790610199565b9052565b600080fd5b600080fd5b600080fd5b9035600160200382360303811215611f3b57016020813591019167ffffffffffffffff8211611f36576001820236038313611f3157565b611ef0565b611eeb565b611ef5565b60209181520190565b90826000939282370152565b9190611f6f81611f6881611f7495611f40565b8095611f49565b6118d9565b0190565b9035600160400382360303811215611f8e570190565b611ef5565b9035600160200382360303811215611fd457016020813591019167ffffffffffffffff8211611fcf576001820236038313611fca57565b611ef0565b611eeb565b611ef5565b60209181520190565b9190611ffc81611ff58161200195611fd9565b8095611f49565b6118d9565b0190565b9061204390602061203b612031604084016120236000880188611f93565b908683036000880152611fe2565b948281019061141a565b910190610779565b90565b6120f0916120e26120d760c0830161206e61206460008701876113f9565b600086019061075f565b61208861207e6020870187611ecc565b6020860190611ede565b6120a2612098604087018761142c565b6040860190610786565b6120bc6120b2606087018761142c565b6060860190610786565b6120c96080860186611efa565b908583036080870152611f55565b9260a0810190611f78565b9060a0818403910152612005565b90565b93929061211f60409161212794612112606089019260008a01906106a4565b8782036020890152612046565b94019061031e565b565b612131610184565b3d6000823e3d90fd5b9150602090612147611040565b5061215a6121556003611e7a565b611e87565b612186633808a90b9492946121916121726004611086565b61217a610184565b97889687958695611e98565b8552600485016120f3565b03915afa9081156121d6576000916121a8575b5090565b6121c9915060203d81116121cf575b6121c181836118e3565b810190611ead565b386121a4565b503d6121b7565b612129565b6121fe946121f891949392946121ef610f05565b50949293612a6c565b92612b67565b90565b61222061221b612225926122136116f6565b506001611b25565b611b3d565b612bc9565b90565b606090565b5090565b67ffffffffffffffff81116122495760208091020190565b61171b565b9061226061225b83612231565b61190c565b918252565b61226d611bcc565b90565b60005b82811061227f57505050565b60209061228a612265565b8184015201612273565b906122b96122a18361224e565b926020806122af8693612231565b9201910390612270565b565b6122cf6122ca6122d492610947565b610f9f565b610376565b90565b60016122e39101610376565b90565b91908110156122f6576020020190565b6110f9565b9061230582610b4e565b811015612316576020809102010190565b6110f9565b919091612326612228565b5061233a61233582859061222d565b612294565b9261234560006122bb565b5b8061236361235d61235886869061222d565b610376565b91610376565b10156124215761237d612378848484916122e6565b611159565b61239861239261238d60066110f5565b610376565b91610376565b10156123ec576123e7906123e06123c460066123be6123b9888887916122e6565b611159565b9061111a565b50876123d08492611ded565b6123da83836122fb565b526122fb565b51506122d7565b612346565b612405916124009161241d949190916122e6565b611159565b6000918291631736b00b60e21b8352600483016104dc565b0390fd5b505050565b906124419161243c61243782611093565b612781565b612443565b565b9061244d916128a5565b565b9061245991612426565b565b60081c90565b61246d6124729161245b565b611c77565b90565b61247f9054612461565b90565b61248b90610fa2565b90565b61249790612482565b90565b6124a3906111c9565b90565b60009103126124b157565b61018f565b60209181520190565b600080fd5b9037565b9091826124d4916124b6565b9160018060fb1b0381116124f757829160206124f392029384916124c4565b0190565b6124bf565b60209181520190565b919061251f8161251881612524956124fc565b8095611f49565b6118d9565b0190565b959391612574979591612566946125589261254b60808b019360008c01906106a4565b89830360208b01526124c8565b9186830360408801526124c8565b926060818503910152612505565b90565b9593916125c39795916125b5946125a79261259a60808b019360008c01906106a4565b89830360208b01526124c8565b9186830360408801526124c8565b9260608185039101526124c8565b90565b9493979695989a839c919a839c6125e9958d95908c908b928d9495969798612e5f565b6126036125fe6125f96005612475565b61248e565b61249a565b9063b48ab8b68389928b998d918a909192873b156126cb57612623610184565b9c8d976126308998611e98565b8852600488019661264097612528565b03815a6000948591f19485156126c65761269495612699575b50949596929091927ffef8e251196d93186ee428d72c0d82e2602d497fe88293cd05aa5c00dfc8ba559761268b610184565b97889788612577565b0390a1565b6126b99060003d81116126bf575b6126b181836118e3565b8101906124a6565b38612659565b503d6126a7565b612129565b611e93565b6126e9906126e46126df610f60565b612781565b6126eb565b565b6126f69060046112e6565b565b612701906126d0565b565b61270b6116f6565b5061271660066110f5565b90565b612721610f05565b50806127366127306000610199565b91610199565b14908115612743575b5090565b61274d9150613391565b3861273f565b61275b610f05565b5061276581613391565b908115612771575b5090565b61277b91506133d1565b3861276d565b6127939061278d612898565b9061357e565b565b6127a160208201611159565b6127be6127b86127b360008501611159565b610376565b91610376565b10612851576127cf60808201611159565b6127e26127dc60006122bb565b91610376565b146128345761281061280a61280560a06127fe60c08601611219565b9401611219565b61076c565b9161076c565b1061281757565b60006310ba94e960e31b8152806128306004820161029f565b0390fd5b60006310ba94e960e31b81528061284d6004820161029f565b0390fd5b60006310ba94e960e31b81528061286a6004820161029f565b0390fd5b9061289061288b61289593612884818590613617565b6001611b25565b611b3d565b6136e1565b50565b6128a0611b20565b503390565b906128c76128c26128cc936128bb81859061371c565b6001611b25565b611b3d565b6137b5565b50565b6128d8906111c9565b90565b63ffffffff1690565b6128f86128f36128fd926128db565b611e98565b610199565b90565b91602061292292949361291b604082019660008301906106a4565b01906104cf565b565b9161296860049261295961296d959361294063a9059cbb6128e4565b92612949610184565b9687946020860190815201612900565b602082018103825203836118e3565b613963565b565b9061298561298a9392612980610f60565b61286e565b6139d0565b565b90565b61299b6129a091611069565b61117d565b90565b6129b76129b26129bc92610376565b610f9f565b610245565b90565b6129eb6129e66129f5936129e160006129f0956129da611b20565b500161298c565b613a52565b61298f565b6129a3565b6111c9565b90565b60601b90565b612a07906129f8565b90565b612a13906129fe565b90565b612a22612a2791610250565b612a0a565b9052565b90565b612a3a612a3f916102d8565b612a2b565b9052565b601481612a56612a5e9360209695612a16565b018092612a2e565b0190565b60200190565b5190565b612a9f90612a78611040565b50612a90612a84610184565b93849260208401612a43565b602082018103825203826118e3565b612ab1612aab82612a68565b91612a62565b2090565b90612abf90611045565b600052602052604060002090565b90612ad790611045565b600052602052604060002090565b67ffffffffffffffff8111612afd5760208091020190565b61171b565b90929192612b17612b1282612ae5565b61190c565b9381855260208086019202830192818411612b5457915b838310612b3b5750505050565b60208091612b4984866102f0565b815201920191612b2e565b6109c3565b612b64913691612b02565b90565b929092612b72610f05565b50612b9a612b94612b8f612b8860028590612ab5565b8590612acd565b611a03565b156101e8565b9384612ba8575b5050505090565b612bc0945090612bbb9193909293612b59565b613a74565b38808080612ba1565b612be16000612be692612bda6116f6565b500161298c565b613a9e565b90565b5090565b612bf79051610376565b90565b612c04905161076c565b90565b612c1b612c16612c209261076c565b610f9f565b610376565b90565b612c2d9051610250565b90565b90612c3a9061117d565b600052602052604060002090565b90612c529061117d565b600052602052604060002090565b634e487b7160e01b600052601160045260246000fd5b612c85612c8b91939293610376565b92610376565b8203918211612c9657565b612c60565b916020612cbd929493612cb6604082019660008301906104cf565b01906104cf565b565b612cc990516102d8565b90565b600080fd5b600080fd5b600080fd5b903590600160200381360303821215612d1d570180359067ffffffffffffffff8211612d1857602001916020820236038313612d1357565b612cd6565b612cd1565b612ccc565b90821015612d3d576020612d399202810190612cdb565b9091565b6110f9565b612d56612d51612d5b92610376565b61094a565b6102d8565b90565b612d6d612d7391939293610376565b92610376565b8201809211612d7e57565b612c60565b612d92612d9891939293610376565b92610376565b91612da4838202610376565b928184041490151715612db357565b612c60565b604090612de2612de99496959396612dd8606084019860008501906106a4565b60208301906104cf565b01906104cf565b565b612dff612dfa612e0492610947565b610f9f565b610245565b90565b612e1090612deb565b90565b612e1c906111c9565b90565b612e28906122bb565b9052565b604090612e56612e5d9496959396612e4c606084019860008501906106a4565b6020830190612e1f565b01906104cf565b565b93999295909497919998969860805260a05260e052612e7c6116f6565b96612e8883859061222d565b80612ea5612e9f612e9a8d8a9061222d565b610376565b91610376565b1415801561336a575b8015613343575b6133265797600060c052612ec76116f6565b60c0525b60c051612ee0612eda8b610376565b91610376565b101561320a57612efc612ef7858760c051916122e6565b611159565b612f14612f0f6080518b60c051916122e6565b611159565b6101205261012051612f37612f31612f2c60066110f5565b610376565b91610376565b10156131e757612f55612f4f6006610120519061111a565b50611ded565b9080612f74612f6e612f6960008601612bed565b610376565b91610376565b1080156131c2575b6131a55742612f9e612f98612f9360a08601612bfa565b612c07565b91610376565b108015613180575b61316357612fb660608301612c23565b612fca612fc460a051610250565b91610250565b0361314657612fe5612fe08d8a60c051916122e6565b611159565b6101005261010051613000612ffa60006122bb565b91610376565b146131295761302661302161301760078490612c30565b6101205190612c48565b611c5c565b6101005161305161304b61304661303f60808801612bed565b8590612c76565b610376565b91610376565b116130f0576040836130c56130d5946130c06130b68f6130cb976130a46130ae926130936130856130db9f9e60e001612cbf565b9160e0519060c05191612d22565b339161309e8a612d42565b93613b38565b6101005190612d5e565b926007612c30565b6101205190612c48565b61119c565b01612bed565b6101005190612d83565b90612d5e565b976130e760c0516122d7565b60c05297612ecb565b6131059061310060808501612bed565b612c76565b61010051906131256000928392639e4c446160e01b845260048401612c9b565b0390fd5b600063162908e360e11b8152806131426004820161029f565b0390fd5b600063ae4f082b60e01b81528061315f6004820161029f565b0390fd5b6000630fe219dd60e21b81528061317c6004820161029f565b0390fd5b504261319f61319961319460c08601612bfa565b612c07565b91610376565b11612fa6565b60006310ba94e960e31b8152806131be6004820161029f565b0390fd5b50806131e16131db6131d660208601612bed565b610376565b91610376565b11612f7c565b613206610120516000918291631736b00b60e21b8352600483016104dc565b0390fd5b975095509650505050508061322761322184610376565b91610376565b10613301575060a05161324b6132456132406000612e07565b610250565b91610250565b14600014613292573461326661326083610376565b91610376565b0361326f57505b565b60a05161328e346000938493630f55e7df60e11b855260048501612db8565b0390fd5b346132a66132a060006122bb565b91610376565b116000146132db576132b86000612e07565b6000906132d7346000938493630f55e7df60e11b855260048501612e2c565b0390fd5b6132fc906132ea60a05161186c565b90336132f530612e13565b9192613c1a565b61326d565b9061332260a05191926000938493630f55e7df60e11b855260048501612db8565b0390fd5b600063a9854bc960e01b81528061333f6004820161029f565b0390fd5b508061336361335d61335860e0518b90612be9565b610376565b91610376565b1415612eb5565b508061338a61338461337f6080518c9061222d565b610376565b91610376565b1415612eae565b613399610f05565b50806133b46133ae635a05180f60e01b610199565b91610199565b149081156133c1575b5090565b6133cb9150613c69565b386133bd565b6133d9610f05565b50806133f46133ee634e821d3360e11b610199565b91610199565b14908115613401575b5090565b61340b9150612719565b386133fd565b90565b61342861342361342d92613411565b610f9f565b610376565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b61346960178092613430565b61347281613435565b0190565b5190565b60005b83811061348e575050906000910152565b80602091830151818501520161347d565b6134c46134bb926020926134b281613476565b94858093613430565b9384910161347a565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b6134fc60118092613430565b613505816134c8565b0190565b61352361352e939261351d6135289361345d565b9061349f565b6134f0565b9061349f565b90565b90565b61355361355c6020936135619361354a81613476565b93848093611614565b9586910161347a565b6118d9565b0190565b61357b9160208201916000818403910152613534565b90565b9061359361358d838390611b80565b156101e8565b61359b575050565b613613916135f16135ca6135ba6135b46135f695613cfc565b9361298f565b6135c46020613414565b90613efa565b916135e26135d6610184565b93849260208401613509565b602082018103825203826118e3565b613531565b6135fe610184565b91829162461bcd60e51b835260048301613565565b0390fd5b61362b613625828490611b80565b156101e8565b613634575b5050565b61365660016136516000613649818690611051565b018590611b68565b611a78565b9061365f612898565b9061369c6136966136907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95611045565b926111d5565b926111d5565b926136a5610184565b806136af8161029f565b0390a43880613630565b6136c290610fa2565b90565b6136d96136d46136de92610245565b610f9f565b610376565b90565b9061371461370e6137096137046000613719966136fc610f05565b5001946136b9565b6136c5565b612d42565b9161298c565b614116565b90565b613727818390611b80565b613730575b5050565b613752600061374d6000613745818690611051565b018590611b68565b611a78565b9061375b612898565b9061379861379261378c7ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95611045565b926111d5565b926111d5565b926137a1610184565b806137ab8161029f565b0390a4388061372c565b906137e86137e26137dd6137d860006137ed966137d0610f05565b5001946136b9565b6136c5565b612d42565b9161298c565b61420c565b90565b67ffffffffffffffff811161380e5761380a6020916118d9565b0190565b61171b565b90613825613820836137f0565b61190c565b918252565b60007f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564910152565b61385c6020613813565b906138696020830161382a565b565b613873613852565b90565b61387f816101e8565b0361388657565b600080fd5b9050519061389882613876565b565b906020828203126138b4576138b19160000161388b565b90565b61018f565b60207f6f74207375636365656400000000000000000000000000000000000000000000917f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201520152565b613914602a604092611614565b61391d816138b9565b0190565b6139379060208101906000818303910152613907565b90565b1561394157565b613949610184565b62461bcd60e51b81528061395f60048201613921565b0390fd5b6139ad91613973613982926128cf565b9061397c61386b565b91614316565b61398b81612a68565b61399e61399860006122bb565b91610376565b149081156139af575b5061393a565b565b6139ca915060206139bf82612a68565b81830101910161389a565b386139a7565b906139e76139e06139ee93610fca565b6003611000565b60046112e6565b565b5490565b600052602060002090565b613a08816139f0565b821015613a2357613a1a6001916139f4565b91020190600090565b6110f9565b1c90565b613a3c906008613a419302613a28565b61106f565b90565b90613a4f9154613a2c565b90565b613a71916000613a6b92613a64611040565b50016139ff565b90613a44565b90565b613a8e613a9a9293613a9492613a88610f05565b5061435d565b926102d8565b916102d8565b1490565b6000613ab391613aac6116f6565b50016139f0565b90565b60209181520190565b909182613acb91613ab6565b9160018060fb1b038111613aee5782916020613aea92029384916124c4565b0190565b6124bf565b90613b24613b2f91613b3696989795606095613b176080870193600088019061031e565b8583036020870152613abf565b9660408301906106a4565b019061031e565b565b9294939483613b58613b52613b4d6000610950565b6102d8565b916102d8565b03613b66575b505050509050565b613b71818790612a6c565b95613b89613b83868587908b92612b67565b156101e8565b613bba5750505050613bab613bb09293613ba66001936002612ab5565b612acd565b611a78565b8038808080613b5e565b613be39293949394919091613bcd610184565b9586956304cb8cd560e31b875260048701613af3565b0390fd5b604090613c11613c189496959396613c07606084019860008501906106a4565b60208301906106a4565b01906104cf565b565b613c679391613c53600494613c629394613c376323b872dd6128e4565b93919091613c43610184565b9788956020870190815201613be7565b602082018103825203836118e3565b613963565b565b613c71610f05565b5080613c8c613c86637965db0b60e01b610199565b91610199565b14908115613c99575b5090565b613ca391506143c8565b38613c95565b606090565b90565b60ff1690565b613ccb613cc6613cd092613cae565b610f9f565b613cb1565b90565b613cdd6014613cb7565b90565b613cf4613cef613cf992613cb1565b610f9f565b610376565b90565b613d19613d14613d2f92613d0e613ca9565b506136b9565b6136c5565b613d29613d24613cd3565b613ce0565b90613efa565b90565b90565b613d49613d44613d4e92613d32565b610f9f565b610376565b90565b369037565b90613d7b613d6383611944565b92602080613d718693611921565b9201910390613d51565b565b600360fc1b90565b90613d8f82612a68565b811015613da157600160209102010190565b6110f9565b600f60fb1b90565b90565b613dc5613dc0613dca92613dae565b610f9f565b610376565b90565b613dd690610376565b60008114613de5576001900390565b612c60565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b613e09613dea565b90565b90565b613e23613e1e613e2892613e0c565b610f9f565b610376565b90565b60f81b90565b90565b613e48613e43613e4d92613e31565b610f9f565b613cb1565b90565b613e6f90613e69613e63613e7494613cb1565b91610376565b90613a28565b610376565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b613eab60208092611614565b613eb481613e77565b0190565b613ece9060208101906000818303910152613e9f565b90565b15613ed857565b613ee0610184565b62461bcd60e51b815280613ef660048201613eb8565b0390fd5b9190613f04613ca9565b50613f9e613f8e613f3a613f35613f256002613f208791613d35565b612d83565b613f2f6002613d35565b90612d5e565b613d56565b92613f43613d7d565b613f5c85613f5660009360001a936122bb565b90613d85565b53613f65613da6565b613f7e85613f7860019360001a93613db1565b90613d85565b53613f896002613d35565b612d83565b613f986001613db1565b90612d5e565b925b83613fb4613fae6001613db1565b91610376565b111561401b57613fc2613e01565b81613fcd600f613e0f565b1691601083101561401657613fe961400a92614010941a613e2b565b613ff98591889060001a92613d85565b536140046004613e34565b90613e50565b93613dcd565b92613fa0565b6110f9565b61404392935061403e9061403861403260006122bb565b91610376565b14613ed1565b613531565b90565b90565b600052602060002090565b5490565b61406181614054565b82101561407c57614073600191614049565b91020190600090565b6110f9565b9190600861409d91029161409760001984611769565b92611769565b9181191691161790565b91906140bd6140b86140c593611045565b6112da565b908354614081565b9055565b90815491680100000000000000008310156140f957826140f19160016140f795018155614058565b906140a7565b565b61171b565b9061410890611045565b600052602052604060002090565b61411e610f05565b5061413361412d8284906143ee565b156101e8565b6000146141765761416c6141719261415761415060008501614046565b82906140c9565b6001614165600085016139f0565b93016140fe565b61119c565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b6141a59161419f611040565b916140a7565b565b6141b081614054565b80156141d15760019003906141ce6141c88383614058565b90614193565b55565b61417d565b91906141ec6141e76141f49361117d565b611199565b908354614081565b9055565b61420a916142046116f6565b916141d6565b565b614214610f05565b5061422b6142266001830184906140fe565b611c5c565b908161424061423a60006122bb565b91610376565b141560001461430e576142c09260016142bb928461426960009661426385613db1565b90612c76565b6142866142778885016139f0565b61428086613db1565b90612c76565b8061429961429384610376565b91610376565b036142c5575b5050506142b56142b0868301614046565b6141a7565b016140fe565b6141f8565b600190565b614306926142f86142e46142de614301948c89016139ff565b90613a44565b936142f285918c89016139ff565b906140a7565b918585016140fe565b61119c565b38808061429f565b505050600090565b90614336929161432461195b565b509061433060006122bb565b916144da565b90565b5190565b9061434782614339565b811015614358576020809102010190565b6110f9565b9190614367611040565b5061437260006122bb565b905b8161438f61438961438487614339565b610376565b91610376565b10156143c1576143b56143bb916143af6143aa87869061433d565b612cbf565b90614534565b916122d7565b90614374565b9192505090565b6143d0610f05565b506143ea6143e46301ffc9a760e01b610199565b91610199565b1490565b61440c91600161440792614400610f05565b50016140fe565b611c5c565b61441f61441960006122bb565b91610376565b141590565b61442d906111c9565b90565b60207f722063616c6c0000000000000000000000000000000000000000000000000000917f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201520152565b61448b6026604092611614565b61449481614430565b0190565b6144ae906020810190600081830391015261447e565b90565b156144b857565b6144c0610184565b62461bcd60e51b8152806144d660048201614498565b0390fd5b916000809161453195936144ec61195b565b506145136144f930614424565b3161450c61450685610376565b91610376565b10156144b1565b8591602082019151925af191614527611960565b90929091926145f8565b90565b61453c611040565b508061455061454a846102d8565b916102d8565b1060001461456657906145629161464f565b5b90565b61456f9161464f565b614563565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6145a9601d602092611614565b6145b281614574565b0190565b6145cc906020810190600081830391015261459c565b90565b156145d657565b6145de610184565b62461bcd60e51b8152806145f4600482016145b6565b0390fd5b91929061460361195b565b50600014614649575061461582612a68565b61462861462260006122bb565b91610376565b14614632575b5090565b61463e614643916146b9565b6145cf565b3861462e565b82614666565b614657611040565b50600052602052604060002090565b9061467082612a68565b61468361467d60006122bb565b91610376565b116000146146945750805190602001fd5b6146b5906146a0610184565b91829162461bcd60e51b835260048301613565565b0390fd5b6146c1610f05565b503b6146d66146d060006122bb565b91610376565b119056fea2646970667358221220e0ba6ab06b6b6dbc743a1814969c8b6f8b676ce2240159077ed23bbec02909be64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -178,223 +208,215 @@ export class ERC1155SaleFactory extends ContractFactory { export const ERC1155SALEFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol:ERC1155SaleFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\nimport { ERC1155Sale } from "@0xsequence/contracts-library/tokens/ERC1155/utility/sale/ERC1155Sale.sol";\nimport {\n IERC1155SaleFactory,\n IERC1155SaleFactoryFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/utility/sale/IERC1155SaleFactory.sol";\n\n/**\n * Deployer of ERC-1155 Sale proxies.\n */\ncontract ERC1155SaleFactory is IERC1155SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Sale Factory.\n * @param factoryOwner The owner of the ERC-1155 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Sale impl = new ERC1155Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function deploy(address proxyOwner, address tokenOwner, address items) external returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(tokenOwner, items));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Sale(proxyAddr).initialize(tokenOwner, items);\n emit ERC1155SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(tokenOwner, items));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC1155Sale } from "./ERC1155Sale.sol";\nimport { IERC1155SaleFactory, IERC1155SaleFactoryFunctions } from "./IERC1155SaleFactory.sol";\n\n/**\n * Deployer of ERC-1155 Sale proxies.\n */\ncontract ERC1155SaleFactory is IERC1155SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Sale Factory.\n * @param factoryOwner The owner of the ERC-1155 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Sale impl = new ERC1155Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function deploy(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(nonce, tokenOwner, items, implicitModeValidator, implicitModeProjectId));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Sale(proxyAddr).initialize(tokenOwner, items, implicitModeValidator, implicitModeProjectId);\n emit ERC1155SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function determineAddress(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(nonce, tokenOwner, items, implicitModeValidator, implicitModeProjectId));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' }, 'src/proxies/SequenceProxyFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ITransparentUpgradeableBeaconProxy,\n TransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";\nimport { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";\nimport { Create2 } from "@openzeppelin/contracts/utils/Create2.sol";\n\n/**\n * An proxy factory that deploys upgradeable beacon proxies.\n * @dev The factory owner is able to upgrade the beacon implementation.\n * @dev Proxy deployers are able to override the beacon reference with their own.\n */\nabstract contract SequenceProxyFactory is Ownable {\n\n UpgradeableBeacon public beacon;\n\n /**\n * Initialize a Sequence Proxy Factory.\n * @param implementation The initial beacon implementation.\n * @param factoryOwner The owner of the factory.\n */\n function _initialize(address implementation, address factoryOwner) internal {\n beacon = new UpgradeableBeacon(implementation);\n Ownable._transferOwnership(factoryOwner);\n }\n\n /**\n * Deploys and initializes a new proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @param _data The initialization data.\n * @return proxyAddress The address of the deployed proxy.\n */\n function _createProxy(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal returns (address proxyAddress) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\n\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\n }\n\n /**\n * Computes the address of a proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @return proxy The expected address of the deployed proxy.\n */\n function _computeProxyAddress(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal view returns (address) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\n\n return Create2.computeAddress(saltedHash, bytecodeHash);\n }\n\n /**\n * Upgrades the beacon implementation.\n * @param implementation The new beacon implementation.\n */\n function upgradeBeacon(\n address implementation\n ) public onlyOwner {\n beacon.upgradeTo(implementation);\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ITransparentUpgradeableBeaconProxy,\n TransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol";\nimport { UpgradeableBeacon } from "openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol";\nimport { Create2 } from "openzeppelin-contracts/contracts/utils/Create2.sol";\n\n/**\n * An proxy factory that deploys upgradeable beacon proxies.\n * @dev The factory owner is able to upgrade the beacon implementation.\n * @dev Proxy deployers are able to override the beacon reference with their own.\n */\nabstract contract SequenceProxyFactory is Ownable {\n\n UpgradeableBeacon public beacon;\n\n /**\n * Initialize a Sequence Proxy Factory.\n * @param implementation The initial beacon implementation.\n * @param factoryOwner The owner of the factory.\n */\n function _initialize(address implementation, address factoryOwner) internal {\n beacon = new UpgradeableBeacon(implementation);\n Ownable._transferOwnership(factoryOwner);\n }\n\n /**\n * Deploys and initializes a new proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @param _data The initialization data.\n * @return proxyAddress The address of the deployed proxy.\n */\n function _createProxy(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal returns (address proxyAddress) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\n\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\n }\n\n /**\n * Computes the address of a proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @return proxy The expected address of the deployed proxy.\n */\n function _computeProxyAddress(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal view returns (address) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\n\n return Create2.computeAddress(saltedHash, bytecodeHash);\n }\n\n /**\n * Upgrades the beacon implementation.\n * @param implementation The new beacon implementation.\n */\n function upgradeBeacon(\n address implementation\n ) public onlyOwner {\n beacon.upgradeTo(implementation);\n }\n\n}\n' }, 'src/tokens/ERC1155/utility/sale/ERC1155Sale.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC1155Supply } from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/ERC1155Supply.sol";\nimport {\n IERC1155Sale,\n IERC1155SaleFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/utility/sale/IERC1155Sale.sol";\n\nimport { MerkleProofSingleUse } from "@0xsequence/contracts-library/tokens/common/MerkleProofSingleUse.sol";\nimport {\n AccessControlEnumerable,\n IERC20,\n SafeERC20,\n WithdrawControlled\n} from "@0xsequence/contracts-library/tokens/common/WithdrawControlled.sol";\n\nimport { IERC1155SupplyFunctions } from\n "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol";\nimport { IERC1155ItemsFunctions } from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol";\nimport { IERC1155 } from "@0xsequence/erc-1155/contracts/interfaces/IERC1155.sol";\n\ncontract ERC1155Sale is IERC1155Sale, WithdrawControlled, MerkleProofSingleUse {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n\n // ERC20 token address for payment. address(0) indicated payment in ETH.\n address private _paymentToken;\n\n SaleDetails private _globalSaleDetails;\n mapping(uint256 => SaleDetails) private _tokenSaleDetails;\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param items The ERC-1155 Items contract address\n * @dev This should be called immediately after deployment.\n */\n function initialize(address owner, address items) public virtual {\n if (_initialized) {\n revert InvalidInitialization();\n }\n\n _items = items;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(MINT_ADMIN_ROLE, owner);\n _grantRole(WITHDRAW_ROLE, owner);\n\n _initialized = true;\n }\n\n /**\n * Checks if the current block.timestamp is out of the give timestamp range.\n * @param _startTime Earliest acceptable timestamp (inclusive).\n * @param _endTime Latest acceptable timestamp (exclusive).\n * @dev A zero endTime value is always considered out of bounds.\n */\n function _blockTimeOutOfBounds(uint256 _startTime, uint256 _endTime) private view returns (bool) {\n // 0 end time indicates inactive sale.\n return _endTime == 0 || block.timestamp < _startTime || block.timestamp >= _endTime; // solhint-disable-line not-rely-on-time\n }\n\n /**\n * Checks the sale is active and takes payment.\n * @param _tokenIds Token IDs to mint.\n * @param _amounts Amounts of tokens to mint.\n * @param _expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param _maxTotal Maximum amount of payment tokens.\n * @param _proof Merkle proof for allowlist minting.\n */\n function _payForActiveMint(\n uint256[] memory _tokenIds,\n uint256[] memory _amounts,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n uint256 lastTokenId;\n uint256 totalCost;\n uint256 totalAmount;\n\n SaleDetails memory gSaleDetails = _globalSaleDetails;\n bool globalSaleInactive = _blockTimeOutOfBounds(gSaleDetails.startTime, gSaleDetails.endTime);\n bool globalMerkleCheckRequired = false;\n for (uint256 i; i < _tokenIds.length; i++) {\n uint256 tokenId = _tokenIds[i];\n // Test tokenIds ordering\n if (i != 0 && lastTokenId >= tokenId) {\n revert InvalidTokenIds();\n }\n lastTokenId = tokenId;\n\n uint256 amount = _amounts[i];\n\n // Active sale test\n SaleDetails memory saleDetails = _tokenSaleDetails[tokenId];\n bool tokenSaleInactive = _blockTimeOutOfBounds(saleDetails.startTime, saleDetails.endTime);\n if (tokenSaleInactive) {\n // Prefer token sale\n if (globalSaleInactive) {\n // Both sales inactive\n revert SaleInactive(tokenId);\n }\n // Use global sale details\n globalMerkleCheckRequired = true;\n totalCost += gSaleDetails.cost * amount;\n } else {\n // Use token sale details\n requireMerkleProof(saleDetails.merkleRoot, _proof, msg.sender, bytes32(tokenId));\n totalCost += saleDetails.cost * amount;\n }\n totalAmount += amount;\n }\n\n if (globalMerkleCheckRequired) {\n // Check it once outside the loop only when required\n requireMerkleProof(gSaleDetails.merkleRoot, _proof, msg.sender, bytes32(type(uint256).max));\n }\n\n if (_expectedPaymentToken != _paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_paymentToken, totalCost, 0);\n }\n if (_maxTotal < totalCost) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, totalCost, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != totalCost) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, totalCost, msg.value);\n }\n } else if (msg.value > 0) {\n // Paid in ERC20, but sent ETH\n revert InsufficientPayment(address(0), 0, msg.value);\n } else {\n // Paid in ERC20\n SafeERC20.safeTransferFrom(IERC20(_expectedPaymentToken), msg.sender, address(this), totalCost);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev tokenIds must be sorted ascending without duplicates.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data,\n address expectedPaymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n _payForActiveMint(tokenIds, amounts, expectedPaymentToken, maxTotal, proof);\n\n IERC1155SupplyFunctions items = IERC1155SupplyFunctions(_items);\n uint256 totalAmount = 0;\n uint256 nMint = tokenIds.length;\n for (uint256 i = 0; i < nMint; i++) {\n // Update storage balance\n uint256 tokenSupplyCap = _tokenSaleDetails[tokenIds[i]].supplyCap;\n if (tokenSupplyCap > 0 && items.tokenSupply(tokenIds[i]) + amounts[i] > tokenSupplyCap) {\n revert InsufficientSupply(items.tokenSupply(tokenIds[i]), amounts[i], tokenSupplyCap);\n }\n totalAmount += amounts[i];\n }\n uint256 totalSupplyCap = _globalSaleDetails.supplyCap;\n if (totalSupplyCap > 0 && items.totalSupply() + totalAmount > totalSupplyCap) {\n revert InsufficientSupply(items.totalSupply(), totalAmount, totalSupplyCap);\n }\n\n IERC1155ItemsFunctions(_items).batchMint(to, tokenIds, amounts, data);\n emit ItemsMinted(to, tokenIds, amounts);\n }\n\n //\n // Admin\n //\n\n /**\n * Set the payment token.\n * @param paymentTokenAddr The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @dev This should be set before the sale starts.\n */\n function setPaymentToken(\n address paymentTokenAddr\n ) public onlyRole(MINT_ADMIN_ROLE) {\n _paymentToken = paymentTokenAddr;\n }\n\n /**\n * Set the global sale details.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param supplyCap The maximum number of tokens that can be minted.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n */\n function setGlobalSaleDetails(\n uint256 cost,\n uint256 supplyCap,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _globalSaleDetails = SaleDetails(cost, supplyCap, startTime, endTime, merkleRoot);\n emit GlobalSaleDetailsUpdated(cost, supplyCap, startTime, endTime, merkleRoot);\n }\n\n /**\n * Set the sale details for an individual token.\n * @param tokenId The token ID to set the sale details for.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param supplyCap The maximum number of tokens that can be minted.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n */\n function setTokenSaleDetails(\n uint256 tokenId,\n uint256 cost,\n uint256 supplyCap,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] = SaleDetails(cost, supplyCap, startTime, endTime, merkleRoot);\n emit TokenSaleDetailsUpdated(tokenId, cost, supplyCap, startTime, endTime, merkleRoot);\n }\n\n /**\n * Set the sale details for a batch of tokens.\n * @param tokenIds The token IDs to set the sale details for.\n * @param costs The amount of payment tokens to accept for each token minted.\n * @param supplyCaps The maximum number of tokens that can be minted.\n * @param startTimes The start time of the sale. Tokens cannot be minted before this time.\n * @param endTimes The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoots The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n * @dev tokenIds must be sorted ascending without duplicates.\n */\n function setTokenSaleDetailsBatch(\n uint256[] calldata tokenIds,\n uint256[] calldata costs,\n uint256[] calldata supplyCaps,\n uint64[] calldata startTimes,\n uint64[] calldata endTimes,\n bytes32[] calldata merkleRoots\n ) public onlyRole(MINT_ADMIN_ROLE) {\n if (\n tokenIds.length != costs.length || tokenIds.length != supplyCaps.length\n || tokenIds.length != startTimes.length || tokenIds.length != endTimes.length\n || tokenIds.length != merkleRoots.length\n ) {\n revert InvalidSaleDetails();\n }\n\n uint256 lastTokenId;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n uint256 tokenId = tokenIds[i];\n if (i != 0 && lastTokenId >= tokenId) {\n revert InvalidTokenIds();\n }\n lastTokenId = tokenId;\n\n // solhint-disable-next-line not-rely-on-time\n if (endTimes[i] < startTimes[i] || endTimes[i] <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] =\n SaleDetails(costs[i], supplyCaps[i], startTimes[i], endTimes[i], merkleRoots[i]);\n emit TokenSaleDetailsUpdated(tokenId, costs[i], supplyCaps[i], startTimes[i], endTimes[i], merkleRoots[i]);\n }\n }\n\n //\n // Views\n //\n\n /**\n * Get global sales details.\n * @return Sale details.\n * @notice Global sales details apply to all tokens.\n * @notice Global sales details are overriden when token sale is active.\n */\n function globalSaleDetails() external view returns (SaleDetails memory) {\n return _globalSaleDetails;\n }\n\n /**\n * Get token sale details.\n * @param tokenId Token ID to get sale details for.\n * @return Sale details.\n * @notice Token sale details override global sale details.\n */\n function tokenSaleDetails(\n uint256 tokenId\n ) external view returns (SaleDetails memory) {\n return _tokenSaleDetails[tokenId];\n }\n\n /**\n * Get sale details for multiple tokens.\n * @param tokenIds Array of token IDs to retrieve sale details for.\n * @return Array of sale details corresponding to each token ID.\n * @notice Each token\'s sale details override the global sale details if set.\n */\n function tokenSaleDetailsBatch(\n uint256[] calldata tokenIds\n ) external view returns (SaleDetails[] memory) {\n SaleDetails[] memory details = new SaleDetails[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n details[i] = _tokenSaleDetails[tokenIds[i]];\n }\n return details;\n }\n\n /**\n * Get payment token.\n * @return Payment token address.\n * @notice address(0) indicates payment in ETH.\n */\n function paymentToken() external view returns (address) {\n return _paymentToken;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable) returns (bool) {\n return type(IERC1155SaleFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { MerkleProofSingleUse } from "../../../common/MerkleProofSingleUse.sol";\nimport { SignalsImplicitModeControlled } from "../../../common/SignalsImplicitModeControlled.sol";\nimport { AccessControlEnumerable, IERC20, SafeERC20, WithdrawControlled } from "../../../common/WithdrawControlled.sol";\nimport { IERC1155ItemsFunctions } from "../../presets/items/IERC1155Items.sol";\nimport { IERC1155Sale } from "./IERC1155Sale.sol";\n\ncontract ERC1155Sale is IERC1155Sale, WithdrawControlled, MerkleProofSingleUse, SignalsImplicitModeControlled {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n\n // Sales details indexed by sale index.\n SaleDetails[] private _saleDetails;\n // tokenId => saleIndex => quantity minted\n mapping(uint256 => mapping(uint256 => uint256)) private _tokensMintedPerSale;\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param items The ERC-1155 Items contract address\n * @param implicitModeValidator Implicit session validator address\n * @param implicitModeProjectId Implicit session project id\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual {\n if (_initialized) {\n revert InvalidInitialization();\n }\n\n _items = items;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(MINT_ADMIN_ROLE, owner);\n _grantRole(WITHDRAW_ROLE, owner);\n\n _initializeImplicitMode(owner, implicitModeValidator, implicitModeProjectId);\n\n _initialized = true;\n }\n\n /**\n * Checks the sale is active, valid and takes payment.\n * @param _tokenIds Token IDs to mint.\n * @param _amounts Amounts of tokens to mint.\n * @param _saleIndexes Sale indexes for each token.\n * @param _expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param _maxTotal Maximum amount of payment tokens.\n * @param _proofs Merkle proofs for allowlist minting.\n */\n function _validateMint(\n uint256[] calldata _tokenIds,\n uint256[] calldata _amounts,\n uint256[] calldata _saleIndexes,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[][] calldata _proofs\n ) private {\n uint256 totalCost;\n\n // Validate input arrays have matching lengths\n uint256 length = _tokenIds.length;\n if (length != _amounts.length || length != _saleIndexes.length || length != _proofs.length) {\n revert InvalidArrayLengths();\n }\n\n for (uint256 i; i < length; i++) {\n uint256 tokenId = _tokenIds[i];\n uint256 saleIndex = _saleIndexes[i];\n\n // Find the sale details for the token\n if (saleIndex >= _saleDetails.length) {\n revert SaleDetailsNotFound(saleIndex);\n }\n SaleDetails memory details = _saleDetails[saleIndex];\n\n // Check if token is within the sale range\n if (tokenId < details.minTokenId || tokenId > details.maxTokenId) {\n revert InvalidSaleDetails();\n }\n\n // Check if sale is active\n // solhint-disable-next-line not-rely-on-time\n if (block.timestamp < details.startTime || block.timestamp > details.endTime) {\n revert SaleInactive();\n }\n\n // Validate payment token matches expected\n if (details.paymentToken != _expectedPaymentToken) {\n revert PaymentTokenMismatch();\n }\n\n uint256 amount = _amounts[i];\n if (amount == 0) {\n revert InvalidAmount();\n }\n\n // Check supply\n uint256 minted = _tokensMintedPerSale[tokenId][saleIndex];\n if (amount > details.supply - minted) {\n revert InsufficientSupply(details.supply - minted, amount);\n }\n\n // Check merkle proof\n requireMerkleProof(details.merkleRoot, _proofs[i], msg.sender, bytes32(tokenId));\n\n // Update supply and calculate cost\n _tokensMintedPerSale[tokenId][saleIndex] = minted + amount;\n totalCost += details.cost * amount;\n }\n\n if (_maxTotal < totalCost) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, totalCost, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != totalCost) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, totalCost, msg.value);\n }\n } else if (msg.value > 0) {\n // Paid in ERC20, but sent ETH\n revert InsufficientPayment(address(0), 0, msg.value);\n } else {\n // Paid in ERC20\n SafeERC20.safeTransferFrom(IERC20(_expectedPaymentToken), msg.sender, address(this), totalCost);\n }\n }\n\n //\n // Minting\n //\n\n /// @inheritdoc IERC1155Sale\n /// @notice Sale must be active for all tokens.\n /// @dev All sales must use the same payment token.\n /// @dev An empty proof is supplied when no proof is required.\n function mint(\n address to,\n uint256[] calldata tokenIds,\n uint256[] calldata amounts,\n bytes calldata data,\n uint256[] calldata saleIndexes,\n address expectedPaymentToken,\n uint256 maxTotal,\n bytes32[][] calldata proofs\n ) public payable {\n _validateMint(tokenIds, amounts, saleIndexes, expectedPaymentToken, maxTotal, proofs);\n IERC1155ItemsFunctions(_items).batchMint(to, tokenIds, amounts, data);\n emit ItemsMinted(to, tokenIds, amounts, saleIndexes);\n }\n\n //\n // Admin\n //\n\n /// @inheritdoc IERC1155Sale\n function addSaleDetails(\n SaleDetails calldata details\n ) public onlyRole(MINT_ADMIN_ROLE) returns (uint256 saleIndex) {\n _validateSaleDetails(details);\n\n saleIndex = _saleDetails.length;\n _saleDetails.push(details);\n\n emit SaleDetailsAdded(saleIndex, details);\n }\n\n /// @inheritdoc IERC1155Sale\n function updateSaleDetails(uint256 saleIndex, SaleDetails calldata details) public onlyRole(MINT_ADMIN_ROLE) {\n if (saleIndex >= _saleDetails.length) {\n revert SaleDetailsNotFound(saleIndex);\n }\n _validateSaleDetails(details);\n\n _saleDetails[saleIndex] = details;\n\n emit SaleDetailsUpdated(saleIndex, details);\n }\n\n function _validateSaleDetails(\n SaleDetails calldata details\n ) private pure {\n if (details.maxTokenId < details.minTokenId) {\n revert InvalidSaleDetails();\n }\n if (details.supply == 0) {\n revert InvalidSaleDetails();\n }\n if (details.endTime < details.startTime) {\n revert InvalidSaleDetails();\n }\n }\n\n //\n // Views\n //\n\n /// @inheritdoc IERC1155Sale\n function saleDetailsCount() external view returns (uint256) {\n return _saleDetails.length;\n }\n\n /// @inheritdoc IERC1155Sale\n function saleDetails(\n uint256 saleIndex\n ) external view returns (SaleDetails memory) {\n if (saleIndex >= _saleDetails.length) {\n revert SaleDetailsNotFound(saleIndex);\n }\n return _saleDetails[saleIndex];\n }\n\n /// @inheritdoc IERC1155Sale\n function saleDetailsBatch(\n uint256[] calldata saleIndexes\n ) external view returns (SaleDetails[] memory) {\n SaleDetails[] memory details = new SaleDetails[](saleIndexes.length);\n for (uint256 i = 0; i < saleIndexes.length; i++) {\n if (saleIndexes[i] >= _saleDetails.length) {\n revert SaleDetailsNotFound(saleIndexes[i]);\n }\n details[i] = _saleDetails[saleIndexes[i]];\n }\n return details;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(WithdrawControlled, SignalsImplicitModeControlled) returns (bool) {\n return type(IERC1155Sale).interfaceId == interfaceId || WithdrawControlled.supportsInterface(interfaceId)\n || SignalsImplicitModeControlled.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC1155/utility/sale/IERC1155SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Sale proxy contract\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-1155 Items contract.\n */\n function deploy(address proxyOwner, address tokenOwner, address items) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactory is IERC1155SaleFactoryFunctions, IERC1155SaleFactorySignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Sale proxy contract\n * @param nonce Extra salt to add to the salt used to compute the address\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-1155 Items contract.\n */\n function deploy(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param nonce Extra salt to add to the salt used to compute the address\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n */\n function determineAddress(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactory is IERC1155SaleFactoryFunctions, IERC1155SaleFactorySignals { }\n' }, 'src/proxies/TransparentUpgradeableBeaconProxy.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { BeaconProxy, Proxy } from "./openzeppelin/BeaconProxy.sol";\nimport { ERC1967Proxy, TransparentUpgradeableProxy } from "./openzeppelin/TransparentUpgradeableProxy.sol";\n\ninterface ITransparentUpgradeableBeaconProxy {\n\n function initialize(address admin, address beacon, bytes memory data) external;\n\n}\n\nerror InvalidInitialization();\n\n/**\n * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation,\n * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors.\n * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * The proxy selectors are:\n * - 0xcf7a1d77: initialize\n * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy)\n * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy)\n * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy)\n * - 0xf851a440: admin (from TransparentUpgradeableProxy)\n * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy)\n */\ncontract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy {\n\n /**\n * Decode the initialization data from the msg.data and call the initialize function.\n */\n function _dispatchInitialize() private returns (bytes memory) {\n _requireZeroValue();\n\n (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes));\n initialize(admin, beacon, data);\n\n return "";\n }\n\n function initialize(address admin, address beacon, bytes memory data) internal {\n if (_admin() != address(0)) {\n // Redundant call. This function can only be called when the admin is not set.\n revert InvalidInitialization();\n }\n _changeAdmin(admin);\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev If the admin is not set, the fallback function is used to initialize the proxy.\n * @dev If the admin is set, the fallback function is used to delegatecall the implementation.\n */\n function _fallback() internal override(TransparentUpgradeableProxy, Proxy) {\n if (_getAdmin() == address(0)) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) {\n ret = _dispatchInitialize();\n // solhint-disable-next-line no-inline-assembly\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n }\n // When the admin is not set, the fallback function is used to initialize the proxy.\n revert InvalidInitialization();\n }\n TransparentUpgradeableProxy._fallback();\n }\n\n /**\n * Returns the current implementation address.\n * @dev This is the implementation address set by the admin, or the beacon implementation.\n */\n function _implementation() internal view override(ERC1967Proxy, BeaconProxy) returns (address) {\n address implementation = ERC1967Proxy._implementation();\n if (implementation != address(0)) {\n return implementation;\n }\n return BeaconProxy._implementation();\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/access/Ownable.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/Context.sol";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), "Ownable: caller is not the owner");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), "Ownable: new owner is the zero address");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IBeacon.sol";\nimport "../../access/Ownable.sol";\nimport "../../utils/Address.sol";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");\n _implementation = newImplementation;\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/Create2.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as \'counterfactual interactions\'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n require(address(this).balance >= amount, "Create2: insufficient balance");\n require(bytecode.length != 0, "Create2: bytecode length is zero");\n /// @solidity memory-safe-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), "Create2: Failed on deploy");\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract\'s address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := keccak256(start, 85)\n }\n }\n}\n' }, - 'src/tokens/ERC1155/extensions/supply/ERC1155Supply.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n IERC1155Supply,\n IERC1155SupplyFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol";\nimport { ERC1155 } from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol";\n\n/**\n * An ERC-1155 extension that tracks token supply.\n */\nabstract contract ERC1155Supply is ERC1155, IERC1155Supply {\n\n // Current supply\n uint256 public totalSupply;\n mapping(uint256 => uint256) public tokenSupply;\n\n /**\n * Mint _amount of tokens of a given id\n * @param _to The address to mint tokens to\n * @param _id Token id to mint\n * @param _amount The amount to be minted\n * @param _data Data to pass if receiver is contract\n */\n function _mint(address _to, uint256 _id, uint256 _amount, bytes memory _data) internal virtual {\n totalSupply += _amount;\n tokenSupply[_id] += _amount;\n balances[_to][_id] += _amount;\n\n emit TransferSingle(msg.sender, address(0x0), _to, _id, _amount);\n\n _callonERC1155Received(address(0x0), _to, _id, _amount, gasleft(), _data);\n }\n\n /**\n * Mint tokens for each ids in _ids\n * @param _to The address to mint tokens to\n * @param _ids Array of ids to mint\n * @param _amounts Array of amount of tokens to mint per id\n * @param _data Data to pass if receiver is contract\n */\n function _batchMint(\n address _to,\n uint256[] memory _ids,\n uint256[] memory _amounts,\n bytes memory _data\n ) internal virtual {\n uint256 nMint = _ids.length;\n if (nMint != _amounts.length) {\n revert InvalidArrayLength();\n }\n\n // Executing all minting\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < nMint; i++) {\n // Update storage balance\n balances[_to][_ids[i]] += _amounts[i];\n tokenSupply[_ids[i]] += _amounts[i];\n totalAmount += _amounts[i];\n }\n totalSupply += totalAmount;\n\n emit TransferBatch(msg.sender, address(0x0), _to, _ids, _amounts);\n\n // Calling onReceive method if recipient is contract\n _callonERC1155BatchReceived(address(0x0), _to, _ids, _amounts, gasleft(), _data);\n }\n\n /**\n * Burn _amount of tokens of a given token id\n * @param _from The address to burn tokens from\n * @param _id Token id to burn\n * @param _amount The amount to be burned\n */\n function _burn(address _from, uint256 _id, uint256 _amount) internal virtual {\n // Supply\n totalSupply -= _amount;\n tokenSupply[_id] -= _amount;\n\n // Balances\n balances[_from][_id] -= _amount;\n\n // Emit event\n emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount);\n }\n\n /**\n * Burn tokens of given token id for each (_ids[i], _amounts[i]) pair\n * @param _from The address to burn tokens from\n * @param _ids Array of token ids to burn\n * @param _amounts Array of the amount to be burned\n */\n function _batchBurn(address _from, uint256[] memory _ids, uint256[] memory _amounts) internal virtual {\n uint256 nBurn = _ids.length;\n if (nBurn != _amounts.length) {\n revert InvalidArrayLength();\n }\n\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < nBurn; i++) {\n // Update balances\n balances[_from][_ids[i]] -= _amounts[i];\n tokenSupply[_ids[i]] -= _amounts[i];\n totalAmount += _amounts[i];\n }\n totalSupply -= totalAmount;\n\n // Emit batch mint event\n emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts);\n }\n\n //\n // Views\n //\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC1155) returns (bool) {\n return type(IERC1155SupplyFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' - }, - 'src/tokens/ERC1155/utility/sale/IERC1155Sale.sol': { - content: - "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFunctions {\n\n struct SaleDetails {\n uint256 cost;\n uint256 supplyCap; // 0 supply cap indicates unlimited supply\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Get global sales details.\n * @return Sale details.\n * @notice Global sales details apply to all tokens.\n * @notice Global sales details are overriden when token sale is active.\n */\n function globalSaleDetails() external view returns (SaleDetails memory);\n\n /**\n * Get token sale details.\n * @param tokenId Token ID to get sale details for.\n * @return Sale details.\n * @notice Token sale details override global sale details.\n */\n function tokenSaleDetails(\n uint256 tokenId\n ) external view returns (SaleDetails memory);\n\n /**\n * Get sale details for multiple tokens.\n * @param tokenIds Array of token IDs to retrieve sale details for.\n * @return Array of sale details corresponding to each token ID.\n * @notice Each token's sale details override the global sale details if set.\n */\n function tokenSaleDetailsBatch(\n uint256[] calldata tokenIds\n ) external view returns (SaleDetails[] memory);\n\n /**\n * Get payment token.\n * @return Payment token address.\n * @notice address(0) indicates payment in ETH.\n */\n function paymentToken() external view returns (address);\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev tokenIds must be sorted ascending without duplicates.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) external payable;\n\n}\n\ninterface IERC1155SaleSignals {\n\n event GlobalSaleDetailsUpdated(\n uint256 cost, uint256 supplyCap, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event TokenSaleDetailsUpdated(\n uint256 tokenId, uint256 cost, uint256 supplyCap, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256[] tokenIds, uint256[] amounts);\n\n /**\n * Contract already initialized.\n */\n error InvalidInitialization();\n\n /**\n * Sale details supplied are invalid.\n */\n error InvalidSaleDetails();\n\n /**\n * Sale is not active globally.\n */\n error GlobalSaleInactive();\n\n /**\n * Sale is not active.\n * @param tokenId Invalid Token ID.\n */\n error SaleInactive(uint256 tokenId);\n\n /**\n * Insufficient tokens for payment.\n * @param currency Currency address. address(0) indicates ETH.\n * @param expected Expected amount of tokens.\n * @param actual Actual amount of tokens.\n */\n error InsufficientPayment(address currency, uint256 expected, uint256 actual);\n\n /**\n * Invalid token IDs.\n */\n error InvalidTokenIds();\n\n /**\n * Insufficient supply of tokens.\n */\n error InsufficientSupply(uint256 currentSupply, uint256 requestedAmount, uint256 maxSupply);\n\n}\n\ninterface IERC1155Sale is IERC1155SaleFunctions, IERC1155SaleSignals { }\n" - }, 'src/tokens/common/MerkleProofSingleUse.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IMerkleProofSingleUse } from "@0xsequence/contracts-library/tokens/common/IMerkleProofSingleUse.sol";\nimport { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";\n\n/**\n * Require single use merkle proofs per address.\n */\nabstract contract MerkleProofSingleUse is IMerkleProofSingleUse {\n\n // Stores proofs used by an address\n mapping(address => mapping(bytes32 => bool)) private _proofUsed;\n\n /**\n * Requires the given merkle proof to be valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @notice Fails when the proof is invalid or the proof has already been claimed by this address.\n * @dev This function reverts on failure.\n */\n function requireMerkleProof(bytes32 root, bytes32[] calldata proof, address addr, bytes32 salt) internal {\n if (root != bytes32(0)) {\n if (!checkMerkleProof(root, proof, addr, salt)) {\n revert MerkleProofInvalid(root, proof, addr, salt);\n }\n _proofUsed[addr][root] = true;\n }\n }\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) public view returns (bool) {\n return !_proofUsed[addr][root] && MerkleProof.verify(proof, root, keccak256(abi.encodePacked(addr, salt)));\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IMerkleProofSingleUse } from "./IMerkleProofSingleUse.sol";\n\nimport { MerkleProof } from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol";\n\n/**\n * Require single use merkle proofs per root.\n */\nabstract contract MerkleProofSingleUse is IMerkleProofSingleUse {\n\n // Stores proofs used per root\n mapping(bytes32 => mapping(bytes32 => bool)) private _proofUsed;\n\n /**\n * Requires the given merkle proof to be valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @notice Fails when the proof is invalid or the proof has already been claimed by this address.\n * @dev This function reverts on failure.\n */\n function requireMerkleProof(bytes32 root, bytes32[] calldata proof, address addr, bytes32 salt) internal {\n if (root != bytes32(0)) {\n bytes32 leaf = _getLeaf(addr, salt);\n if (!_checkMerkleProof(root, proof, leaf)) {\n revert MerkleProofInvalid(root, proof, addr, salt);\n }\n _proofUsed[root][leaf] = true;\n }\n }\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) public view returns (bool) {\n return _checkMerkleProof(root, proof, _getLeaf(addr, salt));\n }\n\n function _getLeaf(address addr, bytes32 salt) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(addr, salt));\n }\n\n function _checkMerkleProof(bytes32 root, bytes32[] calldata proof, bytes32 leaf) internal view returns (bool) {\n return !_proofUsed[root][leaf] && MerkleProof.verify(proof, root, leaf);\n }\n\n}\n' }, - 'src/tokens/common/WithdrawControlled.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IWithdrawControlled } from "@0xsequence/contracts-library/tokens/common/IWithdrawControlled.sol";\n\nimport { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";\nimport { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";\n\n/**\n * An abstract contract that allows ETH and ERC20 tokens stored in the contract to be withdrawn.\n */\nabstract contract WithdrawControlled is AccessControlEnumerable, IWithdrawControlled {\n\n bytes32 internal constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");\n\n //\n // Withdraw\n //\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawERC20(address token, address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n SafeERC20.safeTransfer(IERC20(token), to, value);\n }\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawETH(address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n (bool success,) = to.call{ value: value }("");\n if (!success) {\n revert WithdrawFailed();\n }\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { AccessControlEnumerable } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport {\n IERC165,\n IImplicitProjectValidation,\n SignalsImplicitMode\n} from "signals-implicit-mode/src/helper/SignalsImplicitMode.sol";\n\n/**\n * An abstract contract that allows implicit session access for a given project.\n */\nabstract contract SignalsImplicitModeControlled is AccessControlEnumerable, SignalsImplicitMode {\n\n bytes32 internal constant _IMPLICIT_MODE_ADMIN_ROLE = keccak256("IMPLICIT_MODE_ADMIN_ROLE");\n\n function _initializeImplicitMode(address owner, address validator, bytes32 projectId) internal {\n _grantRole(_IMPLICIT_MODE_ADMIN_ROLE, owner);\n _initializeSignalsImplicitMode(validator, projectId);\n }\n\n /**\n * Updates the validator for implicit mode validation.\n * @param validator The validator address.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeValidator(\n address validator\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _validator = IImplicitProjectValidation(validator);\n }\n\n /**\n * Updates the settings for implicit mode validation.\n * @param projectId The project id.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeProjectId(\n bytes32 projectId\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _projectId = projectId;\n }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable, SignalsImplicitMode) returns (bool) {\n return\n AccessControlEnumerable.supportsInterface(interfaceId) || SignalsImplicitMode.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'src/tokens/ERC1155/extensions/supply/IERC1155Supply.sol': { + 'src/tokens/common/WithdrawControlled.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SupplyFunctions {\n\n /**\n * Returns the total supply of ERC1155 tokens.\n */\n function totalSupply() external returns (uint256);\n\n /**\n * Returns the total supply of a given ERC1155 token.\n * @param tokenId The ERC1155 token id.\n */\n function tokenSupply(\n uint256 tokenId\n ) external returns (uint256);\n\n}\n\ninterface IERC1155SupplySignals {\n\n /**\n * Invalid array input length.\n */\n error InvalidArrayLength();\n\n}\n\ninterface IERC1155Supply is IERC1155SupplySignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IWithdrawControlled } from "./IWithdrawControlled.sol";\n\nimport { AccessControlEnumerable, ERC165 } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport { IERC20, SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";\n\n/**\n * An abstract contract that allows ETH and ERC20 tokens stored in the contract to be withdrawn.\n */\nabstract contract WithdrawControlled is AccessControlEnumerable, IWithdrawControlled {\n\n bytes32 internal constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");\n\n //\n // Withdraw\n //\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawERC20(address token, address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n SafeERC20.safeTransfer(IERC20(token), to, value);\n }\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawETH(address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n (bool success,) = to.call{ value: value }("");\n if (!success) {\n revert WithdrawFailed();\n }\n }\n\n /// @inheritdoc ERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable) returns (bool) {\n return interfaceId == type(IWithdrawControlled).interfaceId\n || AccessControlEnumerable.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC1155/presets/items/IERC1155Items.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenId Token ID to mint.\n * @param amount Amount of tokens to mint.\n * @param data Data to pass if receiver is contract.\n */\n function mint(address to, uint256 tokenId, uint256 amount, bytes memory data) external;\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n */\n function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data) external;\n\n}\n\ninterface IERC1155ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC1155Items is IERC1155ItemsFunctions, IERC1155ItemsSignals { }\n' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC1155.sol': { + 'src/tokens/ERC1155/utility/sale/IERC1155Sale.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\nimport \'./IERC165.sol\';\n\n\ninterface IERC1155 is IERC165 {\n\n /****************************************|\n | Events |\n |_______________________________________*/\n\n /**\n * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning\n * Operator MUST be msg.sender\n * When minting/creating tokens, the `_from` field MUST be set to `0x0`\n * When burning/destroying tokens, the `_to` field MUST be set to `0x0`\n * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID\n * To broadcast the existence of a token ID with no initial balance, the contract SHOULD emit the TransferSingle event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0\n */\n event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount);\n\n /**\n * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning\n * Operator MUST be msg.sender\n * When minting/creating tokens, the `_from` field MUST be set to `0x0`\n * When burning/destroying tokens, the `_to` field MUST be set to `0x0`\n * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID\n * To broadcast the existence of multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0\n */\n event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts);\n\n /**\n * @dev MUST emit when an approval is updated\n */\n event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);\n\n\n /****************************************|\n | Functions |\n |_______________________________________*/\n\n /**\n * @notice Transfers amount of an _id from the _from address to the _to address specified\n * @dev MUST emit TransferSingle event on success\n * Caller must be approved to manage the _from account\'s tokens (see isApprovedForAll)\n * MUST throw if `_to` is the zero address\n * MUST throw if balance of sender for token `_id` is lower than the `_amount` sent\n * MUST throw on any other error\n * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external;\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @dev MUST emit TransferBatch event on success\n * Caller must be approved to manage the _from account\'s tokens (see isApprovedForAll)\n * MUST throw if `_to` is the zero address\n * MUST throw if length of `_ids` is not the same as length of `_amounts`\n * MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_amounts` sent\n * MUST throw on any other error\n * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`\n * Transfers and events MUST occur in the array order they were submitted (_ids[0] before _ids[1], etc)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external;\n\n /**\n * @notice Get the balance of an account\'s Tokens\n * @param _owner The address of the token holder\n * @param _id ID of the Token\n * @return The _owner\'s balance of the Token type requested\n */\n function balanceOf(address _owner, uint256 _id) external view returns (uint256);\n\n /**\n * @notice Get the balance of multiple account/token pairs\n * @param _owners The addresses of the token holders\n * @param _ids ID of the Tokens\n * @return The _owner\'s balance of the Token types requested (i.e. balance for each (owner, id) pair)\n */\n function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);\n\n /**\n * @notice Enable or disable approval for a third party ("operator") to manage all of caller\'s tokens\n * @dev MUST emit the ApprovalForAll event on success\n * @param _operator Address to add to the set of authorized operators\n * @param _approved True if the operator is approved, false to revoke approval\n */\n function setApprovalForAll(address _operator, bool _approved) external;\n\n /**\n * @notice Queries the approval status of an operator for a given owner\n * @param _owner The owner of the Tokens\n * @param _operator Address of authorized operator\n * @return isOperator True if the operator is approved, false if not\n */\n function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator);\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155Sale {\n\n /**\n * Sale details.\n * @param minTokenId Minimum token ID for this sale. (Inclusive)\n * @param maxTokenId Maximum token ID for this sale. (Inclusive)\n * @param cost Cost per token.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates payment in ETH.\n * @param supply Maximum number of tokens that can be minted (per token ID).\n * @param startTime Start time of the sale. (Inclusive)\n * @param endTime End time of the sale. (Inclusive)\n * @param merkleRoot Merkle root for allowlist minting. 0 indicates no proof required.\n */\n struct SaleDetails {\n uint256 minTokenId;\n uint256 maxTokenId;\n uint256 cost;\n address paymentToken;\n uint256 supply;\n uint64 startTime;\n uint64 endTime;\n bytes32 merkleRoot;\n }\n\n /**\n * Get the total number of sale details.\n * @return Total number of sale details.\n */\n function saleDetailsCount() external view returns (uint256);\n\n /**\n * Get sale details.\n * @param saleIndex Index of the sale details to get.\n * @return details Sale details.\n */\n function saleDetails(\n uint256 saleIndex\n ) external view returns (SaleDetails memory details);\n\n /**\n * Get sale details for multiple sale indexes.\n * @param saleIndexes Array of sale indexes to retrieve sale details for.\n * @return details Array of sale details corresponding to each sale index.\n */\n function saleDetailsBatch(\n uint256[] calldata saleIndexes\n ) external view returns (SaleDetails[] memory details);\n\n /**\n * Add new sale details.\n * @param details Sale details to add.\n * @return saleIndex Index of the newly added sale details.\n */\n function addSaleDetails(\n SaleDetails calldata details\n ) external returns (uint256 saleIndex);\n\n /**\n * Update existing sale details.\n * @param saleIndex Index of the sale details to update.\n * @param details Sale details to update.\n */\n function updateSaleDetails(uint256 saleIndex, SaleDetails calldata details) external;\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param saleIndexes Sale indexes for each token. Must match tokenIds length.\n * @param expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proofs Merkle proofs for allowlist minting. Must match tokenIds length.\n * @notice Sale must be active for all tokens.\n * @dev All sales must use the same payment token.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] calldata tokenIds,\n uint256[] calldata amounts,\n bytes calldata data,\n uint256[] calldata saleIndexes,\n address expectedPaymentToken,\n uint256 maxTotal,\n bytes32[][] calldata proofs\n ) external payable;\n\n /**\n * Emitted when sale details are added.\n * @param saleIndex Index of the sale details that were added.\n * @param details Sale details that were added.\n */\n event SaleDetailsAdded(uint256 saleIndex, SaleDetails details);\n\n /**\n * Emitted when sale details are updated.\n * @param saleIndex Index of the sale details that were updated.\n * @param details Sale details that were updated.\n */\n event SaleDetailsUpdated(uint256 saleIndex, SaleDetails details);\n\n /**\n * Emitted when tokens are minted.\n * @param to Address that minted the tokens.\n * @param tokenIds Token IDs that were minted.\n * @param amounts Amounts of tokens that were minted.\n * @param saleIndexes Sale indexes that were minted from.\n */\n event ItemsMinted(address to, uint256[] tokenIds, uint256[] amounts, uint256[] saleIndexes);\n\n /**\n * Contract already initialized.\n */\n error InvalidInitialization();\n\n /**\n * Sale details supplied are invalid.\n */\n error InvalidSaleDetails();\n\n /**\n * Sale details index does not exist.\n */\n error SaleDetailsNotFound(uint256 index);\n\n /**\n * Sale is not active.\n */\n error SaleInactive();\n\n /**\n * Insufficient tokens for payment.\n * @param currency Currency address. address(0) indicates ETH.\n * @param expected Expected amount of tokens.\n * @param actual Actual amount of tokens.\n */\n error InsufficientPayment(address currency, uint256 expected, uint256 actual);\n\n /**\n * Insufficient supply of tokens.\n * @param remainingSupply Remaining supply.\n * @param amount Amount to mint.\n */\n error InsufficientSupply(uint256 remainingSupply, uint256 amount);\n\n /**\n * Invalid array lengths.\n */\n error InvalidArrayLengths();\n\n /**\n * Invalid amount.\n */\n error InvalidAmount();\n\n /**\n * Payment token mismatch between sales.\n */\n error PaymentTokenMismatch();\n\n}\n' }, 'src/proxies/openzeppelin/BeaconProxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\nimport "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\nimport "openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' }, 'src/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\n/// @notice This implementation is a copy of OpenZeppelin\'s with the following changes:\n/// - Pragma updated\n/// - Imports updated\n/// - Constructor removed\n/// - Allows admin to call implementation\n\npragma solidity ^0.8.19;\n\nimport "./ERC1967Proxy.sol";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(\n address\n ) external;\n\n function upgradeTo(\n address\n ) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * Unlike the original OpenZeppelin implementation, this contract does not prevent the admin from calling the implementation.\n * This potentially exposes the admin to a proxy selector attack. See\n * https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * When using this contract, you must ensure that the implementation function selectors do not clash with the proxy selectors.\n * The proxy selectors are:\n * - 0x3659cfe6: upgradeTo\n * - 0x4f1ef286: upgradeToAndCall\n * - 0x8f283970: changeAdmin\n * - 0xf851a440: admin\n * - 0x5c60da1b: implementation\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n // Call implementation\n return super._fallback();\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(""), false);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return "";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() internal {\n require(msg.value == 0);\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/utils/Context.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Context.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/IBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n' }, - 'lib/openzeppelin/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Address.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn\'t rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity\'s `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, "Address: insufficient balance");\n\n (bool success, ) = recipient.call{value: amount}("");\n require(success, "Address: unable to send value, recipient may have reverted");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, "Address: low-level call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, "Address: low-level call with value failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, "Address: insufficient balance for call");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, "Address: low-level static call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, "Address: low-level delegate call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), "Address: call to non-contract");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn\'t, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/tokens/ERC1155/ERC1155.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\nimport "../../interfaces/IERC1155TokenReceiver.sol";\nimport "../../interfaces/IERC1155.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/ERC165.sol";\n\n/**\n * @dev Implementation of Multi-Token Standard contract\n */\ncontract ERC1155 is IERC1155, ERC165 {\n using Address for address;\n\n /***********************************|\n | Variables and Events |\n |__________________________________*/\n\n // onReceive function signatures\n bytes4 constant internal ERC1155_RECEIVED_VALUE = 0xf23a6e61;\n bytes4 constant internal ERC1155_BATCH_RECEIVED_VALUE = 0xbc197c81;\n\n // Objects balances\n mapping (address => mapping(uint256 => uint256)) internal balances;\n\n // Operator Functions\n mapping (address => mapping(address => bool)) internal operators;\n\n\n /***********************************|\n | Public Transfer Functions |\n |__________________________________*/\n\n /**\n * @notice Transfers amount amount of an _id from the _from address to the _to address specified\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data)\n public virtual override\n {\n require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeTransferFrom: INVALID_OPERATOR");\n require(_to != address(0),"ERC1155#safeTransferFrom: INVALID_RECIPIENT");\n\n _safeTransferFrom(_from, _to, _id, _amount);\n _callonERC1155Received(_from, _to, _id, _amount, gasleft(), _data);\n }\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data)\n public virtual override\n {\n // Requirements\n require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeBatchTransferFrom: INVALID_OPERATOR");\n require(_to != address(0), "ERC1155#safeBatchTransferFrom: INVALID_RECIPIENT");\n\n _safeBatchTransferFrom(_from, _to, _ids, _amounts);\n _callonERC1155BatchReceived(_from, _to, _ids, _amounts, gasleft(), _data);\n }\n\n\n /***********************************|\n | Internal Transfer Functions |\n |__________________________________*/\n\n /**\n * @notice Transfers amount amount of an _id from the _from address to the _to address specified\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n */\n function _safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount)\n internal virtual\n {\n // Update balances\n balances[_from][_id] -= _amount;\n balances[_to][_id] += _amount;\n\n // Emit event\n emit TransferSingle(msg.sender, _from, _to, _id, _amount);\n }\n\n /**\n * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...)\n */\n function _callonERC1155Received(address _from, address _to, uint256 _id, uint256 _amount, uint256 _gasLimit, bytes memory _data)\n internal virtual\n {\n // Check if recipient is contract\n if (_to.isContract()) {\n bytes4 retval = IERC1155TokenReceiver(_to).onERC1155Received{gas: _gasLimit}(msg.sender, _from, _id, _amount, _data);\n require(retval == ERC1155_RECEIVED_VALUE, "ERC1155#_callonERC1155Received: INVALID_ON_RECEIVE_MESSAGE");\n }\n }\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n */\n function _safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts)\n internal virtual\n {\n require(_ids.length == _amounts.length, "ERC1155#_safeBatchTransferFrom: INVALID_ARRAYS_LENGTH");\n\n // Number of transfer to execute\n uint256 nTransfer = _ids.length;\n\n // Executing all transfers\n for (uint256 i = 0; i < nTransfer; i++) {\n // Update storage balance of previous bin\n balances[_from][_ids[i]] -= _amounts[i];\n balances[_to][_ids[i]] += _amounts[i];\n }\n\n // Emit event\n emit TransferBatch(msg.sender, _from, _to, _ids, _amounts);\n }\n\n /**\n * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155BatchReceived(...)\n */\n function _callonERC1155BatchReceived(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, uint256 _gasLimit, bytes memory _data)\n internal virtual\n {\n // Pass data if recipient is contract\n if (_to.isContract()) {\n bytes4 retval = IERC1155TokenReceiver(_to).onERC1155BatchReceived{gas: _gasLimit}(msg.sender, _from, _ids, _amounts, _data);\n require(retval == ERC1155_BATCH_RECEIVED_VALUE, "ERC1155#_callonERC1155BatchReceived: INVALID_ON_RECEIVE_MESSAGE");\n }\n }\n\n\n /***********************************|\n | Operator Functions |\n |__________________________________*/\n\n /**\n * @notice Enable or disable approval for a third party ("operator") to manage all of caller\'s tokens\n * @param _operator Address to add to the set of authorized operators\n * @param _approved True if the operator is approved, false to revoke approval\n */\n function setApprovalForAll(address _operator, bool _approved)\n external virtual override\n {\n // Update operator status\n operators[msg.sender][_operator] = _approved;\n emit ApprovalForAll(msg.sender, _operator, _approved);\n }\n\n /**\n * @notice Queries the approval status of an operator for a given owner\n * @param _owner The owner of the Tokens\n * @param _operator Address of authorized operator\n * @return isOperator True if the operator is approved, false if not\n */\n function isApprovedForAll(address _owner, address _operator)\n public view virtual override returns (bool isOperator)\n {\n return operators[_owner][_operator];\n }\n\n\n /***********************************|\n | Balance Functions |\n |__________________________________*/\n\n /**\n * @notice Get the balance of an account\'s Tokens\n * @param _owner The address of the token holder\n * @param _id ID of the Token\n * @return The _owner\'s balance of the Token type requested\n */\n function balanceOf(address _owner, uint256 _id)\n public view virtual override returns (uint256)\n {\n return balances[_owner][_id];\n }\n\n /**\n * @notice Get the balance of multiple account/token pairs\n * @param _owners The addresses of the token holders\n * @param _ids ID of the Tokens\n * @return The _owner\'s balance of the Token types requested (i.e. balance for each (owner, id) pair)\n */\n function balanceOfBatch(address[] memory _owners, uint256[] memory _ids)\n public view virtual override returns (uint256[] memory)\n {\n require(_owners.length == _ids.length, "ERC1155#balanceOfBatch: INVALID_ARRAY_LENGTH");\n\n // Variables\n uint256[] memory batchBalances = new uint256[](_owners.length);\n\n // Iterate over each owner and token ID\n for (uint256 i = 0; i < _owners.length; i++) {\n batchBalances[i] = balances[_owners[i]][_ids[i]];\n }\n\n return batchBalances;\n }\n\n\n /***********************************|\n | ERC165 Functions |\n |__________________________________*/\n\n /**\n * @notice Query if a contract implements an interface\n * @param _interfaceID The interface identifier, as specified in ERC-165\n * @return `true` if the contract implements `_interfaceID` and\n */\n function supportsInterface(bytes4 _interfaceID) public view virtual override(ERC165, IERC165) returns (bool) {\n if (_interfaceID == type(IERC1155).interfaceId) {\n return true;\n }\n return super.supportsInterface(_interfaceID);\n }\n}\n' - }, 'src/tokens/common/IMerkleProofSingleUse.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IMerkleProofSingleUseFunctions {\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) external view returns (bool);\n\n}\n\ninterface IMerkleProofSingleUseSignals {\n\n /**\n * Thrown when the merkle proof is invalid or has already been used.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n */\n error MerkleProofInvalid(bytes32 root, bytes32[] proof, address addr, bytes32 salt);\n\n}\n\ninterface IMerkleProofSingleUse is IMerkleProofSingleUseFunctions, IMerkleProofSingleUseSignals { }\n' }, - 'lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol': { + 'lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin\'s JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary MerkleProof {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n /**\n * @dev Calldata version of {verify}\n *\n * _Available since v4.7._\n */\n function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProofCalldata(proof, leaf) == root;\n }\n\n /**\n * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n * hash matches the root of the tree. When processing the proof, the pairs\n * of leafs & pre-images are assumed to be sorted.\n *\n * _Available since v4.4._\n */\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Calldata version of {processProof}\n *\n * _Available since v4.7._\n */\n function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by\n * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerify(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProof(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Calldata version of {multiProofVerify}\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerifyCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction\n * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another\n * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false\n * respectively.\n *\n * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree\n * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the\n * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).\n *\n * _Available since v4.7._\n */\n function processMultiProof(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");\n\n // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue\'s "pop".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, "MerkleProof: invalid multiproof");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n /**\n * @dev Calldata version of {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");\n\n // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue\'s "pop".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, "MerkleProof: invalid multiproof");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n' }, - 'src/tokens/common/IWithdrawControlled.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IWithdrawControlledFunctions {\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawERC20(address token, address to, uint256 value) external;\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawETH(address to, uint256 value) external;\n\n}\n\ninterface IWithdrawControlledSignals {\n\n /**\n * Withdraw failed error.\n */\n error WithdrawFailed();\n\n}\n\ninterface IWithdrawControlled is IWithdrawControlledFunctions, IWithdrawControlledSignals { }\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControlEnumerable.sol";\nimport "./AccessControl.sol";\nimport "../utils/structs/EnumerableSet.sol";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n}\n' }, - 'lib/openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControlEnumerable.sol";\nimport "./AccessControl.sol";\nimport "../utils/structs/EnumerableSet.sol";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.13;\n\nimport { IImplicitProjectValidation } from "../registry/IImplicitProjectValidation.sol";\n\nimport { ERC165, IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol";\nimport { Attestation } from "sequence-v3/src/extensions/sessions/implicit/Attestation.sol";\nimport { ISignalsImplicitMode } from "sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol";\nimport { Payload } from "sequence-v3/src/modules/Payload.sol";\n\n/// @title SignalsImplicitMode\n/// @author Michael Standen\n/// @notice Base contract for implicit mode validation by project\nabstract contract SignalsImplicitMode is ISignalsImplicitMode, ERC165 {\n\n IImplicitProjectValidation internal _validator;\n bytes32 internal _projectId;\n\n /// @notice Initialize implicit mode validation\n /// @param validator The IImplicitProjectValidation address\n /// @param projectId The project id\n function _initializeSignalsImplicitMode(address validator, bytes32 projectId) internal {\n _validator = IImplicitProjectValidation(validator);\n _projectId = projectId;\n }\n\n /// @inheritdoc ISignalsImplicitMode\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32) {\n _validateImplicitRequest(wallet, attestation, call);\n return _validator.validateAttestation(wallet, attestation, _projectId);\n }\n\n /// @notice Validates an implicit request\n /// @dev Optional hook for additional validation of the implicit requests\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n function _validateImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) internal view virtual { }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return interfaceId == type(ISignalsImplicitMode).interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol': { + 'src/tokens/common/IWithdrawControlled.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\nimport "../extensions/IERC20Permit.sol";\nimport "../../../utils/Address.sol";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \'safeIncreaseAllowance\' and \'safeDecreaseAllowance\'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n "SafeERC20: approve from non-zero to non-zero allowance"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract\'s allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IWithdrawControlledFunctions {\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawERC20(address token, address to, uint256 value) external;\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawETH(address to, uint256 value) external;\n\n}\n\ninterface IWithdrawControlledSignals {\n\n /**\n * Withdraw failed error.\n */\n error WithdrawFailed();\n\n}\n\ninterface IWithdrawControlled is IWithdrawControlledFunctions, IWithdrawControlledSignals { }\n' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n\n/**\n * @title ERC165\n * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md\n */\ninterface IERC165 {\n\n /**\n * @notice Query if a contract implements an interface\n * @dev Interface identification is specified in ERC-165. This function\n * uses less than 30,000 gas\n * @param _interfaceId The interface identifier, as specified in ERC-165\n */\n function supportsInterface(bytes4 _interfaceId)\n external\n view\n returns (bool);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\nimport "../extensions/IERC20Permit.sol";\nimport "../../../utils/Address.sol";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \'safeIncreaseAllowance\' and \'safeDecreaseAllowance\'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n "SafeERC20: approve from non-zero to non-zero allowance"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract\'s allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport "../beacon/IBeacon.sol";\nimport "../../interfaces/IERC1967.sol";\nimport "../../interfaces/draft-IERC1822.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/StorageSlot.sol";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");\n } catch {\n revert("ERC1967Upgrade: new implementation is not UUPS");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), "ERC1967: new admin is the zero address");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256(\'eip1967.proxy.beacon\')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n "ERC1967: beacon implementation is not a contract"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" }, 'src/proxies/openzeppelin/ERC1967Proxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC1155TokenReceiver.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1155 interface for accepting safe transfers.\n */\ninterface IERC1155TokenReceiver {\n\n /**\n * @notice Handle the receipt of a single ERC1155 token type\n * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated\n * This function MAY throw to revert and reject the transfer\n * Return of other amount than the magic value MUST result in the transaction being reverted\n * Note: The token contract address is always the message sender\n * @param _operator The address which called the `safeTransferFrom` function\n * @param _from The address which previously owned the token\n * @param _id The id of the token being transferred\n * @param _amount The amount of tokens being transferred\n * @param _data Additional data with no specified format\n * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`\n */\n function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _amount, bytes calldata _data) external returns(bytes4);\n\n /**\n * @notice Handle the receipt of multiple ERC1155 token types\n * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated\n * This function MAY throw to revert and reject the transfer\n * Return of other amount than the magic value WILL result in the transaction being reverted\n * Note: The token contract address is always the message sender\n * @param _operator The address which called the `safeBatchTransferFrom` function\n * @param _from The address which previously owned the token\n * @param _ids An array containing ids of each token being transferred\n * @param _amounts An array containing amounts of each token being transferred\n * @param _data Additional data with no specified format\n * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`\n */\n function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external returns(bytes4);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.sol': { content: - 'pragma solidity ^0.8.0;\n\n/**\n * Utility library of inline functions on addresses\n */\nlibrary Address {\n\n // Default hash for EOA accounts returned by extcodehash\n bytes32 constant internal ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n\n /**\n * Returns whether the target address is a contract\n * @dev This function will return false if invoked during the constructor of a contract.\n * @param _address address of the account to check\n * @return Whether the target address is a contract\n */\n function isContract(address _address) internal view returns (bool) {\n bytes32 codehash;\n\n // Currently there is no better way to check if there is a contract in an address\n // than to check the size of the code at that address or if it has a non-zero code hash or account hash\n assembly { codehash := extcodehash(_address) }\n return (codehash != 0x0 && codehash != ACCOUNT_HASH);\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\nimport "../utils/Context.sol";\nimport "../utils/Strings.sol";\nimport "../utils/introspection/ERC165.sol";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn\'t allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role\'s admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n "AccessControl: account ",\n Strings.toHexString(account),\n " is missing role ",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role\'s admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function\'s\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), "AccessControl: can only renounce roles for self");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn\'t perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``\'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/utils/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol': { content: - 'pragma solidity ^0.8.0;\nimport "../interfaces/IERC165.sol";\n\nabstract contract ERC165 is IERC165 {\n /**\n * @notice Query if a contract implements an interface\n * @param _interfaceID The interface identifier, as specified in ERC-165\n * @return `true` if the contract implements `_interfaceID`\n */\n function supportsInterface(bytes4 _interfaceID) public view virtual override returns (bool) {\n return _interfaceID == this.supportsInterface.selector;\n }\n}\n' + "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" }, - 'lib/openzeppelin/contracts/access/IAccessControlEnumerable.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.13;\n\nimport { Attestation } from "sequence-v3/src/extensions/sessions/implicit/Attestation.sol";\n\n/// @title IImplicitProjectValidation\n/// @author Michael Standen\n/// @notice Interface for contracts supporting validation of implicit sessions for projects\ninterface IImplicitProjectValidation {\n\n /// @notice Invalid redirect url error\n error InvalidRedirectUrl();\n\n /// @notice Check if a project has a code\n /// @param wallet The wallet address\n /// @param attestation The attestation\n /// @param projectId The project id\n /// @return magic The attestation magic bytes for the wallet address\n function validateAttestation(\n address wallet,\n Attestation calldata attestation,\n bytes32 projectId\n ) external view returns (bytes32);\n\n}\n' }, - 'lib/openzeppelin/contracts/access/AccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\nimport "../utils/Context.sol";\nimport "../utils/Strings.sol";\nimport "../utils/introspection/ERC165.sol";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn\'t allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role\'s admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n "AccessControl: account ",\n Strings.toHexString(account),\n " is missing role ",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role\'s admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function\'s\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), "AccessControl: can only renounce roles for self");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn\'t perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``\'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.sol': { content: - "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../../../utils/LibBytes.sol";\nimport { ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX } from "./ISignalsImplicitMode.sol";\n\nusing LibBytes for bytes;\n\n/// @notice Attestation for a specific session\n/// @param approvedSigner Address of the approved signer\n/// @param identityType Identity type\n/// @param issuerHash Hash of the issuer\n/// @param audienceHash Hash of the audience\n/// @param applicationData Unspecified application data\n/// @param authData Auth data\nstruct Attestation {\n address approvedSigner;\n bytes4 identityType;\n bytes32 issuerHash;\n bytes32 audienceHash;\n bytes applicationData;\n AuthData authData;\n}\n\n/// @notice Auth data for an attestation\n/// @param redirectUrl Authorization redirect URL\n/// @param issuedAt Timestamp of the attestation issuance\nstruct AuthData {\n string redirectUrl;\n uint64 issuedAt;\n}\n\n/// @title LibAttestation\n/// @author Michael Standen\n/// @notice Library for attestation management\nlibrary LibAttestation {\n\n /// @notice Hashes an attestation\n function toHash(\n Attestation memory attestation\n ) internal pure returns (bytes32) {\n return keccak256(toPacked(attestation));\n }\n\n /// @notice Decodes an attestation from a packed bytes array\n /// @param encoded The packed bytes array\n /// @param pointer The pointer to the start of the attestation\n /// @return attestation The decoded attestation\n /// @return newPointer The new pointer to the end of the attestation\n function fromPacked(\n bytes calldata encoded,\n uint256 pointer\n ) internal pure returns (Attestation memory attestation, uint256 newPointer) {\n newPointer = pointer;\n (attestation.approvedSigner, newPointer) = encoded.readAddress(newPointer);\n (attestation.identityType, newPointer) = encoded.readBytes4(newPointer);\n (attestation.issuerHash, newPointer) = encoded.readBytes32(newPointer);\n (attestation.audienceHash, newPointer) = encoded.readBytes32(newPointer);\n // Application data (arbitrary bytes)\n uint256 dataSize;\n (dataSize, newPointer) = encoded.readUint24(newPointer);\n attestation.applicationData = encoded[newPointer:newPointer + dataSize];\n newPointer += dataSize;\n // Auth data\n (attestation.authData, newPointer) = fromPackedAuthData(encoded, newPointer);\n return (attestation, newPointer);\n }\n\n /// @notice Decodes the auth data from a packed bytes\n /// @param encoded The packed bytes containing the auth data\n /// @param pointer The pointer to the start of the auth data within the encoded data\n /// @return authData The decoded auth data\n /// @return newPointer The pointer to the end of the auth data within the encoded data\n function fromPackedAuthData(\n bytes calldata encoded,\n uint256 pointer\n ) internal pure returns (AuthData memory authData, uint256 newPointer) {\n uint24 redirectUrlLength;\n (redirectUrlLength, pointer) = encoded.readUint24(pointer);\n authData.redirectUrl = string(encoded[pointer:pointer + redirectUrlLength]);\n pointer += redirectUrlLength;\n (authData.issuedAt, pointer) = encoded.readUint64(pointer);\n return (authData, pointer);\n }\n\n /// @notice Encodes an attestation into a packed bytes array\n /// @param attestation The attestation to encode\n /// @return encoded The packed bytes array\n function toPacked(\n Attestation memory attestation\n ) internal pure returns (bytes memory encoded) {\n return abi.encodePacked(\n attestation.approvedSigner,\n attestation.identityType,\n attestation.issuerHash,\n attestation.audienceHash,\n uint24(attestation.applicationData.length),\n attestation.applicationData,\n toPackAuthData(attestation.authData)\n );\n }\n\n /// @notice Encodes the auth data into a packed bytes array\n /// @param authData The auth data to encode\n /// @return encoded The packed bytes array\n function toPackAuthData(\n AuthData memory authData\n ) internal pure returns (bytes memory encoded) {\n return abi.encodePacked(uint24(bytes(authData.redirectUrl).length), bytes(authData.redirectUrl), authData.issuedAt);\n }\n\n /// @notice Generates the implicit request magic return value\n /// @param attestation The attestation\n /// @param wallet The wallet\n /// @return magic The expected implicit request magic\n function generateImplicitRequestMagic(Attestation memory attestation, address wallet) internal pure returns (bytes32) {\n return keccak256(\n abi.encodePacked(ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX, wallet, attestation.audienceHash, attestation.issuerHash)\n );\n }\n\n}\n' + }, + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { Payload } from "../../../modules/Payload.sol";\nimport { Attestation } from "./Attestation.sol";\n\n/// @dev Magic prefix for the implicit request\nbytes32 constant ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX = keccak256(abi.encodePacked("acceptImplicitRequest"));\n\n/// @title ISignalsImplicitMode\n/// @author Agustin Aguilar, Michael Standen\n/// @notice Interface for the contracts that support implicit mode validation\ninterface ISignalsImplicitMode {\n\n /// @notice Determines if an implicit request is valid\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n /// @return magic The hash of the implicit request if valid\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32 magic);\n\n}\n' }, - 'lib/openzeppelin/contracts/token/ERC20/IERC20.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../utils/LibBytes.sol";\n\nusing LibBytes for bytes;\n\n/// @title Payload\n/// @author Agustin Aguilar, Michael Standen, William Hua\n/// @notice Library for encoding and decoding payloads\nlibrary Payload {\n\n /// @notice Error thrown when the kind is invalid\n error InvalidKind(uint8 kind);\n\n /// @dev keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")\n bytes32 private constant EIP712_DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n /// @dev keccak256("Sequence Wallet")\n bytes32 private constant EIP712_DOMAIN_NAME_SEQUENCE =\n 0x4aa45ca7ad825ceb1bf35643f0a58c295239df563b1b565c2485f96477c56318;\n\n /// @dev keccak256("3")\n bytes32 private constant EIP712_DOMAIN_VERSION_SEQUENCE =\n 0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de;\n\n function domainSeparator(bool _noChainId, address _wallet) internal view returns (bytes32 _domainSeparator) {\n return keccak256(\n abi.encode(\n EIP712_DOMAIN_TYPEHASH,\n EIP712_DOMAIN_NAME_SEQUENCE,\n EIP712_DOMAIN_VERSION_SEQUENCE,\n _noChainId ? uint256(0) : uint256(block.chainid),\n _wallet\n )\n );\n }\n\n /// @dev keccak256("Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALL_TYPEHASH = 0x0603985259a953da1f65a522f589c17bd1d0117ec1d3abb7c0788aef251ef437;\n\n /// @dev keccak256("Calls(Call[] calls,uint256 space,uint256 nonce,address[] wallets)Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALLS_TYPEHASH = 0x11e1e4079a79a66e4ade50033cfe2678cdd5341d2dfe5ef9513edb1a0be147a2;\n\n /// @dev keccak256("Message(bytes message,address[] wallets)")\n bytes32 private constant MESSAGE_TYPEHASH = 0xe19a3b94fc3c7ece3f890d98a99bc422615537a08dea0603fa8425867d87d466;\n\n /// @dev keccak256("ConfigUpdate(bytes32 imageHash,address[] wallets)")\n bytes32 private constant CONFIG_UPDATE_TYPEHASH = 0x11fdeb7e8373a1aa96bfac8d0ea91526b2c5d15e5cee20e0543e780258f3e8e4;\n\n /// @notice Kind of transaction\n uint8 public constant KIND_TRANSACTIONS = 0x00;\n /// @notice Kind of digest\n uint8 public constant KIND_MESSAGE = 0x01;\n /// @notice Kind of config update\n uint8 public constant KIND_CONFIG_UPDATE = 0x02;\n /// @notice Kind of message\n uint8 public constant KIND_DIGEST = 0x03;\n\n /// @notice Behavior on error: ignore error\n uint8 public constant BEHAVIOR_IGNORE_ERROR = 0x00;\n /// @notice Behavior on error: revert on error\n uint8 public constant BEHAVIOR_REVERT_ON_ERROR = 0x01;\n /// @notice Behavior on error: abort on error\n uint8 public constant BEHAVIOR_ABORT_ON_ERROR = 0x02;\n\n /// @notice Payload call information\n /// @param to Address of the target contract\n /// @param value Value to send with the call\n /// @param data Data to send with the call\n /// @param gasLimit Gas limit for the call\n /// @param delegateCall If the call is a delegate call\n /// @param onlyFallback If the call should only be executed in an error scenario\n /// @param behaviorOnError Behavior on error\n struct Call {\n address to;\n uint256 value;\n bytes data;\n uint256 gasLimit;\n bool delegateCall;\n bool onlyFallback;\n uint256 behaviorOnError;\n }\n\n /// @notice Decoded payload\n /// @param kind Kind of payload\n /// @param noChainId If the chain ID should be omitted\n /// @param calls Array of calls (transaction kind)\n /// @param space Nonce space for the calls (transaction kind)\n /// @param nonce Nonce value for the calls (transaction kind)\n /// @param message Message to validate (message kind)\n /// @param imageHash Image hash to update to (config update kind)\n /// @param digest Digest to validate (digest kind)\n /// @param parentWallets Parent wallets\n struct Decoded {\n uint8 kind;\n bool noChainId;\n // Transaction kind\n Call[] calls;\n uint256 space;\n uint256 nonce;\n // Message kind\n // TODO: Maybe native 721 ?\n bytes message;\n // Config update kind\n bytes32 imageHash;\n // Digest kind for 1271\n bytes32 digest;\n // Parent wallets\n address[] parentWallets;\n }\n\n function fromMessage(\n bytes memory message\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_MESSAGE;\n _decoded.message = message;\n }\n\n function fromConfigUpdate(\n bytes32 imageHash\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_CONFIG_UPDATE;\n _decoded.imageHash = imageHash;\n }\n\n function fromDigest(\n bytes32 digest\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_DIGEST;\n _decoded.digest = digest;\n }\n\n function fromPackedCalls(\n bytes calldata packed\n ) internal view returns (Decoded memory _decoded) {\n _decoded.kind = KIND_TRANSACTIONS;\n\n // Read the global flag\n (uint256 globalFlag, uint256 pointer) = packed.readFirstUint8();\n\n // First bit determines if space is zero or not\n if (globalFlag & 0x01 == 0x01) {\n _decoded.space = 0;\n } else {\n (_decoded.space, pointer) = packed.readUint160(pointer);\n }\n\n // Next 3 bits determine the size of the nonce\n uint256 nonceSize = (globalFlag >> 1) & 0x07;\n\n if (nonceSize > 0) {\n // Read the nonce\n (_decoded.nonce, pointer) = packed.readUintX(pointer, nonceSize);\n }\n\n uint256 numCalls;\n\n // Bit 5 determines if the batch contains a single call\n if (globalFlag & 0x10 == 0x10) {\n numCalls = 1;\n } else {\n // Bit 6 determines if the number of calls uses 1 byte or 2 bytes\n if (globalFlag & 0x20 == 0x20) {\n (numCalls, pointer) = packed.readUint16(pointer);\n } else {\n (numCalls, pointer) = packed.readUint8(pointer);\n }\n }\n\n // Read the calls\n _decoded.calls = new Call[](numCalls);\n\n for (uint256 i = 0; i < numCalls; i++) {\n uint8 flags;\n (flags, pointer) = packed.readUint8(pointer);\n\n // First bit determines if this is a call to self\n // or a call to another address\n if (flags & 0x01 == 0x01) {\n // Call to self\n _decoded.calls[i].to = address(this);\n } else {\n // Call to another address\n (_decoded.calls[i].to, pointer) = packed.readAddress(pointer);\n }\n\n // Second bit determines if the call has value or not\n if (flags & 0x02 == 0x02) {\n (_decoded.calls[i].value, pointer) = packed.readUint256(pointer);\n }\n\n // Third bit determines if the call has data or not\n if (flags & 0x04 == 0x04) {\n // 3 bytes determine the size of the calldata\n uint256 calldataSize;\n (calldataSize, pointer) = packed.readUint24(pointer);\n _decoded.calls[i].data = packed[pointer:pointer + calldataSize];\n pointer += calldataSize;\n }\n\n // Fourth bit determines if the call has a gas limit or not\n if (flags & 0x08 == 0x08) {\n (_decoded.calls[i].gasLimit, pointer) = packed.readUint256(pointer);\n }\n\n // Fifth bit determines if the call is a delegate call or not\n _decoded.calls[i].delegateCall = (flags & 0x10 == 0x10);\n\n // Sixth bit determines if the call is fallback only\n _decoded.calls[i].onlyFallback = (flags & 0x20 == 0x20);\n\n // Last 2 bits are directly mapped to the behavior on error\n _decoded.calls[i].behaviorOnError = (flags & 0xC0) >> 6;\n }\n }\n\n function hashCall(\n Call memory c\n ) internal pure returns (bytes32) {\n return keccak256(\n abi.encode(\n CALL_TYPEHASH, c.to, c.value, keccak256(c.data), c.gasLimit, c.delegateCall, c.onlyFallback, c.behaviorOnError\n )\n );\n }\n\n function hashCalls(\n Call[] memory calls\n ) internal pure returns (bytes32) {\n // In EIP712, an array is often hashed as the keccak256 of the concatenated\n // hashes of each item. So we hash each Call, pack them, and hash again.\n bytes32[] memory callHashes = new bytes32[](calls.length);\n for (uint256 i = 0; i < calls.length; i++) {\n callHashes[i] = hashCall(calls[i]);\n }\n return keccak256(abi.encodePacked(callHashes));\n }\n\n function toEIP712(\n Decoded memory _decoded\n ) internal pure returns (bytes32) {\n bytes32 walletsHash = keccak256(abi.encodePacked(_decoded.parentWallets));\n\n if (_decoded.kind == KIND_TRANSACTIONS) {\n bytes32 callsHash = hashCalls(_decoded.calls);\n // The top-level struct for Calls might be something like:\n // Calls(bytes32 callsHash,uint256 space,uint256 nonce,bytes32 walletsHash)\n return keccak256(abi.encode(CALLS_TYPEHASH, callsHash, _decoded.space, _decoded.nonce, walletsHash));\n } else if (_decoded.kind == KIND_MESSAGE) {\n // If you define your top-level as: Message(bytes32 messageHash,bytes32 walletsHash)\n return keccak256(abi.encode(MESSAGE_TYPEHASH, keccak256(_decoded.message), walletsHash));\n } else if (_decoded.kind == KIND_CONFIG_UPDATE) {\n // Top-level: ConfigUpdate(bytes32 imageHash,bytes32 walletsHash)\n return keccak256(abi.encode(CONFIG_UPDATE_TYPEHASH, _decoded.imageHash, walletsHash));\n } else if (_decoded.kind == KIND_DIGEST) {\n // Top-level: Use MESSAGE_TYPEHASH but assume the digest is already the hashed message\n return keccak256(abi.encode(MESSAGE_TYPEHASH, _decoded.digest, walletsHash));\n } else {\n // Unknown kind\n revert InvalidKind(_decoded.kind);\n }\n }\n\n function hash(\n Decoded memory _decoded\n ) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, address(this));\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n function hashFor(Decoded memory _decoded, address _wallet) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, _wallet);\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n}\n' + }, + 'lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" }, - 'lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" }, - 'lib/openzeppelin/contracts/interfaces/IERC1967.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/draft-IERC1822.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n' }, - 'lib/openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/access/IAccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" }, - 'lib/openzeppelin/contracts/utils/Strings.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport "./math/Math.sol";\nimport "./math/SignedMath.sol";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = "0123456789abcdef";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = "0";\n buffer[1] = "x";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, "Strings: hex length insufficient");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/Math.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/utils/LibBytes.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.18;\n\n/// @title Library for reading data from bytes arrays\n/// @author Agustin Aguilar (aa@horizon.io), Michael Standen (mstan@horizon.io)\n/// @notice This library contains functions for reading data from bytes arrays.\n/// @dev These functions do not check if the input index is within the bounds of the data array.\n/// @dev Reading out of bounds may return dirty values.\nlibrary LibBytes {\n\n function readFirstUint8(\n bytes calldata _data\n ) internal pure returns (uint8 a, uint256 newPointer) {\n assembly {\n let word := calldataload(_data.offset)\n a := shr(248, word)\n newPointer := 1\n }\n }\n\n function readUint8(bytes calldata _data, uint256 _index) internal pure returns (uint8 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(248, word)\n newPointer := add(_index, 1)\n }\n }\n\n function readUint16(bytes calldata _data, uint256 _index) internal pure returns (uint16 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(240, word)\n newPointer := add(_index, 2)\n }\n }\n\n function readUint24(bytes calldata _data, uint256 _index) internal pure returns (uint24 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(232, word)\n newPointer := add(_index, 3)\n }\n }\n\n function readUint64(bytes calldata _data, uint256 _index) internal pure returns (uint64 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(192, word)\n newPointer := add(_index, 8)\n }\n }\n\n function readUint160(bytes calldata _data, uint256 _index) internal pure returns (uint160 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(96, word)\n newPointer := add(_index, 20)\n }\n }\n\n function readUint256(bytes calldata _data, uint256 _index) internal pure returns (uint256 a, uint256 newPointer) {\n assembly {\n a := calldataload(add(_index, _data.offset))\n newPointer := add(_index, 32)\n }\n }\n\n function readUintX(\n bytes calldata _data,\n uint256 _index,\n uint256 _length\n ) internal pure returns (uint256 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n let shift := sub(256, mul(_length, 8))\n a := and(shr(shift, word), sub(shl(mul(8, _length), 1), 1))\n newPointer := add(_index, _length)\n }\n }\n\n function readBytes4(bytes calldata _data, uint256 _pointer) internal pure returns (bytes4 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_pointer, _data.offset))\n a := and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000)\n newPointer := add(_pointer, 4)\n }\n }\n\n function readBytes32(bytes calldata _data, uint256 _pointer) internal pure returns (bytes32 a, uint256 newPointer) {\n assembly {\n a := calldataload(add(_pointer, _data.offset))\n newPointer := add(_pointer, 32)\n }\n }\n\n function readAddress(bytes calldata _data, uint256 _index) internal pure returns (address a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := and(shr(96, word), 0xffffffffffffffffffffffffffffffffffffffff)\n newPointer := add(_index, 20)\n }\n }\n\n /// @dev ERC-2098 Compact Signature\n function readRSVCompact(\n bytes calldata _data,\n uint256 _index\n ) internal pure returns (bytes32 r, bytes32 s, uint8 v, uint256 newPointer) {\n uint256 yParityAndS;\n assembly {\n r := calldataload(add(_index, _data.offset))\n yParityAndS := calldataload(add(_index, add(_data.offset, 32)))\n newPointer := add(_index, 64)\n }\n uint256 yParity = uint256(yParityAndS >> 255);\n s = bytes32(uint256(yParityAndS) & ((1 << 255) - 1));\n v = uint8(yParity) + 27;\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/SignedMath.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/Math.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' } }, settings: { remappings: [ - '@0xsequence/contracts-library/=src/', - 'ds-test/=lib/forge-std/lib/ds-test/src/', + '@openzeppelin/contracts/=lib/murky/lib/openzeppelin-contracts/contracts/', + 'ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/', + 'erc2470-libs/=lib/erc2470-libs/', + 'erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/', 'forge-std/=lib/forge-std/src/', - 'murky/=lib/murky/src/', - '@0xsequence/erc20-meta-token/=lib/0xsequence/erc20-meta-token/src/', - '@0xsequence/erc-1155/=lib/0xsequence/erc-1155/src/', - 'erc721a/=lib/chiru-labs/erc721a/', - 'erc721a-upgradeable/=lib/chiru-labs/erc721a-upgradeable/', - '@openzeppelin/=lib/openzeppelin/', - '@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'solady/=lib/solady/src/', - '0xsequence/=lib/0xsequence/', - 'chiru-labs/=lib/chiru-labs/', - 'erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/', + 'halmos-cheatcodes/=lib/signals-implicit-mode/lib/sequence-v3/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/', + 'murky/=lib/murky/', 'openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/', - 'openzeppelin/=lib/openzeppelin/' + 'openzeppelin-contracts/=lib/openzeppelin-contracts/', + 'openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/', + 'sequence-v3/=lib/signals-implicit-mode/lib/sequence-v3/', + 'signals-implicit-mode/=lib/signals-implicit-mode/', + 'solady/=lib/solady/src/' ], optimizer: { - enabled: true, - runs: 20000 + enabled: false, + runs: 200 }, metadata: { useLiteralContent: true,