diff --git a/README.md b/README.md index acb374f..9cdf765 100644 --- a/README.md +++ b/README.md @@ -152,8 +152,8 @@ The following is a list of contracts that are deployed by this script. | ERC20ItemsFactory | 0x1063cBEe6b3Cd69B49f1B922A0D402f484b39855 | | ERC721ItemsFactory | 0xC6064FfBaDB0687Da29721C8EC02ACa71e735a3e | | ERC1155ItemsFactory | 0x7364fDEFe24385B2b3869504383c94cF083AcbD6 | -| ERC721SaleFactory | 0xc412172a99e657609f5f7D4b9Bea37684B8eEE4E | -| ERC1155SaleFactory | 0x52A6E7236A01B72eeb262d58F7270cb9AeD8Db4B | +| ERC721SaleFactory | 0x2Ce46243FAb9d688CcC2B1F1B8D2c464e87A2076 | +| ERC1155SaleFactory | 0xFb89C8A7DF9A1e0299088C3fC46fd87D3FcbcDBd | | ERC721SoulboundFactory | 0x2fBFF6fd3C978ab1bBd21b878262c5289a14b6c1 | | ERC1155SoulboundFactory | 0xaB069C041FaCAB8f4D747D91EEda5705b5caAB76 | | ERC1155PackFactory | 0x5B2f47ee798eee52cE184C9eC4d60873185836d8 | diff --git a/scripts/factories/token_library/ERC1155SaleFactory.ts b/scripts/factories/token_library/ERC1155SaleFactory.ts index 7924af0..4084434 100644 --- a/scripts/factories/token_library/ERC1155SaleFactory.ts +++ b/scripts/factories/token_library/ERC1155SaleFactory.ts @@ -1,48 +1,25 @@ 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/ff6b02ec8ccd9321b6ef8318e5c0d45585721f3b/src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol const abi = [ { - inputs: [ - { - internalType: 'address', - name: 'factoryOwner', - type: 'address' - } - ], + inputs: [{ internalType: 'address', name: 'factoryOwner', type: 'address' }], stateMutability: 'nonpayable', type: 'constructor' }, { anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], + inputs: [{ indexed: false, internalType: 'address', name: 'proxyAddr', type: 'address' }], name: 'ERC1155SaleDeployed', type: 'event' }, { anonymous: false, inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address' - } + { indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' }, + { indexed: true, internalType: 'address', name: 'newOwner', type: 'address' } ], name: 'OwnershipTransferred', type: 'event' @@ -50,115 +27,55 @@ const abi = [ { inputs: [], name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], + outputs: [{ internalType: 'contract UpgradeableBeacon', name: '', type: 'address' }], stateMutability: 'view', type: 'function' }, { inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'items', - type: 'address' - } + { internalType: 'uint256', name: 'nonce', type: 'uint256' }, + { internalType: 'address', name: 'proxyOwner', type: 'address' }, + { internalType: 'address', name: 'tokenOwner', type: 'address' }, + { internalType: 'address', name: 'items', type: 'address' }, + { internalType: 'address', name: 'implicitModeValidator', type: 'address' }, + { internalType: 'bytes32', name: 'implicitModeProjectId', type: 'bytes32' } ], name: 'deploy', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], + outputs: [{ internalType: 'address', name: 'proxyAddr', type: 'address' }], stateMutability: 'nonpayable', type: 'function' }, { inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'items', - type: 'address' - } + { internalType: 'uint256', name: 'nonce', type: 'uint256' }, + { internalType: 'address', name: 'proxyOwner', type: 'address' }, + { internalType: 'address', name: 'tokenOwner', type: 'address' }, + { internalType: 'address', name: 'items', type: 'address' }, + { internalType: 'address', name: 'implicitModeValidator', type: 'address' }, + { internalType: 'bytes32', name: 'implicitModeProjectId', type: 'bytes32' } ], name: 'determineAddress', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], + outputs: [{ internalType: 'address', name: 'proxyAddr', type: 'address' }], stateMutability: 'view', type: 'function' }, { inputs: [], name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], + outputs: [{ internalType: 'address', name: '', type: 'address' }], stateMutability: 'view', type: 'function' }, + { inputs: [], name: 'renounceOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], + inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }], name: 'transferOwnership', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], + inputs: [{ internalType: 'address', name: 'implementation', type: 'address' }], name: 'upgradeBeacon', outputs: [], stateMutability: 'nonpayable', @@ -170,7 +87,7 @@ export class ERC1155SaleFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( abi, - '608034610121576001600160401b0390601f6155e638819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b82519361321494858101958187108388111761010b576123d2823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611de4853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611c76908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461079057806359659e901461073d578063715018a6146106a05780638da5cb5b1461064b578063d9181cd3146102ee578063e657f693146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561084f565b906100ae6108bd565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b8284346102eb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb57506101e461084f565b906101ed610877565b916055600b6101fa61089a565b845173ffffffffffffffffffffffffffffffffffffffff968716602080830191825292909716604080830191909152815290957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09161025a60608261099b565b519020906102ab86519161026d8361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff9661029f8860015416948a519586938d850198896109ff565b0390810183528261099b565b5190206111eb85516102bf8883018261099b565b81815287810191610a5683395190209085519186830152868201523081520160ff815320915191168152f35b80fd5b5090346101a65760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a65761032761084f565b92610330610877565b61033861089a565b908351946020968787018761037586868490602090939293604083019473ffffffffffffffffffffffffffffffffffffffff809216845216910152565b03976103a77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0998a810183528261099b565b5190208651916103b68361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff91816103f98c6103ed878d88600154169051958694850197886109ff565b038c810183528261099b565b5190206111eb895161040d8d83018261099b565b8181528c810191610a5683398051156105f057518492918af516988915610594578260015416938a3b156105905791608491601f8a95946104988f8e51998a9889977fcf7a1d77000000000000000000000000000000000000000000000000000000008952168c880152602487015260606044870152825192839182606489015288880191016109dc565b01168101030181838b5af1801561058657908591610572575b5050853b1561056e5784517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316918101918252929091166020820152829082908190604001038183885af1801561056457610550575b50507f346f0211197dd599e2e2a8c828f6e7dc39e8a49171ce0a728428e8b778c61eea838251848152a151908152f35b61055a829161093c565b6102eb5780610520565b83513d84823e3d90fd5b8380fd5b61057b9061093c565b61056e5783386104b1565b86513d87823e3d90fd5b8880fd5b6064858c8b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b6064878e808e51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b83346102eb57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb576106d76108bd565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a657826107ca61084f565b6107d26108bd565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561056e5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af1908115610846575061083a575080f35b6108439061093c565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108de57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b67ffffffffffffffff811161095057604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff82111761095057604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761095057604052565b60005b8381106109ef5750506000910152565b81810151838201526020016109df565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610a5082518093602086850191016109dc565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea2646970667358221220a592f27f25373407ca73911ddc0bbaa6ea0e0d6dfcce18bb6b5765f70d2e1a1764736f6c63430008130033a2646970667358221220cacf10d5c818ae8f15d105a3e217b088abc54a07a2101d07f54bee5abff11c7164736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ff9f63e676c96c753988d58c9eed378dc3ae25dde2df2114b6217eba7bb9455964736f6c6343000813003360808060405234610016576131f8908161001c8239f35b600080fdfe61010080604052600436101561001457600080fd5b600080608052803560e01c91826301ffc9a714611ee3575081630869678c14611ead578163119cd50c14611e44578163248a9ca314611e155781632f2ff15d14611d135781633013ce2914611cdd57816336568abe14611c1757816344004cc114611b765781634782f77914611b0a578163485cc955146117e15781634f651ccd1461168657816360e606f6146109ce5781636a326ab1146109685781639010d07c1461091357816391d14854146108bc57816397559600146107a0578163a217fddf14610782578163bad436611461070d57508063ca15c873146106df578063d547741f14610699578063f07f04ff1461028e5763ff81434e1461011857600080fd5b34610288576020806003193601126102885760043567ffffffffffffffff81116102885761014a9036906004016121c5565b919061015583612115565b9261016360405194856120d4565b8084527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061019082612115565b01836080515b828110610272575050506080515b81811061022c57838560405190828201838352815180915283604084019201936080515b8281106101d55784840385f35b9091928260a08261021d6001948a5160808091805184526020810151602085015267ffffffffffffffff80604083015116604086015260608201511660608501520151910152565b019601910194929190946101c8565b8061023b61026d928486613030565b356080515260098552610252604060805120612d81565b61025c8288612cf6565b526102678187612cf6565b50612cc9565b6101a4565b61027a613055565b828289010152018490610196565b60805180fd5b346102885760c06003193601126102885760043567ffffffffffffffff8111610288576102bf9036906004016121c5565b9060243567ffffffffffffffff8111610288576102e09036906004016121c5565b909160443567ffffffffffffffff8111610288576103029036906004016121c5565b929060643567ffffffffffffffff8111610288576103249036906004016121c5565b95909160843567ffffffffffffffff8111610288576103479036906004016121c5565b9460a43567ffffffffffffffff8111610288576103689036906004016121c5565b9590946103736124c9565b828c1480159061068f575b8015610685575b801561067b575b8015610671575b6105eb5760805180995b8d8b106103aa5760805180f35b6103b58b8f83613030565b3591828c15159182610666575b505061063c578a808e8c859e6103d8918b613030565b6103e190613040565b916103ec9188613030565b6103f590613040565b67ffffffffffffffff169067ffffffffffffffff16108015610615575b6105eb578d8f93808f918d8f91868f918f8f918f8f91928f8087848f8f90988e8e859b8f878f818f819f8f839f61044c8580948193613030565b359c61045792613030565b359661046292613030565b61046b90613040565b9661047592613030565b61047e90613040565b9361048892613030565b35936040519561049787612051565b8652602090818701928352604087019467ffffffffffffffff168552606087019367ffffffffffffffff168452608087019586526080515260099052608051604090209451855551600185015560028401915167ffffffffffffffff168254915160401b6fffffffffffffffff000000000000000016917fffffffffffffffffffffffffffffffff00000000000000000000000000000000161717905551906003015561054392613030565b359b61054e92613030565b359a61055992613030565b61056290613040565b9561056c92613030565b61057590613040565b9261057f92613030565b6040805194855260208501959095529383019490945267ffffffffffffffff908116606083015290921660808301523560a08201527f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f969060c090a16105e390612cc9565b9a915061039d565b60046040517f85d4a748000000000000000000000000000000000000000000000000000000008152fd5b50610629610624828d8a613030565b613040565b67ffffffffffffffff4291161115610412565b60046040517f340bc4c9000000000000000000000000000000000000000000000000000000008152fd5b1015905082386103c2565b50868c1415610393565b50878c141561038c565b508a8c1415610385565b50898c141561037e565b34610288576040600319360112610288576106d96004356106b8611fef565b9080608051526106d4600160406080518060205220015461263f565b6127e0565b60805180f35b3461028857602060031936011261028857600435608051526001602052602060406080512054604051908152f35b346102885760806003193601126102885760243567ffffffffffffffff81116102885761073e9036906004016121c5565b6044929192359173ffffffffffffffffffffffffffffffffffffffff8316830361077f576020610775606435858588600435613080565b6040519015158152f35b80fd5b34610288576080518060031936011261077f57602090604051908152f35b346102885760a06003193601126102885760043590602435916044359167ffffffffffffffff9081841680940361077f57506107da61203a565b92608435916107e76124c9565b84169080821080156108b2575b6105eb577f8fd3ac39fbb3d5e9c906dd9ec439dc6e584b8fa3ce02d5b67d589b22b22152a99560a09584608060405161082c81612051565b88815284602082015285604082015286606082015201528560055581600655827fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffff00000000000000006007549360401b1692161717600755836008556040519485526020850152604084015260608301526080820152a160805180f35b50428211156107f4565b346102885760406003193601126102885760ff60406020926108dc611fef565b6004356080515273ffffffffffffffffffffffffffffffffffffffff83608051808852209116825284522054166040519015158152f35b3461028857604060031936011261028857600435608051526001602052602073ffffffffffffffffffffffffffffffffffffffff610958602435604060805120612a97565b9190546040519260031b1c168152f35b346102885760206003193601126102885773ffffffffffffffffffffffffffffffffffffffff610996612017565b61099e6124c9565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600454161760045560805180f35b60e0600319360112610288576109e2612017565b60243567ffffffffffffffff811161028857610a0290369060040161212d565b60443567ffffffffffffffff811161028857610a2290369060040161212d565b916064359167ffffffffffffffff83116102885736602384011215610288578260040135610a4f8161218b565b93610a5d60405195866120d4565b818552366024838301011161028857602482910160208601376020608051918501015273ffffffffffffffffffffffffffffffffffffffff60843516608435036102885767ffffffffffffffff60c4351161028857610ac49391933660c4356004016121c5565b9060c052926080519283928496610ad9612d3e565b60a052610b0767ffffffffffffffff604060a05101511667ffffffffffffffff606060a05101511690613008565b60805160e08190529094905b835160e0511015610d2057610b2a60e05185612cf6565b51968760e05115159182610d15575b505061063c5786610b4c60e05187612cf6565b519181608051526009602052610b66604060805120612d81565b610b8d67ffffffffffffffff60408301511667ffffffffffffffff60608401511690613008565b15610c0557505086610bd45750610bbd90610bb7600199610bb18360a05151612893565b906128d5565b9a6128d5565b96610bc960e051612cc9565b60e052989698610b13565b602490604051907f035acf500000000000000000000000000000000000000000000000000000000082526004820152fd5b9099916080820151908c82610c2b575b5050508291610bb1610bbd94610bb79351612893565b81610c3b91339060c05186613080565b15610c92575060808051339052600260209081528151604080822094909152929052512080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905581610bb18c610c15565b8c604051927f265c66a80000000000000000000000000000000000000000000000000000000084526004840152608060248401528060848401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811161028857829060051b60a4928160c0518585013733604484015260648301528101030190fd5b10159050878c610b39565b88889194939461142d575b5073ffffffffffffffffffffffffffffffffffffffff600454168073ffffffffffffffffffffffffffffffffffffffff60843516036113ef575060a435818110611399575060843573ffffffffffffffffffffffffffffffffffffffff166112e45780340361128d57505b73ffffffffffffffffffffffffffffffffffffffff60035460081c1660805190835182905b8082106110ba575050600654908115158061102c575b610f645750505073ffffffffffffffffffffffffffffffffffffffff60035460081c1690813b156102885760405180927fb48ab8b600000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff86166004830152608060248301528180610e83610e6e610e5c608484018a612d0a565b6003198482030160448501528b612d0a565b6003198382030160648401526080519661279d565b0391608051905af18015610f5757610f06575b7f23519238b590c499a2abcf44a33b5f431ac6ca51c22fad26bc2c3d08b97eaa2173ffffffffffffffffffffffffffffffffffffffff84610efd87610eef87604051958695168552606060208601526060850190612d0a565b908382036040850152612d0a565b0390a160805180f35b919067ffffffffffffffff8311610f265760409290925290610efd610e96565b7f4e487b71000000000000000000000000000000000000000000000000000000006080515260416004526024608051fd5b6040513d608051823e3d90fd5b906020600492604051938480927f18160ddd000000000000000000000000000000000000000000000000000000008252608051905af1918215610f575760805192610ff6575b50610ff2906040519384937fa9227830000000000000000000000000000000000000000000000000000000008552600485016040919493926060820195825260208201520152565b0390fd5b9091506020813d602011611024575b81611012602093836120d4565b81010312610288575190610ff2610faa565b3d9150611005565b506040517f18160ddd000000000000000000000000000000000000000000000000000000008152602081600481608051865af18015610f575784849160805190611082575b61107c9293506128d5565b11610dd1565b5050506020813d6020116110b2575b8161109e602093836120d4565b810103126102885751829081908590611071565b3d9150611091565b90926110c68487612cf6565b5160805152600960205260016040608051200154801515806111ec575b61110c5750611100611106916110f9868b612cf6565b51906128d5565b93612cc9565b90610dbb565b83858a602061111b838c612cf6565b516024604051809681937f2693ebf20000000000000000000000000000000000000000000000000000000083526004830152608051905af1928315610f5757608051936111b6575b50610ff29161117191612cf6565b51926040519384937fa9227830000000000000000000000000000000000000000000000000000000008552600485016040919493926060820195825260208201520152565b9092506020813d6020116111e4575b816111d2602093836120d4565b81010312610288575191610ff2611163565b3d91506111c5565b506111f78588612cf6565b51604051907f2693ebf20000000000000000000000000000000000000000000000000000000082526004820152602081602481608051895af18015610f5757829160805191611256575b50611250906110f9888d612cf6565b116110e3565b9150506020813d602011611285575b81611272602093836120d4565b8101031261028857518190611250611241565b3d9150611265565b6040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260843573ffffffffffffffffffffffffffffffffffffffff1660048201526024810191909152346044820152606490fd5b341561132a5760646040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260805160048201526080516024820152346044820152fd5b61139490604051907f23b872dd00000000000000000000000000000000000000000000000000000000602083015233602483015230604483015260648201526064815261137681612051565b73ffffffffffffffffffffffffffffffffffffffff60843516612dc9565b610d96565b6040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260843573ffffffffffffffffffffffffffffffffffffffff16600482015260248101929092526044820152606490fd5b606491604051917f1eabcfbe000000000000000000000000000000000000000000000000000000008352600483015260248201526080516044820152fd5b608060a05101519081611441575b50610d2b565b336080515260026020526080518260408220915260205260ff6040608051205416158061155e575b156114bc5750336080515260026020526080519060408220915260205260406080512060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055858061143b565b604051917f265c66a80000000000000000000000000000000000000000000000000000000083526004830152608060248301528060848301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610288578160a49160051b8060c051848401373360448301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60648301528101030190fd5b509491959260409491945160208101907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1682527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6034820152603481526115c98161209c565b519020966115d687612115565b976115e4604051998a6120d4565b87895260208901368960051b60c05101116102885760c051905b8960051b60c05101821061167657505095608051965b895188101561166457611627888b612cf6565b51608051818310156116525750906080515260205261164c6040608051205b97612cc9565b96611614565b5260205261164c604060805120611646565b90939650839194979295985014611469565b81358152602091820191016115fe565b346102885760c0600319360112610288576044356024356004356116a861203a565b67ffffffffffffffff6084358181169591928682036102885760a435926116cd6124c9565b8482169788811080156117d7575b6105eb576003610efd967f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f969a6040519361171485612051565b8b85526020850192868452604086019283526060860191825260808601938a85528c60805152600960205260406080512096518755516001870155600286019251167fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffff00000000000000008454935160401b1692161717905551910155604051968796879260a09492979695919760c085019885526020850152604084015267ffffffffffffffff80921660608401521660808201520152565b50428111156116db565b34610288576040600319360112610288576117fa612017565b611802611fef565b6003549060ff8216611ae05774ffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffff0000000000000000000000000000000000000000ff9160081b16911617600355608051805261196860805160209281845273ffffffffffffffffffffffffffffffffffffffff604083209116809252835260805160ff60408220541615611a72575b506080518052600183818095526118ae83604060805120612aaf565b507f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280608051526080518083528460408220915282528060805160ff60408220541615611a05575b50506080515281815261190e83604060805120612aaf565b507f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec80608051526080518083528460408220915282528060805160ff60408220541615611998575b50506080515252604060805120612aaf565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600354161760035560805180f35b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a48087611956565b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a480876118f6565b80526080518084528160408220915283526080516040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790558133917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a483611892565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b3461028857604060031936011261028857611b23612017565b611b2b6121f6565b60805180808093602435905af1611b40612f0c565b5015611b4c5760805180f35b60046040517f750b219c000000000000000000000000000000000000000000000000000000008152fd5b3461028857606060031936011261028857611b8f612017565b611b97611fef565b611b9f6121f6565b604051907fa9059cbb00000000000000000000000000000000000000000000000000000000602083015273ffffffffffffffffffffffffffffffffffffffff8091166024830152604435604483015260448252608082019282841067ffffffffffffffff851117610f26576106d99360405216612dc9565b3461028857604060031936011261028857611c30611fef565b3373ffffffffffffffffffffffffffffffffffffffff821603611c59576106d9906004356127e0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610288576080518060031936011261077f57602073ffffffffffffffffffffffffffffffffffffffff60045416604051908152f35b3461028857604060031936011261028857611da16004356001611d34611fef565b91806080515260805190611d5283604060209480865220015461263f565b80608051526080519384835273ffffffffffffffffffffffffffffffffffffffff60408620911680955282528060805160ff60408220541615611da85750506080515252604060805120612aaf565b5060805180f35b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a48086611956565b346102885760206003193601126102885760043560805152602060016040608051808452200154604051908152f35b34610288576080518060031936011261077f57611e5f613055565b5060a0611e6a612d3e565b611eab604051809260808091805184526020810151602085015267ffffffffffffffff80604083015116604086015260608201511660608501520151910152565bf35b3461028857602060031936011261028857611ec6613055565b5060043560805152600960205260a0611e6a604060805120612d81565b34611feb576020600319360112611feb576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103611fe75760209250807fb68139110000000000000000000000000000000000000000000000000000000014908115611f57575b5015158152f35b7f5a05180f00000000000000000000000000000000000000000000000000000000811491508115611f8a575b5083611f50565b7f7965db0b00000000000000000000000000000000000000000000000000000000811491508115611fbd575b5083611f83565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483611fb6565b8280fd5b5080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361201257565b600080fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361201257565b6064359067ffffffffffffffff8216820361201257565b60a0810190811067ffffffffffffffff82111761206d57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761206d57604052565b6080810190811067ffffffffffffffff82111761206d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761206d57604052565b67ffffffffffffffff811161206d5760051b60200190565b81601f820112156120125780359161214483612115565b9261215260405194856120d4565b808452602092838086019260051b820101928311612012578301905b82821061217c575050505090565b8135815290830190830161216e565b67ffffffffffffffff811161206d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b9181601f840112156120125782359167ffffffffffffffff8311612012576020808501948460051b01011161201257565b3360009081527f20be27040b8e00df40bca0df34743417f3574a156386188f7d7f14369e5ee82b602090815260408083205490927f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec9160ff161561225a5750505050565b61226333612922565b91845190612270826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b8183116123d157505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b8401917f206973206d697373696e6720726f6c652000000000000000000000000000000060378401525180938684019061277a565b010360288101875201856120d4565b519283927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152602483019061279d565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61240e85876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0191906122a1565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f6058ee1f1c102e8ac9ef0c4319964e42c1ab00dfba021f8302fd0802656934ac602090815260408083205490927f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c29160ff161561252d5750505050565b61253633612922565b91845190612543826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b8183116125ce57505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61260b85876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190612574565b600090808252602090828252604092838120338252835260ff8482205416156126685750505050565b61267133612922565b9184519061267e826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b81831161270957505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61274685876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0191906126af565b60005b83811061278d5750506000910152565b818101518382015260200161277d565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936127d98151809281875287808801910161277a565b0116010190565b90604061282b926000908082528160205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff838320541661282e575b8152600160205220612b70565b50565b808252816020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a461281e565b818102929181159184041417156128a657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919082018092116128a657565b9081518110156128f3570160200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040519061292f8261209c565b602a82526020820160403682378251156128f3576030905381516001908110156128f357607860218401536029905b8082116129cc57505061296e5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015612a69577f3031323334353637383961626364656600000000000000000000000000000000901a612a0884866128e2565b5360041c918015612a3b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019061295e565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b80548210156128f35760005260206000200190600090565b91906001830160009082825280602052604082205415600014612b6a5784549468010000000000000000861015612b3d5783612b2d612af8886001604098999a01855584612a97565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014612cc2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91828101818111612c9557825490848201918211612c6857808203612c33575b50505080548015612c0657820191612be98383612a97565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b612c53612c43612af89386612a97565b90549060031b1c92839286612a97565b90558652846020526040862055388080612bd1565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146128a65760010190565b80518210156128f35760209160051b010190565b90815180825260208080930193019160005b828110612d2a575050505090565b835185529381019392810192600101612d1c565b60405190612d4b82612051565b816005548152600654602082015260075467ffffffffffffffff90818116604084015260401c1660608201526080600854910152565b90604051612d8e81612051565b6080600382948054845260018101546020850152600281015467ffffffffffffffff90818116604087015260401c1660608501520154910152565b73ffffffffffffffffffffffffffffffffffffffff1690604051604081019080821067ffffffffffffffff83111761206d57612e49916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af1612e43612f0c565b91612f3c565b805191821591848315612ee8575b505050905015612e645750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b919381809450010312611feb5782015190811515820361077f575080388084612e57565b3d15612f37573d90612f1d8261218b565b91612f2b60405193846120d4565b82523d6000602084013e565b606090565b91929015612fb75750815115612f50575090565b3b15612f595790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015612fca5750805190602001fd5b610ff2906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061279d565b908015918215613026575b50811561301e575090565b905042101590565b4210915038613013565b91908110156128f35760051b0190565b3567ffffffffffffffff811681036120125790565b6040519061306282612051565b60006080838281528260208201528260408201528260608201520152565b91929060009073ffffffffffffffffffffffffffffffffffffffff8316825260209060028252604093848420868552835260ff85852054161597886130cb575b505050505050505090565b909192939597508496989451907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008583019360601b1683526034820152603481526131158161209c565b5190209061312288612115565b9761312f8751998a6120d4565b8089528389019060051b8201913683116131be578490915b8383106131ae57505050509183925b8751841015613199576131698489612cf6565b519081811015613189578552825261318385852093612cc9565b92613156565b9085528252613183858520611100565b945095505050501438808080808080806130c0565b8235815291810191859101613147565b8680fdfea26469706673582212200c951b38aeb19ea68e45ccc53d57fe854abf845aa0d3e3c417ffc2a5e258f8eb64736f6c63430008130033', + '60806040523461002f576100196100146100fa565b610169565b610021610034565b6125d461039782396125d490f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b6101186183af8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b614fa2810181811060018060401b038211176101c5576101a18291614fa261296b843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa261790d85396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610403565b61001e60003561008d565b80631a4b671d146100885780631bce45831461008357806359659e901461007e57806369b3934d14610079578063715018a6146100745780638da5cb5b1461006f5763f2fde38b0361000e576103d0565b61039b565b610368565b61032c565b6102f7565b610215565b6101b4565b60e01c90565b60405190565b600080fd5b600080fd5b90565b6100af816100a3565b036100b657565b600080fd5b905035906100c8826100a6565b565b60018060a01b031690565b6100de906100ca565b90565b6100ea816100d5565b036100f157565b600080fd5b90503590610103826100e1565b565b90565b61011181610105565b0361011857565b600080fd5b9050359061012a82610108565b565b909160c08284031261018c5761014583600084016100bb565b9261015381602085016100f6565b9261016182604083016100f6565b9261018961017284606085016100f6565b9361018081608086016100f6565b9360a00161011d565b90565b61009e565b61019a906100d5565b9052565b91906101b290600060208501940190610191565b565b346101eb576101e76101d66101ca36600461012c565b9493909392919261052f565b6101de610093565b9182918261019e565b0390f35b610099565b9060208282031261020a57610207916000016100f6565b90565b61009e565b60000190565b346102435761022d6102283660046101f0565b61068c565b610235610093565b8061023f8161020f565b0390f35b610099565b600091031261025357565b61009e565b1c90565b60018060a01b031690565b61027790600861027c9302610258565b61025c565b90565b9061028a9154610267565b90565b61029a600160009061027f565b90565b90565b6102b46102af6102b9926100ca565b61029d565b6100ca565b90565b6102c5906102a0565b90565b6102d1906102bc565b90565b6102dd906102c8565b9052565b91906102f5906000602085019401906102d4565b565b3461032757610307366004610248565b61032361031261028d565b61031a610093565b918291826102e1565b0390f35b610099565b346103635761035f61034e61034236600461012c565b949390939291926106fa565b610356610093565b9182918261019e565b0390f35b610099565b3461039657610378366004610248565b61038061087f565b610388610093565b806103928161020f565b0390f35b610099565b346103cb576103ab366004610248565b6103c76103b66108b5565b6103be610093565b9182918261019e565b0390f35b610099565b346103fe576103e86103e33660046101f0565b6109c2565b6103f0610093565b806103fa8161020f565b0390f35b610099565b600080fd5b600090565b610416906100a3565b9052565b61042390610105565b9052565b909594926104739461046261046c9261045860809661044e60a088019c600089019061040d565b6020870190610191565b6040850190610191565b6060830190610191565b019061041a565b565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061049f90610475565b810190811067ffffffffffffffff8211176104b957604052565b61047f565b60200190565b5190565b906104db6104d4610093565b9283610495565b565b67ffffffffffffffff81116104fb576104f7602091610475565b0190565b61047f565b9061051261050d836104dd565b6104c8565b918252565b6105216000610500565b90565b61052c610517565b90565b61056e9291946105909661055f92610545610408565b509395919091610553610093565b96879560208701610427565b60208201810382520382610495565b61058061057a826104c4565b916104be565b209061058a610524565b91610aa1565b90565b6105a49061059f610bba565b6105f9565b565b60001c90565b6105b86105bd916105a6565b61025c565b90565b6105ca90546105ac565b90565b600080fd5b60e01b90565b60009103126105e357565b61009e565b6105f0610093565b3d6000823e3d90fd5b61060b61060660016105c0565b6102c8565b90633659cfe690823b1561068757610643926106386000809461062c610093565b968795869485936105d2565b83526004830161019e565b03925af1801561068257610655575b50565b6106759060003d811161067b575b61066d8183610495565b8101906105d8565b38610652565b503d610663565b6105e8565b6105cd565b61069590610593565b565b6106a0906102a0565b90565b6106ac90610697565b90565b6106b8906102bc565b90565b6106f16106f8946106e76060949897956106dd608086019a6000870190610191565b6020850190610191565b6040830190610191565b019061041a565b565b9061075c9193929361070a610408565b5061073a859161072b86898b9161071f610093565b96879560208701610427565b60208201810382520382610495565b61074c610746826104c4565b916104be565b2090610756610524565b91610cad565b9361076e610769866106a3565b6106af565b906363acc14d93929490823b15610829576000946107aa869261079f94610793610093565b998a98899788966105d2565b8652600486016106bb565b03925af18015610824576107f7575b50806107f17f346f0211197dd599e2e2a8c828f6e7dc39e8a49171ce0a728428e8b778c61eea916107e8610093565b9182918261019e565b0390a190565b6108179060003d811161081d575b61080f8183610495565b8101906105d8565b386107b9565b503d610805565b6105e8565b6105cd565b610836610bba565b61083e61086b565b565b90565b61085761085261085c92610840565b61029d565b6100ca565b90565b61086890610843565b90565b61087d610878600061085f565b610e3c565b565b61088761082e565b565b60018060a01b031690565b6108a06108a5916105a6565b610889565b90565b6108b29054610894565b90565b6108bd610408565b506108c860006108a8565b90565b6108dc906108d7610bba565b610991565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b61094260266040926108de565b61094b816108e7565b0190565b6109659060208101906000818303910152610935565b90565b1561096f57565b610977610093565b62461bcd60e51b81528061098d6004820161094f565b0390fd5b6109c0906109bb816109b46109ae6109a9600061085f565b6100d5565b916100d5565b1415610968565b610e3c565b565b6109cb906108cb565b565b90565b6109dc6109e191610105565b6109cd565b9052565b60601b90565b6109f4906109e5565b90565b610a00906109eb565b90565b610a0f610a14916100d5565b6109f7565b9052565b905090565b60005b838110610a31575050906000910152565b806020918301518185015201610a20565b610a67610a5e92602092610a55816104c4565b94858093610a18565b93849101610a1d565b0190565b60148093610a8f602084610a87610a9796610a9e9b9a986109d0565b018092610a03565b018092610a03565b0190610a42565b90565b610b349291610ade610aed92610ab5610408565b509193610aca610ac560016105c0565b6102c8565b610ad2610093565b95869460208601610a6b565b60208201810382520382610495565b610aff610af9826104c4565b916104be565b2061148a610b0f602082016104c8565b908082526111156020830139610b2d610b27826104c4565b916104be565b2090610ea9565b90565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6b602080926108de565b610b7481610b37565b0190565b610b8e9060208101906000818303910152610b5f565b90565b15610b9857565b610ba0610093565b62461bcd60e51b815280610bb660048201610b78565b0390fd5b610be4610bc56108b5565b610bde610bd8610bd3610eca565b6100d5565b916100d5565b14610b91565b565b610bfa610bf5610bff92610840565b61029d565b6100a3565b90565b610c0b906102a0565b90565b610c1790610c02565b90565b610c23906102a0565b90565b610c2f90610c1a565b90565b610c3b906102bc565b90565b60209181520190565b610c66610c6f602093610c7493610c5d816104c4565b93848093610c3e565b95869101610a1d565b610475565b0190565b610c9d610caa949293610c9360608401956000850190610191565b6020830190610191565b6040818403910152610c47565b90565b610d3d9093929193610cbd610408565b50610cfd8591610cee610cd8610cd360016105c0565b6102c8565b8690610ce2610093565b95869460208601610a6b565b60208201810382520382610495565b610d0f610d09826104c4565b916104be565b2061148a610d1f602082016104c8565b908082526111156020830139610d386000929192610be6565b611062565b92610d57610d52610d4d86610c0e565b610c26565b610c32565b63cf7a1d779190610d70610d6b60016105c0565b6102c8565b9392813b15610de7576000610d9891610da38296610d8c610093565b988997889687956105d2565b855260048501610c78565b03925af18015610de257610db5575b50565b610dd59060003d8111610ddb575b610dcd8183610495565b8101906105d8565b38610db2565b503d610dc3565b6105e8565b6105cd565b60001b90565b90610e0360018060a01b0391610dec565b9181191691161790565b610e16906102bc565b90565b90565b90610e31610e2c610e3892610e0d565b610e19565b8254610df2565b9055565b610e4660006108a8565b610e51826000610e1c565b90610e85610e7f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610e0d565b91610e0d565b91610e8e610093565b80610e988161020f565b0390a3565b610ea6906102bc565b90565b90610ec791610eb6610408565b5090610ec130610e9d565b916110eb565b90565b610ed2610408565b503390565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b610f0c601d6020926108de565b610f1581610ed7565b0190565b610f2f9060208101906000818303910152610eff565b90565b15610f3957565b610f41610093565b62461bcd60e51b815280610f5760048201610f19565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b610f8f602080926108de565b610f9881610f5b565b0190565b610fb29060208101906000818303910152610f83565b90565b15610fbc57565b610fc4610093565b62461bcd60e51b815280610fda60048201610f9c565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61101360196020926108de565b61101c81610fde565b0190565b6110369060208101906000818303910152611006565b90565b1561104057565b611048610093565b62461bcd60e51b81528061105e60048201611020565b0390fd5b91909161106d610408565b5061109461107a30610e9d565b3161108d611087846100a3565b916100a3565b1015610f32565b6110ba6110a0836104c4565b6110b36110ad6000610be6565b916100a3565b1415610fb5565b60208251920190f5906110e9826110e26110dc6110d7600061085f565b6100d5565b916100d5565b1415611039565b565b90605592600b926110fa610408565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a2646970667358221220e4017702d245f60c5abf556451ec1816e94c2280e9885e04b6e2f912ad89e01364736f6c634300081b0033608060405234601c57600e6020565b614f7661002c8239614f7690f35b6026565b60405190565b600080fdfe60a06040526004361015610013575b6112a5565b61001e6000356101ad565b806301ffc9a7146101a85780630869678c146101a35780630bb310de1461019e578063119cd50c14610199578063248a9ca3146101945780632f2ff15d1461018f5780633013ce291461018a57806336568abe1461018557806344004cc1146101805780634782f7791461017b5780634f651ccd1461017657806360e606f61461017157806363acc14d1461016c5780636a326ab1146101675780639010d07c1461016257806391d148541461015d5780639d043a6614610158578063a217fddf14610153578063bad436611461014e578063c81ee65014610149578063ca15c87314610144578063d547741f1461013f578063ed4c2ac71461013a578063f07f04ff146101355763ff81434e0361000e5761126f565b611105565b610f54565b610f20565b610eeb565b610e8e565b610de4565b610d4c565b610cd9565b610c0e565b610bd8565b610b77565b610b40565b610ac6565b6107e9565b61072c565b6106ca565b61065b565b610626565b6105cf565b61056c565b6104d1565b6103f8565b610363565b61023f565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b6101dd816101c8565b036101e457565b600080fd5b905035906101f6826101d4565b565b906020828203126102125761020f916000016101e9565b90565b6101be565b151590565b61022590610217565b9052565b919061023d9060006020850194019061021c565b565b3461026f5761026b61025a6102553660046101f8565b6112af565b6102626101b3565b91829182610229565b0390f35b6101b9565b90565b61028081610274565b0361028757565b600080fd5b9050359061029982610277565b565b906020828203126102b5576102b29160000161028c565b90565b6101be565b6102c390610274565b9052565b67ffffffffffffffff1690565b6102dd906102c7565b9052565b90565b6102ed906102e1565b9052565b9060808061034b9361030b600082015160008601906102ba565b61031d602082015160208601906102ba565b61032f604082015160408601906102d4565b610341606082015160608601906102d4565b01519101906102e4565b565b919061036190600060a085019401906102f1565b565b346103935761038f61037e61037936600461029b565b611509565b6103866101b3565b9182918261034d565b0390f35b6101b9565b60018060a01b031690565b6103ac90610398565b90565b6103b8816103a3565b036103bf57565b600080fd5b905035906103d1826103af565b565b906020828203126103ed576103ea916000016103c4565b90565b6101be565b60000190565b346104265761041061040b3660046103d3565b6115fa565b6104186101b3565b80610422816103f2565b0390f35b6101b9565b600091031261043657565b6101be565b9060c0806104b993610455600082015160008601906102ba565b610467602082015160208601906102ba565b610479604082015160408601906102ba565b61048b606082015160608601906102ba565b61049d608082015160808601906102d4565b6104af60a082015160a08601906102d4565b01519101906102e4565b565b91906104cf90600060e0850194019061043b565b565b34610501576104e136600461042b565b6104fd6104ec61173e565b6104f46101b3565b918291826104bb565b0390f35b6101b9565b61050f816102e1565b0361051657565b600080fd5b9050359061052882610506565b565b90602082820312610544576105419160000161051b565b90565b6101be565b610552906102e1565b9052565b919061056a90600060208501940190610549565b565b3461059c5761059861058761058236600461052a565b61177d565b61058f6101b3565b91829182610556565b0390f35b6101b9565b91906040838203126105ca57806105be6105c7926000860161051b565b936020016103c4565b90565b6101be565b346105fe576105e86105e23660046105a1565b906117c8565b6105f06101b3565b806105fa816103f2565b0390f35b6101b9565b61060c906103a3565b9052565b919061062490600060208501940190610603565b565b346106565761063636600461042b565b610652610641611805565b6106496101b3565b91829182610610565b0390f35b6101b9565b3461068a5761067461066e3660046105a1565b906118ce565b61067c6101b3565b80610686816103f2565b0390f35b6101b9565b90916060828403126106c5576106c26106ab84600085016103c4565b936106b981602086016103c4565b9360400161028c565b90565b6101be565b346106f9576106e36106dd36600461068f565b9161196d565b6106eb6101b3565b806106f5816103f2565b0390f35b6101b9565b9190604083820312610727578061071b61072492600086016103c4565b9360200161028c565b90565b6101be565b3461075b5761074561073f3660046106fe565b90611a50565b61074d6101b3565b80610757816103f2565b0390f35b6101b9565b610769816102c7565b0361077057565b600080fd5b9050359061078282610760565b565b909160c0828403126107e45761079d836000840161028c565b926107ab816020850161028c565b926107b9826040830161028c565b926107e16107ca8460608501610775565b936107d88160808601610775565b9360a00161051b565b90565b6101be565b3461081e576108086107fc366004610784565b94939093929192611e42565b6108106101b3565b8061081a816103f2565b0390f35b6101b9565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061085290610828565b810190811067ffffffffffffffff82111761086c57604052565b610832565b9061088461087d6101b3565b9283610848565b565b67ffffffffffffffff811161089e5760208091020190565b610832565b600080fd5b909291926108bd6108b882610886565b610871565b93818552602080860192028301928184116108fa57915b8383106108e15750505050565b602080916108ef848661028c565b8152019201916108d4565b6108a3565b9080601f8301121561091d5781602061091a933591016108a8565b90565b610823565b600080fd5b67ffffffffffffffff811161094557610941602091610828565b0190565b610832565b90826000939282370152565b9092919261096b61096682610927565b610871565b93818552602085019082840111610987576109859261094a565b565b610922565b9080601f830112156109aa578160206109a793359101610956565b90565b610823565b600080fd5b909182601f830112156109ee5781359167ffffffffffffffff83116109e95760200192602083028401116109e457565b6108a3565b6109af565b610823565b9060e082820312610ac157610a0b81600084016103c4565b92602083013567ffffffffffffffff8111610abc5782610a2c9185016108ff565b92604081013567ffffffffffffffff8111610ab75783610a4d9183016108ff565b92606082013567ffffffffffffffff8111610ab25781610a6e91840161098c565b92610a7c82608085016103c4565b92610a8a8360a0830161028c565b9260c082013567ffffffffffffffff8111610aad57610aa992016109b4565b9091565b6101c3565b6101c3565b6101c3565b6101c3565b6101be565b610ae3610ad43660046109f3565b96959095949194939293612038565b610aeb6101b3565b80610af5816103f2565b0390f35b608081830312610b3b57610b1082600083016103c4565b92610b38610b2184602085016103c4565b93610b2f81604086016103c4565b9360600161051b565b90565b6101be565b34610b7257610b5c610b53366004610af9565b92919091612231565b610b646101b3565b80610b6e816103f2565b0390f35b6101b9565b34610ba557610b8f610b8a3660046103d3565b612301565b610b976101b3565b80610ba1816103f2565b0390f35b6101b9565b9190604083820312610bd35780610bc7610bd0926000860161051b565b9360200161028c565b90565b6101be565b34610c0957610c05610bf4610bee366004610baa565b90612327565b610bfc6101b3565b91829182610610565b0390f35b6101b9565b34610c3f57610c3b610c2a610c243660046105a1565b90612367565b610c326101b3565b91829182610229565b0390f35b6101b9565b600080fd5b908160c0910312610c575790565b610c44565b908160e0910312610c6a5790565b610c44565b91606083830312610cd457610c8782600085016103c4565b92602081013567ffffffffffffffff8111610ccf5783610ca8918301610c49565b92604082013567ffffffffffffffff8111610cca57610cc79201610c5c565b90565b6101c3565b6101c3565b6101be565b34610d0a57610d06610cf5610cef366004610c6f565b9161268b565b610cfd6101b3565b91829182610556565b0390f35b6101b9565b90565b60001b90565b610d2c610d27610d3192610d0f565b610d12565b6102e1565b90565b610d3e6000610d18565b90565b610d49610d34565b90565b34610d7c57610d5c36600461042b565b610d78610d67610d41565b610d6f6101b3565b91829182610556565b0390f35b6101b9565b91608083830312610ddf57610d99826000850161051b565b9260208101359167ffffffffffffffff8311610dda57610dbe84610dd79484016109b4565b939094610dce81604086016103c4565b9360600161051b565b90565b6101c3565b6101be565b34610e1857610e14610e03610dfa366004610d81565b9392909261284e565b610e0b6101b3565b91829182610229565b0390f35b6101b9565b60e081830312610e8957610e34826000830161028c565b92610e42836020840161028c565b92610e50816040850161028c565b92610e5e826060830161028c565b92610e86610e6f8460808501610775565b93610e7d8160a08601610775565b9360c00161051b565b90565b6101be565b34610ec357610ead610ea1366004610e1d565b95949094939193612b95565b610eb56101b3565b80610ebf816103f2565b0390f35b6101b9565b610ed190610274565b9052565b9190610ee990600060208501940190610ec8565b565b34610f1b57610f17610f06610f0136600461052a565b612bab565b610f0e6101b3565b91829182610ed5565b0390f35b6101b9565b34610f4f57610f39610f333660046105a1565b90612bfb565b610f416101b3565b80610f4b816103f2565b0390f35b6101b9565b34610f8257610f6c610f6736600461052a565b612c2f565b610f746101b3565b80610f7e816103f2565b0390f35b6101b9565b909182601f83011215610fc15781359167ffffffffffffffff8311610fbc576020019260208302840111610fb757565b6108a3565b6109af565b610823565b909182601f830112156110005781359167ffffffffffffffff8311610ffb576020019260208302840111610ff657565b6108a3565b6109af565b610823565b909160c08284031261110057600082013567ffffffffffffffff81116110fb5783611031918401610f87565b929093602082013567ffffffffffffffff81116110f65781611054918401610f87565b929093604082013567ffffffffffffffff81116110f15783611077918401610f87565b929093606082013567ffffffffffffffff81116110ec578161109a918401610fc6565b929093608082013567ffffffffffffffff81116110e757836110bd918401610fc6565b92909360a082013567ffffffffffffffff81116110e2576110de92016109b4565b9091565b6101c3565b6101c3565b6101c3565b6101c3565b6101c3565b6101c3565b6101be565b346111435761112d611118366004611005565b9a99909998919897929796939695949561315e565b6111356101b3565b8061113f816103f2565b0390f35b6101b9565b9060208282031261117a57600082013567ffffffffffffffff8111611175576111719201610f87565b9091565b6101c3565b6101be565b5190565b60209181520190565b60200190565b906080806111ec936111ac600082015160008601906102ba565b6111be602082015160208601906102ba565b6111d0604082015160408601906102d4565b6111e2606082015160608601906102d4565b01519101906102e4565b565b906111fb8160a093611192565b0190565b60200190565b9061122261121c6112158461117f565b8093611183565b9261118c565b9060005b8181106112335750505090565b90919261124c61124660019286516111ee565b946111ff565b9101919091611226565b61126c9160208201916000818403910152611205565b90565b346112a05761129c61128b611285366004611148565b90613223565b6112936101b3565b91829182611256565b0390f35b6101b9565b600080fd5b600090565b6112b76112aa565b5063b681391160e01b6112d26112cc836101c8565b916101c8565b1480156112f6575b9081156112e6575b5090565b6112f091506132fb565b386112e2565b50611300816132c1565b6112da565b61130f60a0610871565b90565b600090565b600090565b600090565b611329611305565b9060208080808086611339611312565b815201611344611312565b81520161134f611317565b81520161135a611317565b81520161136561131c565b81525050565b611373611321565b90565b90565b61138d61138861139292610274565b611376565b610274565b90565b9061139f90611379565b600052602052604060002090565b60001c90565b90565b6113c26113c7916113ad565b6113b3565b90565b6113d490546113b6565b90565b906113e190610274565b9052565b67ffffffffffffffff1690565b6113fe611403916113ad565b6113e5565b90565b61141090546113f2565b90565b9061141d906102c7565b9052565b60401c90565b61143361143891611421565b6113e5565b90565b6114459054611427565b90565b90565b61145761145c916113ad565b611448565b90565b611469905461144b565b90565b90611476906102e1565b9052565b906114fb6114f2600361148b611305565b946114a461149b600083016113ca565b600088016113d7565b6114bc6114b3600183016113ca565b602088016113d7565b6114d46114cb60028301611406565b60408801611413565b6114ec6114e36002830161143b565b60608801611413565b0161145f565b6080840161146c565b565b6115069061147a565b90565b6115206115259161151861136b565b50600d611395565b6114fd565b90565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b6115659061156061155b611528565b613329565b6115e5565b565b61157b61157661158092610398565b611376565b610398565b90565b61158c90611567565b90565b61159890611583565b90565b906115ac60018060a01b0391610d12565b9181191691161790565b6115bf90611583565b90565b90565b906115da6115d56115e1926115b6565b6115c2565b825461159b565b9055565b6115f16115f89161158f565b60036115c5565b565b6116039061154c565b565b61160f60e0610871565b90565b61161a611605565b9060208080808080808861162c611312565b815201611637611312565b815201611642611312565b81520161164d611312565b815201611658611317565b815201611663611317565b81520161166e61131c565b81525050565b61167c611612565b90565b906117306117276005611690611605565b946116a96116a0600083016113ca565b600088016113d7565b6116c16116b8600183016113ca565b602088016113d7565b6116d96116d0600283016113ca565b604088016113d7565b6116f16116e8600383016113ca565b606088016113d7565b61170961170060048301611406565b60808801611413565b6117216117186004830161143b565b60a08801611413565b0161145f565b60c0840161146c565b565b61173b9061167f565b90565b611746611674565b506117516007611732565b90565b600090565b611762906102e1565b90565b9061176f90611759565b600052602052604060002090565b600161179661179c9261178e611754565b506000611765565b0161145f565b90565b906117ba916117b56117b08261177d565b613329565b6117bc565b565b906117c69161333d565b565b906117d29161179f565b565b600090565b60018060a01b031690565b6117f06117f5916113ad565b6117d9565b90565b61180290546117e4565b90565b61180d6117d4565b5061181860066117f8565b90565b60209181520190565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b61187f602f60409261181b565b61188881611824565b0190565b6118a29060208101906000818303910152611872565b90565b156118ac57565b6118b46101b3565b62461bcd60e51b8152806118ca6004820161188c565b0390fd5b906118fb916118f6826118f06118ea6118e5613367565b6103a3565b916103a3565b146118a5565b613374565b565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec90565b9061193c92916119376119326118fd565b613329565b611956565b565b61194790611567565b90565b6119539061193e565b90565b9161196361196b9361194a565b9190916133f3565b565b906119789291611921565b565b906119949161198f61198a6118fd565b613329565b6119fe565b565b905090565b6119a760008092611996565b0190565b6119b49061199b565b90565b906119c96119c483610927565b610871565b918252565b606090565b3d6000146119f0576119e43d6119b7565b903d6000602084013e5b565b6119f86119ce565b906119ee565b6000611a2d92819290611a0f6101b3565b9081611a1a816119ab565b03925af1611a266119d3565b5015610217565b611a3357565b6000631d42c86760e21b815280611a4c600482016103f2565b0390fd5b90611a5a9161197a565b565b7f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c290565b90611a9e9594939291611a99611a94611a5c565b613329565b611d0e565b565b611ab4611aaf611ab9926102c7565b611376565b610274565b90565b611ad0611acb611ad592610d0f565b611376565b610274565b90565b611ae260a0610871565b90565b611aef9051610274565b90565b90611aff60001991610d12565b9181191691161790565b90565b90611b21611b1c611b2892611379565b611b09565b8254611af2565b9055565b611b3690516102c7565b90565b90611b4c67ffffffffffffffff91610d12565b9181191691161790565b611b6a611b65611b6f926102c7565b611376565b6102c7565b90565b90565b90611b8a611b85611b9192611b56565b611b72565b8254611b39565b9055565b60401b90565b90611bb66fffffffffffffffff000000000000000091611b95565b9181191691161790565b90611bd5611bd0611bdc92611b56565b611b72565b8254611b9b565b9055565b611bea90516102e1565b90565b611bf6906113ad565b90565b90611c0e611c09611c1592611759565b611bed565b8254611af2565b9055565b90611c9160806003611c9794611c3e60008201611c3860008801611ae5565b90611b0c565b611c5760018201611c5160208801611ae5565b90611b0c565b611c7060028201611c6a60408801611b2c565b90611b75565b611c8960028201611c8360608801611b2c565b90611bc0565b019201611be0565b90611bf9565b565b90611ca391611c19565b565b611cae906102c7565b9052565b9194611cfb611d0592989795611cf160a096611ce7611d0c9a611cdd60c08a019e60008b0190610ec8565b6020890190610ec8565b6040870190610ec8565b6060850190611ca5565b6080830190611ca5565b0190610549565b565b919390929481611d26611d20886102c7565b916102c7565b108015611e27575b611e0a5784611d46611d406000611abc565b91610274565b14611ded57611de892611daf85611d9e88611d958b611d8c8991611d838a95611d7a611d70611ad8565b9960008b016113d7565b602089016113d7565b60408701611413565b60608501611413565b6080830161146c565b611daa600d8490611395565b611c99565b9394959190917f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f9696611ddf6101b3565b96879687611cb2565b0390a1565b60006310ba94e960e31b815280611e06600482016103f2565b0390fd5b60006310ba94e960e31b815280611e23600482016103f2565b0390fd5b5081611e3b611e3542610274565b91611aa0565b1115611d2e565b90611e509594939291611a80565b565b5190565b60081c90565b611e68611e6d91611e56565b6117d9565b90565b611e7a9054611e5c565b90565b611e8690611567565b90565b611e9290611e7d565b90565b611e9e90611567565b90565b611eaa90611e95565b90565b600080fd5b60e01b90565b6000910312611ec357565b6101be565b60209181520190565b60200190565b90611ee4816020936102ba565b0190565b60200190565b90611f0b611f05611efe84611e52565b8093611ec8565b92611ed1565b9060005b818110611f1c5750505090565b909192611f35611f2f6001928651611ed7565b94611ee8565b9101919091611f0f565b5190565b60209181520190565b60005b838110611f60575050906000910152565b806020918301518185015201611f4f565b611f90611f99602093611f9e93611f8781611f3f565b93848093611f43565b95869101611f4c565b610828565b0190565b92611fce611fdc92611fea9694611fc160808801926000890190610603565b8682036020880152611eee565b908482036040860152611eee565b916060818403910152611f71565b90565b611ff56101b3565b3d6000823e3d90fd5b9161203593916120279161201a60608601926000870190610603565b8482036020860152611eee565b916040818403910152611eee565b90565b949293919596909661204988611e52565b61206361205d6120588a611e52565b610274565b91610274565b036121565761207993889388909192939461360d565b61209361208e6120896005611e70565b611e89565b611ea1565b63b48ab8b690839086938690823b15612151576000946120d186926120c6946120ba6101b3565b998a9889978896611eb2565b865260048601611fa2565b03925af1801561214c5761211f575b5091909161211a7f23519238b590c499a2abcf44a33b5f431ac6ca51c22fad26bc2c3d08b97eaa21936121116101b3565b93849384611ffe565b0390a1565b61213f9060003d8111612145575b6121378183610848565b810190611eb8565b386120e0565b503d61212d565b611fed565b611ead565b600063340bc4c960e01b81528061216f600482016103f2565b0390fd5b60ff1690565b61218561218a916113ad565b612173565b90565b6121979054612179565b90565b60081b90565b906121b3610100600160a81b039161219a565b9181191691161790565b6121c690611e95565b90565b90565b906121e16121dc6121e8926121bd565b6121c9565b82546121a0565b9055565b906121f860ff91610d12565b9181191691161790565b61220b90610217565b90565b90565b9061222661222161222d92612202565b61220e565b82546121ec565b9055565b92909261223e600561218d565b61229c5761225061228e9460056121cc565b61226261225b610d34565b829061333d565b61227461226d611a5c565b829061333d565b61228661227f6118fd565b829061333d565b919091613b0e565b61229a60016005612211565b565b600063f92ee8a960e01b8152806122b5600482016103f2565b0390fd5b6122d2906122cd6122c8611a5c565b613329565b6122f4565b565b906122e96122e46122f0926121bd565b6121c9565b825461159b565b9055565b6122ff9060066122d4565b565b61230a906122b9565b565b9061231690611759565b600052602052604060002090565b90565b9061234761234261234c9361233a6117d4565b50600161230c565b612324565b613b5e565b90565b90612359906121bd565b600052602052604060002090565b61238e9160006123836123899361237c6112aa565b5082611765565b0161234f565b61218d565b90565b60018060a01b031690565b6123a86123ad916113ad565b612391565b90565b6123ba905461239c565b90565b6123c690611e95565b90565b905051906123d682610506565b565b906020828203126123f2576123ef916000016123c9565b90565b6101be565b506124069060208101906103c4565b90565b612412906103a3565b9052565b506124259060208101906101e9565b90565b612431906101c8565b9052565b5061244490602081019061051b565b90565b600080fd5b600080fd5b600080fd5b903560016020038236030381121561249757016020813591019167ffffffffffffffff821161249257600182023603831361248d57565b61244c565b612447565b612451565b60209181520190565b91906124bf816124b8816124c49561249c565b809561094a565b610828565b0190565b90356001604003823603038112156124de570190565b612451565b903560016020038236030381121561252457016020813591019167ffffffffffffffff821161251f57600182023603831361251a57565b61244c565b612447565b612451565b60209181520190565b919061254c816125458161255195612529565b809561094a565b610828565b0190565b50612564906020810190610775565b90565b906125a590602061259d6125936040840161258560008801886124e3565b908683036000880152612532565b9482810190612555565b9101906102d4565b90565b6126529161264461263960c083016125d06125c660008701876123f7565b6000860190612409565b6125ea6125e06020870187612416565b6020860190612428565b6126046125fa6040870187612435565b60408601906102e4565b61261e6126146060870187612435565b60608601906102e4565b61262b6080860186612456565b9085830360808701526124a5565b9260a08101906124c8565b9060a0818403910152612567565b90565b93929061268160409161268994612674606089019260008a0190610603565b87820360208901526125a8565b940190610549565b565b9150602090612698611754565b506126ab6126a660036123b0565b6123bd565b6126d7633808a90b9492946126e26126c3600461145f565b6126cb6101b3565b97889687958695611eb2565b855260048501612655565b03915afa908115612727576000916126f9575b5090565b61271a915060203d8111612720575b6127128183610848565b8101906123d8565b386126f5565b503d612708565b611fed565b90612736906121bd565b600052602052604060002090565b9061274e90611759565b600052602052604060002090565b60601b90565b61276b9061275c565b90565b61277790612762565b90565b61278661278b916103a3565b61276e565b9052565b90565b61279e6127a3916102e1565b61278f565b9052565b6014816127ba6127c2936020969561277a565b018092612792565b0190565b60200190565b67ffffffffffffffff81116127e45760208091020190565b610832565b909291926127fe6127f9826127cc565b610871565b938185526020808601920283019281841161283b57915b8383106128225750505050565b60208091612830848661051b565b815201920191612815565b6108a3565b61284b9136916127e9565b90565b909392919261285b6112aa565b5061288361287d6128786128716002879061272c565b8590612744565b61218d565b15610217565b9485612892575b505050505090565b6128e79550906128c96128e293929592946128ba6128ae6101b3565b938492602084016127a7565b60208201810382520382610848565b6128db6128d582611f3f565b916127c6565b2093612840565b613b97565b388080808061288a565b9061291096959493929161290b612906611a5c565b613329565b612a46565b565b61291c60e0610871565b90565b906129c960c060056129cf946129446000820161293e60008801611ae5565b90611b0c565b61295d6001820161295760208801611ae5565b90611b0c565b6129766002820161297060408801611ae5565b90611b0c565b61298f6003820161298960608801611ae5565b90611b0c565b6129a8600482016129a260808801611b2c565b90611b75565b6129c1600482016129bb60a08801611b2c565b90611bc0565b019201611be0565b90611bf9565b565b906129db9161291f565b565b949290979695939160e0860198600087016129f791610ec8565b60208601612a0491610ec8565b60408501612a1191610ec8565b60608401612a1e91610ec8565b60808301612a2b91611ca5565b60a08201612a3891611ca5565b60c001612a4491610549565b565b92959093919480612a5f612a59856102c7565b916102c7565b108015612b7a575b612b5d5786612a7f612a796000611abc565b91610274565b14612b405783612b016000612afa88612af187612ae8888f8f612ad6612b3b9f928f92612acd90612ac4612adf969b91939597999b612abc612912565b9e8f016113d7565b60208d016113d7565b60408b016113d7565b606089016113d7565b60808701611413565b60a08501611413565b60c0830161146c565b60076129d1565b949596929091927f099eb0c4bcb0e32c2243e81b424e1960f39d7ac2fe1598742f19aa8aec203acb97612b326101b3565b978897886129dd565b0390a1565b60006310ba94e960e31b815280612b59600482016103f2565b0390fd5b60006310ba94e960e31b815280612b76600482016103f2565b0390fd5b5080612b8e612b8842610274565b91611aa0565b1115612a67565b90612ba49695949392916128f1565b565b600090565b612bca612bc5612bcf92612bbd612ba6565b50600161230c565b612324565b613bc1565b90565b90612bed91612be8612be38261177d565b613329565b612bef565b565b90612bf991613374565b565b90612c0591612bd2565b565b612c2090612c1b612c16611528565b613329565b612c22565b565b612c2d906004611bf9565b565b612c3890612c07565b565b90612c5e9b9a999897969594939291612c59612c54611a5c565b613329565b612cf7565b565b5090565b5090565b5090565b6001612c789101610274565b90565b634e487b7160e01b600052603260045260246000fd5b9190811015612ca1576020020190565b612c7b565b35612cb081610277565b90565b9190811015612cc3576020020190565b612c7b565b35612cd281610760565b90565b9190811015612ce5576020020190565b612c7b565b35612cf481610506565b90565b909a9599969398949291979a612d0e828290612c60565b612d2a612d24612d1f8c8790612c60565b610274565b91610274565b1415801561312f575b80156130ff575b80156130cf575b80156130a0575b61308357612d54612ba6565b91612d5f6000611abc565b5b80612d7d612d77612d72858790612c60565b610274565b91610274565b101561307357612d97612d9283858491612c91565b612ca6565b9381612dac612da66000611abc565b91610274565b14159081613057575b5061303a57838e8e612dfb612df5612df0612deb8d8f9b612ddd612de2919d89908c91612cb3565b612cc8565b95908991612cb3565b612cc8565b6102c7565b916102c7565b1090811561300a575b50612fed57612e1d612e188e898591612c91565b612ca6565b612e30612e2a6000611abc565b91610274565b14612fd0578d8f918d8f918d8f918d8f918d8f9187828d90612e5192612c91565b612e5a90612ca6565b898d85612e6692612c91565b612e6f90612ca6565b8d8d8d888390612e7e92612cb3565b612e8790612cc8565b90898390612e9492612cb3565b612e9d90612cc8565b918b908b612eaa92612cd5565b612eb390612cea565b92612ebc611ad8565b946000860190612ecb916113d7565b6020850190612ed9916113d7565b6040840190612ee791611413565b6060830190612ef591611413565b6080820190612f039161146c565b600d82612f0f91611395565b90612f1991611c99565b96908b90612f2692612c91565b612f2f90612ca6565b96908a90612f3c92612c91565b612f4590612ca6565b96908990612f5292612cb3565b612f5b90612cc8565b96908890612f6892612cb3565b612f7190612cc8565b91908790612f7e92612cd5565b612f8790612cea565b907f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f9695612fb26101b3565b958695612fbf9587611cb2565b0390a1612fcb90612c6c565b612d60565b60006310ba94e960e31b815280612fe9600482016103f2565b0390fd5b60006310ba94e960e31b815280613006600482016103f2565b0390fd5b613020915061301b908b8591612cb3565b612cc8565b61303261302c42610274565b91611aa0565b11158f612e04565b600063340bc4c960e01b815280613053600482016103f2565b0390fd5b905061306b61306586610274565b91610274565b101538612db5565b5050505050505050505050505050565b60006310ba94e960e31b81528061309c600482016103f2565b0390fd5b506130ac828290612c60565b6130c86130c26130bd8b8b90612c68565b610274565b91610274565b1415612d48565b508b6130f86130f26130ed6130e5868690612c60565b938a90612c64565b610274565b91610274565b1415612d41565b508a61312861312261311d613115868690612c60565b938990612c64565b610274565b91610274565b1415612d3a565b5061313b828290612c60565b61315761315161314c8d8890612c60565b610274565b91610274565b1415612d33565b906131729b9a999897969594939291612c3a565b565b606090565b67ffffffffffffffff81116131915760208091020190565b610832565b906131a86131a383613179565b610871565b918252565b6131b5611321565b90565b60005b8281106131c757505050565b6020906131d26131ad565b81840152016131bb565b906132016131e983613196565b926020806131f78693613179565b92019103906131b8565b565b9061320d8261117f565b81101561321e576020809102010190565b612c7b565b61322b613174565b5061323f61323a828490612c60565b6131dc565b9161324a6000611abc565b5b8061326861326261325d868690612c60565b610274565b91610274565b10156132bb576132b6906132af613294600d61328e61328988888791612c91565b612ca6565b90611395565b8661329f84926114fd565b6132a98383613203565b52613203565b5150612c6c565b61324b565b50505090565b6132c96112aa565b50806132de6132d860006101c8565b916101c8565b149081156132eb575b5090565b6132f59150613be1565b386132e7565b6133036112aa565b5061330d81613be1565b908115613319575b5090565b6133239150613c21565b38613315565b61333b90613335613367565b90613da9565b565b9061335f61335a61336493613353818590613e42565b600161230c565b612324565b613f0c565b50565b61336f6117d4565b503390565b9061339661339161339b9361338a818590613f47565b600161230c565b612324565b613fe0565b50565b6133a790611e95565b90565b63ffffffff1690565b6133c76133c26133cc926133aa565b611eb2565b6101c8565b90565b9160206133f19294936133ea60408201966000830190610603565b0190610ec8565b565b9161343760049261342861343c959361340f63a9059cbb6133b3565b926134186101b3565b96879460208601908152016133cf565b60208201810382520383610848565b61418e565b565b9061344882611e52565b811015613459576020809102010190565b612c7b565b91602061348092949361347960408201966000830190610ec8565b0190610ec8565b565b61349661349161349b92610274565b610d12565b6102e1565b90565b634e487b7160e01b600052601160045260246000fd5b6134c36134c991939293610274565b92610274565b916134d5838202610274565b9281840414901517156134e457565b61349e565b6134f86134fe91939293610274565b92610274565b820180921161350957565b61349e565b61351d61352391939293610274565b92610274565b820391821161352e57565b61349e565b61353c90611abc565b9052565b60409061356a613571949695939661356060608401986000850190610603565b6020830190610ec8565b0190613533565b565b60409061359d6135a4949695939661359360608401986000850190610603565b6020830190610ec8565b0190610ec8565b565b6135ba6135b56135bf92610d0f565b611376565b610398565b90565b6135cb906135a6565b90565b6135d790611e95565b90565b60409061360461360b94969593966135fa60608401986000850190610603565b6020830190613533565b0190610ec8565b565b93959190949560805261361e612ba6565b90613627612ba6565b95613630612ba6565b9561363b6007611732565b9461366f61364b60808801611b2c565b61366961366361365d60a08b01611b2c565b92611aa0565b91611aa0565b906141fb565b9360009761367b612ba6565b995b8a61369861369261368d88611e52565b610274565b91610274565b1015613978576136b16136ac868d9061343e565b611ae5565b978b6136c66136c06000611abc565b91610274565b1415908161395c575b5061393f57876136e76136e28d8961343e565b611ae5565b9a6136fc6136f7600d8490611395565b6114fd565b61372f61370b60408301611b2c565b61372961372361371d60608601611b2c565b92611aa0565b91611aa0565b906141fb565b60001461386b57505061374460008b01611ae5565b61375661375083610274565b91610274565b118015613846575b801561383f575b613820575061377760036007016113ca565b6137896137838c610274565b91610274565b106137f35760019b8960400161379e90611ae5565b8b6137a8916134b4565b6137b1916134e9565b99806007600301906137c2826113ca565b906137cc9161350e565b6137d591611b0c565b6137ea916137e4915b906134e9565b9a612c6c565b999a989a61367d565b8961380160036007016113ca565b61381c6000928392639e4c446160e01b84526004840161345e565b0390fd5b61383b9060009182916235acf560e41b835260048301610ed5565b0390fd5b5087613765565b5061385360208b01611ae5565b61386561385f83610274565b91610274565b1061375e565b61387d919e916020829e949e01611ae5565b61388f61388985610274565b91610274565b1061391357918f6138e66137ea95938f6138d96000886138d361390e976138e0956138bf60806137e49e01611be0565b916080516138cd3393613482565b936142f2565b01611ae5565b85906134b4565b906134e9565b9d61390860016138f88593600d611395565b0191613903836113ca565b61350e565b90611b0c565b6137de565b6139206020849201611ae5565b61393b6000928392639e4c446160e01b84526004840161345e565b0390fd5b600063340bc4c960e01b815280613958600482016103f2565b0390fd5b905061397061396a8a610274565b91610274565b1015386136cf565b5097945097509893505050613ae0575b5050816139a66139a061399b60066117f8565b6103a3565b916103a3565b03613ab557806139be6139b885610274565b91610274565b10613a925750806139e06139da6139d560006135c2565b6103a3565b916103a3565b14600014613a2557346139fb6139f584610274565b91610274565b03613a055750505b565b613a21346000938493630f55e7df60e11b855260048501613573565b0390fd5b9034613a3a613a346000611abc565b91610274565b11600014613a6f57613a4c60006135c2565b600090613a6b346000938493630f55e7df60e11b8552600485016135da565b0390fd5b613a7b613a8d9261194a565b9033613a86306135ce565b91926143c5565b613a03565b82613ab18391926000938493630f55e7df60e11b855260048501613573565b0390fd5b82613ac060066117f8565b613adc600080938493630f55e7df60e11b855260048501613540565b0390fd5b613aef60c0613b079301611be0565b90608051903391613b01600019613482565b936142f2565b3880613988565b90613b24613b299392613b1f611528565b61333d565b614414565b565b90565b613b3a613b3f916113ad565b611379565b90565b613b56613b51613b5b92610274565b611376565b610398565b90565b613b8a613b85613b9493613b806000613b8f95613b796117d4565b5001613b2b565b614496565b613b2e565b613b42565b611e95565b90565b613bb1613bbd9293613bb792613bab6112aa565b506144dc565b926102e1565b916102e1565b1490565b613bd96000613bde92613bd2612ba6565b5001613b2b565b614547565b90565b613be96112aa565b5080613c04613bfe635a05180f60e01b6101c8565b916101c8565b14908115613c11575b5090565b613c1b915061455f565b38613c0d565b613c296112aa565b5080613c44613c3e634e821d3360e11b6101c8565b916101c8565b14908115613c51575b5090565b613c5b91506132c1565b38613c4d565b90565b613c78613c73613c7d92613c61565b611376565b610274565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b613cb960178092613c80565b613cc281613c85565b0190565b5190565b613cef613ce692602092613cdd81613cc6565b94858093613c80565b93849101611f4c565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b613d2760118092613c80565b613d3081613cf3565b0190565b613d4e613d599392613d48613d5393613cad565b90613cca565b613d1b565b90613cca565b90565b90565b613d7e613d87602093613d8c93613d7581613cc6565b9384809361181b565b95869101611f4c565b610828565b0190565b613da69160208201916000818403910152613d5f565b90565b90613dbe613db8838390612367565b15610217565b613dc6575050565b613e3e91613e1c613df5613de5613ddf613e21956145f2565b93613b2e565b613def6020613c64565b906147f0565b91613e0d613e016101b3565b93849260208401613d34565b60208201810382520382610848565b613d5c565b613e296101b3565b91829162461bcd60e51b835260048301613d90565b0390fd5b613e56613e50828490612367565b15610217565b613e5f575b5050565b613e816001613e7c6000613e74818690611765565b01859061234f565b612211565b90613e8a613367565b90613ec7613ec1613ebb7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95611759565b926121bd565b926121bd565b92613ed06101b3565b80613eda816103f2565b0390a43880613e5b565b613eed90611567565b90565b613f04613eff613f0992610398565b611376565b610274565b90565b90613f3f613f39613f34613f2f6000613f4496613f276112aa565b500194613ee4565b613ef0565b613482565b91613b2b565b614a10565b90565b613f52818390612367565b613f5b575b5050565b613f7d6000613f786000613f70818690611765565b01859061234f565b612211565b90613f86613367565b90613fc3613fbd613fb77ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95611759565b926121bd565b926121bd565b92613fcc6101b3565b80613fd6816103f2565b0390a43880613f57565b9061401361400d614008614003600061401896613ffb6112aa565b500194613ee4565b613ef0565b613482565b91613b2b565b614b06565b90565b67ffffffffffffffff811161403957614035602091610828565b0190565b610832565b9061405061404b8361401b565b610871565b918252565b60007f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564910152565b614087602061403e565b9061409460208301614055565b565b61409e61407d565b90565b6140aa81610217565b036140b157565b600080fd5b905051906140c3826140a1565b565b906020828203126140df576140dc916000016140b6565b90565b6101be565b60207f6f74207375636365656400000000000000000000000000000000000000000000917f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201520152565b61413f602a60409261181b565b614148816140e4565b0190565b6141629060208101906000818303910152614132565b90565b1561416c57565b6141746101b3565b62461bcd60e51b81528061418a6004820161414c565b0390fd5b6141d89161419e6141ad9261339e565b906141a7614096565b91614c10565b6141b681611f3f565b6141c96141c36000611abc565b91610274565b149081156141da575b50614165565b565b6141f5915060206141ea82611f3f565b8183010191016140c5565b386141d2565b6142036112aa565b50816142186142126000611abc565b91610274565b1490811561424b575b5090811561422e575b5090565b905061424361423d4292610274565b91610274565b10153861422a565b905061426061425a4292610274565b91610274565b1038614221565b60209181520190565b600080fd5b9037565b90918261428591614267565b9160018060fb1b0381116142a857829160206142a49202938491614275565b0190565b614270565b906142de6142e9916142f0969897956060956142d160808701936000880190610549565b8583036020870152614279565b966040830190610603565b0190610549565b565b92938361431061430a6143056000610d18565b6102e1565b916102e1565b0361431d575b5050505050565b61433561432f8584868991869361284e565b15610217565b614365575050509061435661435b92614351600193600261272c565b612744565b612211565b3880808080614316565b8461438e918593949190916143786101b3565b9586956304cb8cd560e31b8752600487016142ad565b0390fd5b6040906143bc6143c394969593966143b260608401986000850190610603565b6020830190610603565b0190610ec8565b565b61441293916143fe60049461440d93946143e26323b872dd6133b3565b939190916143ee6101b3565b9788956020870190815201614392565b60208201810382520383610848565b61418e565b565b9061442b6144246144329361158f565b60036115c5565b6004611bf9565b565b5490565b600052602060002090565b61444c81614434565b8210156144675761445e600191614438565b91020190600090565b612c7b565b1c90565b614480906008614485930261446c565b611448565b90565b906144939154614470565b90565b6144b59160006144af926144a8611754565b5001614443565b90614488565b90565b5190565b906144c6826144b8565b8110156144d7576020809102010190565b612c7b565b91906144e6611754565b506144f16000611abc565b905b8161450e614508614503876144b8565b610274565b91610274565b10156145405761453461453a9161452e6145298786906144bc565b611be0565b90614c33565b91612c6c565b906144f3565b9192505090565b600061455c91614555612ba6565b5001614434565b90565b6145676112aa565b508061458261457c637965db0b60e01b6101c8565b916101c8565b1490811561458f575b5090565b6145999150614c73565b3861458b565b606090565b90565b60ff1690565b6145c16145bc6145c6926145a4565b611376565b6145a7565b90565b6145d360146145ad565b90565b6145ea6145e56145ef926145a7565b611376565b610274565b90565b61460f61460a6146259261460461459f565b50613ee4565b613ef0565b61461f61461a6145c9565b6145d6565b906147f0565b90565b90565b61463f61463a61464492614628565b611376565b610274565b90565b369037565b90614671614659836119b7565b926020806146678693610927565b9201910390614647565b565b600360fc1b90565b9061468582611f3f565b81101561469757600160209102010190565b612c7b565b600f60fb1b90565b90565b6146bb6146b66146c0926146a4565b611376565b610274565b90565b6146cc90610274565b600081146146db576001900390565b61349e565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b6146ff6146e0565b90565b90565b61471961471461471e92614702565b611376565b610274565b90565b60f81b90565b90565b61473e61473961474392614727565b611376565b6145a7565b90565b6147659061475f61475961476a946145a7565b91610274565b9061446c565b610274565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b6147a16020809261181b565b6147aa8161476d565b0190565b6147c49060208101906000818303910152614795565b90565b156147ce57565b6147d66101b3565b62461bcd60e51b8152806147ec600482016147ae565b0390fd5b91906147fa61459f565b5061489461488461483061482b61481b6002614816879161462b565b6134b4565b614825600261462b565b906134e9565b61464c565b92614839614673565b6148528561484c60009360001a93611abc565b9061467b565b5361485b61469c565b6148748561486e60019360001a936146a7565b9061467b565b5361487f600261462b565b6134b4565b61488e60016146a7565b906134e9565b925b836148aa6148a460016146a7565b91610274565b1115614911576148b86146f7565b816148c3600f614705565b1691601083101561490c576148df61490092614906941a614721565b6148ef8591889060001a9261467b565b536148fa600461472a565b90614746565b936146c3565b92614896565b612c7b565b6149399293506149349061492e6149286000611abc565b91610274565b146147c7565b613d5c565b90565b90565b600052602060002090565b5490565b6149578161494a565b8210156149725761496960019161493f565b91020190600090565b612c7b565b1b90565b9190600861499791029161499160001984614977565b92614977565b9181191691161790565b91906149b76149b26149bf93611759565b611bed565b90835461497b565b9055565b90815491680100000000000000008310156149f357826149eb9160016149f19501815561494e565b906149a1565b565b610832565b90614a0290611759565b600052602052604060002090565b614a186112aa565b50614a2d614a27828490614c99565b15610217565b600014614a7057614a66614a6b92614a51614a4a6000850161493c565b82906149c3565b6001614a5f60008501614434565b93016149f8565b611b0c565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b614a9f91614a99611754565b916149a1565b565b614aaa8161494a565b8015614acb576001900390614ac8614ac2838361494e565b90614a8d565b55565b614a77565b9190614ae6614ae1614aee93611379565b611b09565b90835461497b565b9055565b614b0491614afe612ba6565b91614ad0565b565b614b0e6112aa565b50614b25614b206001830184906149f8565b6113ca565b9081614b3a614b346000611abc565b91610274565b1415600014614c0857614bba926001614bb59284614b63600096614b5d856146a7565b9061350e565b614b80614b71888501614434565b614b7a866146a7565b9061350e565b80614b93614b8d84610274565b91610274565b03614bbf575b505050614baf614baa86830161493c565b614aa1565b016149f8565b614af2565b600190565b614c0092614bf2614bde614bd8614bfb948c8901614443565b90614488565b93614bec85918c8901614443565b906149a1565b918585016149f8565b611b0c565b388080614b99565b505050600090565b90614c309291614c1e6119ce565b5090614c2a6000611abc565b91614d85565b90565b614c3b611754565b5080614c4f614c49846102e1565b916102e1565b10600014614c655790614c6191614ddf565b5b90565b614c6e91614ddf565b614c62565b614c7b6112aa565b50614c95614c8f6301ffc9a760e01b6101c8565b916101c8565b1490565b614cb7916001614cb292614cab6112aa565b50016149f8565b6113ca565b614cca614cc46000611abc565b91610274565b141590565b614cd890611e95565b90565b60207f722063616c6c0000000000000000000000000000000000000000000000000000917f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201520152565b614d36602660409261181b565b614d3f81614cdb565b0190565b614d599060208101906000818303910152614d29565b90565b15614d6357565b614d6b6101b3565b62461bcd60e51b815280614d8160048201614d43565b0390fd5b9160008091614ddc9593614d976119ce565b50614dbe614da430614ccf565b31614db7614db185610274565b91610274565b1015614d5c565b8591602082019151925af191614dd26119d3565b9092909192614e7a565b90565b614de7611754565b50600052602052604060002090565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b614e2b601d60209261181b565b614e3481614df6565b0190565b614e4e9060208101906000818303910152614e1e565b90565b15614e5857565b614e606101b3565b62461bcd60e51b815280614e7660048201614e38565b0390fd5b919290614e856119ce565b50600014614ecb5750614e9782611f3f565b614eaa614ea46000611abc565b91610274565b14614eb4575b5090565b614ec0614ec591614f1f565b614e51565b38614eb0565b8290614ed682611f3f565b614ee9614ee36000611abc565b91610274565b11600014614efa5750805190602001fd5b614f1b90614f066101b3565b91829162461bcd60e51b835260048301613d90565b0390fd5b614f276112aa565b503b614f3c614f366000611abc565b91610274565b119056fea26469706673582212209b133d36303e49007373f2ed22cf983ed518061b7d81d902daa498b0e0d6ef5764736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -178,223 +95,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, IERC1155SaleFunctions } 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 // ERC20 token address for payment. address(0) indicated payment in ETH.\n address private _paymentToken;\n\n GlobalSaleDetails 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 * @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 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, valid 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 _validateMint(\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 GlobalSaleDetails 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 (gSaleDetails.minTokenId > tokenId || gSaleDetails.maxTokenId < tokenId || globalSaleInactive) {\n // Both sales inactive\n revert SaleInactive(tokenId);\n }\n // Use global sale details\n if (_globalSaleDetails.remainingSupply < amount) {\n revert InsufficientSupply(_globalSaleDetails.remainingSupply, amount);\n }\n globalMerkleCheckRequired = true;\n totalCost += gSaleDetails.cost * amount;\n _globalSaleDetails.remainingSupply -= amount;\n } else {\n // Use token sale details\n if (saleDetails.remainingSupply < amount) {\n revert InsufficientSupply(saleDetails.remainingSupply, amount);\n }\n requireMerkleProof(saleDetails.merkleRoot, _proof, msg.sender, bytes32(tokenId));\n totalCost += saleDetails.cost * amount;\n _tokenSaleDetails[tokenId].remainingSupply -= 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 if (tokenIds.length != amounts.length) {\n revert InvalidTokenIds();\n }\n _validateMint(tokenIds, amounts, expectedPaymentToken, maxTotal, proof);\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 minTokenId The minimum token ID to apply the sale to.\n * @param maxTokenId The maximum token ID to apply the sale to.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param remainingSupply The maximum number of tokens that can be minted by the items contract.\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 minTokenId,\n uint256 maxTokenId,\n uint256 cost,\n uint256 remainingSupply,\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 if (remainingSupply == 0) {\n revert InvalidSaleDetails();\n }\n _globalSaleDetails =\n GlobalSaleDetails(minTokenId, maxTokenId, cost, remainingSupply, startTime, endTime, merkleRoot);\n emit GlobalSaleDetailsUpdated(minTokenId, maxTokenId, cost, remainingSupply, 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 remainingSupply The maximum number of tokens that can be minted by this contract.\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 remainingSupply,\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 if (remainingSupply == 0) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] = SaleDetails(cost, remainingSupply, startTime, endTime, merkleRoot);\n emit TokenSaleDetailsUpdated(tokenId, cost, remainingSupply, 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 remainingSupplies The maximum number of tokens that can be minted by this contract.\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 remainingSupplies,\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 != remainingSupplies.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 if (remainingSupplies[i] == 0) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] =\n SaleDetails(costs[i], remainingSupplies[i], startTimes[i], endTimes[i], merkleRoots[i]);\n emit TokenSaleDetailsUpdated(\n tokenId, costs[i], remainingSupplies[i], startTimes[i], endTimes[i], merkleRoots[i]\n );\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 (GlobalSaleDetails 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(WithdrawControlled, SignalsImplicitModeControlled) returns (bool) {\n return type(IERC1155SaleFunctions).interfaceId == interfaceId\n || 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 Nonce for randomizing the deployment 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 Nonce for randomizing the deployment 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 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' }, - '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 IERC1155SaleFunctions {\n\n struct GlobalSaleDetails {\n uint256 minTokenId;\n uint256 maxTokenId;\n uint256 cost;\n uint256 remainingSupply;\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n struct SaleDetails {\n uint256 cost;\n uint256 remainingSupply;\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 (GlobalSaleDetails 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 minTokenId,\n uint256 maxTokenId,\n uint256 cost,\n uint256 remainingSupply,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n );\n event TokenSaleDetailsUpdated(\n uint256 tokenId, uint256 cost, uint256 remainingSupply, 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 * @param remainingSupply Remaining supply.\n * @param amount Amount to mint.\n */\n error InsufficientSupply(uint256 remainingSupply, uint256 amount);\n\n}\n\ninterface IERC1155Sale is IERC1155SaleFunctions, IERC1155SaleSignals { }\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/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.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' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC1155TokenReceiver.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.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 (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/Address.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.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) (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/0xsequence/erc-1155/src/contracts/utils/ERC165.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.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: 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/IAccessControlEnumerable.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.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: 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/access/AccessControl.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) (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: 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/openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.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 { 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/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/token/ERC20/IERC20.sol': { + '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, diff --git a/scripts/factories/token_library/ERC721SaleFactory.ts b/scripts/factories/token_library/ERC721SaleFactory.ts index 2e416c4..fbe64dc 100644 --- a/scripts/factories/token_library/ERC721SaleFactory.ts +++ b/scripts/factories/token_library/ERC721SaleFactory.ts @@ -1,7 +1,7 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' -// https://github.com/0xsequence/contracts-library/blob/ead1baf34270c76260d01cfc130bb7cc9d57518e/src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol +// https://github.com/0xsequence/contracts-library/blob/2d624ed35c2ad097b0e2a3efbc62baf6455b3e49/src/tokens/ERC721/utility/sale/ERC721SaleFactory.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 ERC721SaleFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( abi, - '608034610121576001600160401b0390601f6148a438819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b8251936124d294858101958187108388111761010b576123d2823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611de4853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611c76908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461079057806359659e901461073d578063715018a6146106a05780638da5cb5b1461064b578063d9181cd3146102ee578063e657f693146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561084f565b906100ae6108bd565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b8284346102eb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb57506101e461084f565b906101ed610877565b916055600b6101fa61089a565b845173ffffffffffffffffffffffffffffffffffffffff968716602080830191825292909716604080830191909152815290957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09161025a60608261099b565b519020906102ab86519161026d8361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff9661029f8860015416948a519586938d850198896109ff565b0390810183528261099b565b5190206111eb85516102bf8883018261099b565b81815287810191610a5683395190209085519186830152868201523081520160ff815320915191168152f35b80fd5b5090346101a65760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a65761032761084f565b92610330610877565b61033861089a565b908351946020968787018761037586868490602090939293604083019473ffffffffffffffffffffffffffffffffffffffff809216845216910152565b03976103a77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0998a810183528261099b565b5190208651916103b68361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff91816103f98c6103ed878d88600154169051958694850197886109ff565b038c810183528261099b565b5190206111eb895161040d8d83018261099b565b8181528c810191610a5683398051156105f057518492918af516988915610594578260015416938a3b156105905791608491601f8a95946104988f8e51998a9889977fcf7a1d77000000000000000000000000000000000000000000000000000000008952168c880152602487015260606044870152825192839182606489015288880191016109dc565b01168101030181838b5af1801561058657908591610572575b5050853b1561056e5784517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316918101918252929091166020820152829082908190604001038183885af1801561056457610550575b50507fe3fc4d8c7984f762222579e0c4564a72a74f96cde3f6bae2751d01108c6ec240838251848152a151908152f35b61055a829161093c565b6102eb5780610520565b83513d84823e3d90fd5b8380fd5b61057b9061093c565b61056e5783386104b1565b86513d87823e3d90fd5b8880fd5b6064858c8b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b6064878e808e51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b83346102eb57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb576106d76108bd565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a657826107ca61084f565b6107d26108bd565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561056e5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af1908115610846575061083a575080f35b6108439061093c565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108de57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b67ffffffffffffffff811161095057604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff82111761095057604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761095057604052565b60005b8381106109ef5750506000910152565b81810151838201526020016109df565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610a5082518093602086850191016109dc565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea2646970667358221220a592f27f25373407ca73911ddc0bbaa6ea0e0d6dfcce18bb6b5765f70d2e1a1764736f6c63430008130033a2646970667358221220f7464573d2144d649988f0f60625c5f6ed3b279c89ac9793209a1b06152866e664736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ff9f63e676c96c753988d58c9eed378dc3ae25dde2df2114b6217eba7bb9455964736f6c6343000813003360808060405234610016576124b6908161001c8239f35b600080fdfe608060408181526004908136101561001657600080fd5b600092833560e01c90816301ffc9a7146116de575080630668d0bb14610f3b578063248a9ca314610f115780632f2ff15d14610e915780633474a4a614610dc057806336568abe14610cf957806344004cc114610c255780634782f77914610bc2578063485cc955146108bf5780638c17030f146104475780639010d07c146103f857806391d14854146103a5578063a217fddf1461038a578063a971e8421461034e578063bad4366114610146578063ca15c8731461011e5763d547741f146100df57600080fd5b3461011a578060031936011261011a5761011791356101126001610101611829565b938387528660205286200154611b16565b611d81565b80f35b8280fd5b50903461011a57602060031936011261011a5760209282913581526001845220549051908152f35b503461011a57608060031936011261011a578135602490813567ffffffffffffffff9586821161034b575061017e903690860161184c565b9490610188611806565b9573ffffffffffffffffffffffffffffffffffffffff8716600052602097600289528660002085600052895260ff8760002054161597886101cf575b898989519015158152f35b9091929497508695989396517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008582019260601b16825260643560348201526034815261021b81611cbe565b51902090821161031e5760059382851b86519361023a86830186611cf6565b845284840190820191368311610319578590915b8383106103095750505050926000935b82518510156102f25784821b830184015190866000838310156102e55750506000528352846000205b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146102b8576001019361025e565b886011887f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b9190928252855220610287565b9496955050509450501490388080808080806101c4565b823581529181019186910161024e565b600080fd5b876041877f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b80fd5b83823461038657816003193601126103865760209073ffffffffffffffffffffffffffffffffffffffff60035460081c169051908152f35b5080fd5b83823461038657816003193601126103865751908152602090f35b50903461011a578160031936011261011a5773ffffffffffffffffffffffffffffffffffffffff826020946103d8611829565b93358152808652209116600052825260ff81600020541690519015158152f35b50903461011a578160031936011261011a5761043860209373ffffffffffffffffffffffffffffffffffffffff9235815260018552836024359120611fe9565b92905490519260031b1c168152f35b50903461011a5760c060031936011261011a5780359160249081359061046b611806565b906064359267ffffffffffffffff9485851694858103610319576084359687168097036103195760a435977f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280600052602093600085528660002033600052855260ff87600020541615610628575050868810801561061e575b6105f7579189979593917fabec13ca1773eed55d54d2f64593c33fa520ee45cac73a162f13928a2ebee2339a86948b60a073ffffffffffffffffffffffffffffffffffffffff60c09e9c9a519961053b8b611c73565b858b5288888c0152169889898201528a60608201528b608082015201525582600555847fffffffff000000000000000000000000000000000000000000000000000000007bffffffffffffffff00000000000000000000000000000000000000006006549360a01b1692161717600655857fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000060075416176007558660085582519788528701528501526060840152608083015260a0820152a180f35b84517f85d4a748000000000000000000000000000000000000000000000000000000008152fd5b50428811156104e5565b919450915061063633611e74565b85519161064283611cda565b604283528483019360603686378351156108925760308553835160019081101561086557607860218601536041905b80821161079d575050610742575061073e938693610710936107016048946106cc9a519a857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008d978801528251928391603789019101611c50565b8401917f206973206d697373696e6720726f6c6520000000000000000000000000000000603784015251809386840190611c50565b01036028810187520185611cf6565b519283927f08c379a00000000000000000000000000000000000000000000000000000000084528301611d37565b0390fd5b925050508160649451937f08c379a00000000000000000000000000000000000000000000000000000000085528401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015610838577f3031323334353637383961626364656600000000000000000000000000000000901a6107d98488611e34565b53881c91801561080b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610671565b8360118a7f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b8460328b7f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b826032897f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b506032867f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b50903461011a578160031936011261011a576108d96117e3565b906108e2611829565b6003549160ff8316610b9b5750907fffffffffffffffffffffff0000000000000000000000000000000000000000ff74ffffffffffffffffffffffffffffffffffffffff00610a2c949360081b16911617600355600080526020926000845273ffffffffffffffffffffffffffffffffffffffff8160002092169182600052845260ff81600020541615610b2f575b60008052600184818096526109898484600020612001565b507f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280600052600082528360002085600052825260ff84600020541615610ac4575b6000528181526109de8484600020612001565b507f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec80600052600082528360002085600052825260ff84600020541615610a59575b60005252600020612001565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600354161760035580f35b80600052600082528360002085600052825283600020837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4610a20565b80600052600082528360002085600052825283600020837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a46109cb565b6000805260008452806000208260005284528060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055338260007f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4610971565b84517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b503461011a578060031936011261011a5782808080610bdf6117e3565b610be761187d565b602435905af1610bf561235e565b5015610bff578280f35b517f750b219c000000000000000000000000000000000000000000000000000000008152fd5b83823461038657606060031936011261038657610cc773ffffffffffffffffffffffffffffffffffffffff61011792610cf3610c5f6117e3565b91610c68611829565b90610c7161187d565b517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff909116602482015260448035908201529384906064820190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101855284611cf6565b1661221b565b50919034610386578260031936011261038657610d14611829565b903373ffffffffffffffffffffffffffffffffffffffff831603610d3d57906101179135611d81565b60849060208551917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b50903461011a578260031936011261011a5760c09260a08351610de281611c73565b82815282602082015282858201528260608201528260808201520152815190610e0a82611c73565b5491828252600554602083019081526006548284019273ffffffffffffffffffffffffffffffffffffffff908183168552606086019167ffffffffffffffff9586809560a01c1684528460075416956080890196875260a060085499019889528351998a525160208a015251169087015251166060850152511660808301525160a0820152f35b503461011a578060031936011261011a57610f0d9135906001610eb2611829565b92808652602090868252610eca838589200154611b16565b806000526000825273ffffffffffffffffffffffffffffffffffffffff8460002095169485600052825260ff84600020541615610a595760005252600020612001565b5080f35b50903461011a57602060031936011261011a57816020936001923581528085522001549051908152f35b509060a060031936011261011a57610f516117e3565b602491823592610f5f611806565b67ffffffffffffffff929060843584811161123257610f81903690840161184c565b8560065460a01c16866007541680159182156116d4575b5081156116c9575b506116a157600854918261143d575b505050600554868102908082048814901517156114125773ffffffffffffffffffffffffffffffffffffffff918260065416838216908082036113d8575060643583811061137d5750806112a457508134036112485750505b60035460081c169286517f18160ddd0000000000000000000000000000000000000000000000000000000081526020818481885afa90811561123e578991611209575b50825490811515806111cc575b611192575050833b1561118e5787875180957f40c10f190000000000000000000000000000000000000000000000000000000082528183816110c08c8c8a84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1801561118457611125575b5050935173ffffffffffffffffffffffffffffffffffffffff90921682525060208101919091527ff32d98590495ee51bacb93809409a188e7ab8268b70b4c969d9da3a883c539f7915080604081015b0390a180f35b831161115a575050835261111f7ff32d98590495ee51bacb93809409a188e7ab8268b70b4c969d9da3a883c539f738806110cf565b604187917f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b87513d8a823e3d90fd5b8780fd5b606491888686938c51947fa92278300000000000000000000000000000000000000000000000000000000086528501528301526044820152fd5b508781018082116111de578210611058565b858b6011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b90506020813d8211611236575b8161122360209383611cf6565b8101031261123257513861104b565b8880fd5b3d9150611216565b88513d8b823e3d90fd5b61073e848a519384937f1eabcfbe0000000000000000000000000000000000000000000000000000000085523492850160409194939273ffffffffffffffffffffffffffffffffffffffff606083019616825260208201520152565b939894979496949593905034156112ef576064898b8a818b51937f1eabcfbe000000000000000000000000000000000000000000000000000000008552840152820152346044820152fd5b8698939597949651917f23b872dd000000000000000000000000000000000000000000000000000000006020840152338684015230604484015260648301526064825260a082018281108782111761135257895261134d919061221b565b611008565b858b6041877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8a517f1eabcfbe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84168188019081526020810186905260408101929092529081906060010390fd5b858c85896064948f51947f1eabcfbe0000000000000000000000000000000000000000000000000000000086528501528301526044820152fd5b83896011857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b338b52602091600283528a8c20848d52835260ff8b8d2054161580611528575b156114a6575050338a5260028152888a20918a525286882060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055388080610faf565b908b8692608089878f51967f265c66a80000000000000000000000000000000000000000000000000000000088528701528501528060848501527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81116103865791839160a49360051b80928585013733604484015260648301528101030190fd5b50999690959a989293879892959851868101907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1682528b60348201526034815261157681611cbe565b51902094828c116116765788519560059594939291908d871b8e61159c8b83018b611cf6565b89528a01898901368211611672578a8c915b8383106116625750505050988c995b88518b1015611649578a881b89018a0151908e8282101561163b575289528a8d205b997fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461161057600101996115bd565b8f8e60118f7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b9190915289528a8d206115df565b919650939a97949b9d9850859196509b91989b1461145d565b82358152918101918c91016115ae565b8e80fd5b8c8b60418c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8389517f3f886774000000000000000000000000000000000000000000000000000000008152fd5b905042101538610fa0565b4210915038610f98565b8490843461011a57602060031936011261011a57357fffffffff00000000000000000000000000000000000000000000000000000000811680910361011a57602092507fbe0b7712000000000000000000000000000000000000000000000000000000008114908115611753575b5015158152f35b7f5a05180f00000000000000000000000000000000000000000000000000000000811491508115611786575b508361174c565b7f7965db0b000000000000000000000000000000000000000000000000000000008114915081156117b9575b508361177f565b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014836117b2565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361031957565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361031957565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361031957565b9181601f840112156103195782359167ffffffffffffffff8311610319576020808501948460051b01011161031957565b3360009081527f20be27040b8e00df40bca0df34743417f3574a156386188f7d7f14369e5ee82b60209081526040808320549092907f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec9060ff16156118e25750505050565b6118eb33611e74565b8451916118f783611cda565b60428352848301936060368637835115611ae95760308553835190600191821015611ae95790607860218601536041915b818311611a1e575050506119c2576106cc9385936119929361198360489461073e995198857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008b978801528251928391603789019101611c50565b01036028810185520183611cf6565b519182917f08c379a000000000000000000000000000000000000000000000000000000000835260048301611d37565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015611abc577f3031323334353637383961626364656600000000000000000000000000000000901a611a5b8588611e34565b5360041c928015611a8f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190611928565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b6000818152602090808252604092838220338352835260ff848320541615611b3e5750505050565b611b4733611e74565b845191611b5383611cda565b60428352848301936060368637835115611ae95760308553835190600191821015611ae95790607860218601536041915b818311611bdf575050506119c2576106cc9385936119929361198360489461073e995198857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008b978801528251928391603789019101611c50565b909192600f81166010811015611abc577f3031323334353637383961626364656600000000000000000000000000000000901a611c1c8588611e34565b5360041c928015611a8f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190611b84565b60005b838110611c635750506000910152565b8181015183820152602001611c53565b60c0810190811067ffffffffffffffff821117611c8f57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff821117611c8f57604052565b6080810190811067ffffffffffffffff821117611c8f57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117611c8f57604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60409360208452611d7a8151809281602088015260208888019101611c50565b0116010190565b906040611dcc926000908082528160205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff8383205416611dcf575b81526001602052206120c2565b50565b808252816020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4611dbf565b908151811015611e45570160200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190611e8182611cbe565b602a8252602082016040368237825115611e4557603090538151600190811015611e4557607860218401536029905b808211611f1e575050611ec05790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015611fbb577f3031323334353637383961626364656600000000000000000000000000000000901a611f5a8486611e34565b5360041c918015611f8d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190611eb0565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8054821015611e455760005260206000200190600090565b919060018301600090828252806020526040822054156000146120bc578454946801000000000000000086101561208f578361207f61204a886001604098999a01855584611fe9565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014612214577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff918281018181116121e7578254908482019182116121ba57808203612185575b505050805480156121585782019161213b8383611fe9565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b6121a561219561204a9386611fe9565b90549060031b1c92839286611fe9565b90558652846020526040862055388080612123565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b73ffffffffffffffffffffffffffffffffffffffff1690604051604081019080821067ffffffffffffffff831117611c8f5761229b916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af161229561235e565b916123bc565b80519182159184831561233a575b5050509050156122b65750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b9193818094500103126103865782015190811515820361034b5750803880846122a9565b3d156123b7573d9067ffffffffffffffff8211611c8f57604051916123ab60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184611cf6565b82523d6000602084013e565b606090565b9192901561243757508151156123d0575090565b3b156123d95790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b82519091501561244a5750805190602001fd5b61073e906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260048301611d3756fea26469706673582212209f37eab5b9ee7f4712182c88f56ac6041c6dd2dc3e533abce5b326ab2343314564736f6c63430008130033', + '60806040523461002f576100196100146100fa565b610169565b610021610034565b6125d461039782396125d490f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118616f378038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b613b2a810181811060018060401b038211176101c5576101a18291613b2a61296b843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa261649585396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610403565b61001e60003561008d565b80631a4b671d146100885780631bce45831461008357806359659e901461007e57806369b3934d14610079578063715018a6146100745780638da5cb5b1461006f5763f2fde38b0361000e576103d0565b61039b565b610368565b61032c565b6102f7565b610215565b6101b4565b60e01c90565b60405190565b600080fd5b600080fd5b90565b6100af816100a3565b036100b657565b600080fd5b905035906100c8826100a6565b565b60018060a01b031690565b6100de906100ca565b90565b6100ea816100d5565b036100f157565b600080fd5b90503590610103826100e1565b565b90565b61011181610105565b0361011857565b600080fd5b9050359061012a82610108565b565b909160c08284031261018c5761014583600084016100bb565b9261015381602085016100f6565b9261016182604083016100f6565b9261018961017284606085016100f6565b9361018081608086016100f6565b9360a00161011d565b90565b61009e565b61019a906100d5565b9052565b91906101b290600060208501940190610191565b565b346101eb576101e76101d66101ca36600461012c565b9493909392919261052f565b6101de610093565b9182918261019e565b0390f35b610099565b9060208282031261020a57610207916000016100f6565b90565b61009e565b60000190565b346102435761022d6102283660046101f0565b61068c565b610235610093565b8061023f8161020f565b0390f35b610099565b600091031261025357565b61009e565b1c90565b60018060a01b031690565b61027790600861027c9302610258565b61025c565b90565b9061028a9154610267565b90565b61029a600160009061027f565b90565b90565b6102b46102af6102b9926100ca565b61029d565b6100ca565b90565b6102c5906102a0565b90565b6102d1906102bc565b90565b6102dd906102c8565b9052565b91906102f5906000602085019401906102d4565b565b3461032757610307366004610248565b61032361031261028d565b61031a610093565b918291826102e1565b0390f35b610099565b346103635761035f61034e61034236600461012c565b949390939291926106fa565b610356610093565b9182918261019e565b0390f35b610099565b3461039657610378366004610248565b61038061087f565b610388610093565b806103928161020f565b0390f35b610099565b346103cb576103ab366004610248565b6103c76103b66108b5565b6103be610093565b9182918261019e565b0390f35b610099565b346103fe576103e86103e33660046101f0565b6109c2565b6103f0610093565b806103fa8161020f565b0390f35b610099565b600080fd5b600090565b610416906100a3565b9052565b61042390610105565b9052565b909594926104739461046261046c9261045860809661044e60a088019c600089019061040d565b6020870190610191565b6040850190610191565b6060830190610191565b019061041a565b565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061049f90610475565b810190811067ffffffffffffffff8211176104b957604052565b61047f565b60200190565b5190565b906104db6104d4610093565b9283610495565b565b67ffffffffffffffff81116104fb576104f7602091610475565b0190565b61047f565b9061051261050d836104dd565b6104c8565b918252565b6105216000610500565b90565b61052c610517565b90565b61056e9291946105909661055f92610545610408565b509395919091610553610093565b96879560208701610427565b60208201810382520382610495565b61058061057a826104c4565b916104be565b209061058a610524565b91610aa1565b90565b6105a49061059f610bba565b6105f9565b565b60001c90565b6105b86105bd916105a6565b61025c565b90565b6105ca90546105ac565b90565b600080fd5b60e01b90565b60009103126105e357565b61009e565b6105f0610093565b3d6000823e3d90fd5b61060b61060660016105c0565b6102c8565b90633659cfe690823b1561068757610643926106386000809461062c610093565b968795869485936105d2565b83526004830161019e565b03925af1801561068257610655575b50565b6106759060003d811161067b575b61066d8183610495565b8101906105d8565b38610652565b503d610663565b6105e8565b6105cd565b61069590610593565b565b6106a0906102a0565b90565b6106ac90610697565b90565b6106b8906102bc565b90565b6106f16106f8946106e76060949897956106dd608086019a6000870190610191565b6020850190610191565b6040830190610191565b019061041a565b565b9061075c9193929361070a610408565b5061073a859161072b86898b9161071f610093565b96879560208701610427565b60208201810382520382610495565b61074c610746826104c4565b916104be565b2090610756610524565b91610cad565b9361076e610769866106a3565b6106af565b906363acc14d93929490823b15610829576000946107aa869261079f94610793610093565b998a98899788966105d2565b8652600486016106bb565b03925af18015610824576107f7575b50806107f17fe3fc4d8c7984f762222579e0c4564a72a74f96cde3f6bae2751d01108c6ec240916107e8610093565b9182918261019e565b0390a190565b6108179060003d811161081d575b61080f8183610495565b8101906105d8565b386107b9565b503d610805565b6105e8565b6105cd565b610836610bba565b61083e61086b565b565b90565b61085761085261085c92610840565b61029d565b6100ca565b90565b61086890610843565b90565b61087d610878600061085f565b610e3c565b565b61088761082e565b565b60018060a01b031690565b6108a06108a5916105a6565b610889565b90565b6108b29054610894565b90565b6108bd610408565b506108c860006108a8565b90565b6108dc906108d7610bba565b610991565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b61094260266040926108de565b61094b816108e7565b0190565b6109659060208101906000818303910152610935565b90565b1561096f57565b610977610093565b62461bcd60e51b81528061098d6004820161094f565b0390fd5b6109c0906109bb816109b46109ae6109a9600061085f565b6100d5565b916100d5565b1415610968565b610e3c565b565b6109cb906108cb565b565b90565b6109dc6109e191610105565b6109cd565b9052565b60601b90565b6109f4906109e5565b90565b610a00906109eb565b90565b610a0f610a14916100d5565b6109f7565b9052565b905090565b60005b838110610a31575050906000910152565b806020918301518185015201610a20565b610a67610a5e92602092610a55816104c4565b94858093610a18565b93849101610a1d565b0190565b60148093610a8f602084610a87610a9796610a9e9b9a986109d0565b018092610a03565b018092610a03565b0190610a42565b90565b610b349291610ade610aed92610ab5610408565b509193610aca610ac560016105c0565b6102c8565b610ad2610093565b95869460208601610a6b565b60208201810382520382610495565b610aff610af9826104c4565b916104be565b2061148a610b0f602082016104c8565b908082526111156020830139610b2d610b27826104c4565b916104be565b2090610ea9565b90565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6b602080926108de565b610b7481610b37565b0190565b610b8e9060208101906000818303910152610b5f565b90565b15610b9857565b610ba0610093565b62461bcd60e51b815280610bb660048201610b78565b0390fd5b610be4610bc56108b5565b610bde610bd8610bd3610eca565b6100d5565b916100d5565b14610b91565b565b610bfa610bf5610bff92610840565b61029d565b6100a3565b90565b610c0b906102a0565b90565b610c1790610c02565b90565b610c23906102a0565b90565b610c2f90610c1a565b90565b610c3b906102bc565b90565b60209181520190565b610c66610c6f602093610c7493610c5d816104c4565b93848093610c3e565b95869101610a1d565b610475565b0190565b610c9d610caa949293610c9360608401956000850190610191565b6020830190610191565b6040818403910152610c47565b90565b610d3d9093929193610cbd610408565b50610cfd8591610cee610cd8610cd360016105c0565b6102c8565b8690610ce2610093565b95869460208601610a6b565b60208201810382520382610495565b610d0f610d09826104c4565b916104be565b2061148a610d1f602082016104c8565b908082526111156020830139610d386000929192610be6565b611062565b92610d57610d52610d4d86610c0e565b610c26565b610c32565b63cf7a1d779190610d70610d6b60016105c0565b6102c8565b9392813b15610de7576000610d9891610da38296610d8c610093565b988997889687956105d2565b855260048501610c78565b03925af18015610de257610db5575b50565b610dd59060003d8111610ddb575b610dcd8183610495565b8101906105d8565b38610db2565b503d610dc3565b6105e8565b6105cd565b60001b90565b90610e0360018060a01b0391610dec565b9181191691161790565b610e16906102bc565b90565b90565b90610e31610e2c610e3892610e0d565b610e19565b8254610df2565b9055565b610e4660006108a8565b610e51826000610e1c565b90610e85610e7f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610e0d565b91610e0d565b91610e8e610093565b80610e988161020f565b0390a3565b610ea6906102bc565b90565b90610ec791610eb6610408565b5090610ec130610e9d565b916110eb565b90565b610ed2610408565b503390565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b610f0c601d6020926108de565b610f1581610ed7565b0190565b610f2f9060208101906000818303910152610eff565b90565b15610f3957565b610f41610093565b62461bcd60e51b815280610f5760048201610f19565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b610f8f602080926108de565b610f9881610f5b565b0190565b610fb29060208101906000818303910152610f83565b90565b15610fbc57565b610fc4610093565b62461bcd60e51b815280610fda60048201610f9c565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61101360196020926108de565b61101c81610fde565b0190565b6110369060208101906000818303910152611006565b90565b1561104057565b611048610093565b62461bcd60e51b81528061105e60048201611020565b0390fd5b91909161106d610408565b5061109461107a30610e9d565b3161108d611087846100a3565b916100a3565b1015610f32565b6110ba6110a0836104c4565b6110b36110ad6000610be6565b916100a3565b1415610fb5565b60208251920190f5906110e9826110e26110dc6110d7600061085f565b6100d5565b916100d5565b1415611039565b565b90605592600b926110fa610408565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a26469706673582212206bc6c1471f4cc9c60143b475e599cedd261b753a87093c41a9601e41752618c964736f6c634300081b0033608060405234601c57600e6020565b613afe61002c8239613afe90f35b6026565b60405190565b600080fdfe60806040526004361015610013575b610ba7565b61001e60003561015d565b806301ffc9a7146101585780630668d0bb146101535780630bb310de1461014e578063248a9ca3146101495780632f2ff15d146101445780633474a4a61461013f57806336568abe1461013a57806344004cc1146101355780634782f7791461013057806363acc14d1461012b5780638c17030f146101265780639010d07c1461012157806391d148541461011c5780639d043a6614610117578063a217fddf14610112578063a971e8421461010d578063bad4366114610108578063ca15c87314610103578063d547741f146100fe5763ed4c2ac70361000e57610b74565b610b40565b610b0b565b610aaf565b610a17565b6109e2565b61096f565b6108a4565b61086e565b6107e3565b610723565b6106a8565b610646565b6105d7565b6105a2565b610499565b610436565b61039a565b61034b565b6101ef565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b61018d81610178565b0361019457565b600080fd5b905035906101a682610184565b565b906020828203126101c2576101bf91600001610199565b90565b61016e565b151590565b6101d5906101c7565b9052565b91906101ed906000602085019401906101cc565b565b3461021f5761021b61020a6102053660046101a8565b610bb1565b610212610163565b918291826101d9565b0390f35b610169565b60018060a01b031690565b61023890610224565b90565b6102448161022f565b0361024b57565b600080fd5b9050359061025d8261023b565b565b90565b61026b8161025f565b0361027257565b600080fd5b9050359061028482610262565b565b600080fd5b600080fd5b600080fd5b909182601f830112156102cf5781359167ffffffffffffffff83116102ca5760200192602083028401116102c557565b610290565b61028b565b610286565b91909160a081840312610340576102ee8360008301610250565b926102fc8160208401610277565b9261030a8260408501610250565b926103188360608301610277565b92608082013567ffffffffffffffff811161033b576103379201610295565b9091565b610173565b61016e565b60000190565b6103656103593660046102d4565b94939093929192610d21565b61036d610163565b8061037781610345565b0390f35b906020828203126103955761039291600001610250565b90565b61016e565b346103c8576103b26103ad36600461037b565b610f69565b6103ba610163565b806103c481610345565b0390f35b610169565b90565b6103d9816103cd565b036103e057565b600080fd5b905035906103f2826103d0565b565b9060208282031261040e5761040b916000016103e5565b90565b61016e565b61041c906103cd565b9052565b919061043490600060208501940190610413565b565b346104665761046261045161044c3660046103f4565b610fc7565b610459610163565b91829182610420565b0390f35b610169565b9190604083820312610494578061048861049192600086016103e5565b93602001610250565b90565b61016e565b346104c8576104b26104ac36600461046b565b90611012565b6104ba610163565b806104c481610345565b0390f35b610169565b60009103126104d857565b61016e565b6104e69061025f565b9052565b6104f39061022f565b9052565b67ffffffffffffffff1690565b61050d906104f7565b9052565b61051a906103cd565b9052565b9060a08061058a93610538600082015160008601906104dd565b61054a602082015160208601906104dd565b61055c604082015160408601906104ea565b61056e60608201516060860190610504565b61058060808201516080860190610504565b0151910190610511565b565b91906105a090600060c0850194019061051e565b565b346105d2576105b23660046104cd565b6105ce6105bd61122e565b6105c5610163565b9182918261058c565b0390f35b610169565b34610606576105f06105ea36600461046b565b906112f7565b6105f8610163565b8061060281610345565b0390f35b610169565b90916060828403126106415761063e6106278460008501610250565b936106358160208601610250565b93604001610277565b90565b61016e565b346106755761065f61065936600461060b565b91611396565b610667610163565b8061067181610345565b0390f35b610169565b91906040838203126106a357806106976106a09260008601610250565b93602001610277565b90565b61016e565b346106d7576106c16106bb36600461067a565b9061149c565b6106c9610163565b806106d381610345565b0390f35b610169565b60808183031261071e576106f38260008301610250565b9261071b6107048460208501610250565b936107128160408601610250565b936060016103e5565b90565b61016e565b346107555761073f6107363660046106dc565b9291909161158a565b610747610163565b8061075181610345565b0390f35b610169565b610763816104f7565b0361076a57565b600080fd5b9050359061077c8261075a565b565b909160c0828403126107de576107978360008401610277565b926107a58160208501610277565b926107b38260408301610250565b926107db6107c4846060850161076f565b936107d2816080860161076f565b9360a0016103e5565b90565b61016e565b34610818576108026107f636600461077e565b94939093929192611a34565b61080a610163565b8061081481610345565b0390f35b610169565b9190604083820312610846578061083a61084392600086016103e5565b93602001610277565b90565b61016e565b6108549061022f565b9052565b919061086c9060006020850194019061084b565b565b3461089f5761089b61088a61088436600461081d565b90611a64565b610892610163565b91829182610858565b0390f35b610169565b346108d5576108d16108c06108ba36600461046b565b90611aa4565b6108c8610163565b918291826101d9565b0390f35b610169565b600080fd5b908160c09103126108ed5790565b6108da565b908160e09103126109005790565b6108da565b9160608383031261096a5761091d8260008501610250565b92602081013567ffffffffffffffff8111610965578361093e9183016108df565b92604082013567ffffffffffffffff81116109605761095d92016108f2565b90565b610173565b610173565b61016e565b346109a05761099c61098b610985366004610905565b91611dc7565b610993610163565b91829182610420565b0390f35b610169565b90565b60001b90565b6109c26109bd6109c7926109a5565b6109a8565b6103cd565b90565b6109d460006109ae565b90565b6109df6109ca565b90565b34610a12576109f23660046104cd565b610a0e6109fd6109d7565b610a05610163565b91829182610420565b0390f35b610169565b34610a4757610a273660046104cd565b610a43610a32611e68565b610a3a610163565b91829182610858565b0390f35b610169565b91608083830312610aaa57610a6482600085016103e5565b9260208101359167ffffffffffffffff8311610aa557610a8984610aa2948401610295565b939094610a998160408601610250565b936060016103e5565b90565b610173565b61016e565b34610ae357610adf610ace610ac5366004610a4c565b93929092611fa4565b610ad6610163565b918291826101d9565b0390f35b610169565b610af19061025f565b9052565b9190610b0990600060208501940190610ae8565b565b34610b3b57610b37610b26610b213660046103f4565b61204c565b610b2e610163565b91829182610af5565b0390f35b610169565b34610b6f57610b59610b5336600461046b565b9061209c565b610b61610163565b80610b6b81610345565b0390f35b610169565b34610ba257610b8c610b873660046103f4565b6120d0565b610b94610163565b80610b9e81610345565b0390f35b610169565b600080fd5b600090565b610bb9610bac565b5080610bd4610bce635f05bb8960e11b610178565b91610178565b148015610bf8575b908115610be8575b5090565b610bf29150612115565b38610be4565b50610c02816120db565b610bdc565b60081c90565b60018060a01b031690565b610c24610c2991610c07565b610c0d565b90565b610c369054610c18565b90565b90565b610c50610c4b610c5592610224565b610c39565b610224565b90565b610c6190610c3c565b90565b610c6d90610c58565b90565b610c7990610c3c565b90565b610c8590610c70565b90565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b90610cb790610c8d565b810190811067ffffffffffffffff821117610cd157604052565b610c97565b60e01b90565b6000910312610ce757565b61016e565b916020610d0e929493610d076040820196600083019061084b565b0190610ae8565b565b610d18610163565b3d6000823e3d90fd5b93610d34939591958693909192936122b6565b610d4e610d49610d446005610c2c565b610c64565b610c7c565b632e73e0fd828492803b15610eae57610d7b60008094610d86610d6f610163565b97889687958694610cd6565b845260048401610cec565b03925af19081610e81575b5015600014610e7c576001610dde575b5b907ff32d98590495ee51bacb93809409a188e7ab8268b70b4c969d9da3a883c539f791610dd9610dd0610163565b92839283610cec565b0390a1565b610df8610df3610dee6005610c2c565b610c64565b610c7c565b6340c10f19828492803b15610e7757610e2560008094610e30610e19610163565b97889687958694610cd6565b845260048401610cec565b03925af18015610e7257610e45575b50610da1565b610e659060003d8111610e6b575b610e5d8183610cad565b810190610cdc565b38610e3f565b503d610e53565b610d10565b610c88565b610da2565b610ea19060003d8111610ea7575b610e998183610cad565b810190610cdc565b38610d91565b503d610e8f565b610c88565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b610ef090610eeb610ee6610eb3565b61251a565b610f54565b565b610efb90610c3c565b90565b610f0790610ef2565b90565b90610f1b60018060a01b03916109a8565b9181191691161790565b610f2e90610ef2565b90565b90565b90610f49610f44610f5092610f25565b610f31565b8254610f0a565b9055565b610f60610f6791610efe565b6003610f34565b565b610f7290610ed7565b565b600090565b610f82906103cd565b90565b90610f8f90610f79565b600052602052604060002090565b60001c90565b90565b610fb2610fb791610f9d565b610fa3565b90565b610fc49054610fa6565b90565b6001610fe0610fe692610fd8610f74565b506000610f85565b01610fba565b90565b9061100491610fff610ffa82610fc7565b61251a565b611006565b565b906110109161252e565b565b9061101c91610fe9565b565b9061103161102a610163565b9283610cad565b565b61103d60c061101e565b90565b600090565b600090565b600090565b600090565b61105c611033565b90602080808080808761106d611040565b815201611078611040565b815201611083611045565b81520161108e61104a565b81520161109961104a565b8152016110a461104f565b81525050565b6110b2611054565b90565b90565b6110c46110c991610f9d565b6110b5565b90565b6110d690546110b8565b90565b906110e39061025f565b9052565b6110f36110f891610f9d565b610c0d565b90565b61110590546110e7565b90565b906111129061022f565b9052565b60a01c90565b67ffffffffffffffff1690565b61113561113a91611116565b61111c565b90565b6111479054611129565b90565b90611154906104f7565b9052565b61116461116991610f9d565b61111c565b90565b6111769054611158565b90565b90611183906103cd565b9052565b906112206112176004611198611033565b946111b16111a8600083016110cc565b600088016110d9565b6111c96111c0600183016110cc565b602088016110d9565b6111e16111d8600283016110fb565b60408801611108565b6111f96111f06002830161113d565b6060880161114a565b6112116112086003830161116c565b6080880161114a565b01610fba565b60a08401611179565b565b61122b90611187565b90565b6112366110aa565b506112416006611222565b90565b60209181520190565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b6112a8602f604092611244565b6112b18161124d565b0190565b6112cb906020810190600081830391015261129b565b90565b156112d557565b6112dd610163565b62461bcd60e51b8152806112f3600482016112b5565b0390fd5b906113249161131f8261131961131361130e612558565b61022f565b9161022f565b146112ce565b612565565b565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec90565b90611365929161136061135b611326565b61251a565b61137f565b565b61137090610c3c565b90565b61137c90611367565b90565b9161138c61139493611373565b9190916125c0565b565b906113a1929161134a565b565b906113bd916113b86113b3611326565b61251a565b61144a565b565b905090565b6113d0600080926113bf565b0190565b6113dd906113c4565b90565b67ffffffffffffffff81116113fe576113fa602091610c8d565b0190565b610c97565b90611415611410836113e0565b61101e565b918252565b606090565b3d60001461143c576114303d611403565b903d6000602084013e5b565b61144461141a565b9061143a565b60006114799281929061145b610163565b9081611466816113d4565b03925af161147261141f565b50156101c7565b61147f57565b6000631d42c86760e21b81528061149860048201610345565b0390fd5b906114a6916113a3565b565b60ff1690565b6114ba6114bf91610f9d565b6114a8565b90565b6114cc90546114ae565b90565b60081b90565b906114e8610100600160a81b03916114cf565b9181191691161790565b6114fb90610c70565b90565b90565b9061151661151161151d926114f2565b6114fe565b82546114d5565b9055565b7f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c290565b9061155160ff916109a8565b9181191691161790565b611564906101c7565b90565b90565b9061157f61157a6115869261155b565b611567565b8254611545565b9055565b92909261159760056114c2565b6115f5576115a96115e7946005611501565b6115bb6115b46109ca565b829061252e565b6115cd6115c6611521565b829061252e565b6115df6115d8611326565b829061252e565b91909161260b565b6115f36001600561156a565b565b600063f92ee8a960e01b81528061160e60048201610345565b0390fd5b90611630959493929161162b611626611521565b61251a565b6118fd565b565b61164661164161164b926104f7565b610c39565b61025f565b90565b61166261165d611667926109a5565b610c39565b61025f565b90565b61167460c061101e565b90565b611681905161025f565b90565b90611691600019916109a8565b9181191691161790565b6116af6116aa6116b49261025f565b610c39565b61025f565b90565b90565b906116cf6116ca6116d69261169b565b6116b7565b8254611684565b9055565b6116e4905161022f565b90565b906116fc6116f7611703926114f2565b6114fe565b8254610f0a565b9055565b61171190516104f7565b90565b60a01b90565b9061173067ffffffffffffffff60a01b91611714565b9181191691161790565b61174e611749611753926104f7565b610c39565b6104f7565b90565b90565b9061176e6117696117759261173a565b611756565b825461171a565b9055565b9061178c67ffffffffffffffff916109a8565b9181191691161790565b906117ab6117a66117b29261173a565b611756565b8254611779565b9055565b6117c090516103cd565b90565b6117cc90610f9d565b90565b906117e46117df6117eb92610f79565b6117c3565b8254611684565b9055565b9061188060a06004611886946118146000820161180e60008801611677565b906116ba565b61182d6001820161182760208801611677565b906116ba565b61184660028201611840604088016116da565b906116e7565b61185f6002820161185960608801611707565b90611759565b6118786003820161187260808801611707565b90611796565b0192016117b6565b906117cf565b565b90611892916117ef565b565b61189d906104f7565b9052565b91946118ea6118f4929897956118e060a0966118d66118fb9a6118cc60c08a019e60008b0190610ae8565b6020890190610ae8565b604087019061084b565b6060850190611894565b6080830190611894565b0190610413565b565b91939092948161191561190f886104f7565b916104f7565b108015611a19575b6119fc578261193561192f600061164e565b9161025f565b146119df57826119a16119da9461199a876119918a6119888d61197f8b936119768c9761196d61196361166a565b9b60008d016110d9565b60208b016110d9565b60408901611108565b6060870161114a565b6080850161114a565b60a08301611179565b6006611888565b9394959190917fabec13ca1773eed55d54d2f64593c33fa520ee45cac73a162f13928a2ebee233966119d1610163565b968796876118a1565b0390a1565b60006310ba94e960e31b8152806119f860048201610345565b0390fd5b60006310ba94e960e31b815280611a1560048201610345565b0390fd5b5081611a2d611a274261025f565b91611632565b111561191d565b90611a429594939291611612565b565b600090565b90611a5390610f79565b600052602052604060002090565b90565b90611a84611a7f611a8993611a77611a44565b506001611a49565b611a61565b61265b565b90565b90611a96906114f2565b600052602052604060002090565b611acb916000611ac0611ac693611ab9610bac565b5082610f85565b01611a8c565b6114c2565b90565b60018060a01b031690565b611ae5611aea91610f9d565b611ace565b90565b611af79054611ad9565b90565b611b0390610c70565b90565b90505190611b13826103d0565b565b90602082820312611b2f57611b2c91600001611b06565b90565b61016e565b50611b43906020810190610250565b90565b50611b55906020810190610199565b90565b611b6190610178565b9052565b50611b749060208101906103e5565b90565b600080fd5b600080fd5b600080fd5b9035600160200382360303811215611bc757016020813591019167ffffffffffffffff8211611bc2576001820236038313611bbd57565b611b7c565b611b77565b611b81565b60209181520190565b90826000939282370152565b9190611bfb81611bf481611c0095611bcc565b8095611bd5565b610c8d565b0190565b9035600160400382360303811215611c1a570190565b611b81565b9035600160200382360303811215611c6057016020813591019167ffffffffffffffff8211611c5b576001820236038313611c5657565b611b7c565b611b77565b611b81565b60209181520190565b9190611c8881611c8181611c8d95611c65565b8095611bd5565b610c8d565b0190565b50611ca090602081019061076f565b90565b90611ce1906020611cd9611ccf60408401611cc16000880188611c1f565b908683036000880152611c6e565b9482810190611c91565b910190610504565b90565b611d8e91611d80611d7560c08301611d0c611d026000870187611b34565b60008601906104ea565b611d26611d1c6020870187611b46565b6020860190611b58565b611d40611d366040870187611b65565b6040860190610511565b611d5a611d506060870187611b65565b6060860190610511565b611d676080860186611b86565b908583036080870152611be1565b9260a0810190611c04565b9060a0818403910152611ca3565b90565b939290611dbd604091611dc594611db0606089019260008a019061084b565b8782036020890152611ce4565b940190610413565b565b9150602090611dd4610f74565b50611de7611de26003611aed565b611afa565b611e13633808a90b949294611e1e611dff6004610fba565b611e07610163565b97889687958695610cd6565b855260048501611d91565b03915afa908115611e6357600091611e35575b5090565b611e56915060203d8111611e5c575b611e4e8183610cad565b810190611b15565b38611e31565b503d611e44565b610d10565b611e70611a44565b50611e7b6005610c2c565b90565b90611e88906114f2565b600052602052604060002090565b90611ea090610f79565b600052602052604060002090565b60601b90565b611ebd90611eae565b90565b611ec990611eb4565b90565b611ed8611edd9161022f565b611ec0565b9052565b90565b611ef0611ef5916103cd565b611ee1565b9052565b601481611f0c611f149360209695611ecc565b018092611ee4565b0190565b60200190565b5190565b67ffffffffffffffff8111611f3a5760208091020190565b610c97565b90929192611f54611f4f82611f22565b61101e565b9381855260208086019202830192818411611f9157915b838310611f785750505050565b60208091611f8684866103e5565b815201920191611f6b565b610290565b611fa1913691611f3f565b90565b9093929192611fb1610bac565b50611fd9611fd3611fce611fc760028790611e7e565b8590611e96565b6114c2565b156101c7565b9485611fe8575b505050505090565b61203d95509061201f6120389392959294612010612004610163565b93849260208401611ef9565b60208201810382520382610cad565b61203161202b82611f1e565b91611f18565b2093611f96565b612694565b3880808080611fe0565b600090565b61206b6120666120709261205e612047565b506001611a49565b611a61565b6126be565b90565b9061208e9161208961208482610fc7565b61251a565b612090565b565b9061209a91612565565b565b906120a691612073565b565b6120c1906120bc6120b7610eb3565b61251a565b6120c3565b565b6120ce9060046117cf565b565b6120d9906120a8565b565b6120e3610bac565b50806120f86120f26000610178565b91610178565b14908115612105575b5090565b61210f91506126de565b38612101565b61211d610bac565b50612127816126de565b908115612133575b5090565b61213d915061271e565b3861212f565b91602061216592949361215e60408201966000830190610ae8565b0190610ae8565b565b634e487b7160e01b600052601160045260246000fd5b61218c6121929193929361025f565b9261025f565b820391821161219d57565b612167565b600090565b6121b66121bc9193929361025f565b9261025f565b916121c883820261025f565b9281840414901517156121d757565b612167565b6121e59061164e565b9052565b60409061221361221a94969593966122096060840198600085019061084b565b6020830190610ae8565b01906121dc565b565b60409061224661224d949695939661223c6060840198600085019061084b565b6020830190610ae8565b0190610ae8565b565b61226361225e612268926109a5565b610c39565b610224565b90565b6122749061224f565b90565b61228090610c70565b90565b6040906122ad6122b494969593966122a36060840198600085019061084b565b60208301906121dc565b0190610ae8565b565b91939290926122f06122cb600260060161113d565b6122ea6122e46122de600360060161116c565b92611632565b91611632565b9061275e565b6124fd5761230160006006016110cc565b61231361230d8561025f565b9161025f565b106124d0578291612361916123426123739561233c600060060191612337836110cc565b61217d565b906116ba565b61234f6004600601610fba565b9190339161235b6121a2565b93612855565b61236e60016006016110cc565b6121a7565b918161239361238d61238860026006016110fb565b61022f565b9161022f565b036124a257806123ab6123a58561025f565b9161025f565b1061247f5750806123cd6123c76123c2600061226b565b61022f565b9161022f565b1460001461241257346123e86123e28461025f565b9161025f565b036123f25750505b565b61240e346000938493630f55e7df60e11b85526004850161221c565b0390fd5b9034612427612421600061164e565b9161025f565b1160001461245c57612439600061226b565b600090612458346000938493630f55e7df60e11b855260048501612283565b0390fd5b61246861247a92611373565b903361247330612277565b9192612928565b6123f0565b8261249e8391926000938493630f55e7df60e11b85526004850161221c565b0390fd5b826124b060026006016110fb565b6124cc600080938493630f55e7df60e11b8552600485016121e9565b0390fd5b826124de60006006016110cc565b6124f96000928392639e4c446160e01b845260048401612143565b0390fd5b6000630fe219dd60e21b81528061251660048201610345565b0390fd5b61252c90612526612558565b90612ae4565b565b9061255061254b61255593612544818590612b7d565b6001611a49565b611a61565b612c63565b50565b612560611a44565b503390565b9061258761258261258c9361257b818590612c9e565b6001611a49565b611a61565b612d37565b50565b61259890610c70565b90565b63ffffffff1690565b6125b86125b36125bd9261259b565b610cd6565b610178565b90565b916126046004926125f561260995936125dc63a9059cbb6125a4565b926125e5610163565b9687946020860190815201610cec565b60208201810382520383610cad565b612ee5565b565b90612621612626939261261c610eb3565b61252e565b612f52565b565b90565b61263761263c91610f9d565b61169b565b90565b61265361264e6126589261025f565b610c39565b610224565b90565b6126876126826126919361267d600061268c95612676611a44565b5001612628565b612fea565b61262b565b61263f565b610c70565b90565b6126ae6126ba92936126b4926126a8610bac565b5061303f565b926103cd565b916103cd565b1490565b6126d660006126db926126cf612047565b5001612628565b6130aa565b90565b6126e6610bac565b50806127016126fb635a05180f60e01b610178565b91610178565b1490811561270e575b5090565b61271891506130c2565b3861270a565b612726610bac565b508061274161273b634e821d3360e11b610178565b91610178565b1490811561274e575b5090565b61275891506120db565b3861274a565b612766610bac565b508161277b612775600061164e565b9161025f565b149081156127ae575b50908115612791575b5090565b90506127a66127a0429261025f565b9161025f565b10153861278d565b90506127c36127bd429261025f565b9161025f565b1038612784565b60209181520190565b600080fd5b9037565b9091826127e8916127ca565b9160018060fb1b03811161280b578291602061280792029384916127d8565b0190565b6127d3565b9061284161284c916128539698979560609561283460808701936000880190610413565b85830360208701526127dc565b96604083019061084b565b0190610413565b565b92938361287361286d61286860006109ae565b6103cd565b916103cd565b03612880575b5050505050565b61289861289285848689918693611fa4565b156101c7565b6128c857505050906128b96128be926128b46001936002611e7e565b611e96565b61156a565b3880808080612879565b846128f1918593949190916128db610163565b9586956304cb8cd560e31b875260048701612810565b0390fd5b60409061291f61292694969593966129156060840198600085019061084b565b602083019061084b565b0190610ae8565b565b612975939161296160049461297093946129456323b872dd6125a4565b93919091612951610163565b97889560208701908152016128f5565b60208201810382520383610cad565b612ee5565b565b90565b61298e61298961299392612977565b610c39565b61025f565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b6129cf60178092612996565b6129d88161299b565b0190565b5190565b60005b8381106129f4575050906000910152565b8060209183015181850152016129e3565b612a2a612a2192602092612a18816129dc565b94858093612996565b938491016129e0565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b612a6260118092612996565b612a6b81612a2e565b0190565b612a89612a949392612a83612a8e936129c3565b90612a05565b612a56565b90612a05565b90565b90565b612ab9612ac2602093612ac793612ab0816129dc565b93848093611244565b958691016129e0565b610c8d565b0190565b612ae19160208201916000818403910152612a9a565b90565b90612af9612af3838390611aa4565b156101c7565b612b01575050565b612b7991612b57612b30612b20612b1a612b5c95613155565b9361262b565b612b2a602061297a565b90613378565b91612b48612b3c610163565b93849260208401612a6f565b60208201810382520382610cad565b612a97565b612b64610163565b91829162461bcd60e51b835260048301612acb565b0390fd5b612b91612b8b828490611aa4565b156101c7565b612b9a575b5050565b612bbc6001612bb76000612baf818690610f85565b018590611a8c565b61156a565b90612bc5612558565b90612c02612bfc612bf67f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95610f79565b926114f2565b926114f2565b92612c0b610163565b80612c1581610345565b0390a43880612b96565b612c2890610c3c565b90565b612c3f612c3a612c4492610224565b610c39565b61025f565b90565b612c5b612c56612c609261025f565b6109a8565b6103cd565b90565b90612c96612c90612c8b612c866000612c9b96612c7e610bac565b500194612c1f565b612c2b565b612c47565b91612628565b613598565b90565b612ca9818390611aa4565b612cb2575b5050565b612cd46000612ccf6000612cc7818690610f85565b018590611a8c565b61156a565b90612cdd612558565b90612d1a612d14612d0e7ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95610f79565b926114f2565b926114f2565b92612d23610163565b80612d2d81610345565b0390a43880612cae565b90612d6a612d64612d5f612d5a6000612d6f96612d52610bac565b500194612c1f565b612c2b565b612c47565b91612628565b61368e565b90565b67ffffffffffffffff8111612d9057612d8c602091610c8d565b0190565b610c97565b90612da7612da283612d72565b61101e565b918252565b60007f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564910152565b612dde6020612d95565b90612deb60208301612dac565b565b612df5612dd4565b90565b612e01816101c7565b03612e0857565b600080fd5b90505190612e1a82612df8565b565b90602082820312612e3657612e3391600001612e0d565b90565b61016e565b60207f6f74207375636365656400000000000000000000000000000000000000000000917f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201520152565b612e96602a604092611244565b612e9f81612e3b565b0190565b612eb99060208101906000818303910152612e89565b90565b15612ec357565b612ecb610163565b62461bcd60e51b815280612ee160048201612ea3565b0390fd5b612f2f91612ef5612f049261258f565b90612efe612ded565b91613798565b612f0d81611f1e565b612f20612f1a600061164e565b9161025f565b14908115612f31575b50612ebc565b565b612f4c91506020612f4182611f1e565b818301019101612e1c565b38612f29565b90612f69612f62612f7093610efe565b6003610f34565b60046117cf565b565b634e487b7160e01b600052603260045260246000fd5b5490565b600052602060002090565b612fa081612f88565b821015612fbb57612fb2600191612f8c565b91020190600090565b612f72565b1c90565b612fd4906008612fd99302612fc0565b610fa3565b90565b90612fe79154612fc4565b90565b61300991600061300392612ffc610f74565b5001612f97565b90612fdc565b90565b6001613018910161025f565b90565b5190565b906130298261301b565b81101561303a576020809102010190565b612f72565b9190613049610f74565b50613054600061164e565b905b8161307161306b6130668761301b565b61025f565b9161025f565b10156130a35761309761309d9161309161308c87869061301f565b6117b6565b906137bb565b9161300c565b90613056565b9192505090565b60006130bf916130b8612047565b5001612f88565b90565b6130ca610bac565b50806130e56130df637965db0b60e01b610178565b91610178565b149081156130f2575b5090565b6130fc91506137fb565b386130ee565b606090565b90565b60ff1690565b61312461311f61312992613107565b610c39565b61310a565b90565b6131366014613110565b90565b61314d6131486131529261310a565b610c39565b61025f565b90565b61317261316d61318892613167613102565b50612c1f565b612c2b565b61318261317d61312c565b613139565b90613378565b90565b90565b6131a261319d6131a79261318b565b610c39565b61025f565b90565b6131b96131bf9193929361025f565b9261025f565b82018092116131ca57565b612167565b369037565b906131f96131e183611403565b926020806131ef86936113e0565b92019103906131cf565b565b600360fc1b90565b9061320d82611f1e565b81101561321f57600160209102010190565b612f72565b600f60fb1b90565b90565b61324361323e6132489261322c565b610c39565b61025f565b90565b6132549061025f565b60008114613263576001900390565b612167565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b613287613268565b90565b90565b6132a161329c6132a69261328a565b610c39565b61025f565b90565b60f81b90565b90565b6132c66132c16132cb926132af565b610c39565b61310a565b90565b6132ed906132e76132e16132f29461310a565b9161025f565b90612fc0565b61025f565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b61332960208092611244565b613332816132f5565b0190565b61334c906020810190600081830391015261331d565b90565b1561335657565b61335e610163565b62461bcd60e51b81528061337460048201613336565b0390fd5b9190613382613102565b5061341c61340c6133b86133b36133a3600261339e879161318e565b6121a7565b6133ad600261318e565b906131aa565b6131d4565b926133c16131fb565b6133da856133d460009360001a9361164e565b90613203565b536133e3613224565b6133fc856133f660019360001a9361322f565b90613203565b53613407600261318e565b6121a7565b613416600161322f565b906131aa565b925b8361343261342c600161322f565b9161025f565b11156134995761344061327f565b8161344b600f61328d565b16916010831015613494576134676134889261348e941a6132a9565b6134778591889060001a92613203565b5361348260046132b2565b906132ce565b9361324b565b9261341e565b612f72565b6134c19293506134bc906134b66134b0600061164e565b9161025f565b1461334f565b612a97565b90565b90565b600052602060002090565b5490565b6134df816134d2565b8210156134fa576134f16001916134c7565b91020190600090565b612f72565b1b90565b9190600861351f910291613519600019846134ff565b926134ff565b9181191691161790565b919061353f61353a61354793610f79565b6117c3565b908354613503565b9055565b908154916801000000000000000083101561357b5782613573916001613579950181556134d6565b90613529565b565b610c97565b9061358a90610f79565b600052602052604060002090565b6135a0610bac565b506135b56135af828490613821565b156101c7565b6000146135f8576135ee6135f3926135d96135d2600085016134c4565b829061354b565b60016135e760008501612f88565b9301613580565b6116ba565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b61362791613621610f74565b91613529565b565b613632816134d2565b801561365357600190039061365061364a83836134d6565b90613615565b55565b6135ff565b919061366e6136696136769361169b565b6116b7565b908354613503565b9055565b61368c91613686612047565b91613658565b565b613696610bac565b506136ad6136a8600183018490613580565b6110cc565b90816136c26136bc600061164e565b9161025f565b14156000146137905761374292600161373d92846136eb6000966136e58561322f565b9061217d565b6137086136f9888501612f88565b6137028661322f565b9061217d565b8061371b6137158461025f565b9161025f565b03613747575b5050506137376137328683016134c4565b613629565b01613580565b61367a565b600190565b6137889261377a613766613760613783948c8901612f97565b90612fdc565b9361377485918c8901612f97565b90613529565b91858501613580565b6116ba565b388080613721565b505050600090565b906137b892916137a661141a565b50906137b2600061164e565b9161390d565b90565b6137c3610f74565b50806137d76137d1846103cd565b916103cd565b106000146137ed57906137e991613967565b5b90565b6137f691613967565b6137ea565b613803610bac565b5061381d6138176301ffc9a760e01b610178565b91610178565b1490565b61383f91600161383a92613833610bac565b5001613580565b6110cc565b61385261384c600061164e565b9161025f565b141590565b61386090610c70565b90565b60207f722063616c6c0000000000000000000000000000000000000000000000000000917f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201520152565b6138be6026604092611244565b6138c781613863565b0190565b6138e190602081019060008183039101526138b1565b90565b156138eb57565b6138f3610163565b62461bcd60e51b815280613909600482016138cb565b0390fd5b9160008091613964959361391f61141a565b5061394661392c30613857565b3161393f6139398561025f565b9161025f565b10156138e4565b8591602082019151925af19161395a61141f565b9092909192613a02565b90565b61396f610f74565b50600052602052604060002090565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6139b3601d602092611244565b6139bc8161397e565b0190565b6139d690602081019060008183039101526139a6565b90565b156139e057565b6139e8610163565b62461bcd60e51b8152806139fe600482016139c0565b0390fd5b919290613a0d61141a565b50600014613a535750613a1f82611f1e565b613a32613a2c600061164e565b9161025f565b14613a3c575b5090565b613a48613a4d91613aa7565b6139d9565b38613a38565b8290613a5e82611f1e565b613a71613a6b600061164e565b9161025f565b11600014613a825750805190602001fd5b613aa390613a8e610163565b91829162461bcd60e51b835260048301612acb565b0390fd5b613aaf610bac565b503b613ac4613abe600061164e565b9161025f565b119056fea2646970667358221220c204633b23276edd95aa322dbea2171da8b640438f81199e08fb87ec1d64aa7f64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -178,80 +208,80 @@ export class ERC721SaleFactory extends ContractFactory { export const ERC721SALEFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol:ERC721SaleFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\nimport { ERC721Sale } from "@0xsequence/contracts-library/tokens/ERC721/utility/sale/ERC721Sale.sol";\nimport {\n IERC721SaleFactory,\n IERC721SaleFactoryFunctions\n} from "@0xsequence/contracts-library/tokens/ERC721/utility/sale/IERC721SaleFactory.sol";\n\n/**\n * Deployer of ERC-721 Sale proxies.\n */\ncontract ERC721SaleFactory is IERC721SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-721 Sale Factory.\n * @param factoryOwner The owner of the ERC-721 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC721Sale impl = new ERC721Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\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 ERC721Sale(proxyAddr).initialize(tokenOwner, items);\n emit ERC721SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\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 { ERC721Sale } from "./ERC721Sale.sol";\nimport { IERC721SaleFactory, IERC721SaleFactoryFunctions } from "./IERC721SaleFactory.sol";\n\n/**\n * Deployer of ERC-721 Sale proxies.\n */\ncontract ERC721SaleFactory is IERC721SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-721 Sale Factory.\n * @param factoryOwner The owner of the ERC-721 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC721Sale impl = new ERC721Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\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 ERC721Sale(proxyAddr).initialize(tokenOwner, items, implicitModeValidator, implicitModeProjectId);\n emit ERC721SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\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/ERC721/utility/sale/ERC721Sale.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n IERC721Sale, IERC721SaleFunctions\n} from "@0xsequence/contracts-library/tokens/ERC721/utility/sale/IERC721Sale.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 { IERC721ItemsFunctions } from "@0xsequence/contracts-library/tokens/ERC721/presets/items/IERC721Items.sol";\nimport { IERC721A } from "erc721a/contracts/extensions/ERC721AQueryable.sol";\n\n/**\n * An ERC-721 token contract with primary sale mechanisms.\n */\ncontract ERC721Sale is IERC721Sale, WithdrawControlled, MerkleProofSingleUse {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n SaleDetails private _saleDetails;\n\n /**\n * Initialize the contract.\n * @param owner The owner of the contract\n * @param items The ERC-721 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 _amount Amount 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 _amount,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n // Active sale test\n if (_blockTimeOutOfBounds(_saleDetails.startTime, _saleDetails.endTime)) {\n revert SaleInactive();\n }\n requireMerkleProof(_saleDetails.merkleRoot, _proof, msg.sender, "");\n\n uint256 total = _saleDetails.cost * _amount;\n if (_expectedPaymentToken != _saleDetails.paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_saleDetails.paymentToken, total, 0);\n }\n if (_maxTotal < total) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, total, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != total) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, total, 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), total);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\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 An empty proof is supplied when no proof is required.\n * @dev `paymentToken` must match the `paymentToken` in the sale details.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n _payForActiveMint(amount, paymentToken, maxTotal, proof);\n\n uint256 currentSupply = IERC721A(_items).totalSupply();\n uint256 supplyCap = _saleDetails.supplyCap;\n if (supplyCap > 0 && currentSupply + amount > supplyCap) {\n revert InsufficientSupply(currentSupply, amount, supplyCap);\n }\n\n IERC721ItemsFunctions(_items).mint(to, amount);\n emit ItemsMinted(to, amount);\n }\n\n /**\n * Set the sale details.\n * @param supplyCap The maximum number of tokens that can be minted. 0 indicates unlimited supply.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\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 */\n function setSaleDetails(\n uint256 supplyCap,\n uint256 cost,\n address paymentToken,\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 _saleDetails = SaleDetails(supplyCap, cost, paymentToken, startTime, endTime, merkleRoot);\n emit SaleDetailsUpdated(supplyCap, cost, paymentToken, startTime, endTime, merkleRoot);\n }\n\n //\n // Views\n //\n function itemsContract() external view returns (address) {\n return address(_items);\n }\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory) {\n return _saleDetails;\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 interfaceId == type(IERC721SaleFunctions).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 { IERC20, SafeERC20, WithdrawControlled } from "../../../common/WithdrawControlled.sol";\nimport { IERC721ItemsFunctions } from "../../presets/items/IERC721Items.sol";\nimport { IERC721Sale, IERC721SaleFunctions } from "./IERC721Sale.sol";\n\n/**\n * An ERC-721 token contract with primary sale mechanisms.\n */\ncontract ERC721Sale is IERC721Sale, 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 SaleDetails private _saleDetails;\n\n /**\n * Initialize the contract.\n * @param owner The owner of the contract\n * @param items The ERC-721 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 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, valid and takes payment.\n * @param _amount Amount 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 _validateMint(\n uint256 _amount,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n // Active sale test\n if (_blockTimeOutOfBounds(_saleDetails.startTime, _saleDetails.endTime)) {\n revert SaleInactive();\n }\n // Supply test\n if (_saleDetails.remainingSupply < _amount) {\n revert InsufficientSupply(_saleDetails.remainingSupply, _amount);\n }\n _saleDetails.remainingSupply -= _amount;\n // Check proof\n requireMerkleProof(_saleDetails.merkleRoot, _proof, msg.sender, "");\n\n uint256 total = _saleDetails.cost * _amount;\n if (_expectedPaymentToken != _saleDetails.paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_saleDetails.paymentToken, total, 0);\n }\n if (_maxTotal < total) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, total, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != total) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, total, 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), total);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\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 An empty proof is supplied when no proof is required.\n * @dev `paymentToken` must match the `paymentToken` in the sale details.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n _validateMint(amount, paymentToken, maxTotal, proof);\n try IERC721ItemsFunctions(_items).mintSequential(to, amount) { }\n catch {\n // On failure, support old minting method.\n IERC721ItemsFunctions(_items).mint(to, amount);\n }\n emit ItemsMinted(to, amount);\n }\n\n /**\n * Set the sale details.\n * @param remainingSupply The remaining number of tokens that can be minted by the items contract. 0 indicates unlimited supply.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\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 */\n function setSaleDetails(\n uint256 remainingSupply,\n uint256 cost,\n address paymentToken,\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 if (remainingSupply == 0) {\n revert InvalidSaleDetails();\n }\n _saleDetails = SaleDetails(remainingSupply, cost, paymentToken, startTime, endTime, merkleRoot);\n emit SaleDetailsUpdated(remainingSupply, cost, paymentToken, startTime, endTime, merkleRoot);\n }\n\n //\n // Views\n //\n function itemsContract() external view returns (address) {\n return address(_items);\n }\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory) {\n return _saleDetails;\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 interfaceId == type(IERC721SaleFunctions).interfaceId\n || WithdrawControlled.supportsInterface(interfaceId)\n || SignalsImplicitModeControlled.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC721/utility/sale/IERC721SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFactoryFunctions {\n\n /**\n * Creates an ERC-721 Sale for given token contract\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 Items contract address\n * @return proxyAddr The address of the ERC-721 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-721 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-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 Items contract address\n * @return proxyAddr The address of the ERC-721 Sale Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC721SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-721 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC721SaleFactory is IERC721SaleFactoryFunctions, IERC721SaleFactorySignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFactoryFunctions {\n\n /**\n * Creates an ERC-721 Sale for given token contract\n * @param nonce Nonce for randomizing the deployment address.\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 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-721 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-721 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 Nonce for randomizing the deployment address.\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 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-721 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 IERC721SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-721 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC721SaleFactory is IERC721SaleFactoryFunctions, IERC721SaleFactorySignals { }\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/ERC721/utility/sale/IERC721Sale.sol': { + 'src/tokens/common/MerkleProofSingleUse.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFunctions {\n\n struct SaleDetails {\n uint256 supplyCap; // 0 supply cap indicates unlimited supply\n uint256 cost;\n address paymentToken; // ERC20 token address for payment. address(0) indicated payment in ETH.\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\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 An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] memory proof\n ) external payable;\n\n /**\n * Set the sale details.\n * @param supplyCap The maximum number of tokens that can be minted. 0 indicates unlimited supply.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\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 */\n function setSaleDetails(\n uint256 supplyCap,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) external;\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory);\n\n}\n\ninterface IERC721SaleSignals {\n\n event SaleDetailsUpdated(\n uint256 supplyCap, uint256 cost, address paymentToken, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256 amount);\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.\n */\n error SaleInactive();\n\n /**\n * Insufficient supply.\n * @param currentSupply Current supply.\n * @param amount Amount to mint.\n * @param maxSupply Maximum supply.\n */\n error InsufficientSupply(uint256 currentSupply, uint256 amount, uint256 maxSupply);\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\ninterface IERC721Sale is IERC721SaleFunctions, IERC721SaleSignals { }\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 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' }, - 'src/tokens/common/MerkleProofSingleUse.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.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 { 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/common/WithdrawControlled.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 { 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/ERC721/presets/items/IERC721Items.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n */\n function mint(address to, uint256 amount) external;\n\n}\n\ninterface IERC721ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC721Items is IERC721ItemsFunctions, IERC721ItemsSignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenId Token id to mint.\n */\n function mint(address to, uint256 tokenId) external;\n\n /**\n * Mint a sequential token.\n * @param to Address to mint token to.\n * @param amount Amount of tokens to mint.\n */\n function mintSequential(address to, uint256 amount) external;\n\n /**\n * Get the total supply of tokens.\n * @return totalSupply The total supply of tokens.\n */\n function totalSupply() external view returns (uint256 totalSupply);\n\n}\n\ninterface IERC721ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC721Items is IERC721ItemsFunctions, IERC721ItemsSignals { }\n' }, - 'lib/chiru-labs/erc721a/contracts/extensions/ERC721AQueryable.sol': { + 'src/tokens/ERC721/utility/sale/IERC721Sale.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721AQueryable.sol';\nimport '../ERC721A.sol';\n\n/**\n * @title ERC721AQueryable.\n *\n * @dev ERC721A subclass with convenience query functions.\n */\nabstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n *\n * - `addr = address(0)`\n * - `startTimestamp = 0`\n * - `burned = false`\n * - `extraData = 0`\n *\n * If the `tokenId` is burned:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = true`\n * - `extraData = `\n *\n * Otherwise:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = false`\n * - `extraData = `\n */\n function explicitOwnershipOf(uint256 tokenId)\n public\n view\n virtual\n override\n returns (TokenOwnership memory ownership)\n {\n unchecked {\n if (tokenId >= _startTokenId()) {\n if (tokenId > _sequentialUpTo()) return _ownershipAt(tokenId);\n\n if (tokenId < _nextTokenId()) {\n // If the `tokenId` is within bounds,\n // scan backwards for the initialized ownership slot.\n while (!_ownershipIsInitialized(tokenId)) --tokenId;\n return _ownershipAt(tokenId);\n }\n }\n }\n }\n\n /**\n * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\n * See {ERC721AQueryable-explicitOwnershipOf}\n */\n function explicitOwnershipsOf(uint256[] calldata tokenIds)\n external\n view\n virtual\n override\n returns (TokenOwnership[] memory)\n {\n TokenOwnership[] memory ownerships;\n uint256 i = tokenIds.length;\n assembly {\n // Grab the free memory pointer.\n ownerships := mload(0x40)\n // Store the length.\n mstore(ownerships, i)\n // Allocate one word for the length,\n // `tokenIds.length` words for the pointers.\n i := shl(5, i) // Multiply `i` by 32.\n mstore(0x40, add(add(ownerships, 0x20), i))\n }\n while (i != 0) {\n uint256 tokenId;\n assembly {\n i := sub(i, 0x20)\n tokenId := calldataload(add(tokenIds.offset, i))\n }\n TokenOwnership memory ownership = explicitOwnershipOf(tokenId);\n assembly {\n // Store the pointer of `ownership` in the `ownerships` array.\n mstore(add(add(ownerships, 0x20), i), ownership)\n }\n }\n return ownerships;\n }\n\n /**\n * @dev Returns an array of token IDs owned by `owner`,\n * in the range [`start`, `stop`)\n * (i.e. `start <= tokenId < stop`).\n *\n * This function allows for tokens to be queried if the collection\n * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\n *\n * Requirements:\n *\n * - `start < stop`\n */\n function tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) external view virtual override returns (uint256[] memory) {\n return _tokensOfOwnerIn(owner, start, stop);\n }\n\n /**\n * @dev Returns an array of token IDs owned by `owner`.\n *\n * This function scans the ownership mapping and is O(`totalSupply`) in complexity.\n * It is meant to be called off-chain.\n *\n * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\n * multiple smaller scans if the collection is large enough to cause\n * an out-of-gas error (10K collections should be fine).\n */\n function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {\n // If spot mints are enabled, full-range scan is disabled.\n if (_sequentialUpTo() != type(uint256).max) _revert(NotCompatibleWithSpotMints.selector);\n uint256 start = _startTokenId();\n uint256 stop = _nextTokenId();\n uint256[] memory tokenIds;\n if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop);\n return tokenIds;\n }\n\n /**\n * @dev Helper function for returning an array of token IDs owned by `owner`.\n *\n * Note that this function is optimized for smaller bytecode size over runtime gas,\n * since it is meant to be called off-chain.\n */\n function _tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) private view returns (uint256[] memory tokenIds) {\n unchecked {\n if (start >= stop) _revert(InvalidQueryRange.selector);\n // Set `start = max(start, _startTokenId())`.\n if (start < _startTokenId()) start = _startTokenId();\n uint256 nextTokenId = _nextTokenId();\n // If spot mints are enabled, scan all the way until the specified `stop`.\n uint256 stopLimit = _sequentialUpTo() != type(uint256).max ? stop : nextTokenId;\n // Set `stop = min(stop, stopLimit)`.\n if (stop >= stopLimit) stop = stopLimit;\n // Number of tokens to scan.\n uint256 tokenIdsMaxLength = balanceOf(owner);\n // Set `tokenIdsMaxLength` to zero if the range contains no tokens.\n if (start >= stop) tokenIdsMaxLength = 0;\n // If there are one or more tokens to scan.\n if (tokenIdsMaxLength != 0) {\n // Set `tokenIdsMaxLength = min(balanceOf(owner), tokenIdsMaxLength)`.\n if (stop - start <= tokenIdsMaxLength) tokenIdsMaxLength = stop - start;\n uint256 m; // Start of available memory.\n assembly {\n // Grab the free memory pointer.\n tokenIds := mload(0x40)\n // Allocate one word for the length, and `tokenIdsMaxLength` words\n // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.\n m := add(tokenIds, shl(5, add(tokenIdsMaxLength, 1)))\n mstore(0x40, m)\n }\n // We need to call `explicitOwnershipOf(start)`,\n // because the slot at `start` may not be initialized.\n TokenOwnership memory ownership = explicitOwnershipOf(start);\n address currOwnershipAddr;\n // If the starting slot exists (i.e. not burned),\n // initialize `currOwnershipAddr`.\n // `ownership.address` will not be zero,\n // as `start` is clamped to the valid token ID range.\n if (!ownership.burned) currOwnershipAddr = ownership.addr;\n uint256 tokenIdsIdx;\n // Use a do-while, which is slightly more efficient for this case,\n // as the array will at least contain one element.\n do {\n if (_sequentialUpTo() != type(uint256).max) {\n // Skip the remaining unused sequential slots.\n if (start == nextTokenId) start = _sequentialUpTo() + 1;\n // Reset `currOwnershipAddr`, as each spot-minted token is a batch of one.\n if (start > _sequentialUpTo()) currOwnershipAddr = address(0);\n }\n ownership = _ownershipAt(start); // This implicitly allocates memory.\n assembly {\n switch mload(add(ownership, 0x40))\n // if `ownership.burned == false`.\n case 0 {\n // if `ownership.addr != address(0)`.\n // The `addr` already has it's upper 96 bits clearned,\n // since it is written to memory with regular Solidity.\n if mload(ownership) {\n currOwnershipAddr := mload(ownership)\n }\n // if `currOwnershipAddr == owner`.\n // The `shl(96, x)` is to make the comparison agnostic to any\n // dirty upper 96 bits in `owner`.\n if iszero(shl(96, xor(currOwnershipAddr, owner))) {\n tokenIdsIdx := add(tokenIdsIdx, 1)\n mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)\n }\n }\n // Otherwise, reset `currOwnershipAddr`.\n // This handles the case of batch burned tokens\n // (burned bit of first slot set, remaining slots left uninitialized).\n default {\n currOwnershipAddr := 0\n }\n start := add(start, 1)\n // Free temporary memory implicitly allocated for ownership\n // to avoid quadratic memory expansion costs.\n mstore(0x40, m)\n }\n } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));\n // Store the length of the array.\n assembly {\n mstore(tokenIds, tokenIdsIdx)\n }\n }\n }\n }\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFunctions {\n\n struct SaleDetails {\n uint256 remainingSupply;\n uint256 cost;\n address paymentToken; // ERC20 token address for payment. address(0) indicated payment in ETH.\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\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 An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] memory proof\n ) external payable;\n\n /**\n * Set the sale details.\n * @param remainingSupply The maximum number of tokens that can be minted in this sale.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\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 */\n function setSaleDetails(\n uint256 remainingSupply,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) external;\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory);\n\n}\n\ninterface IERC721SaleSignals {\n\n event SaleDetailsUpdated(\n uint256 remainingSupply,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256 amount);\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.\n */\n error SaleInactive();\n\n /**\n * Insufficient supply.\n * @param remainingSupply Remaining supply.\n * @param amount Amount to mint.\n */\n error InsufficientSupply(uint256 remainingSupply, uint256 amount);\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\ninterface IERC721Sale is IERC721SaleFunctions, IERC721SaleSignals { }\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' }, @@ -259,137 +289,148 @@ export const ERC721SALEFACTORY_VERIFICATION: Omit 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': { - 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' - }, - 'lib/openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.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' }, - 'lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.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.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/chiru-labs/erc721a/contracts/extensions/IERC721AQueryable.sol': { + 'src/tokens/common/IWithdrawControlled.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport '../IERC721A.sol';\n\n/**\n * @dev Interface of ERC721AQueryable.\n */\ninterface IERC721AQueryable is IERC721A {\n /**\n * Invalid query range (`start` >= `stop`).\n */\n error InvalidQueryRange();\n\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n *\n * - `addr = address(0)`\n * - `startTimestamp = 0`\n * - `burned = false`\n * - `extraData = 0`\n *\n * If the `tokenId` is burned:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = true`\n * - `extraData = `\n *\n * Otherwise:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = false`\n * - `extraData = `\n */\n function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);\n\n /**\n * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\n * See {ERC721AQueryable-explicitOwnershipOf}\n */\n function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);\n\n /**\n * @dev Returns an array of token IDs owned by `owner`,\n * in the range [`start`, `stop`)\n * (i.e. `start <= tokenId < stop`).\n *\n * This function allows for tokens to be queried if the collection\n * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\n *\n * Requirements:\n *\n * - `start < stop`\n */\n function tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) external view returns (uint256[] memory);\n\n /**\n * @dev Returns an array of token IDs owned by `owner`.\n *\n * This function scans the ownership mapping and is O(`totalSupply`) in complexity.\n * It is meant to be called off-chain.\n *\n * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\n * multiple smaller scans if the collection is large enough to cause\n * an out-of-gas error (10K collections should be fine).\n */\n function tokensOfOwner(address owner) external view returns (uint256[] memory);\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/chiru-labs/erc721a/contracts/ERC721A.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721A.sol';\n\n/**\n * @dev Interface of ERC721 token receiver.\n */\ninterface ERC721A__IERC721Receiver {\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n\n/**\n * @title ERC721A\n *\n * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)\n * Non-Fungible Token Standard, including the Metadata extension.\n * Optimized for lower gas during batch mints.\n *\n * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)\n * starting from `_startTokenId()`.\n *\n * The `_sequentialUpTo()` function can be overriden to enable spot mints\n * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.\n *\n * Assumptions:\n *\n * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.\n * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).\n */\ncontract ERC721A is IERC721A {\n // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).\n struct TokenApprovalRef {\n address value;\n }\n\n // =============================================================\n // CONSTANTS\n // =============================================================\n\n // Mask of an entry in packed address data.\n uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n // The bit position of `numberMinted` in packed address data.\n uint256 private constant _BITPOS_NUMBER_MINTED = 64;\n\n // The bit position of `numberBurned` in packed address data.\n uint256 private constant _BITPOS_NUMBER_BURNED = 128;\n\n // The bit position of `aux` in packed address data.\n uint256 private constant _BITPOS_AUX = 192;\n\n // Mask of all 256 bits in packed address data except the 64 bits for `aux`.\n uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n // The bit position of `startTimestamp` in packed ownership.\n uint256 private constant _BITPOS_START_TIMESTAMP = 160;\n\n // The bit mask of the `burned` bit in packed ownership.\n uint256 private constant _BITMASK_BURNED = 1 << 224;\n\n // The bit position of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;\n\n // The bit mask of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n // The bit position of `extraData` in packed ownership.\n uint256 private constant _BITPOS_EXTRA_DATA = 232;\n\n // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.\n uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;\n\n // The mask of the lower 160 bits for addresses.\n uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;\n\n // The maximum `quantity` that can be minted with {_mintERC2309}.\n // This limit is to prevent overflows on the address data entries.\n // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}\n // is required to cause an overflow, which is unrealistic.\n uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;\n\n // The `Transfer` event signature is given by:\n // `keccak256(bytes(\"Transfer(address,address,uint256)\"))`.\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n // =============================================================\n // STORAGE\n // =============================================================\n\n // The next token ID to be minted.\n uint256 private _currentIndex;\n\n // The number of tokens burned.\n uint256 private _burnCounter;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to ownership details\n // An empty struct value does not necessarily mean the token is unowned.\n // See {_packedOwnershipOf} implementation for details.\n //\n // Bits Layout:\n // - [0..159] `addr`\n // - [160..223] `startTimestamp`\n // - [224] `burned`\n // - [225] `nextInitialized`\n // - [232..255] `extraData`\n mapping(uint256 => uint256) private _packedOwnerships;\n\n // Mapping owner address to address data.\n //\n // Bits Layout:\n // - [0..63] `balance`\n // - [64..127] `numberMinted`\n // - [128..191] `numberBurned`\n // - [192..255] `aux`\n mapping(address => uint256) private _packedAddressData;\n\n // Mapping from token ID to approved address.\n mapping(uint256 => TokenApprovalRef) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // The amount of tokens minted above `_sequentialUpTo()`.\n // We call these spot mints (i.e. non-sequential mints).\n uint256 private _spotMinted;\n\n // =============================================================\n // CONSTRUCTOR\n // =============================================================\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n\n if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);\n }\n\n // =============================================================\n // TOKEN COUNTING OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the starting token ID for sequential mints.\n *\n * Override this function to change the starting token ID for sequential mints.\n *\n * Note: The value returned must never change after any tokens have been minted.\n */\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev Returns the maximum token ID (inclusive) for sequential mints.\n *\n * Override this function to return a value less than 2**256 - 1,\n * but greater than `_startTokenId()`, to enable spot (non-sequential) mints.\n *\n * Note: The value returned must never change after any tokens have been minted.\n */\n function _sequentialUpTo() internal view virtual returns (uint256) {\n return type(uint256).max;\n }\n\n /**\n * @dev Returns the next token ID to be minted.\n */\n function _nextTokenId() internal view virtual returns (uint256) {\n return _currentIndex;\n }\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() public view virtual override returns (uint256 result) {\n // Counter underflow is impossible as `_burnCounter` cannot be incremented\n // more than `_currentIndex + _spotMinted - _startTokenId()` times.\n unchecked {\n // With spot minting, the intermediate `result` can be temporarily negative,\n // and the computation must be unchecked.\n result = _currentIndex - _burnCounter - _startTokenId();\n if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;\n }\n }\n\n /**\n * @dev Returns the total amount of tokens minted in the contract.\n */\n function _totalMinted() internal view virtual returns (uint256 result) {\n // Counter underflow is impossible as `_currentIndex` does not decrement,\n // and it is initialized to `_startTokenId()`.\n unchecked {\n result = _currentIndex - _startTokenId();\n if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;\n }\n }\n\n /**\n * @dev Returns the total number of tokens burned.\n */\n function _totalBurned() internal view virtual returns (uint256) {\n return _burnCounter;\n }\n\n /**\n * @dev Returns the total number of tokens that are spot-minted.\n */\n function _totalSpotMinted() internal view virtual returns (uint256) {\n return _spotMinted;\n }\n\n // =============================================================\n // ADDRESS DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);\n return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens minted by `owner`.\n */\n function _numberMinted(address owner) internal view returns (uint256) {\n return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens burned by or on behalf of `owner`.\n */\n function _numberBurned(address owner) internal view returns (uint256) {\n return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n */\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> _BITPOS_AUX);\n }\n\n /**\n * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n * If there are multiple variables, please pack them into a uint64.\n */\n function _setAux(address owner, uint64 aux) internal virtual {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n // Cast `aux` with assembly to avoid redundant masking.\n assembly {\n auxCasted := aux\n }\n packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n // The interface IDs are constants representing the first 4 bytes\n // of the XOR of all function selectors in the interface.\n // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)\n // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)\n return\n interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.\n interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.\n interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.\n }\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, it can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return '';\n }\n\n // =============================================================\n // OWNERSHIPS OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\n }\n\n /**\n * @dev Gas spent here starts off proportional to the maximum mint batch size.\n * It gradually moves to O(1) as tokens get transferred around over time.\n */\n function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct at `index`.\n */\n function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n /**\n * @dev Returns whether the ownership slot at `index` is initialized.\n * An uninitialized slot does not necessarily mean that the slot has no owner.\n */\n function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {\n return _packedOwnerships[index] != 0;\n }\n\n /**\n * @dev Initializes the ownership slot minted at `index` for efficiency purposes.\n */\n function _initializeOwnershipAt(uint256 index) internal virtual {\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n /**\n * @dev Returns the packed ownership data of `tokenId`.\n */\n function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {\n if (_startTokenId() <= tokenId) {\n packed = _packedOwnerships[tokenId];\n\n if (tokenId > _sequentialUpTo()) {\n if (_packedOwnershipExists(packed)) return packed;\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n\n // If the data at the starting slot does not exist, start the scan.\n if (packed == 0) {\n if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);\n // Invariant:\n // There will always be an initialized ownership slot\n // (i.e. `ownership.addr != address(0) && ownership.burned == false`)\n // before an unintialized ownership slot\n // (i.e. `ownership.addr == address(0) && ownership.burned == false`)\n // Hence, `tokenId` will not underflow.\n //\n // We can directly compare the packed value.\n // If the address is zero, packed will be zero.\n for (;;) {\n unchecked {\n packed = _packedOwnerships[--tokenId];\n }\n if (packed == 0) continue;\n if (packed & _BITMASK_BURNED == 0) return packed;\n // Otherwise, the token is burned, and we must revert.\n // This handles the case of batch burned tokens, where only the burned bit\n // of the starting slot is set, and remaining slots are left uninitialized.\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n }\n // Otherwise, the data exists and we can skip the scan.\n // This is possible because we have already achieved the target condition.\n // This saves 2143 gas on transfers of initialized tokens.\n // If the token is not burned, return `packed`. Otherwise, revert.\n if (packed & _BITMASK_BURNED == 0) return packed;\n }\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct from `packed`.\n */\n function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);\n ownership.burned = packed & _BITMASK_BURNED != 0;\n ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);\n }\n\n /**\n * @dev Packs ownership data into a single uint256.\n */\n function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.\n result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))\n }\n }\n\n /**\n * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.\n */\n function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {\n // For branchless setting of the `nextInitialized` flag.\n assembly {\n // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.\n result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))\n }\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n */\n function approve(address to, uint256 tokenId) public payable virtual override {\n _approve(to, tokenId, true);\n }\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);\n\n return _tokenApprovals[tokenId].value;\n }\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted. See {_mint}.\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool result) {\n if (_startTokenId() <= tokenId) {\n if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);\n\n if (tokenId < _currentIndex) {\n uint256 packed;\n while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;\n result = packed & _BITMASK_BURNED == 0;\n }\n }\n }\n\n /**\n * @dev Returns whether `packed` represents a token that exists.\n */\n function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {\n assembly {\n // The following is equivalent to `owner != address(0) && burned == false`.\n // Symbolically tested.\n result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED))\n }\n }\n\n /**\n * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.\n */\n function _isSenderApprovedOrOwner(\n address approvedAddress,\n address owner,\n address msgSender\n ) private pure returns (bool result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.\n msgSender := and(msgSender, _BITMASK_ADDRESS)\n // `msgSender == owner || msgSender == approvedAddress`.\n result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))\n }\n }\n\n /**\n * @dev Returns the storage slot and value for the approved address of `tokenId`.\n */\n function _getApprovedSlotAndAddress(uint256 tokenId)\n private\n view\n returns (uint256 approvedAddressSlot, address approvedAddress)\n {\n TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];\n // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.\n assembly {\n approvedAddressSlot := tokenApproval.slot\n approvedAddress := sload(approvedAddressSlot)\n }\n }\n\n // =============================================================\n // TRANSFER OPERATIONS\n // =============================================================\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable virtual override {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.\n from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));\n\n if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);\n\n (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);\n\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))\n if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // We can directly increment and decrement the balances.\n --_packedAddressData[from]; // Updates: `balance -= 1`.\n ++_packedAddressData[to]; // Updates: `balance += 1`.\n\n // Updates:\n // - `address` to the next owner.\n // - `startTimestamp` to the timestamp of transfering.\n // - `burned` to `false`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n from, // `from`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n if (toMasked == 0) _revert(TransferToZeroAddress.selector);\n\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable virtual override {\n safeTransferFrom(from, to, tokenId, '');\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public payable virtual override {\n transferFrom(from, to, tokenId);\n if (to.code.length != 0)\n if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n }\n\n /**\n * @dev Hook that is called before a set of serially-ordered token IDs\n * are about to be transferred. This includes minting.\n * And also called before burning one token.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after a set of serially-ordered token IDs\n * have been transferred. This includes minting.\n * And also called after one token has been burned.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been\n * transferred to `to`.\n * - When `from` is zero, `tokenId` has been minted for `to`.\n * - When `to` is zero, `tokenId` has been burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.\n *\n * `from` - Previous owner of the given token ID.\n * `to` - Target address that will receive the token.\n * `tokenId` - Token ID to be transferred.\n * `_data` - Optional data to send along with the call.\n *\n * Returns whether the call correctly returned the expected magic value.\n */\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (\n bytes4 retval\n ) {\n return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n\n // =============================================================\n // MINT OPERATIONS\n // =============================================================\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mint(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (quantity == 0) _revert(MintZeroQuantity.selector);\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are incredibly unrealistic.\n // `balance` and `numberMinted` have a maximum limit of 2**64.\n // `tokenId` has a maximum limit of 2**256.\n unchecked {\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)\n );\n\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n\n if (toMasked == 0) _revert(MintToZeroAddress.selector);\n\n uint256 end = startTokenId + quantity;\n uint256 tokenId = startTokenId;\n\n if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);\n\n do {\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n // The `!=` check ensures that large values of `quantity`\n // that overflows uint256 will make the loop run out of gas.\n } while (++tokenId != end);\n\n _currentIndex = end;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * This function is intended for efficient minting only during contract creation.\n *\n * It emits only one {ConsecutiveTransfer} as defined in\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),\n * instead of a sequence of {Transfer} event(s).\n *\n * Calling this function outside of contract creation WILL make your contract\n * non-compliant with the ERC721 standard.\n * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309\n * {ConsecutiveTransfer} event is only permissible during contract creation.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {ConsecutiveTransfer} event.\n */\n function _mintERC2309(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) _revert(MintToZeroAddress.selector);\n if (quantity == 0) _revert(MintZeroQuantity.selector);\n if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are unrealistic due to the above check for `quantity` to be below the limit.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)\n );\n\n if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);\n\n emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);\n\n _currentIndex = startTokenId + quantity;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Safely mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.\n * - `quantity` must be greater than 0.\n *\n * See {_mint}.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal virtual {\n _mint(to, quantity);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 end = _currentIndex;\n uint256 index = end - quantity;\n do {\n if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n } while (index < end);\n // This prevents reentrancy to `_safeMint`.\n // It does not prevent reentrancy to `_safeMintSpot`.\n if (_currentIndex != end) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMint(to, quantity, '')`.\n */\n function _safeMint(address to, uint256 quantity) internal virtual {\n _safeMint(to, quantity, '');\n }\n\n /**\n * @dev Mints a single token at `tokenId`.\n *\n * Note: A spot-minted `tokenId` that has been burned can be re-minted again.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` must be greater than `_sequentialUpTo()`.\n * - `tokenId` must not exist.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mintSpot(address to, uint256 tokenId) internal virtual {\n if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);\n uint256 prevOwnershipPacked = _packedOwnerships[tokenId];\n if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);\n\n _beforeTokenTransfers(address(0), to, tokenId, 1);\n\n // Overflows are incredibly unrealistic.\n // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.\n // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.\n unchecked {\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `true` (as `quantity == 1`).\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked)\n );\n\n // Updates:\n // - `balance += 1`.\n // - `numberMinted += 1`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n\n if (toMasked == 0) _revert(MintToZeroAddress.selector);\n\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n\n ++_spotMinted;\n }\n\n _afterTokenTransfers(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Safely mints a single token at `tokenId`.\n *\n * Note: A spot-minted `tokenId` that has been burned can be re-minted again.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.\n * - `tokenId` must be greater than `_sequentialUpTo()`.\n * - `tokenId` must not exist.\n *\n * See {_mintSpot}.\n *\n * Emits a {Transfer} event.\n */\n function _safeMintSpot(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mintSpot(to, tokenId);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 currentSpotMinted = _spotMinted;\n if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n // This prevents reentrancy to `_safeMintSpot`.\n // It does not prevent reentrancy to `_safeMint`.\n if (_spotMinted != currentSpotMinted) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.\n */\n function _safeMintSpot(address to, uint256 tokenId) internal virtual {\n _safeMintSpot(to, tokenId, '');\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_approve(to, tokenId, false)`.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _approve(to, tokenId, false);\n }\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function _approve(\n address to,\n uint256 tokenId,\n bool approvalCheck\n ) internal virtual {\n address owner = ownerOf(tokenId);\n\n if (approvalCheck && _msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n _revert(ApprovalCallerNotOwnerNorApproved.selector);\n }\n\n _tokenApprovals[tokenId].value = to;\n emit Approval(owner, to, tokenId);\n }\n\n // =============================================================\n // BURN OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_burn(tokenId, false)`.\n */\n function _burn(uint256 tokenId) internal virtual {\n _burn(tokenId, false);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n address from = address(uint160(prevOwnershipPacked));\n\n (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);\n\n if (approvalCheck) {\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))\n if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);\n }\n\n _beforeTokenTransfers(from, address(0), tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // Updates:\n // - `balance -= 1`.\n // - `numberBurned += 1`.\n //\n // We can directly decrement the balance, and increment the number burned.\n // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.\n _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;\n\n // Updates:\n // - `address` to the last owner.\n // - `startTimestamp` to the timestamp of burning.\n // - `burned` to `true`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n from,\n (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, address(0), tokenId);\n _afterTokenTransfers(from, address(0), tokenId, 1);\n\n // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times.\n unchecked {\n _burnCounter++;\n }\n }\n\n // =============================================================\n // EXTRA DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Directly sets the extra data for the ownership data `index`.\n */\n function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {\n uint256 packed = _packedOwnerships[index];\n if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);\n uint256 extraDataCasted;\n // Cast `extraData` with assembly to avoid redundant masking.\n assembly {\n extraDataCasted := extraData\n }\n packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);\n _packedOwnerships[index] = packed;\n }\n\n /**\n * @dev Called during each token transfer to set the 24bit `extraData` field.\n * Intended to be overridden by the cosumer contract.\n *\n * `previousExtraData` - the value of `extraData` before transfer.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _extraData(\n address from,\n address to,\n uint24 previousExtraData\n ) internal view virtual returns (uint24) {}\n\n /**\n * @dev Returns the next extra data for the packed ownership data.\n * The returned result is shifted into position.\n */\n function _nextExtraData(\n address from,\n address to,\n uint256 prevOwnershipPacked\n ) private view returns (uint256) {\n uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);\n return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;\n }\n\n // =============================================================\n // OTHER OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the message sender (defaults to `msg.sender`).\n *\n * If you are writing GSN compatible contracts, you need to override this function.\n */\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n /**\n * @dev Converts a uint256 to its ASCII string decimal representation.\n */\n function _toString(uint256 value) internal pure virtual returns (string memory str) {\n assembly {\n // The maximum value of a uint256 contains 78 digits (1 byte per digit), but\n // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.\n // We will need 1 word for the trailing zeros padding, 1 word for the length,\n // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.\n let m := add(mload(0x40), 0xa0)\n // Update the free memory pointer to allocate.\n mstore(0x40, m)\n // Assign the `str` to the end.\n str := sub(m, 0x20)\n // Zeroize the slot after the string.\n mstore(str, 0)\n\n // Cache the end of the memory to calculate the length later.\n let end := str\n\n // We write the string from rightmost digit to leftmost digit.\n // The following is essentially a do-while loop that also handles the zero case.\n // prettier-ignore\n for { let temp := value } 1 {} {\n str := sub(str, 1)\n // Write the character to the pointer.\n // The ASCII index of the '0' character is 48.\n mstore8(str, add(48, mod(temp, 10)))\n // Keep dividing `temp` until zero.\n temp := div(temp, 10)\n // prettier-ignore\n if iszero(temp) { break }\n }\n\n let length := sub(end, str)\n // Move the pointer 32 bytes leftwards to make room for the length.\n str := sub(str, 0x20)\n // Store the length.\n mstore(str, length)\n }\n }\n\n /**\n * @dev For more efficient reverts.\n */\n function _revert(bytes4 errorSelector) internal pure {\n assembly {\n mstore(0x00, errorSelector)\n revert(0x00, 0x04)\n }\n }\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/openzeppelin/contracts/access/IAccessControlEnumerable.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.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' }, - 'lib/openzeppelin/contracts/access/AccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.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' }, - 'lib/openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.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" }, - 'lib/openzeppelin/contracts/token/ERC20/IERC20.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.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" + '// 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/token/ERC20/extensions/IERC20Permit.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.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" + '// 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/chiru-labs/erc721a/contracts/IERC721A.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n/**\n * @dev Interface of ERC721A.\n */\ninterface IERC721A {\n /**\n * The caller must own the token or be an approved operator.\n */\n error ApprovalCallerNotOwnerNorApproved();\n\n /**\n * The token does not exist.\n */\n error ApprovalQueryForNonexistentToken();\n\n /**\n * Cannot query the balance for the zero address.\n */\n error BalanceQueryForZeroAddress();\n\n /**\n * Cannot mint to the zero address.\n */\n error MintToZeroAddress();\n\n /**\n * The quantity of tokens minted must be more than zero.\n */\n error MintZeroQuantity();\n\n /**\n * The token does not exist.\n */\n error OwnerQueryForNonexistentToken();\n\n /**\n * The caller must own the token or be an approved operator.\n */\n error TransferCallerNotOwnerNorApproved();\n\n /**\n * The token must be owned by `from`.\n */\n error TransferFromIncorrectOwner();\n\n /**\n * Cannot safely transfer to a contract that does not implement the\n * ERC721Receiver interface.\n */\n error TransferToNonERC721ReceiverImplementer();\n\n /**\n * Cannot transfer to the zero address.\n */\n error TransferToZeroAddress();\n\n /**\n * The token does not exist.\n */\n error URIQueryForNonexistentToken();\n\n /**\n * The `quantity` minted with ERC2309 exceeds the safety limit.\n */\n error MintERC2309QuantityExceedsLimit();\n\n /**\n * The `extraData` cannot be set on an unintialized ownership slot.\n */\n error OwnershipNotInitializedForExtraData();\n\n /**\n * `_sequentialUpTo()` must be greater than `_startTokenId()`.\n */\n error SequentialUpToTooSmall();\n\n /**\n * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.\n */\n error SequentialMintExceedsLimit();\n\n /**\n * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.\n */\n error SpotMintTokenIdTooSmall();\n\n /**\n * Cannot mint over a token that already exists.\n */\n error TokenAlreadyExists();\n\n /**\n * The feature is not compatible with spot mints.\n */\n error NotCompatibleWithSpotMints();\n\n // =============================================================\n // STRUCTS\n // =============================================================\n\n struct TokenOwnership {\n // The address of the owner.\n address addr;\n // Stores the start time of ownership with minimal overhead for tokenomics.\n uint64 startTimestamp;\n // Whether the token has been burned.\n bool burned;\n // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.\n uint24 extraData;\n }\n\n // =============================================================\n // TOKEN COUNTERS\n // =============================================================\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() external view returns (uint256);\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n\n // =============================================================\n // IERC721\n // =============================================================\n\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables\n * (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`,\n * checking first that contract recipients are aware of the ERC721 protocol\n * to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move\n * this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external payable;\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external payable;\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom}\n * whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external payable;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external payable;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n\n // =============================================================\n // IERC2309\n // =============================================================\n\n /**\n * @dev Emitted when tokens in `fromTokenId` to `toTokenId`\n * (inclusive) is transferred from `from` to `to`, as defined in the\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.\n *\n * See {_mintERC2309} for more details.\n */\n event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);\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/openzeppelin/contracts/interfaces/IERC1967.sol': { + '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/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/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/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: { - evmVersion: 'paris', - libraries: {}, + remappings: [ + '@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/', + '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/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: false, + runs: 200 + }, metadata: { useLiteralContent: true, bytecodeHash: 'ipfs', appendCBOR: true }, - optimizer: { enabled: true, runs: 20000 }, - remappings: [ - '@0xsequence/contracts-library/=src/', - 'ds-test/=lib/forge-std/lib/ds-test/src/', - '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/', - 'openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/', - 'openzeppelin/=lib/openzeppelin/' - ], - viaIR: true, outputSelection: { '*': { '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] } - } + }, + evmVersion: 'paris', + viaIR: true, + libraries: {} } } }