diff --git a/README.md b/README.md index 625cb52..acb374f 100644 --- a/README.md +++ b/README.md @@ -150,13 +150,13 @@ The following is a list of contracts that are deployed by this script. | SequenceMarketV1 | 0xB537a160472183f2150d42EB1c3DD6684A55f74c | | BatchPayableHelper | 0x6166c1952c54dEd6b070B4616797E61b6c48A117 | | ERC20ItemsFactory | 0x1063cBEe6b3Cd69B49f1B922A0D402f484b39855 | -| ERC721ItemsFactory | 0x29BCF1043Ca4B2c95aB28082143587896D39D22D | +| ERC721ItemsFactory | 0xC6064FfBaDB0687Da29721C8EC02ACa71e735a3e | | ERC1155ItemsFactory | 0x7364fDEFe24385B2b3869504383c94cF083AcbD6 | | ERC721SaleFactory | 0xc412172a99e657609f5f7D4b9Bea37684B8eEE4E | | ERC1155SaleFactory | 0x52A6E7236A01B72eeb262d58F7270cb9AeD8Db4B | | ERC721SoulboundFactory | 0x2fBFF6fd3C978ab1bBd21b878262c5289a14b6c1 | | ERC1155SoulboundFactory | 0xaB069C041FaCAB8f4D747D91EEda5705b5caAB76 | -| ERC1155PackFactory | 0x305197A57961CB16Df8D7F829Baf6aaF4bfD0d48 | +| ERC1155PackFactory | 0x5B2f47ee798eee52cE184C9eC4d60873185836d8 | | ERC721OperatorEnforcedFactory | 0x5fD880b092bD285873b16335a454D11c062a4689 | | ERC1155OperatorEnforcedFactory | 0xc89f63389ef3B53D07649D52D47F9E4afcAbb1fB | | Clawback | 0x6F9a2c3E11011b894fae691d5338748f8048467d | diff --git a/scripts/factories/token_library/ERC1155PackFactory.ts b/scripts/factories/token_library/ERC1155PackFactory.ts index e9489ef..c2509d5 100644 --- a/scripts/factories/token_library/ERC1155PackFactory.ts +++ b/scripts/factories/token_library/ERC1155PackFactory.ts @@ -1,89 +1,228 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' -// https://github.com/0xsequence/contracts-library/blob/d1718c6ae4289ae482ee427164672de60fc0cade/src/tokens/ERC1155/presets/pack/ERC1155PackFactory.sol +// https://github.com/0xsequence/contracts-library/blob/73363994054ad0983ceabebb8b98ad02044a4267/src/tokens/ERC1155/presets/pack/ERC1155PackFactory.sol const abi = [ { - type: 'constructor', - inputs: [{ name: 'factoryOwner', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' + inputs: [ + { + internalType: 'address', + name: 'factoryOwner', + type: 'address' + } + ], + stateMutability: 'nonpayable', + type: 'constructor' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'proxyAddr', + type: 'address' + } + ], + name: 'ERC1155PackDeployed', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address' + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'OwnershipTransferred', + type: 'event' }, { - type: 'function', - name: 'beacon', inputs: [], - outputs: [{ name: '', type: 'address', internalType: 'contract UpgradeableBeacon' }], - stateMutability: 'view' + name: 'beacon', + outputs: [ + { + internalType: 'contract UpgradeableBeacon', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' }, { - type: 'function', - name: 'deploy', inputs: [ - { name: 'proxyOwner', type: 'address', internalType: 'address' }, - { name: 'tokenOwner', type: 'address', internalType: 'address' }, - { name: 'name', type: 'string', internalType: 'string' }, - { name: 'baseURI', type: 'string', internalType: 'string' }, - { name: 'contractURI', type: 'string', internalType: 'string' }, - { name: 'royaltyReceiver', type: 'address', internalType: 'address' }, - { name: 'royaltyFeeNumerator', type: 'uint96', internalType: 'uint96' }, - { name: 'merkleRoot', type: 'bytes32', internalType: 'bytes32' }, - { name: 'supply', type: 'uint256', internalType: 'uint256' } + { + internalType: 'address', + name: 'proxyOwner', + type: 'address' + }, + { + internalType: 'address', + name: 'tokenOwner', + type: 'address' + }, + { + internalType: 'string', + name: 'name', + type: 'string' + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string' + }, + { + internalType: 'string', + name: 'contractURI', + type: 'string' + }, + { + internalType: 'address', + name: 'royaltyReceiver', + type: 'address' + }, + { + internalType: 'uint96', + name: 'royaltyFeeNumerator', + type: 'uint96' + }, + { + internalType: 'address', + name: 'implicitModeValidator', + type: 'address' + }, + { + internalType: 'bytes32', + name: 'implicitModeProjectId', + type: 'bytes32' + } + ], + name: 'deploy', + outputs: [ + { + internalType: 'address', + name: 'proxyAddr', + type: 'address' + } ], - outputs: [{ name: 'proxyAddr', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' + stateMutability: 'nonpayable', + type: 'function' }, { - type: 'function', - name: 'determineAddress', inputs: [ - { name: 'proxyOwner', type: 'address', internalType: 'address' }, - { name: 'tokenOwner', type: 'address', internalType: 'address' }, - { name: 'name', type: 'string', internalType: 'string' }, - { name: 'baseURI', type: 'string', internalType: 'string' }, - { name: 'contractURI', type: 'string', internalType: 'string' }, - { name: 'royaltyReceiver', type: 'address', internalType: 'address' }, - { name: 'royaltyFeeNumerator', type: 'uint96', internalType: 'uint96' } + { + internalType: 'address', + name: 'proxyOwner', + type: 'address' + }, + { + internalType: 'address', + name: 'tokenOwner', + type: 'address' + }, + { + internalType: 'string', + name: 'name', + type: 'string' + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string' + }, + { + internalType: 'string', + name: 'contractURI', + type: 'string' + }, + { + internalType: 'address', + name: 'royaltyReceiver', + type: 'address' + }, + { + internalType: 'uint96', + name: 'royaltyFeeNumerator', + type: 'uint96' + }, + { + internalType: 'address', + name: 'implicitModeValidator', + type: 'address' + }, + { + internalType: 'bytes32', + name: 'implicitModeProjectId', + type: 'bytes32' + } + ], + name: 'determineAddress', + outputs: [ + { + internalType: 'address', + name: 'proxyAddr', + type: 'address' + } ], - outputs: [{ name: 'proxyAddr', type: 'address', internalType: 'address' }], - stateMutability: 'view' + stateMutability: 'view', + type: 'function' }, { - type: 'function', - name: 'owner', inputs: [], - outputs: [{ name: '', type: 'address', internalType: 'address' }], - stateMutability: 'view' + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' }, - { type: 'function', name: 'renounceOwnership', inputs: [], outputs: [], stateMutability: 'nonpayable' }, { - type: 'function', - name: 'transferOwnership', - inputs: [{ name: 'newOwner', type: 'address', internalType: 'address' }], + inputs: [], + name: 'renounceOwnership', outputs: [], - stateMutability: 'nonpayable' + stateMutability: 'nonpayable', + type: 'function' }, { - type: 'function', - name: 'upgradeBeacon', - inputs: [{ name: 'implementation', type: 'address', internalType: 'address' }], + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'transferOwnership', outputs: [], - stateMutability: 'nonpayable' + stateMutability: 'nonpayable', + type: 'function' }, { - type: 'event', - name: 'ERC1155PackDeployed', - inputs: [{ name: 'proxyAddr', type: 'address', indexed: false, internalType: 'address' }], - anonymous: false - }, - { - type: 'event', - name: 'OwnershipTransferred', inputs: [ - { name: 'previousOwner', type: 'address', indexed: true, internalType: 'address' }, - { name: 'newOwner', type: 'address', indexed: true, internalType: 'address' } + { + internalType: 'address', + name: 'implementation', + type: 'address' + } ], - anonymous: false + name: 'upgradeBeacon', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' } ] @@ -91,7 +230,7 @@ export class ERC1155PackFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( abi, - '0x608034610125576001600160401b0390601f6200744338819003918201601f191683019291908484118385101761010f57816020928492604096875283398101031261012557516001600160a01b038082168203610125576100603361012a565b825193614e5394858101958187108388111761010f57620025f0823980600096039086f0908115610105578451916105ee808401928311848410176100f1579184849260209462002002853916815203019085f080156100e4576100d69394501660018060a01b0319600154161760015561012a565b51611e909081620001728239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461086457806359659e90146108115780636dbefeff1461068a578063715018a6146105ed5780638da5cb5b1461059c578063d42d4b0a146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a5610923565b906100ae610ac1565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b50919034610598577ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc91610120833601126104a2576101e7610923565b926101f061094b565b9067ffffffffffffffff604435818111610594576102119036908901610a31565b90606435818111610590576102299036908a01610a31565b90608435908111610590578794939291906102479036908b01610a31565b9261025061096e565b93610259610aa6565b9289519b60209c8d8c88838c8a8d8a8a888601966102779588610ba6565b03937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09485810182526102aa90826109f0565b5190209b8d82519485916102bd836109d4565b825273ffffffffffffffffffffffffffffffffffffffff9e8f60015416908551938492888401966102ee9388610c19565b0390810182526102fe90826109f0565b519020916111eb91519080830161031590836109f0565b828252810191610c70833980511561053257518c92918ef5169c8d156104d5576001548b16908e3b156104d157908e8c8f8f94610393869251978896879586947fcf7a1d77000000000000000000000000000000000000000000000000000000008652168b8501526024840152606060448401526064830190610b63565b03925af180156104c757908b916104b3575b50508b3b156104af576104327f1d14ef670000000000000000000000000000000000000000000000000000000096946bffffffffffffffffffffffff946104238d9b9a98958f958e96519e8f9d8e9d8e5216908c015261010060248c0152610413610104998a8d0190610b63565b90848c83030160448d0152610b63565b918983030160648a0152610b63565b941660848601521660a484015260e43560c48401523560e4830152038183885af180156104a55761048e575b50507fe3049ee698743dac343b02bfe6b441269ca8b5f5dd610b74d96c1c02034ee566838251848152a151908152f35b6104988291610991565b6104a2578061045e565b80fd5b83513d84823e3d90fd5b8980fd5b6104bc90610991565b6104af5789386103a5565b8c513d8d823e3d90fd5b8c80fd5b506064828f8e51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b5050506064828f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b8580fd5b8480fd5b5080fd5b50503461059857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105985773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b83346104a257807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104a257610624610ac1565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5091346104a25760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126104a2576106c3610923565b906106cc61094b565b67ffffffffffffffff91906044358381116101a6576106ee9036908801610a31565b9560643584811161080d576107069036908301610a31565b9360843590811161080d5760559492610728600b95936107cd93369101610a31565b9361074f61073461096e565b61073c610aa6565b908b5197889460209e8f87019788610ba6565b03936107817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0958681018352826109f0565b51902092875192610791846109d4565b835273ffffffffffffffffffffffffffffffffffffffff966107c18860015416948a519586938d85019889610c19565b039081018352826109f0565b5190206111eb85516107e1888301826109f0565b81815287810191610c7083395190209085519186830152868201523081520160ff815320915191168152f35b8380fd5b50503461059857817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126105985760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6578261089e610923565b6108a6610ac1565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561080d5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af190811561091a575061090e575080f35b61091790610991565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361094657565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361094657565b60a4359073ffffffffffffffffffffffffffffffffffffffff8216820361094657565b67ffffffffffffffff81116109a557604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176109a557604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109a557604052565b81601f820112156109465780359067ffffffffffffffff82116109a55760405192610a8460207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601856109f0565b8284526020838301011161094657816000926020809301838601378301015290565b60c435906bffffffffffffffffffffffff8216820361094657565b73ffffffffffffffffffffffffffffffffffffffff600054163303610ae257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b838110610b535750506000910152565b8181015183820152602001610b43565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610b9f81518092818752878088019101610b40565b0116010190565b9496959160a094610bfe6bffffffffffffffffffffffff95610bf0610c0c9473ffffffffffffffffffffffffffffffffffffffff8097168b5260c060208c015260c08b0190610b63565b9089820360408b0152610b63565b908782036060890152610b63565b9616608085015216910152565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610c6a8251809360208685019101610b40565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea2646970667358221220b820652d5793497c167e3cfe4d8ae98e5e8a03632e1b489cac5616cd2b77dde864736f6c63430008130033a26469706673582212206042f8485c3720a3843e788e3999900f7d3500f1c8aea0a9042957fc3db6fd1664736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea26469706673582212201cbd07faafe4f9244190e59ad13104130390b97708c6d97e7a003733063b13b764736f6c6343000813003360a060405234620002ec5762000014620002f1565b6200001e620002f1565b815190916001600160401b0390818311620001ed576005938454916001948584811c9416918215620002e1575b60209283861014620002cb578190601f9586811162000277575b5083908683116001146200020f5760009262000203575b5050600019600383901b1c191690861b1786555b8151938411620001ed576004958654908682811c92168015620001e2575b83831014620001cd5784821162000184575b5050809284116001146200011957509282939183926000946200010d575b50501b916000199060031b1c19161790555b33608052604051614b3d908162000316823960805181613d240152f35b015192503880620000de565b919083601f1981168760005284600020946000905b888383106200016957505050106200014f575b505050811b019055620000f0565b015160001960f88460031b161c1916905538808062000141565b8587015188559096019594850194879350908101906200012e565b87600052826000209085808801821c830193858910620001c3575b01901c019086905b828110620001b65750620000c0565b60008155018690620001a7565b935082936200019f565b602288634e487b7160e01b6000525260246000fd5b91607f1691620000ae565b634e487b7160e01b600052604160045260246000fd5b0151905038806200007c565b90889350601f198316918a600052856000209260005b8782821062000260575050841162000246575b505050811b01865562000090565b015160001960f88460031b161c1916905538808062000238565b8385015186558c9790950194938401930162000225565b9091508860005283600020868085018b1c820192868610620002c1575b918a9186959493018c1c01915b828110620002b157505062000065565b600081558594508a9101620002a1565b9250819262000294565b634e487b7160e01b600052602260045260246000fd5b93607f16936200004b565b600080fd5b60405190602082016001600160401b03811183821017620001ed576040526000825256fe608080604052600436101561001357600080fd5b60003560e01c908162fdd58e14612e145750806301ffc9a714612d4157806304634d8d14612cff578063047fc9aa14612ce157806306fdde0314612c3b5780630b5ee00614612ac25780630e89341c1461297a57806318160ddd1461295c5780631d14ef67146127e957806320ec271b146126b0578063248a9ca3146126815780632693ebf214612655578063275bf183146124285780632a55205a146123745780632eb2c2d614611eb05780632eb4a7ab14611e925780632f2ff15d14611dbc57806336568abe14611cf65780633c7a3aff14611bb75780634e1273f4146119d95780635944c753146118bb5780636c0360eb146118155780636f225bd4146115fd578063731133e9146114ab5780637e518ec8146113315780639010d07c146112e757806391d148541461128c578063938e3d7b14611112578063a206e5e114610c4a578063a217fddf14610c2e578063a22cb46514610b9b578063b390c0ab14610b0c578063b48ab8b6146107fa578063bd93f5a0146107cd578063ca15c873146107a1578063d547741f14610762578063da0239a614610744578063e8a3d4851461065e578063e985e9c5146105fa578063f242432a1461026e5763f8954818146101e157600080fd5b346102695760c0600319360112610269576101fa612e64565b67ffffffffffffffff906024358281116102695761021c90369060040161301b565b6044358381116102695761023490369060040161301b565b6064359384116102695761024f61026794369060040161301b565b90610258612e87565b92610261612eee565b94613d04565b005b600080fd5b346102695760a060031936011261026957610287612e64565b61028f612eaa565b906044356064359260843567ffffffffffffffff8111610269576102b790369060040161301b565b73ffffffffffffffffffffffffffffffffffffffff8094169384331480156105d6575b156105525782169182156104ce5784600052602095600087526040600020856000528752604060002061030e828254613122565b905583600052600087526040600020856000528752604060002061033382825461312f565b90558386604051878152838a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a46103725a926132dd565b61037857005b600087946103d596604051978896879586937ff23a6e61000000000000000000000000000000000000000000000000000000009c8d865233600487015260248601526044850152606484015260a0608484015260a4830190612fda565b0393f180156104c2577fffffffff0000000000000000000000000000000000000000000000000000000091600091610495575b50160361041157005b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152603a60248201527f45524331313535235f63616c6c6f6e4552433131353552656365697665643a2060448201527f494e56414c49445f4f4e5f524543454956455f4d4553534147450000000000006064820152fd5b6104b59150843d86116104bb575b6104ad8183612f94565b81019061313c565b84610408565b503d6104a3565b6040513d6000823e3d90fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f524543495049454e540000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f4f50455241544f52000000000000000000000000000000000000000000006064820152fd5b5084600052600160205260406000203360005260205260ff604060002054166102da565b3461026957604060031936011261026957610613612e64565b61061b612eaa565b9073ffffffffffffffffffffffffffffffffffffffff809116600052600160205260406000209116600052602052602060ff604060002054166040519015158152f35b34610269576000600319360112610269576040516000600a5461068081612f09565b8084529060019081811690811561071d57506001146106c2575b6106be846106aa81860382612f94565b604051918291602083526020830190612fda565b0390f35b600a600090815292507fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85b8284106107055750505081016020016106aa8261069a565b805460208587018101919091529093019281016106ed565b60ff191660208087019190915292151560051b850190920192506106aa915083905061069a565b34610269576000600319360112610269576020600e54604051908152f35b3461026957604060031936011261026957610267600435610781612eaa565b9080600052600860205261079c600160406000200154613829565b61393b565b346102695760206003193601126102695760043560005260096020526020604060002054604051908152f35b346102695760206003193601126102695760206107f06107eb612e64565b6146ea565b9050604051908152f35b346102695760031960808136011261026957610814612e64565b9067ffffffffffffffff6024358181116102695761083690369060040161307a565b926044358281116102695761084f90369060040161307a565b916064359081116102695761086890369060040161301b565b906108716136dd565b845183518103610ae25760008073ffffffffffffffffffffffffffffffffffffffff8416925b808310610a4f57506108ac915060025461312f565b6002558060006040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3391806108e48a8d83613197565b0390a46108f15a926132dd565b6108f757005b600061096291602095610971604051988997889687946109527fbc197c81000000000000000000000000000000000000000000000000000000009e8f885233600489015289602489015260a0604489015260a48801906130ee565b90848783030160648801526130ee565b91848303016084850152612fda565b0393f180156104c2577fffffffff0000000000000000000000000000000000000000000000000000000091600091610a31575b5016036109ad57005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f45524331313535235f63616c6c6f6e455243313135354261746368526563656960448201527f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006064820152fd5b610a49915060203d81116104bb576104ad8183612f94565b836109a4565b90610ad5610adb918a60038a610aad88610aa681610a6d8186613183565b51948d600052602095600087526040600020610a89848b613183565b516000528752610a9f604060002091825461312f565b9055613183565b5194613183565b5160005252610ac2604060002091825461312f565b9055610ace858a613183565b519061312f565b92613174565b9190610897565b60046040517f9d89020a000000000000000000000000000000000000000000000000000000008152fd5b34610269576000610b1c366130d8565b610b2881600254613122565b600255818352600360205260408320610b42828254613122565b9055338352826020526040832082845260205260408320610b64828254613122565b9055604051918252602082015233907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4005b3461026957604060031936011261026957610bb4612e64565b6024358015158091036102695733600052600160205273ffffffffffffffffffffffffffffffffffffffff604060002092169182600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b3461026957600060031936011261026957602060405160008152f35b3461026957606060031936011261026957610c63612e64565b67ffffffffffffffff60243511610269576060600319602435360301126102695767ffffffffffffffff60443511610269573660236044350112156102695767ffffffffffffffff6044356004013511610269573660246044356004013560051b60443501011161026957610cd7816146ea565b6040805160208101929092528181015290919080610cfa60046024350180614588565b6060808401528060c084015260e08301919060005b8181106110d95750505090610d8d610d9b92610d69610d376024803501602435600401614588565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0939184878403016080880152614618565b90610d7e604460243501602435600401614588565b918584030160a0860152614618565b03601f198101835282612f94565b60208151910120600c5491610db560443560040135613062565b91610dc36040519384612f94565b60443560048101358452602401602084015b60246044356004013560051b604435010182106110c9575050936000945b8351861015610e3f57610e068685613183565b519081811015610e2b57600052602052610e2560406000205b95613174565b94610df3565b90600052602052610e256040600020610e1f565b840361109f5773ffffffffffffffffffffffffffffffffffffffff8216600052600f60205260006040812055610e82610e79600e546139d2565b80600e55614817565b90600052601060205260406000205560005b610ea36004602435018061467b565b905081101561105c57610ebb6004602435018061467b565b82101561102d578160051b01359073ffffffffffffffffffffffffffffffffffffffff8216820361026957610f0381610efd602480350160243560040161467b565b906146cf565b92610f1c83610efd60446024350160243560040161467b565b73ffffffffffffffffffffffffffffffffffffffff839293163b1561026957600073ffffffffffffffffffffffffffffffffffffffff6020610fb482968b95610fa2869a6040519d8e9b8c9a7fb48ab8b6000000000000000000000000000000000000000000000000000000008c521660048b0152608060248b015260848a01916145db565b916003198884030160448901526145db565b838582039160031983016064880152520193165af180156104c257610fe3575b610fde9150613174565b610e94565b67ffffffffffffffff8211610ffe57610fde91604052610fd4565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f53c9506e55fc6114c87ee7b6f64d544cf5de7fb4025c4aee19279ed5dd3bf15760208373ffffffffffffffffffffffffffffffffffffffff60405191168152a1005b60046040517f09bde339000000000000000000000000000000000000000000000000000000008152fd5b8135815260209182019101610dd5565b9193509160208060019273ffffffffffffffffffffffffffffffffffffffff61110188612ecd565b168152019401910191849392610d0f565b34610269576020806003193601126102695767ffffffffffffffff6004358181116102695761114590369060040161301b565b9161114e613591565b8251918211610ffe57611162600a54612f09565b601f8111611228575b5080601f83116001146111a75750819260009261119c575b50506000198260011b9260031b1c191617600a55600080f35b015190508280611183565b90601f19831693600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8926000905b86821061121057505083600195106111f7575b505050811b01600a55005b015160001960f88460031b161c191690558280806111ec565b806001859682949686015181550195019301906111d9565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f840160051c810191838510611282575b601f0160051c01905b818110611276575061116b565b60008155600101611269565b9091508190611260565b34610269576040600319360112610269576112a5612eaa565b600435600052600860205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b3461026957602073ffffffffffffffffffffffffffffffffffffffff61132161130f366130d8565b90600052600984526040600020613b0e565b9190546040519260031b1c168152f35b34610269576020806003193601126102695767ffffffffffffffff6004358181116102695761136490369060040161301b565b9161136d613591565b8251918211610ffe57611381600454612f09565b601f8111611447575b5080601f83116001146113c6575081926000926113bb575b50506000198260011b9260031b1c191617600455600080f35b0151905082806113a2565b90601f1983169360046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b86821061142f5750508360019510611416575b505050811b01600455005b015160001960f88460031b161c1916905582808061140b565b806001859682949686015181550195019301906113f8565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c8101918385106114a1575b601f0160051c01905b818110611495575061138a565b60008155600101611488565b909150819061147f565b34610269576080600319360112610269576114c4612e64565b60243560443560643567ffffffffffffffff8111610269576114ea90369060040161301b565b926114f36136dd565b6114ff8260025461312f565b6002558260005260209360038552604060002061151d84825461312f565b905573ffffffffffffffffffffffffffffffffffffffff82169182600052600086526040600020856000528652604060002061155a85825461312f565b905582600060405187815286898201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a461159a5a916132dd565b6115a057005b6103d593600087946040518097819682957ff23a6e61000000000000000000000000000000000000000000000000000000009b8c85523360048601528660248601526044850152606484015260a0608484015260a4830190612fda565b346102695760208060031936011261026957611617612e64565b73ffffffffffffffffffffffffffffffffffffffff811680600052600f8352604060002054156117eb5780600052600f8352604060002054804015908115916117e0575b506117b65780600052600f8352600060408120556040519183830183811067ffffffffffffffff821117610ffe57604052600083526002549260019384810180911161178757600255836000526003855260406000208054908582018092116117875755826000526000855260406000208460005285526040600020805490858201809211611787575582600060405186815286888201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a46117235a926132dd565b61172957005b84916103d59160006040519586809581947ff23a6e61000000000000000000000000000000000000000000000000000000009a8b8452336004850152856024850152806044850152606484015260a0608484015260a4830190612fda565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60046040517f55be410c000000000000000000000000000000000000000000000000000000008152fd5b90504311158461165b565b60046040517ffbd0656a000000000000000000000000000000000000000000000000000000008152fd5b3461026957600060031936011261026957604051600060045461183781612f09565b8084529060019081811690811561071d5750600114611860576106be846106aa81860382612f94565b6004600090815292507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8284106118a35750505081016020016106aa8261069a565b8054602085870181019190915290930192810161188b565b34610269576060600319360112610269576118d4612eaa565b6044356bffffffffffffffffffffffff8116809103610269576118f5613313565b611903612710821115614425565b73ffffffffffffffffffffffffffffffffffffffff80921691821561197b577fffffffffffffffffffffffff0000000000000000000000000000000000000000906040519361195185612f5c565b84526020840192835260043560005260076020526040600020935116915160a01b16179055600080f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b346102695760406003193601126102695760043567ffffffffffffffff808211610269573660238301121561026957816004013590611a1782613062565b92611a256040519485612f94565b82845260209260248486019160051b83010191368311610269576024859101915b838310611b9f575050505060243590811161026957611a6990369060040161307a565b8251815103611b1b57825190601f19611a9a611a8484613062565b93611a926040519586612f94565b808552613062565b01368484013760005b8451811015611b08578073ffffffffffffffffffffffffffffffffffffffff611acf611b039388613183565b5116600052600085526040600020611ae78285613183565b516000528552604060002054611afd8286613183565b52613174565b611aa3565b604051848152806106be818701866130ee565b608482604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602c60248201527f455243313135352362616c616e63654f6642617463683a20494e56414c49445f60448201527f41525241595f4c454e47544800000000000000000000000000000000000000006064820152fd5b8190611baa84612ecd565b8152019101908490611a46565b3461026957600060031936011261026957336000526020600f81526040600020546117b6573360005260008152604060002060019081600052825260406000205415611ccc576002546000199081810190811161178757600255816000526003835260406000208054908282019182116117875755336000526000835260406000208260005283526040600020805491820191821161178757556000604051828152828482015233907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4430190814311611787577f5e1dd8c4451717d5ca4ffbefdada35e22e0871220b9ed9dd03a351f0938c5ed79033600052600f8152826040600020556040519283523392a2005b60046040517fc2caa2a6000000000000000000000000000000000000000000000000000000008152fd5b3461026957604060031936011261026957611d0f612eaa565b3373ffffffffffffffffffffffffffffffffffffffff821603611d38576102679060043561393b565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610269576040600319360112610269576102676004356009611ddd612eaa565b918060005260209060088252611dfa600160406000200154613829565b806000526008825273ffffffffffffffffffffffffffffffffffffffff604060002094169384600052825260ff6040600020541615611e42575b600052526040600020613b26565b806000526008825260406000208460005282526040600020600160ff198254161790553384827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4611e34565b34610269576000600319360112610269576020600c54604051908152f35b346102695760a060031936011261026957611ec9612e64565b611ed1612eaa565b9060449067ffffffffffffffff90823582811161026957611ef690369060040161307a565b606494853584811161026957611f1090369060040161307a565b9360843590811161026957611f2990369060040161301b565b73ffffffffffffffffffffffffffffffffffffffff908185163314801561234e575b156122cb57818316156122485783518651036121c557835160005b81811061213b57505060405182841690838716907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180611fa98c8b83613197565b0390a45a94611fb7846132dd565b611fbd57005b8291604051978896879586947fbc197c810000000000000000000000000000000000000000000000000000000086523360048701521660248501528a840160a0905260a4840161200c916130ee565b838103600319018c850152612020916130ee565b82810360031901608484015261203591612fda565b039216600090602095f19081156104c2577fbc197c8100000000000000000000000000000000000000000000000000000000917fffffffff000000000000000000000000000000000000000000000000000000009160009161211d575b50160361209b57005b7f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006084927f45524331313535235f63616c6c6f6e4552433131353542617463685265636569604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152603f6024860152840152820152fd5b612135915060203d81116104bb576104ad8183612f94565b85612092565b806121496121c0928a613183565b51858916600052602090600082526040600020612166848b613183565b51600052825261217c6040600020918254613122565b9055612188828b613183565b5190868816600052600081526040600020906121a4848b613183565b51600052526121b9604060002091825461312f565b9055613174565b611f66565b6084877f494e56414c49445f4152524159535f4c454e47544800000000000000000000008a7f45524331313535235f7361666542617463685472616e7366657246726f6d3a20604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260356024860152840152820152fd5b6084877f4e56414c49445f524543495049454e54000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260306024860152840152820152fd5b6084877f4e56414c49445f4f50455241544f5200000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152602f6024860152840152820152fd5b50818516600052600160205260406000203360005260205260ff60406000205416611f4b565b3461026957612382366130d8565b9060005260076020526040600020906040519161239e83612f5c565b5473ffffffffffffffffffffffffffffffffffffffff928382169182825260a01c60208201529015612406575b6bffffffffffffffffffffffff6020820151169182810292818404149015171561178757604092612710915116918351928352046020820152f35b5060405161241381612f5c565b600654838116825260a01c60208201526123cb565b3461026957612436366130d8565b907fbaa5ee745de68a3095827d2ee7dd2043afc932834d02cc1b8be3da78577f6c1a80600052602060088152604060002033600052815260ff604060002054161561248a575050600c55600d819055600e55005b612493336139df565b916040516124a081612f78565b6042815282810191606036843781511561102d5760308353815160019081101561102d57607860218401536041905b8082116126055750506125a85761255a93612569926048926040519687937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000088860152612525815180928a603789019101612fb7565b8401917f206973206d697373696e6720726f6c6520000000000000000000000000000000603784015251809386840190612fb7565b01036028810185520183612f94565b6125a46040519283927f08c379a000000000000000000000000000000000000000000000000000000000845260048401526024830190612fda565b0390fd5b606483604051907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f811690601082101561102d577f303132333435363738396162636465660000000000000000000000000000000061264f921a61264585876131bf565b5360041c926139d2565b906124cf565b346102695760206003193601126102695760043560005260036020526020604060002054604051908152f35b346102695760206003193601126102695760043560005260086020526020600160406000200154604051908152f35b346102695760406003193601126102695767ffffffffffffffff600435818111610269576126e290369060040161307a565b90602435908111610269576126fb90369060040161307a565b81519181518303610ae2576000926000905b80821061275e575050612724600093600254613122565b6002557f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb604051806127593395339583613197565b0390a4005b90936127dd6127e3916127718787613183565b513360005260209060008252604060002061278c8a89613183565b5160005282526127a26040600020918254613122565b905560036127b08989613183565b51916127bc8a89613183565b51600052526127d16040600020918254613122565b9055610ace8787613183565b94613174565b9061270d565b346102695761010060031936011261026957612803612e64565b67ffffffffffffffff906024358281116102695761282590369060040161301b565b6044358381116102695761283d90369060040161301b565b6064359384116102695761285861026794369060040161301b565b90612861612e87565b9261286a612eee565b73ffffffffffffffffffffffffffffffffffffffff861660008181527f8ee3ca74b3f53745dbc2c424ce3194f7fbce295a6334fe2d150b8a25d4e298e2602052604090205491969160e435916128f7917fbaa5ee745de68a3095827d2ee7dd2043afc932834d02cc1b8be3da78577f6c1a9060ff161561290a575b60005260096020526040600020613b26565b5060c435600c5580600d55600e55613d04565b8060005260086020526040600020826000526020526040600020600160ff198254161790553382827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a46128e5565b34610269576000600319360112610269576020600254604051908152f35b3461026957602080600319360112610269576129976004356131d0565b9060405191828260006004546129ac81612f09565b90600190818116908115612aa55750600114612a42575b505090816129dd8560059594612a2e975194859201612fb7565b017f2e6a736f6e0000000000000000000000000000000000000000000000000000008152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5810185520183612f94565b6106be604051928284938452830190612fda565b60046000908152949593949192507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838310612a8d575092949392505082018101836129dd6129c3565b8054838a018701528896508795909201918101612a72565b60ff191686860152505080151502830182019050836129dd6129c3565b34610269576020806003193601126102695767ffffffffffffffff9060043582811161026957612af690369060040161301b565b91612aff613591565b8251908111610ffe57600591612b158354612f09565b601f8111612bda575b5080601f8311600114612b5a5750819293600092612b4f575b50506000198260011b9260031b1c1916179055600080f35b015190508380612b37565b90601f19831694846000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b878210612bc2575050836001959610612ba9575b505050811b019055005b015160001960f88460031b161c19169055838080612b9f565b80600185968294968601518155019501930190612b8b565b836000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0601f8401851c810191838510612c31575b601f01851c01905b818110612c255750612b1e565b60008155600101612c18565b9091508190612c10565b34610269576000600319360112610269576040516000600554612c5d81612f09565b8084529060019081811690811561071d5750600114612c86576106be846106aa81860382612f94565b6005600090815292507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b828410612cc95750505081016020016106aa8261069a565b80546020858701810191909152909301928101612cb1565b34610269576000600319360112610269576020600d54604051908152f35b3461026957604060031936011261026957612d18612e64565b6024356bffffffffffffffffffffffff811681036102695761026791612d3c613313565b6144b0565b34610269576020600319360112610269576004357fffffffff00000000000000000000000000000000000000000000000000000000811680820361026957602091817f76826f8e0000000000000000000000000000000000000000000000000000000014918215612db9575b50506040519015158152f35b7fc79b8b5f000000000000000000000000000000000000000000000000000000001491508115612e03575b8115612df3575b508280612dad565b612dfd9150614838565b82612deb565b9050612e0e81614838565b90612de4565b346102695760406003193601126102695760209073ffffffffffffffffffffffffffffffffffffffff612e45612e64565b1660005260008252604060002060243560005282526040600020548152f35b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361026957565b6084359073ffffffffffffffffffffffffffffffffffffffff8216820361026957565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361026957565b359073ffffffffffffffffffffffffffffffffffffffff8216820361026957565b60a435906bffffffffffffffffffffffff8216820361026957565b90600182811c92168015612f52575b6020831014612f2357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691612f18565b6040810190811067ffffffffffffffff821117610ffe57604052565b6080810190811067ffffffffffffffff821117610ffe57604052565b90601f601f19910116810190811067ffffffffffffffff821117610ffe57604052565b60005b838110612fca5750506000910152565b8181015183820152602001612fba565b90601f19601f602093612ff881518092818752878088019101612fb7565b0116010190565b67ffffffffffffffff8111610ffe57601f01601f191660200190565b81601f820112156102695780359061303282612fff565b926130406040519485612f94565b8284526020838301011161026957816000926020809301838601378301015290565b67ffffffffffffffff8111610ffe5760051b60200190565b81601f820112156102695780359161309183613062565b9261309f6040519485612f94565b808452602092838086019260051b820101928311610269578301905b8282106130c9575050505090565b813581529083019083016130bb565b6003196040910112610269576004359060243590565b90815180825260208080930193019160005b82811061310e575050505090565b835185529381019392810192600101613100565b9190820391821161178757565b9190820180921161178757565b9081602091031261026957517fffffffff00000000000000000000000000000000000000000000000000000000811681036102695790565b60001981146117875760010190565b805182101561102d5760209160051b010190565b90916131ae6131bc936040845260408401906130ee565b9160208184039101526130ee565b90565b90815181101561102d570160200190565b80156132a35780816000925b61328f5750806131eb83612fff565b926131f96040519485612f94565b808452601f1961320882612fff565b01366020860137915b61321a57505090565b60001982019182116117875781600a808304928184029184830414841517156117875761324a60ff928392613122565b16603001908111611787577fff000000000000000000000000000000000000000000000000000000000000006132889160f81b1660001a91856131bf565b5380613211565b9161329b600a91613174565b9204806131dc565b506040516132b081612f5c565b600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b3f80151590816132eb575090565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709150141590565b3360009081527fa9ced9fdc45cded6d4b7a90e36d1ee82b957a500cc22704c465e9bdf275406fd602090815260408083205490927f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119160ff16156133775750505050565b613380336139df565b9184519061338d82612f78565b60428252848201926060368537825115613564576030845382516001908110156135375790607860218501536041915b8083116134b85750505061345c5760486125a49386936134269361341798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612525815180928c603789019101612fb7565b01036028810187520185612f94565b519283927f08c379a000000000000000000000000000000000000000000000000000000000845260048401526024830190612fda565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f8116601081101561350a57907f3031323334353637383961626364656600000000000000000000000000000000613503921a6134f986886131bf565b5360041c936139d2565b91906133bd565b6024847f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f95f185554aba264de8ed412af70e5aba6acb0e648f258c912ad29ed85d11ca18602090815260408083205490927fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59160ff16156135f55750505050565b6135fe336139df565b9184519061360b82612f78565b60428252848201926060368537825115613564576030845382516001908110156135375790607860218501536041915b8083116136955750505061345c5760486125a49386936134269361341798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612525815180928c603789019101612fb7565b909192600f8116601081101561350a57907f30313233343536373839616263646566000000000000000000000000000000006136d6921a6134f986886131bf565b919061363b565b3360009081527f51a495916474fe1a0c0fcfb65a8a97682b84a054118858cdd1f5dfd7fc0919eb602090815260408083205490927f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69160ff16156137415750505050565b61374a336139df565b9184519061375782612f78565b60428252848201926060368537825115613564576030845382516001908110156135375790607860218501536041915b8083116137e15750505061345c5760486125a49386936134269361341798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612525815180928c603789019101612fb7565b909192600f8116601081101561350a57907f3031323334353637383961626364656600000000000000000000000000000000613822921a6134f986886131bf565b9190613787565b60009080825260209060088252604092838120338252835260ff8482205416156138535750505050565b61385c336139df565b9184519061386982612f78565b60428252848201926060368537825115613564576030845382516001908110156135375790607860218501536041915b8083116138f35750505061345c5760486125a49386936134269361341798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612525815180928c603789019101612fb7565b909192600f8116601081101561350a57907f3031323334353637383961626364656600000000000000000000000000000000613934921a6134f986886131bf565b9190613899565b90604061398792600090808252600860205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff838320541661398a575b8152600960205220613bc9565b50565b808252600860205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a461397a565b8015611787576000190190565b604051906060820182811067ffffffffffffffff821117610ffe57604052602a825260208201604036823782511561102d5760309053815160019081101561102d57607860218401536029905b808211613a9a575050613a3c5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f8116906010821015613ae0577f3031323334353637383961626364656600000000000000000000000000000000613ada921a61264585876131bf565b90613a2c565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b805482101561102d5760005260206000200190600090565b91906001830160009082825280602052604082205415600014613bc35784549468010000000000000000861015613b965783613b86613b6f886001604098999a01855584613b0e565b81939154906000199060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014613cfd5760001991828101818111613cd057825490848201918211613ca357808203613c6e575b50505080548015613c4157820191613c248383613b0e565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b613c8e613c7e613b6f9386613b0e565b90549060031b1c92839286613b0e565b90558652846020526040862055388080613c0c565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b9391959490929573ffffffffffffffffffffffffffffffffffffffff93847f0000000000000000000000000000000000000000000000000000000000000000163314801590614419575b6143ef57805167ffffffffffffffff92838211610ffe5760059180613d738454612f09565b94601f95868111614382575b50602090868311600114614301576000926142f6575b50506000198260011b9260031b1c19161782555b8051848111610ffe5780600492613dc08454612f09565b86811161428b575b5060209086831160011461420a576000926141ff575b50506000198260011b9260031b1c19161781555b89519384116141d15750613e07600a54612f09565b90828211614175575b505060209082116001146140e8579080613f3d9392613f9198996000926140dd575b50506000198260011b9260031b1c191617600a555b6000805260089283602052604094856000209616958660005260205260ff8560002054161561408e575b600080526009602052613e878686600020613b26565b507f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0118060005284602052856000208760005260205260ff8660002054161561403f575b6000526009602052613edf8686600020613b26565b507fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a58060005284602052856000208760005260205260ff86600020541615613ff0575b6000526009602052613f378686600020613b26565b506144b0565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6908160005280602052826000208460005260205260ff83600020541615613fa1575b506000526009602052600020613b26565b50600160ff19600b541617600b55565b81600052602052816000208360005260205281600020600160ff198254161790553383827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a438613f80565b8060005284602052856000208760005260205285600020600160ff198254161790553387827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4613f22565b8060005284602052856000208760005260205285600020600160ff198254161790553387827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4613eca565b6000805283602052846000208660005260205284600020600160ff19825416179055338660007f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4613e71565b015190503880613e32565b601f19821697600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89860005b81811061415d5750986001928492613f3d9695613f919b9c10614144575b505050811b01600a55613e47565b015160001960f88460031b161c19169055388080614136565b838301518b556001909a019960209384019301614118565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89083808601821c830193602087106141c8575b01901c01905b81811015613e1057600081556001016141b4565b935082936141ae565b6041907f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b015190503880613dde565b60008581527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b93601f1916905b818110614273575090846001959493921061425a575b505050811b018155613df2565b015160001960f88460031b161c1916905538808061424d565b92936020600181928786015181550195019301614237565b909150836000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b86808501871c820192602086106142ed575b90859493929101871c01905b8181106142de5750613dc8565b600081558493506001016142d1565b925081926142c5565b015190503880613d95565b60008681527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db093601f1916905b81811061436a5750908460019594939210614351575b505050811b018255613da9565b015160001960f88460031b161c19169055388080614344565b9293602060018192878601518155019501930161432e565b90915060008581527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db087808601881c820193602087106143e6575b9086959493929101881c01915b8281106143d8575050613d7f565b8181558594506001016143ca565b935081936143bd565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff600b5416613d4e565b1561442c57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff8316916144e3612710841115614425565b1691821561452a577fffffffffffffffffffffffff000000000000000000000000000000000000000091602060405161451b81612f5c565b858152015260a01b1617600655565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b90357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe18236030181121561026957016020813591019167ffffffffffffffff8211610269578160051b3603831361026957565b90918281527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83116102695760209260051b809284830137010190565b9082818152602080910193818360051b82010194846000925b858410614642575050505050505090565b90919293949596858061466a83601f1986600196030188526146648c88614588565b906145db565b990194019401929594939190614631565b9035907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe181360301821215610269570180359067ffffffffffffffff821161026957602001918160051b3603831361026957565b9082101561102d576146e69160051b81019061467b565b9091565b600e549081156147ed5773ffffffffffffffffffffffffffffffffffffffff16600090808252600f60205260409182812054409283156147c457828252600f602052808220541561479b578051926020840194855281840152808352606083019183831067ffffffffffffffff84111761476e57505251902006906131bc82614817565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526041600452fd5b600490517ffbd0656a000000000000000000000000000000000000000000000000000000008152fd5b600490517fb7b33787000000000000000000000000000000000000000000000000000000008152fd5b60046040517f5ab64158000000000000000000000000000000000000000000000000000000008152fd5b8060005260106020526040600020548015600014614833575090565b905090565b614841816148de565b908115614875575b8115614864575b811561485a575090565b6131bc91506149a1565b905061486f816149a1565b90614850565b905061488081614886565b90614849565b7f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008216146148d8576131bc906148de565b50600190565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f3e85e62f000000000000000000000000000000000000000000000000000000001490811561492e575090565b6131bc91507fffffffff00000000000000000000000000000000000000000000000000000000167fd9b67a260000000000000000000000000000000000000000000000000000000081146148d8577f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b6149aa81614a90565b9081156149f8575b81156149cd575b81156149c3575090565b6131bc9150614a09565b7fffffffff0000000000000000000000000000000000000000000000000000000081161591506149b9565b9050614a0381614a09565b906149b2565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f5a05180f000000000000000000000000000000000000000000000000000000008214918215614a5c57505090565b7f7965db0b000000000000000000000000000000000000000000000000000000001491508115614a8a575090565b6131bc91505b7fffffffff00000000000000000000000000000000000000000000000000000000167f2a55205a000000000000000000000000000000000000000000000000000000008114908115614ae0575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea2646970667358221220eeda6462fade49d46f5714fedf13c64ad717c956b55489eede81ce4d59e31fc364736f6c63430008130033', + '60806040523461002f576100196100146100fa565b610169565b610021610034565b61271a610397823961271a90f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b61011861950d8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b615fba810181811060018060401b038211176101c5576101a18291615fba612ab1843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa2618a6b85396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610580565b61001e60003561008d565b80631bce45831461008857806359659e901461008357806359a347bd1461007e578063715018a6146100795780638da5cb5b14610074578063cfcc59411461006f5763f2fde38b0361000e5761054d565b61050e565b6104d9565b6104a6565b610467565b6101ea565b610108565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b906020828203126100fd576100fa916000016100d4565b90565b61009e565b60000190565b346101365761012061011b3660046100e3565b61067e565b610128610093565b8061013281610102565b0390f35b610099565b600091031261014657565b61009e565b1c90565b60018060a01b031690565b61016a90600861016f930261014b565b61014f565b90565b9061017d915461015a565b90565b61018d6001600090610172565b90565b90565b6101a76101a26101ac926100a8565b610190565b6100a8565b90565b6101b890610193565b90565b6101c4906101af565b90565b6101d0906101bb565b9052565b91906101e8906000602085019401906101c7565b565b3461021a576101fa36600461013b565b610216610205610180565b61020d610093565b918291826101d4565b0390f35b610099565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061025390610229565b810190811067ffffffffffffffff82111761026d57604052565b610233565b9061028561027e610093565b9283610249565b565b67ffffffffffffffff81116102a5576102a1602091610229565b0190565b610233565b90826000939282370152565b909291926102cb6102c682610287565b610272565b938185526020850190828401116102e7576102e5926102aa565b565b610224565b9080601f8301121561030a57816020610307933591016102b6565b90565b61021f565b6bffffffffffffffffffffffff1690565b6103298161030f565b0361033057565b600080fd5b9050359061034282610320565b565b90565b61035081610344565b0361035757565b600080fd5b9050359061036982610347565b565b90916101208284031261043f5761038583600084016100d4565b9261039381602085016100d4565b92604081013567ffffffffffffffff811161043a57826103b49183016102ec565b92606082013567ffffffffffffffff811161043557836103d59184016102ec565b92608083013567ffffffffffffffff811161043057816103f69185016102ec565b926104048260a083016100d4565b9261042d6104158460c08501610335565b936104238160e086016100d4565b936101000161035c565b90565b6100a3565b6100a3565b6100a3565b61009e565b61044d906100b3565b9052565b919061046590600060208501940190610444565b565b346104a15761049d61048c61047d36600461036b565b979690969591959492946107ee565b610494610093565b91829182610451565b0390f35b610099565b346104d4576104b636600461013b565b6104be610985565b6104c6610093565b806104d081610102565b0390f35b610099565b34610509576104e936600461013b565b6105056104f46109bb565b6104fc610093565b91829182610451565b0390f35b610099565b346105485761054461053361052436600461036b565b979690969591959492946109d1565b61053b610093565b91829182610451565b0390f35b610099565b3461057b576105656105603660046100e3565b610b2a565b61056d610093565b8061057781610102565b0390f35b610099565b600080fd5b61059690610591610bb8565b6105eb565b565b60001c90565b6105aa6105af91610598565b61014f565b90565b6105bc905461059e565b90565b600080fd5b60e01b90565b60009103126105d557565b61009e565b6105e2610093565b3d6000823e3d90fd5b6105fd6105f860016105b2565b6101bb565b90633659cfe690823b15610679576106359261062a6000809461061e610093565b968795869485936105c4565b835260048301610451565b03925af1801561067457610647575b50565b6106679060003d811161066d575b61065f8183610249565b8101906105ca565b38610644565b503d610655565b6105da565b6105bf565b61068790610585565b565b600090565b5190565b60209181520190565b60005b8381106106af575050906000910152565b80602091830151818501520161069e565b6106df6106e86020936106ed936106d68161068e565b93848093610692565b9586910161069b565b610229565b0190565b6106fa9061030f565b9052565b61070790610344565b9052565b939561077461076960e0979b9a9861075b6107889761074d8a61078f9e9961073f61077e9a60006101008501940190610444565b8c60208184039101526106c0565b908a820360408c01526106c0565b9088820360608a01526106c0565b9a6080870190610444565b60a08501906106f1565b60c0830190610444565b01906106fe565b565b60200190565b5190565b906107ad6107a883610287565b610272565b918252565b6107bc600061079b565b90565b6107c76107b2565b90565b6107d390610193565b90565b6107df906107ca565b90565b6107eb906101af565b90565b61085e9098949897969397959295610804610689565b508861083c8461082d8d8a8d8d96928b908d929394610821610093565b998a9860208a0161070b565b60208201810382520382610249565b61084e61084882610797565b91610791565b20906108586107bf565b91610d5d565b9761087061086b8a6107d6565b6107e2565b94638ff83ac192969891939497863b1561092f576000986108a5968a966108b095610899610093565b9d8e9c8d9b8c9a6105c4565b8a5260048a0161070b565b03925af1801561092a576108fd575b50806108f77fe3049ee698743dac343b02bfe6b441269ca8b5f5dd610b74d96c1c02034ee566916108ee610093565b91829182610451565b0390a190565b61091d9060003d8111610923575b6109158183610249565b8101906105ca565b386108bf565b503d61090b565b6105da565b6105bf565b61093c610bb8565b610944610971565b565b90565b61095d61095861096292610946565b610190565b6100a8565b90565b61096e90610949565b90565b61098361097e6000610965565b610eec565b565b61098d610934565b565b60018060a01b031690565b6109a66109ab91610598565b61098f565b90565b6109b8905461099a565b90565b6109c3610689565b506109ce60006109ae565b90565b96610a089396610a1796610a399a939694966109eb610689565b5096989490919293946109fc610093565b998a9860208a0161070b565b60208201810382520382610249565b610a29610a2382610797565b91610791565b2090610a336107bf565b91610f4d565b90565b610a4d90610a48610bb8565b610af9565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610aaa6026604092610692565b610ab381610a4f565b0190565b610acd9060208101906000818303910152610a9d565b90565b15610ad757565b610adf610093565b62461bcd60e51b815280610af560048201610ab7565b0390fd5b610b2890610b2381610b1c610b16610b116000610965565b6100b3565b916100b3565b1415610ad0565b610eec565b565b610b3390610a3c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6960208092610692565b610b7281610b35565b0190565b610b8c9060208101906000818303910152610b5d565b90565b15610b9657565b610b9e610093565b62461bcd60e51b815280610bb460048201610b76565b0390fd5b610be2610bc36109bb565b610bdc610bd6610bd1610fe3565b6100b3565b916100b3565b14610b8f565b565b90565b610bf3610bf891610344565b610be4565b9052565b60601b90565b610c0b90610bfc565b90565b610c1790610c02565b90565b610c26610c2b916100b3565b610c0e565b9052565b905090565b610c59610c5092602092610c4781610797565b94858093610c2f565b9384910161069b565b0190565b60148093610c81602084610c79610c8996610c909b9a98610be7565b018092610c1a565b018092610c1a565b0190610c34565b90565b90565b610caa610ca5610caf92610946565b610190565b610c93565b90565b610cbb90610193565b90565b610cc790610cb2565b90565b610cd390610193565b90565b610cdf90610cca565b90565b610ceb906101af565b90565b60209181520190565b610d16610d1f602093610d2493610d0d81610797565b93848093610cee565b9586910161069b565b610229565b0190565b610d4d610d5a949293610d4360608401956000850190610444565b6020830190610444565b6040818403910152610cf7565b90565b610ded9093929193610d6d610689565b50610dad8591610d9e610d88610d8360016105b2565b6101bb565b8690610d92610093565b95869460208601610c5d565b60208201810382520382610249565b610dbf610db982610797565b91610791565b2061148a610dcf60208201610272565b9080825261125b6020830139610de86000929192610c96565b611187565b92610e07610e02610dfd86610cbe565b610cd6565b610ce2565b63cf7a1d779190610e20610e1b60016105b2565b6101bb565b9392813b15610e97576000610e4891610e538296610e3c610093565b988997889687956105c4565b855260048501610d28565b03925af18015610e9257610e65575b50565b610e859060003d8111610e8b575b610e7d8183610249565b8101906105ca565b38610e62565b503d610e73565b6105da565b6105bf565b60001b90565b90610eb360018060a01b0391610e9c565b9181191691161790565b610ec6906101af565b90565b90565b90610ee1610edc610ee892610ebd565b610ec9565b8254610ea2565b9055565b610ef660006109ae565b610f01826000610ecc565b90610f35610f2f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610ebd565b91610ebd565b91610f3e610093565b80610f4881610102565b0390a3565b610fe09291610f8a610f9992610f61610689565b509193610f76610f7160016105b2565b6101bb565b610f7e610093565b95869460208601610c5d565b60208201810382520382610249565b610fab610fa582610797565b91610791565b2061148a610fbb60208201610272565b9080825261125b6020830139610fd9610fd382610797565b91610791565b2090611210565b90565b610feb610689565b503390565b610ff9906101af565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b611031601d602092610692565b61103a81610ffc565b0190565b6110549060208101906000818303910152611024565b90565b1561105e57565b611066610093565b62461bcd60e51b81528061107c6004820161103e565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110b460208092610692565b6110bd81611080565b0190565b6110d790602081019060008183039101526110a8565b90565b156110e157565b6110e9610093565b62461bcd60e51b8152806110ff600482016110c1565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b6111386019602092610692565b61114181611103565b0190565b61115b906020810190600081830391015261112b565b90565b1561116557565b61116d610093565b62461bcd60e51b81528061118360048201611145565b0390fd5b919091611192610689565b506111b961119f30610ff0565b316111b26111ac84610c93565b91610c93565b1015611057565b6111df6111c583610797565b6111d86111d26000610c96565b91610c93565b14156110da565b60208251920190f59061120e826112076112016111fc6000610965565b6100b3565b916100b3565b141561115e565b565b9061122e9161121d610689565b509061122830610ff0565b91611231565b90565b90605592600b92611240610689565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a26469706673582212206e335c4448e2e24431a6987ffd08b7c2fa55316f79d6fcecb28f14c7b57e92d764736f6c634300081b003360a060405234602b57600e603a565b6014602f565b615f696100518239608051816149130152615f6990f35b6035565b60405190565b600080fd5b60406042565b565b6048604a565b565b3360805256fe60806040526004361015610013575b611bc5565b61001e6000356102cc565b8062fdd58e146102c757806301ffc9a7146102c257806304634d8d146102bd57806306fdde03146102b85780630b5ee006146102b35780630bb310de146102ae5780630e89341c146102a9578063167a59f7146102a457806318160ddd1461029f57806320ec271b1461029a578063248a9ca3146102955780632693ebf2146102905780632a55205a1461028b5780632eb2c2d6146102865780632f2ff15d14610281578063354030231461027c57806336568abe146102775780633c70b3571461027257806347fda41a1461026d5780634e1273f41461026857806350336a03146102635780635377ab8f1461025e5780635944c753146102595780636c0360eb14610254578063731133e91461024f5780637e518ec81461024a5780638ff83ac1146102455780639010d07c1461024057806391d148541461023b578063938e3d7b146102365780639d043a6614610231578063a217fddf1461022c578063a22cb46514610227578063b390c0ab14610222578063b48ab8b61461021d578063ca15c87314610218578063d547741f14610213578063d67b333b1461020e578063e8a3d48514610209578063e985e9c514610204578063ed4c2ac7146101ff578063f242432a146101fa5763f4f98ad50361000e57611b92565b611b58565b611ab4565b611a7e565b611a1b565b6119d4565b6118d2565b61189d565b611866565b6117a2565b61176e565b6116e7565b611674565b6115ac565b611576565b611540565b6114bf565b6113c2565b61138b565b61127a565b611236565b6111c5565b611191565b61111d565b610fa8565b610f59565b610eca565b610e95565b610e47565b610ddc565b610c7f565b610beb565b610b65565b610ac8565b610999565b61092a565b6108f5565b6108a3565b610851565b61073f565b6104e5565b610447565b61039a565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6102fb906102e7565b90565b610307816102f2565b0361030e57565b600080fd5b90503590610320826102fe565b565b90565b61032e81610322565b0361033557565b600080fd5b9050359061034782610325565b565b9190604083820312610372578061036661036f9260008601610313565b9360200161033a565b90565b6102dd565b61038090610322565b9052565b919061039890600060208501940190610377565b565b346103cb576103c76103b66103b0366004610349565b90611bcf565b6103be6102d2565b91829182610384565b0390f35b6102d8565b63ffffffff60e01b1690565b6103e5816103d0565b036103ec57565b600080fd5b905035906103fe826103dc565b565b9060208282031261041a57610417916000016103f1565b90565b6102dd565b151590565b61042d9061041f565b9052565b919061044590600060208501940190610424565b565b346104775761047361046261045d366004610400565b611bf8565b61046a6102d2565b91829182610431565b0390f35b6102d8565b6bffffffffffffffffffffffff1690565b6104968161047c565b0361049d57565b600080fd5b905035906104af8261048d565b565b91906040838203126104da57806104ce6104d79260008601610313565b936020016104a2565b90565b6102dd565b60000190565b34610514576104fe6104f83660046104b1565b90611c84565b6105066102d2565b80610510816104df565b0390f35b6102d8565b600091031261052457565b6102dd565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610575575b602083101461057057565b61053f565b91607f1691610565565b60209181520190565b600052602060002090565b90600092918054906105ae6105a783610555565b809461057f565b9160018116908160001461060757506001146105ca575b505050565b6105d79192939450610588565b916000925b8184106105ef57505001903880806105c5565b600181602092959395548486015201910192906105dc565b92949550505060ff19168252151560200201903880806105c5565b9061062c91610593565b90565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906106599061062f565b810190811067ffffffffffffffff82111761067357604052565b610639565b90610698610691926106886102d2565b93848092610622565b038361064f565b565b906000106106ae576106ab90610678565b90565b610529565b6106c0600860009061069a565b90565b5190565b60209181520190565b60005b8381106106e4575050906000910152565b8060209183015181850152016106d3565b61071461071d6020936107229361070b816106c3565b938480936106c7565b958691016106d0565b61062f565b0190565b61073c91602082019160008184039101526106f5565b90565b3461076f5761074f366004610519565b61076b61075a6106b3565b6107626102d2565b91829182610726565b0390f35b6102d8565b600080fd5b600080fd5b9061079161078a6102d2565b928361064f565b565b67ffffffffffffffff81116107b1576107ad60209161062f565b0190565b610639565b90826000939282370152565b909291926107d76107d282610793565b61077e565b938185526020850190828401116107f3576107f1926107b6565b565b610779565b9080601f8301121561081657816020610813933591016107c2565b90565b610774565b9060208282031261084c57600082013567ffffffffffffffff81116108475761084492016107f8565b90565b6102e2565b6102dd565b3461087f5761086961086436600461081b565b611ec5565b6108716102d2565b8061087b816104df565b0390f35b6102d8565b9060208282031261089e5761089b91600001610313565b90565b6102dd565b346108d1576108bb6108b6366004610884565b611fa2565b6108c36102d2565b806108cd816104df565b0390f35b6102d8565b906020828203126108f0576108ed9160000161033a565b90565b6102dd565b346109255761092161091061090b3660046108d6565b6120cc565b6109186102d2565b91829182610726565b0390f35b6102d8565b346109595761094361093d366004610349565b90612203565b61094b6102d2565b80610955816104df565b0390f35b6102d8565b1c90565b90565b61097590600861097a930261095e565b610962565b90565b906109889154610965565b90565b61099660008061097d565b90565b346109c9576109a9366004610519565b6109c56109b461098b565b6109bc6102d2565b91829182610384565b0390f35b6102d8565b67ffffffffffffffff81116109e65760208091020190565b610639565b600080fd5b90929192610a05610a00826109ce565b61077e565b9381855260208086019202830192818411610a4257915b838310610a295750505050565b60208091610a37848661033a565b815201920191610a1c565b6109eb565b9080601f83011215610a6557816020610a62933591016109f0565b90565b610774565b919091604081840312610ac357600081013567ffffffffffffffff8111610abe5783610a97918301610a47565b92602082013567ffffffffffffffff8111610ab957610ab69201610a47565b90565b6102e2565b6102e2565b6102dd565b34610af757610ae1610adb366004610a6a565b906122fe565b610ae96102d2565b80610af3816104df565b0390f35b6102d8565b90565b610b0881610afc565b03610b0f57565b600080fd5b90503590610b2182610aff565b565b90602082820312610b3d57610b3a91600001610b14565b90565b6102dd565b610b4b90610afc565b9052565b9190610b6390600060208501940190610b42565b565b34610b9557610b91610b80610b7b366004610b23565b612357565b610b886102d2565b91829182610b4f565b0390f35b6102d8565b90565b610bb1610bac610bb692610322565b610b9a565b610322565b90565b90610bc390610b9d565b600052602052604060002090565b610be890610be3600191600092610bb9565b61097d565b90565b34610c1b57610c17610c06610c013660046108d6565b610bd1565b610c0e6102d2565b91829182610384565b0390f35b6102d8565b9190604083820312610c495780610c3d610c46926000860161033a565b9360200161033a565b90565b6102dd565b610c57906102f2565b9052565b916020610c7d929493610c7660408201966000830190610c4e565b0190610377565b565b34610cb157610c98610c92366004610c20565b90612549565b90610cad610ca46102d2565b92839283610c5b565b0390f35b6102d8565b600080fd5b909182601f83011215610cf55781359167ffffffffffffffff8311610cf0576020019260208302840111610ceb57565b6109eb565b610cb6565b610774565b909182601f83011215610d345781359167ffffffffffffffff8311610d2f576020019260018302840111610d2a57565b6109eb565b610cb6565b610774565b9160a083830312610dd757610d518260008501610313565b92610d5f8360208301610313565b92604082013567ffffffffffffffff8111610dd25781610d80918401610cbb565b929093606082013567ffffffffffffffff8111610dcd5783610da3918401610cbb565b929093608082013567ffffffffffffffff8111610dc857610dc49201610cfa565b9091565b6102e2565b6102e2565b6102e2565b6102dd565b34610e1457610dfe610def366004610d39565b96959095949194939293612624565b610e066102d2565b80610e10816104df565b0390f35b6102d8565b9190604083820312610e425780610e36610e3f9260008601610b14565b93602001610313565b90565b6102dd565b34610e7657610e60610e5a366004610e19565b906128c0565b610e686102d2565b80610e72816104df565b0390f35b6102d8565b610e9290610e8d600d91600092610bb9565b61097d565b90565b34610ec557610ec1610eb0610eab3660046108d6565b610e7b565b610eb86102d2565b91829182610384565b0390f35b6102d8565b34610ef957610ee3610edd366004610e19565b90612976565b610eeb6102d2565b80610ef5816104df565b0390f35b6102d8565b90610f0890610b9d565b600052602052604060002090565b90565b610f29906008610f2e930261095e565b610f16565b90565b90610f3c9154610f19565b90565b610f5690610f51600c91600092610efe565b610f31565b90565b34610f8957610f85610f74610f6f3660046108d6565b610f3f565b610f7c6102d2565b91829182610b4f565b0390f35b6102d8565b610fa590610fa0600e91600092610bb9565b61097d565b90565b34610fd857610fd4610fc3610fbe3660046108d6565b610f8e565b610fcb6102d2565b91829182610384565b0390f35b6102d8565b909182601f830112156110175781359167ffffffffffffffff831161101257602001926020830284011161100d57565b6109eb565b610cb6565b610774565b909160408284031261107757600082013567ffffffffffffffff81116110725783611048918401610fdd565b929093602082013567ffffffffffffffff811161106d576110699201610cbb565b9091565b6102e2565b6102e2565b6102dd565b5190565b60209181520190565b60200190565b61109890610322565b9052565b906110a98160209361108f565b0190565b60200190565b906110d06110ca6110c38461107c565b8093611080565b92611089565b9060005b8181106110e15750505090565b9091926110fa6110f4600192865161109c565b946110ad565b91019190916110d4565b61111a91602082019160008184039101526110b3565b90565b346111515761114d61113c61113336600461101c565b929190916129aa565b6111446102d2565b91829182611104565b0390f35b6102d8565b909160608284031261118c576111896111728460008501610b14565b93611180816020860161033a565b9360400161033a565b90565b6102dd565b346111c0576111aa6111a4366004611156565b91612b00565b6111b26102d2565b806111bc816104df565b0390f35b6102d8565b346111f6576111f26111e16111db366004610349565b90612b0d565b6111e96102d2565b91829182610384565b0390f35b6102d8565b90916060828403126112315761122e611217846000850161033a565b936112258160208601610313565b936040016104a2565b90565b6102dd565b346112655761124f6112493660046111fb565b91612b51565b6112576102d2565b80611261816104df565b0390f35b6102d8565b611277600960009061069a565b90565b346112aa5761128a366004610519565b6112a661129561126a565b61129d6102d2565b91829182610726565b0390f35b6102d8565b67ffffffffffffffff81116112cd576112c960209161062f565b0190565b610639565b909291926112e76112e2826112af565b61077e565b9381855260208501908284011161130357611301926107b6565b565b610779565b9080601f8301121561132657816020611323933591016112d2565b90565b610774565b90608082820312611386576113438160008401610313565b92611351826020850161033a565b9261135f836040830161033a565b92606082013567ffffffffffffffff81116113815761137e9201611308565b90565b6102e2565b6102dd565b346113bd576113a761139e36600461132b565b92919091612bb0565b6113af6102d2565b806113b9816104df565b0390f35b6102d8565b346113f0576113da6113d536600461081b565b612be6565b6113e26102d2565b806113ec816104df565b0390f35b6102d8565b9190610100838203126114ba5761140f8160008501610313565b92602081013567ffffffffffffffff81116114b557826114309183016107f8565b92604082013567ffffffffffffffff81116114b057836114519184016107f8565b92606083013567ffffffffffffffff81116114ab57816114729185016107f8565b926114808260808301610313565b926114a86114918460a085016104a2565b9361149f8160c08601610313565b9360e001610b14565b90565b6102e2565b6102e2565b6102e2565b6102dd565b346114f7576114e16114d23660046113f5565b96959095949194939293612bf1565b6114e96102d2565b806114f3816104df565b0390f35b6102d8565b919060408382031261152557806115196115229260008601610b14565b9360200161033a565b90565b6102dd565b919061153e90600060208501940190610c4e565b565b346115715761156d61155c6115563660046114fc565b90612c38565b6115646102d2565b9182918261152a565b0390f35b6102d8565b346115a7576115a361159261158c366004610e19565b90612c9f565b61159a6102d2565b91829182610431565b0390f35b6102d8565b346115da576115c46115bf36600461081b565b612cf2565b6115cc6102d2565b806115d6816104df565b0390f35b6102d8565b600080fd5b908160c09103126115f25790565b6115df565b908160e09103126116055790565b6115df565b9160608383031261166f576116228260008501610313565b92602081013567ffffffffffffffff811161166a57836116439183016115e4565b92604082013567ffffffffffffffff81116116655761166292016115f7565b90565b6102e2565b6102e2565b6102dd565b346116a5576116a161169061168a36600461160a565b91613055565b6116986102d2565b91829182610b4f565b0390f35b6102d8565b90565b60001b90565b6116c76116c26116cc926116aa565b6116ad565b610afc565b90565b6116d960006116b3565b90565b6116e46116cf565b90565b34611717576116f7366004610519565b6117136117026116dc565b61170a6102d2565b91829182610b4f565b0390f35b6102d8565b6117258161041f565b0361172c57565b600080fd5b9050359061173e8261171c565b565b9190604083820312611769578061175d6117669260008601610313565b93602001611731565b90565b6102dd565b3461179d57611787611781366004611740565b906130f6565b61178f6102d2565b80611799816104df565b0390f35b6102d8565b346117d1576117bb6117b5366004610c20565b90613146565b6117c36102d2565b806117cd816104df565b0390f35b6102d8565b90608082820312611861576117ee8160008401610313565b92602083013567ffffffffffffffff811161185c578261180f918501610a47565b92604081013567ffffffffffffffff81116118575783611830918301610a47565b92606082013567ffffffffffffffff81116118525761184f9201611308565b90565b6102e2565b6102e2565b6102e2565b6102dd565b34611898576118826118793660046117d6565b92919091613183565b61188a6102d2565b80611894816104df565b0390f35b6102d8565b346118cd576118c96118b86118b3366004610b23565b613191565b6118c06102d2565b91829182610384565b0390f35b6102d8565b34611901576118eb6118e5366004610e19565b906131e1565b6118f36102d2565b806118fd816104df565b0390f35b6102d8565b908160809103126119145790565b6115df565b909182601f830112156119535781359167ffffffffffffffff831161194e57602001926020830284011161194957565b6109eb565b610cb6565b610774565b9190916080818403126119cf576119728360008301610313565b92602082013567ffffffffffffffff81116119ca5781611993918401611906565b92604083013567ffffffffffffffff81116119c5576119b7836119c2928601611919565b93909460600161033a565b90565b6102e2565b6102e2565b6102dd565b34611a06576119f06119e7366004611958565b9392909261391f565b6119f86102d2565b80611a02816104df565b0390f35b6102d8565b611a18600a60009061069a565b90565b34611a4b57611a2b366004610519565b611a47611a36611a0b565b611a3e6102d2565b91829182610726565b0390f35b6102d8565b9190604083820312611a795780611a6d611a769260008601610313565b93602001610313565b90565b6102dd565b34611aaf57611aab611a9a611a94366004611a50565b90613d16565b611aa26102d2565b91829182610431565b0390f35b6102d8565b34611ae257611acc611ac7366004610b23565b613d62565b611ad46102d2565b80611ade816104df565b0390f35b6102d8565b91909160a081840312611b5357611b018360008301610313565b92611b0f8160208401610313565b92611b1d826040850161033a565b92611b2b836060830161033a565b92608082013567ffffffffffffffff8111611b4e57611b4a9201610cfa565b9091565b6102e2565b6102dd565b34611b8d57611b77611b6b366004611ae7565b94939093929192613d6d565b611b7f6102d2565b80611b89816104df565b0390f35b6102d8565b34611bc057611baa611ba53660046108d6565b613f61565b611bb26102d2565b80611bbc816104df565b0390f35b6102d8565b600080fd5b600090565b611bd7611bca565b50679a31110384e0b0c960205260145260005260406000205490565b600090565b611c00611bf3565b506337bc219560e01b611c1b611c15836103d0565b916103d0565b14908115611c28575b5090565b611c329150614040565b38611c24565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b90611c7691611c71611c6c611c38565b614096565b611c78565b565b90611c82916142b0565b565b90611c8e91611c5c565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b611ccd90611cc8611cc3611c90565b614096565b611eb8565b565b601f602091010490565b1b90565b91906008611cf9910291611cf360001984611cd9565b92611cd9565b9181191691161790565b90565b9190611d1c611d17611d2493610b9d565b611d03565b908354611cdd565b9055565b611d3a91611d34611bca565b91611d06565b565b5b818110611d48575050565b80611d566000600193611d28565b01611d3d565b9190601f8111611d6c575b505050565b611d78611d9d93610588565b906020611d8484611ccf565b83019310611da5575b611d9690611ccf565b0190611d3c565b388080611d67565b9150611d9681929050611d8d565b90611dc4906000199060080261095e565b191690565b81611dd391611db3565b906002021790565b90611de5816106c3565b9067ffffffffffffffff8211611ea757611e0982611e038554610555565b85611d5c565b602090601f8311600114611e3e57918091611e2d93600092611e32575b5050611dc9565b90555b565b90915001513880611e26565b601f19831691611e4d85610588565b9260005b818110611e8f57509160029391856001969410611e75575b50505002019055611e30565b611e85910151601f841690611db3565b9055388080611e69565b91936020600181928787015181550195019201611e51565b610639565b90611eb691611ddb565b565b611ec3906008611eac565b565b611ece90611cb4565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b611f0d90611f08611f03611ed0565b614096565b611f8d565b565b611f23611f1e611f28926102e7565b610b9a565b6102e7565b90565b611f3490611f0f565b90565b611f4090611f2b565b90565b90611f5460018060a01b03916116ad565b9181191691161790565b611f6790611f2b565b90565b90565b90611f82611f7d611f8992611f5e565b611f6a565b8254611f43565b9055565b611f99611fa091611f37565b6006611f6d565b565b611fab90611ef4565b565b606090565b905090565b9060009291805490611fd2611fcb83610555565b8094611fb2565b916001811690816000146120265750600114611fee575b505050565b611ffb9192939450610588565b6000905b8382106120125750500190388080611fe9565b600181602092548486015201910190611fff565b92949550505060ff19168252801515020190388080611fe9565b61206561205c92602092612053816106c3565b94858093611fb2565b938491016106d0565b0190565b60007f2e6a736f6e000000000000000000000000000000000000000000000000000000910152565b61209d60058092611fb2565b6120a681612069565b0190565b916120bb6120c6936120c193611fb7565b90612040565b612091565b90565b90565b612113906120d8611fad565b5061210e6120e760099261432a565b916120ff6120f36102d2565b938492602084016120aa565b6020820181038252038261064f565b6120c9565b90565b9061212090610b9d565b600052602052604060002090565b61213790611f0f565b90565b6121439061212e565b90565b906121509061213a565b600052602052604060002090565b60001c90565b6121706121759161215e565b610962565b90565b6121829054612164565b90565b61219961219461219e926116aa565b610b9a565b610322565b90565b6121ad6121b29161215e565b610b9d565b90565b90565b6121cc6121c76121d1926121b5565b610b9a565b610322565b90565b906121e66121e183610793565b61077e565b918252565b6121f560006121d4565b90565b6122006121eb565b90565b9061222261221d612216600f8490612116565b8490612146565b612178565b806122366122306000612185565b91610322565b146122e15761224581406121a1565b6122586122526000612185565b91610322565b14159081156122c4575b506122a7576122a59161228b600061228661227f600f8690612116565b8490612146565b611d28565b9061229660016121b8565b9061229f6121f8565b9261437f565b565b600063156f904360e21b8152806122c0600482016104df565b0390fd5b90506122d96122d34392610322565b91610322565b111538612262565b6000637de832b560e11b8152806122fa600482016104df565b0390fd5b61230b9133919091614427565b565b600090565b61231b90610afc565b90565b9061232890612312565b600052602052604060002090565b6123426123479161215e565b610f16565b90565b6123549054612336565b90565b60016123706123769261236861230d565b50600461231e565b0161234a565b90565b600090565b9061238890610b9d565b600052602052604060002090565b60018060a01b031690565b6123ad6123b29161215e565b612396565b90565b6123bf90546123a1565b90565b906123cc906102f2565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b6123f36123f8916123d0565b6123d6565b90565b61240590546123e7565b90565b906124129061047c565b9052565b612420604061077e565b90565b9061245a6124516000612434612416565b9461244b6124438383016123b5565b8388016123c2565b016123fb565b60208401612408565b565b61246590612423565b90565b61247290516102f2565b90565b61248961248461248e926116aa565b610b9a565b6102e7565b90565b61249a90612475565b90565b6124a7905161047c565b90565b6124be6124b96124c39261047c565b610b9a565b610322565b90565b634e487b7160e01b600052601160045260246000fd5b6124eb6124f191939293610322565b92610322565b916124fd838202610322565b92818404149015171561250c57565b6124c6565b634e487b7160e01b600052601260045260246000fd5b61253361253991610322565b91610322565b908115612544570490565b612511565b61256c6125719193929361255b612379565b50612564611bca565b50600361237e565b61245c565b9161257e60008401612468565b61259961259361258e6000612491565b6102f2565b916102f2565b146125e6575b60006125db6125c56125e2936125bf6125ba6020890161249d565b6124aa565b906124dc565b6125d56125d0614532565b6124aa565b90612527565b9301612468565b9190565b91506125e260006125db6125c56125fd600261245c565b95935050505061259f565b6126139136916109f0565b90565b6126219136916112d2565b90565b969396959094919295612635614549565b61286e575b8287036128605760601b679a31110384e0b0c9179460601b679a31110384e0b0c91791856020528560601c958360601c93841561285257873303612836575b8860051b805b6127d657505050828660207f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb604051604081528b8d8160051b948286936040860152838d6060870137836060018286015260608486010190815201376080339380010190a46126ec614557565b6127b9575b50813b612702575b50505050505050565b602080809786946000528060c06040519b8c9a63bc197c818c5233868d015260408c015260a060608c01528a8360051b998a9586948593015260e08d01378160c00160808c015260e0828c010192835284830137818060e0010160a08a01520101838152013780010161010401601c60405101600080515af1156127aa575b63bc197c8160e01b90510361279c57388080808080806126f9565b639c05499b6000526004601cfd5b3d15612781573d6000823e3d90fd5b6127d0908690849086908a8c919287948b96614565565b386126f1565b60209003808b013583602052818801356000526040600020805480831161282857829003905582602052604060002090815490810190811061281a5782915561267f565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c205461267957634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b612891848861288b8b879061288588948c96612608565b50612608565b50612616565b5061263a565b906128b2916128ad6128a882612357565b614096565b6128b4565b565b906128be916145af565b565b906128ca91612897565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b612927602f6040926106c7565b612930816128cc565b0190565b61294a906020810190600081830391015261291a565b90565b1561295457565b61295c6102d2565b62461bcd60e51b81528061297260048201612934565b0390fd5b906129a39161299e8261299861299261298d6145d9565b6102f2565b916102f2565b1461294d565b6145e6565b565b606090565b939291906129b66129a5565b508203612a0d5760405193828552602085019260051b808481016040525b6129de5750505050565b602090038082013560601b679a31110384e0b0c9176020528083013560005280604060002054818601526129d4565b633b800a466000526004601cfd5b7fbaa5ee745de68a3095827d2ee7dd2043afc932834d02cc1b8be3da78577f6c1a90565b90612a5a9291612a55612a50612a1b565b614096565b612abf565b565b90612a69600019916116ad565b9181191691161790565b612a7c9061215e565b90565b90612a94612a8f612a9b92612312565b612a73565b8254612a5c565b9055565b90612ab4612aaf612abb92610b9d565b611d03565b8254612a5c565b9055565b612afe9291612adc612af992612ad7600c8690610efe565b612a7f565b612af181612aec600d8690610bb9565b612a9f565b91600e610bb9565b612a9f565b565b90612b0b9291612a3f565b565b90612b2091612b1a611bca565b50614656565b905090565b90612b409291612b3b612b36611c38565b614096565b612b42565b565b91612b4f9291909161483c565b565b90612b5c9291612b25565b565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b90612b9e939291612b99612b94612b5e565b614096565b612ba0565b565b91612bae939190919261437f565b565b90612bbc939291612b82565b565b612bd790612bd2612bcd611c90565b614096565b612bd9565b565b612be4906009611eac565b565b612bef90612bbe565b565b91612c1b97959391969492612c0e612c07612a1b565b82906145af565b9690919293949596614904565b565b90612c2790612312565b600052602052604060002090565b90565b90612c58612c53612c5d93612c4b612379565b506005612c1d565b612c35565b6149ce565b90565b90612c6a9061213a565b600052602052604060002090565b60ff1690565b612c8a612c8f9161215e565b612c78565b90565b612c9c9054612c7e565b90565b612cc7916000612cbc612cc293612cb4611bf3565b50600461231e565b01612c60565b612c92565b90565b612ce390612cde612cd9611c90565b614096565b612ce5565b565b612cf090600a611eac565b565b612cfb90612cca565b565b60018060a01b031690565b612d14612d199161215e565b612cfd565b90565b612d269054612d08565b90565b612d329061212e565b90565b600080fd5b60e01b90565b90505190612d4d82610aff565b565b90602082820312612d6957612d6691600001612d40565b90565b6102dd565b50612d7d906020810190610313565b90565b612d89906102f2565b9052565b50612d9c9060208101906103f1565b90565b612da8906103d0565b9052565b50612dbb906020810190610b14565b90565b612dc790610afc565b9052565b600080fd5b600080fd5b600080fd5b9035600160200382360303811215612e1b57016020813591019167ffffffffffffffff8211612e16576001820236038313612e1157565b612dd0565b612dcb565b612dd5565b60209181520190565b9190612e4381612e3c81612e4895612e20565b80956107b6565b61062f565b0190565b9035600160400382360303811215612e62570190565b612dd5565b9035600160200382360303811215612ea857016020813591019167ffffffffffffffff8211612ea3576001820236038313612e9e57565b612dd0565b612dcb565b612dd5565b9190612ec781612ec081612ecc9561057f565b80956107b6565b61062f565b0190565b67ffffffffffffffff1690565b612ee681612ed0565b03612eed57565b600080fd5b90503590612eff82612edd565b565b50612f10906020810190612ef2565b90565b612f1c90612ed0565b9052565b90612f5e906020612f56612f4c60408401612f3e6000880188612e67565b908683036000880152612ead565b9482810190612f01565b910190612f13565b90565b61300b91612ffd612ff260c08301612f89612f7f6000870187612d6e565b6000860190612d80565b612fa3612f996020870187612d8d565b6020860190612d9f565b612fbd612fb36040870187612dac565b6040860190612dbe565b612fd7612fcd6060870187612dac565b6060860190612dbe565b612fe46080860186612dda565b908583036080870152612e29565b9260a0810190612e4c565b9060a0818403910152612f20565b90565b93929061303a6040916130429461302d606089019260008a0190610c4e565b8782036020890152612f61565b940190610b42565b565b61304c6102d2565b3d6000823e3d90fd5b915060209061306261230d565b506130756130706006612d1c565b612d29565b6130a1633808a90b9492946130ac61308d600761234a565b6130956102d2565b97889687958695612d3a565b85526004850161300e565b03915afa9081156130f1576000916130c3575b5090565b6130e4915060203d81116130ea575b6130dc818361064f565b810190612d4f565b386130bf565b503d6130d2565b613044565b901515679a31110384e0b0c96020523360145281600052806034600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b6131539133919091614a07565b565b9061317193929161316c613167612b5e565b614096565b613173565b565b916131819391909192614a59565b565b9061318f939291613155565b565b6131b06131ab6131b5926131a3611bca565b506005612c1d565b612c35565b614b42565b90565b906131d3916131ce6131c982612357565b614096565b6131d5565b565b906131df916145e6565b565b906131eb916131b8565b565b903560016020038236030381121561322e57016020813591019167ffffffffffffffff821161322957602082023603831361322457565b612dd0565b612dcb565b612dd5565b60209181520190565b90565b9061324c81602093612d80565b0190565b60200190565b916132648261326a92613233565b9261323c565b90816000905b82821061327e575050505090565b909192936132a061329a6001926132958886612d6e565b61323f565b95613250565b920190929192613270565b90356001602003823603038112156132ec57016020813591019167ffffffffffffffff82116132e75760208202360383136132e257565b612dd0565b612dcb565b612dd5565b60209181520190565b90565b6133069061041f565b9052565b90613317816020936132fd565b0190565b5061332a906020810190611731565b90565b60200190565b9161334182613347926132f1565b926132fa565b90816000905b82821061335b575050505090565b9091929361337d613377600192613372888661331b565b61330a565b9561332d565b92019092919261334d565b90356001602003823603038112156133c957016020813591019167ffffffffffffffff82116133c45760208202360383136133bf57565b612dd0565b612dcb565b612dd5565b60209181520190565b90565b60209181520190565b600080fd5b9037565b9091826133f8916133da565b9160018060fb1b03811161341b578291602061341792029384916133e8565b0190565b6133e3565b9061342b92916133ec565b90565b903560016020038236030381121561346f57016020813591019167ffffffffffffffff821161346a57602082023603831361346557565b612dd0565b612dcb565b612dd5565b60200190565b9181613485916133ce565b9081613496602083028401946133d7565b92836000925b8484106134ac5750505050505090565b90919293949560206134d86134d283856001950388526134cc8b8861342e565b90613420565b98613474565b94019401929493919061349c565b6135649161355661354b6135306135156080850161350760008801886131ed565b908783036000890152613256565b61352260208701876132ab565b908683036020880152613333565b61353d6040860186613388565b90858303604087015261347a565b926060810190613388565b91606081850391015261347a565b90565b9161358b9261357e60408201936000830190610377565b60208184039101526134e6565b90565b60200190565b5190565b67ffffffffffffffff81116135b05760208091020190565b610639565b909291926135ca6135c582613598565b61077e565b938185526020808601920283019281841161360757915b8383106135ee5750505050565b602080916135fc8486610b14565b8152019201916135e1565b6109eb565b6136179136916135b5565b90565b61362390610322565b60008114613632576001900390565b6124c6565b9061364190610b9d565b600052602052604060002090565b600161365b9101610322565b90565b600080fd5b600080fd5b600080fd5b9035906001602003813603038212156136af570180359067ffffffffffffffff82116136aa576020019160208202360383136136a557565b613668565b613663565b61365e565b5090565b9035906001602003813603038212156136fa570180359067ffffffffffffffff82116136f5576020019160208202360383136136f057565b613668565b613663565b61365e565b634e487b7160e01b600052603260045260246000fd5b9190811015613725576020020190565b6136ff565b356137348161171c565b90565b9190811015613747576020020190565b6136ff565b35613756816102fe565b90565b61376290611f0f565b90565b61376e90613759565b90565b61377a9061212e565b90565b9035906001602003813603038212156137bf570180359067ffffffffffffffff82116137ba576020019160208202360383136137b557565b613668565b613663565b61365e565b903590600160200381360303821215613806570180359067ffffffffffffffff8211613801576020019160208202360383136137fc57565b613668565b613663565b61365e565b9082101561382657602061382292028101906137c4565b9091565b6136ff565b600091031261383657565b6102dd565b90918261384791611080565b9160018060fb1b03811161386a578291602061386692029384916133e8565b0190565b6133e3565b60209181520190565b6138846000809261386f565b0190565b93916138d295916138c4946138b6926138a9608089019360008a0190610c4e565b878303602089015261383b565b91848303604086015261383b565b906060818303910152613878565b90565b5090565b6138e290611f0f565b90565b6138ee906138d9565b90565b6138fa9061212e565b90565b919081101561390d576020020190565b6136ff565b3561391c81610325565b90565b9261399c6139a29161399793969794613939878a90614656565b9590956139678a9161395861394c6102d2565b93849260208401613567565b6020820181038252038261064f565b61397961397382613594565b9161358e565b20919261399061398b600c8d90610efe565b61234a565b929361360c565b614b62565b1561041f565b613cf957613a28906139ca60006139c56139be600f8a90612116565b8790612146565b611d28565b6139f06139d9600e8890610bb9565b6139ea6139e582612178565b61361a565b90612a9f565b613a23613a11613a0a613a05600e8a90610bb9565b612178565b8890614bb3565b91613a1e60108990613637565b610bb9565b612a9f565b613a326000612185565b935b84613a5d613a57613a52613a4c88600081019061366d565b906136b4565b610322565b91610322565b1015613cb957613a83613a7e613a778660208101906136b8565b8891613715565b61372a565b600014613bc857613a946000612185565b5b80613ac8613ac2613abd613ab7613ab08a604081019061377d565b8c9161380b565b906138d5565b610322565b91610322565b1015613bb657613afe613af9613af4613aef613ae889600081019061366d565b8b91613737565b61374c565b6138e5565b6138f1565b906340c10f1985613b2f613b2a613b23613b1c8b604081019061377d565b8d9161380b565b86916138fd565b613912565b93803b15613bb157613b5560008094613b60613b496102d2565b98899687958694612d3a565b845260048401610c5b565b03925af1918215613bac57613b7a92613b7f575b5061364f565b613a95565b613b9f9060003d8111613ba5575b613b97818361064f565b81019061382b565b38613b74565b503d613b8d565b613044565b612d35565b5093613bc2905b61364f565b93613a34565b93613bf9613bf4613bef613bea613be388600081019061366d565b8691613737565b61374c565b613765565b613771565b9063b48ab8b69184613c19613c1288604081019061377d565b859161380b565b929094613c34613c2d8a606081019061377d565b879161380b565b91833b15613cb457613c68613c5d93600097938894613c516102d2565b9b8c998a988997612d3a565b875260048701613888565b03925af1918215613caf57613bc292613c82575b50613bbd565b613ca29060003d8111613ca8575b613c9a818361064f565b81019061382b565b38613c7c565b503d613c90565b613044565b612d35565b92509250907ff254aace0ef98d6ac1a0d84c95648f8e3f7a1881dbb43393709ecd004b00f10391613cf4613ceb6102d2565b92839283610c5b565b0390a1565b60006309bde33960e01b815280613d12600482016104df565b0390fd5b613d1e611bf3565b50679a31110384e0b0c96020526014526000526034600c205490565b613d5390613d4e613d49611ed0565b614096565b613d55565b565b613d60906007612a7f565b565b613d6b90613d3a565b565b94909194613d79614549565b613f17575b60601b679a31110384e0b0c9179160601b679a31110384e0b0c917918060205260601c928260601c928315613f0957843303613eed575b8660005260406000208054808411613edf5783900390556020526040600020805490828201918210613ed15755806020528284337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4613e17614557565b613eac575b823b613e2b575b505050505050565b602094829160405197889663f23a6e618852338989015260408801526060870152608086015260a0808601528160c086015260e085013760c401906000601c8401915af115613e9d575b63f23a6e6160e01b905103613e8f57388080808080613e23565b639c05499b6000526004601cfd5b3d15613e75573d6000823e3d90fd5b613eb586614c02565b50613ebf81614c02565b50613ecb858390612616565b50613e1c565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c2054613db557634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b613f2086614c02565b50613f2a84614c02565b50613f36858390612616565b50613d7e565b613f4b613f5191939293610322565b92610322565b8201809211613f5c57565b6124c6565b613f7f613f7a613f73600f8490612116565b3390612146565b612178565b613f92613f8c6000612185565b91610322565b0361402357613fac3382613fa660016121b8565b91614a07565b613fde613fc343613fbd60016121b8565b90613f3c565b613fd9613fd2600f8590612116565b3390612146565b612a9f565b3361401e61400c7f5e1dd8c4451717d5ca4ffbefdada35e22e0871220b9ed9dd03a351f0938c5ed79261213a565b926140156102d2565b91829182610384565b0390a2565b600063156f904360e21b81528061403c600482016104df565b0390fd5b614048611bf3565b5063c79b8b5f60e01b61406361405d836103d0565b916103d0565b148015614087575b908115614077575b5090565b6140819150614c22565b38614073565b5061409181614c22565b61406b565b6140a8906140a26145d9565b90614d2f565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b614105602a6040926106c7565b61410e816140aa565b0190565b61412890602081019060008183039101526140f8565b90565b1561413257565b61413a6102d2565b62461bcd60e51b81528061415060048201614112565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b61418960196020926106c7565b61419281614154565b0190565b6141ac906020810190600081830391015261417c565b90565b156141b657565b6141be6102d2565b62461bcd60e51b8152806141d460048201614196565b0390fd5b6141e2604061077e565b90565b90565b906141fd6141f86142049261213a565b6141e5565b8254611f43565b9055565b60a01b90565b906142286bffffffffffffffffffffffff60a01b91614208565b9181191691161790565b61424661424161424b9261047c565b610b9a565b61047c565b90565b90565b9061426661426161426d92614232565b61424e565b825461420e565b9055565b9061429c602060006142a29461429482820161428e848801612468565b906141e8565b01920161249d565b90614251565b565b906142ae91614271565b565b90614321614328926142dc836142d56142cf6142ca614532565b61047c565b9161047c565b111561412b565b614302816142fb6142f56142f06000612491565b6102f2565b916102f2565b14156141af565b9161431861430e6141d8565b93600085016123c2565b60208301612408565b60026142a4565b565b90614333611fad565b506080604051019160208301604052600083528290600a6000198092955b01948181066030018653049384156143705790600a9190809291614351565b93505082602091039203918252565b6143cd91926143996143d3956143be939086849192614dc8565b6143b66143af826143aa6000612178565b613f3c565b6000612a9f565b926001610bb9565b916143c883612178565b613f3c565b90612a9f565b565b906143df8261107c565b8110156143f0576020809102010190565b6136ff565b6143ff9051610322565b90565b61441161441791939293610322565b92610322565b820391821161442257565b6124c6565b6144379093929193848391614ec9565b6144408361107c565b9261444b6000612185565b926144566000612185565b935b8461446b61446588610322565b91610322565b10156144e8576144dc6144e2916144c361448e614489888a906143d5565b6143f5565b6144bd6144ae60016144a86144a38d8c6143d5565b6143f5565b90610bb9565b916144b883612178565b614402565b90612a9f565b6144d66144d18789906143d5565b6143f5565b90613f3c565b9461364f565b93614458565b9150935061450c925061450591506145006000612178565b614402565b6000612a9f565b565b600090565b90565b61452a61452561452f92614513565b610b9a565b61047c565b90565b61453a61450e565b50614546612710614516565b90565b614551611bf3565b50600090565b61455f611bf3565b50600090565b50509492939093614574614557565b614581575b505050505050565b61459761459d936145a397969092939596612608565b50612608565b50612616565b50388080808080614579565b906145d16145cc6145d6936145c5818590614ee4565b6005612c1d565b612c35565b614fcb565b50565b6145e1612379565b503390565b9061460861460361460d936145fc818590615006565b6005612c1d565b612c35565b6150a0565b50565b91602061463292949361462b60408201966000830190610b42565b0190610c4e565b565b61464061464691610322565b91610322565b908115614651570690565b612511565b919091614661611bca565b5061466a611bca565b5061467f61467a600e8590610bb9565b612178565b61469261468c6000612185565b91610322565b1461479b576146b56146b06146a9600f8690612116565b8390612146565b612178565b806146c96146c36000612185565b91610322565b1461477e5740906146d9826121a1565b6146ec6146e66000612185565b91610322565b146147615761473d6147579161472561475e9461471661470a6102d2565b93849260208401614610565b6020820181038252038261064f565b61473761473182613594565b9161358e565b206121a1565b61475161474c600e8790610bb9565b612178565b90614634565b9283614bb3565b90565b600063b7b3378760e01b81528061477a600482016104df565b0390fd5b6000637de832b560e11b815280614797600482016104df565b0390fd5b6000630b56c82b60e31b8152806147b4600482016104df565b0390fd5b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b6147ed601b6020926106c7565b6147f6816147b8565b0190565b61481090602081019060008183039101526147e0565b90565b1561481a57565b6148226102d2565b62461bcd60e51b815280614838600482016147fa565b0390fd5b6148b8906148b16148bd949361486c8561486561485f61485a614532565b61047c565b9161047c565b111561412b565b6148928161488b6148856148806000612491565b6102f2565b916102f2565b1415614813565b936148a861489e6141d8565b95600087016123c2565b60208501612408565b600361237e565b6142a4565b565b906148cb60ff916116ad565b9181191691161790565b6148de9061041f565b90565b90565b906148f96148f4614900926148d5565b6148e1565b82546148bf565b9055565b9596949392943361493d6149377f00000000000000000000000000000000000000000000000000000000000000006102f2565b916102f2565b1415801561499f575b61498257614974976149679661496294899490919293946150db565b6142b0565b61496f612b5e565b6145af565b6149806001600b6148e4565b565b600063f92ee8a960e01b81528061499b600482016104df565b0390fd5b506149aa600b612c92565b614946565b90565b6149c66149c16149cb92610322565b610b9a565b6102e7565b90565b6149fa6149f5614a04936149f060006149ff956149e9612379565b50016149af565b615179565b6121a1565b6149b2565b61212e565b90565b614a42614a5793614a1d614a519385839161519b565b614a3a614a3382614a2e6000612178565b614402565b6000612a9f565b926001610bb9565b91614a4c83612178565b614402565b90612a9f565b565b92614a6a91949390858491926151b6565b614a738361107c565b91614a7e6000612185565b90614a896000612185565b915b82614a9e614a9887610322565b91610322565b1015614b1c57614ac4614b1691614abe614ab98787906143d5565b6143f5565b90613f3c565b92614b11614adb614ad68784906143d5565b6143f5565b614b0b614afc6001614af6614af18d88906143d5565b6143f5565b90610bb9565b91614b0683612178565b613f3c565b90612a9f565b61364f565b91614a8b565b91509350614b409250614b399150614b346000612178565b613f3c565b6000612a9f565b565b614b5a6000614b5f92614b53611bca565b50016149af565b6152f9565b90565b919091614b6d611bf3565b508051614b7a575b501490565b9060208201915160051b8201905b8251811160051b9081526020835191185260206040600020920191818310614b885791505038614b75565b90614bd5614bce614bda92614bc6611bca565b506010613637565b8390610bb9565b612178565b80614bee614be86000612185565b91610322565b14600014614bfb57505b90565b9050614bf8565b90614c0b6129a5565b506040519160408301604052600183526020830152565b614c2a611bf3565b50614c3481615311565b8015614c57575b908115614c47575b5090565b614c5191506153b7565b38614c43565b50614c6181615351565b614c3b565b90565b614c7d614c78614c8292614c66565b610b9a565b610322565b90565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b614cb960178092611fb2565b614cc281614c85565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b614cfa60118092611fb2565b614d0381614cc6565b0190565b614d21614d2c9392614d1b614d2693614cad565b90612040565b614cee565b90612040565b90565b90614d44614d3e838390612c9f565b1561041f565b614d4c575050565b614dc491614da2614d7b614d6b614d65614da795615433565b936121a1565b614d756020614c69565b9061560c565b91614d93614d876102d2565b93849260208401614d07565b6020820181038252038261064f565b6120c9565b614daf6102d2565b91829162461bcd60e51b835260048301610726565b0390fd5b91929092614dd4614549565b614eb0575b8260601b8015614ea257679a31110384e0b0c960205283601452846000526040600020805490838201918210614e9457558160205260601c6000337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604083a4614e41614557565b614e7b575b614e4f83615758565b614e5a575b50505050565b614e7293614e686000612491565b9390919293615765565b38808080614e54565b614e8484614c02565b50614e8e81614c02565b50614e46565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b614eb984614c02565b50614ec381614c02565b50614dd9565b9091614ee292614ed96000612491565b929091926157fe565b565b614ef8614ef2828490612c9f565b1561041f565b614f01575b5050565b614f246001614f1f6000614f176004869061231e565b018590612c60565b6148e4565b90614f2d6145d9565b90614f6a614f64614f5e7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95612312565b9261213a565b9261213a565b92614f736102d2565b80614f7d816104df565b0390a43880614efd565b614f9090611f0f565b90565b614fa7614fa2614fac926102e7565b610b9a565b610322565b90565b614fc3614fbe614fc892610322565b6116ad565b610afc565b90565b90614ffe614ff8614ff3614fee600061500396614fe6611bf3565b500194614f87565b614f93565b614faf565b916149af565b6159ee565b90565b615011818390612c9f565b61501a575b5050565b61503d600061503860006150306004869061231e565b018590612c60565b6148e4565b906150466145d9565b9061508361507d6150777ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95612312565b9261213a565b9261213a565b9261508c6102d2565b80615096816104df565b0390a43880615016565b906150d36150cd6150c86150c360006150d8966150bb611bf3565b500194614f87565b614f93565b614faf565b916149af565b615aae565b90565b91926150fa61513f96946150f3615101946008611eac565b6009611eac565b600a611eac565b61511361510c6116cf565b82906145af565b61512561511e611c38565b82906145af565b615137615130611c90565b82906145af565b919091615bb8565b565b5490565b600052602060002090565b61515981615141565b8210156151745761516b600191615145565b91020190600090565b6136ff565b6151989160006151929261518b61230d565b5001615150565b90610f31565b90565b90916151b4926151ab6000612491565b92909192615bd5565b565b919290926151c2614549565b6152f4575b80518451036152e6578260601b80156152d85780679a31110384e0b0c917602052845160051b805b6152a157506000604051604081527f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb81885160051b602001604082019081818c60045afa503d60400160208301523d01865160051b60200181818960045afa503d01039360601c933392a4615262614557565b61529c575b61527083615758565b61527b575b50505050565b615293936152896000612491565b9390919293615cd9565b38808080615275565b615267565b80830151908087015160005260406000209182549081019081106152ca576020925503806151ef565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b6151c7565b600061530e91615307611bca565b5001615141565b90565b615319611bf3565b50633e85e62f60e01b61533461532e836103d0565b916103d0565b14908115615341575b5090565b61534b9150615d90565b3861533d565b615359611bf3565b5061536381615db7565b80156153a8575b801561538d575b90811561537d575b5090565b6153879150615df7565b38615379565b5060006153a261539c836103d0565b916103d0565b14615371565b506153b281615df7565b61536a565b6153bf611bf3565b506153c981615df7565b9081156153d5575b5090565b6153df9150615e37565b386153d1565b90565b60ff1690565b6154026153fd615407926153e5565b610b9a565b6153e8565b90565b61541460146153ee565b90565b61542b615426615430926153e8565b610b9a565b610322565b90565b61545061544b61546692615445611fad565b50614f87565b614f93565b61546061545b61540a565b615417565b9061560c565b90565b90565b61548061547b61548592615469565b610b9a565b610322565b90565b9061549a615495836112af565b61077e565b918252565b369037565b906154c96154b183615488565b926020806154bf86936112af565b920191039061549f565b565b600360fc1b90565b906154dd82613594565b8110156154ef57600160209102010190565b6136ff565b600f60fb1b90565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b61551b6154fc565b90565b90565b61553561553061553a9261551e565b610b9a565b610322565b90565b60f81b90565b90565b61555a61555561555f92615543565b610b9a565b6153e8565b90565b6155819061557b615575615586946153e8565b91610322565b9061095e565b610322565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b6155bd602080926106c7565b6155c681615589565b0190565b6155e090602081019060008183039101526155b1565b90565b156155ea57565b6155f26102d2565b62461bcd60e51b815280615608600482016155ca565b0390fd5b9190615616611fad565b506156b06156a061564c6156476156376002615632879161546c565b6124dc565b615641600261546c565b90613f3c565b6154a4565b926156556154cb565b61566e8561566860009360001a93612185565b906154d3565b536156776154f4565b6156908561568a60019360001a936121b8565b906154d3565b5361569b600261546c565b6124dc565b6156aa60016121b8565b90613f3c565b925b836156c66156c060016121b8565b91610322565b111561572d576156d4615513565b816156df600f615521565b16916010831015615728576156fb61571c92615722941a61553d565b61570b8591889060001a926154d3565b536157166004615546565b90615562565b9361361a565b926156b2565b6136ff565b6157559293506157509061574a6157446000612185565b91610322565b146155e3565b6120c9565b90565b615760611bf3565b503b90565b919360209360405195869463f23a6e618652338787015260601b60601c60408601526060850152608084015260a08084015280518091818060c08701526157ea575b505060c401906000601c8401915af1156157db575b63f23a6e6160e01b9051036157cd57565b639c05499b6000526004601cfd5b3d156157bc573d6000823e3d90fd5b818660e08701920160045afa5080386157a7565b9193929061580a614549565b615936575b81518551036159285760601b9182679a31110384e0b0c9176020528060601b83811490151715615906575b50835160051b805b6158d057507f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb6000939460405192839160408352805160051b60200180916040850192839160045afa503d60400160208401523d019081815160051b602001809260045afa503d01039260601c923392a46158bb614557565b6158c2575b565b6158ca6121f8565b506158c0565b80820151908086015160005260406000208054928381116158f8576020930390550380615842565b63f4d678b86000526004601cfd5b6000526034600c20541561591a573861583a565b634b6e7f186000526004601cfd5b633b800a466000526004601cfd5b61593e6121f8565b5061580f565b90565b600052602060002090565b5490565b61595f81615952565b82101561597a57615971600191615947565b91020190600090565b6136ff565b919061599561599061599d93612312565b612a73565b908354611cdd565b9055565b90815491680100000000000000008310156159d157826159c99160016159cf95018155615956565b9061597f565b565b610639565b906159e090612312565b600052602052604060002090565b6159f6611bf3565b50615a0b615a05828490615e77565b1561041f565b600014615a4e57615a44615a4992615a2f615a2860008501615944565b82906159a1565b6001615a3d60008501615141565b93016159d6565b612a9f565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b615a7d91615a7761230d565b9161597f565b565b615a8881615952565b8015615aa9576001900390615aa6615aa08383615956565b90615a6b565b55565b615a55565b615ab6611bf3565b50615acd615ac86001830184906159d6565b612178565b9081615ae2615adc6000612185565b91610322565b1415600014615bb057615b62926001615b5d9284615b0b600096615b05856121b8565b90614402565b615b28615b19888501615141565b615b22866121b8565b90614402565b80615b3b615b3584610322565b91610322565b03615b67575b505050615b57615b52868301615944565b615a7f565b016159d6565b611d28565b600190565b615ba892615b9a615b86615b80615ba3948c8901615150565b90610f31565b93615b9485918c8901615150565b9061597f565b918585016159d6565b612a9f565b388080615b41565b505050600090565b90615bce615bd39392615bc9611ed0565b6145af565b615ead565b565b90929192615be1614549565b615cb7575b60601b9081679a31110384e0b0c917602052818160601b148160601b151715615c95575b5082600052604060002090815491828411615c8757836000930390558260205260601c337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604084a4615c5b614557565b615c64575b5050565b615c70615c7692614c02565b50614c02565b50615c7f6121f8565b503880615c60565b63f4d678b86000526004601cfd5b6000526034600c205415615ca95738615c0a565b634b6e7f186000526004601cfd5b615cc084614c02565b50615cca83614c02565b50615cd36121f8565b50615be6565b919360209360405195869463bc197c818652338787015260601b60601c604086015260a06060860152805160051b8601809160c0870192839160045afa503d60a001908160808701523d019182815160051b8801809260045afa503d0160a08501523d01908181518601809260045afa50601c8301903d0103906000601c8401915af115615d81575b63bc197c8160e01b905103615d7357565b639c05499b6000526004601cfd5b3d15615d62573d6000823e3d90fd5b615d98611bf3565b5060e01c630e89341c8114906301ffc9a763d9b67a2682149114171790565b615dbf611bf3565b5080615dda615dd463152a902d60e11b6103d0565b916103d0565b14908115615de7575b5090565b615df19150615ecd565b38615de3565b615dff611bf3565b5080615e1a615e14635a05180f60e01b6103d0565b916103d0565b14908115615e27575b5090565b615e319150615ef3565b38615e23565b615e3f611bf3565b5080615e5a615e54634e821d3360e11b6103d0565b916103d0565b14908115615e67575b5090565b615e719150615351565b38615e63565b615e95916001615e9092615e89611bf3565b50016159d6565b612178565b615ea8615ea26000612185565b91610322565b141590565b90615ec4615ebd615ecb93611f37565b6006611f6d565b6007612a7f565b565b615ed5611bf3565b50615eef615ee96301ffc9a760e01b6103d0565b916103d0565b1490565b615efb611bf3565b5080615f16615f10637965db0b60e01b6103d0565b916103d0565b14908115615f23575b5090565b615f2d9150615db7565b38615f1f56fea2646970667358221220fdfd08eb90c8ee402a9baa171b1d2feff740a3c0392aafd7f5be7219ff4ddece64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -99,227 +238,235 @@ export class ERC1155PackFactory extends ContractFactory { export const ERC1155PACKFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC1155/presets/pack/ERC1155PackFactory.sol:ERC1155PackFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC1155/presets/pack/ERC1155PackFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {ERC1155Pack} from "@0xsequence/contracts-library/tokens/ERC1155/presets/pack/ERC1155Pack.sol";\nimport {\n IERC1155PackFactory,\n IERC1155PackFactoryFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/presets/pack/IERC1155PackFactory.sol";\nimport {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\n\n/**\n * Deployer of ERC-1155 Pack proxies.\n */\ncontract ERC1155PackFactory is IERC1155PackFactory, SequenceProxyFactory {\n /**\n * Creates an ERC-1155 Pack Factory.\n * @param factoryOwner The owner of the ERC-1155 Pack Factory\n */\n constructor(address factoryOwner) {\n ERC1155Pack impl = new ERC1155Pack();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155PackFactoryFunctions\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n bytes32 merkleRoot,\n uint256 supply\n ) external returns (address proxyAddr) {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Pack(proxyAddr).initialize(\n tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator, merkleRoot, supply\n );\n emit ERC1155PackDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155PackFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator\n ) external view returns (address proxyAddr) {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n}\n' - }, - 'src/tokens/ERC1155/presets/pack/ERC1155Pack.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {IERC1155Pack} from "./IERC1155Pack.sol";\nimport {ERC1155Items} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/ERC1155Items.sol";\nimport {MerkleProof} from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";\nimport {IERC1155ItemsFunctions} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol";\n\ncontract ERC1155Pack is ERC1155Items, IERC1155Pack {\n bytes32 internal constant PACK_ADMIN_ROLE = keccak256("PACK_ADMIN_ROLE");\n\n bytes32 public merkleRoot;\n uint256 public supply;\n uint256 public remainingSupply;\n\n mapping(address => uint256) internal _commitments;\n mapping(uint256 => uint256) internal _availableIndices;\n\n constructor() ERC1155Items() {}\n\n /// @inheritdoc IERC1155Pack\n function initialize(\n address owner,\n string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n bytes32 _merkleRoot,\n uint256 _supply\n ) public virtual {\n _grantRole(PACK_ADMIN_ROLE, owner);\n merkleRoot = _merkleRoot;\n supply = _supply;\n remainingSupply = _supply;\n super.initialize(owner, tokenName, tokenBaseURI, tokenContractURI, royaltyReceiver, royaltyFeeNumerator);\n }\n\n /// @inheritdoc IERC1155Pack\n function setPacksContent(bytes32 _merkleRoot, uint256 _supply) external onlyRole(PACK_ADMIN_ROLE) {\n merkleRoot = _merkleRoot;\n supply = _supply;\n remainingSupply = _supply;\n }\n\n /// @inheritdoc IERC1155Pack\n function commit() external {\n if (_commitments[msg.sender] != 0) {\n revert PendingReveal();\n }\n if (balanceOf(msg.sender, 1) == 0) {\n revert NoBalance();\n }\n _burn(msg.sender, 1, 1);\n uint256 revealAfterBlock = block.number + 1;\n _commitments[msg.sender] = revealAfterBlock;\n\n emit Commit(msg.sender, revealAfterBlock);\n }\n\n /// @inheritdoc IERC1155Pack\n function reveal(address user, PackContent calldata packContent, bytes32[] calldata proof) external {\n (uint256 randomIndex, uint256 revealIdx) = _getRevealIdx(user);\n\n bytes32 leaf = keccak256(abi.encode(revealIdx, packContent));\n if (!MerkleProof.verify(proof, merkleRoot, leaf)) {\n revert InvalidProof();\n }\n\n delete _commitments[user];\n remainingSupply--;\n\n // Point this index to the last index\'s value\n _availableIndices[randomIndex] = _getIndexOrDefault(remainingSupply);\n\n for (uint256 i = 0; i < packContent.tokenAddresses.length; i++) {\n IERC1155ItemsFunctions(packContent.tokenAddresses[i]).batchMint(\n user, packContent.tokenIds[i], packContent.amounts[i], ""\n );\n }\n\n emit Reveal(user);\n }\n\n /// @inheritdoc IERC1155Pack\n function refundPack(address user) external {\n if (_commitments[user] == 0) {\n revert NoCommit();\n }\n if (uint256(blockhash(_commitments[user])) != 0 || block.number <= _commitments[user]) {\n revert PendingReveal();\n }\n delete _commitments[user];\n _mint(user, 1, 1, "");\n }\n\n /// @inheritdoc IERC1155Pack\n function getRevealIdx(address user) public view returns (uint256 revealIdx) {\n (, revealIdx) = _getRevealIdx(user);\n return revealIdx;\n }\n\n function _getRevealIdx(address user) internal view returns (uint256 randomIdx, uint256 revealIdx) {\n if (remainingSupply == 0) {\n revert AllPacksOpened();\n }\n\n bytes32 blockHash = blockhash(_commitments[user]);\n if (uint256(blockHash) == 0) {\n revert InvalidCommit();\n }\n\n if (_commitments[user] == 0) {\n revert NoCommit();\n }\n\n randomIdx = uint256(keccak256(abi.encode(blockHash, user))) % remainingSupply;\n revealIdx = _getIndexOrDefault(randomIdx);\n return (randomIdx, revealIdx);\n }\n\n function _getIndexOrDefault(uint256 index) internal view returns (uint256) {\n uint256 value = _availableIndices[index];\n return value == 0 ? index : value;\n }\n\n function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n return type(IERC1155Pack).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n}\n' - }, - 'src/tokens/ERC1155/presets/pack/IERC1155PackFactory.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155PackFactoryFunctions {\n /**\n * Creates an ERC-1155 Pack proxy.\n * @param proxyOwner The owner of the ERC-1155 Pack proxy\n * @param tokenOwner The owner of the ERC-1155 Pack implementation\n * @param name The name of the ERC-1155 Pack proxy\n * @param baseURI The base URI of the ERC-1155 Pack proxy\n * @param contractURI The contract URI of the ERC-1155 Pack proxy\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @param merkleRoot merkle root built from all possible pack contents.\n * @param supply total amount of packs.\n * @return proxyAddr The address of the ERC-1155 Pack Proxy\n */\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n bytes32 merkleRoot,\n uint256 supply\n ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-1155 Pack proxy\n * @param tokenOwner The owner of the ERC-1155 Pack implementation\n * @param name The name of the ERC-1155 Pack proxy\n * @param baseURI The base URI of the ERC-1155 Pack proxy\n * @param contractURI The contract URI of the ERC-1155 Pack proxy\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @return proxyAddr The address of the ERC-1155 Pack Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator\n ) external returns (address proxyAddr);\n}\n\ninterface IERC1155PackFactorySignals {\n /**\n * Event emitted when a new ERC-1155 Pack proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155PackDeployed(address proxyAddr);\n}\n\ninterface IERC1155PackFactory is IERC1155PackFactoryFunctions, IERC1155PackFactorySignals {}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC1155Pack } from "./ERC1155Pack.sol";\nimport { IERC1155PackFactory, IERC1155PackFactoryFunctions } from "./IERC1155PackFactory.sol";\n\n/**\n * Deployer of ERC-1155 Pack proxies.\n */\ncontract ERC1155PackFactory is IERC1155PackFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Pack Factory.\n * @param factoryOwner The owner of the ERC-1155 Pack Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Pack impl = new ERC1155Pack();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155PackFactoryFunctions\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external override returns (address proxyAddr) {\n bytes32 salt = keccak256(\n abi.encode(\n tokenOwner,\n name,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n )\n );\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Pack(proxyAddr).initialize(\n tokenOwner,\n name,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n emit ERC1155PackDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155PackFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view override returns (address proxyAddr) {\n bytes32 salt = keccak256(\n abi.encode(\n tokenOwner,\n name,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n )\n );\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 TransparentUpgradeableBeaconProxy,\n ITransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport {Create2} from "@openzeppelin/contracts/utils/Create2.sol";\nimport {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";\nimport {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.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 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(bytes32 _salt, address _proxyOwner, bytes memory _data)\n internal\n returns (address proxyAddress)\n {\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(bytes32 _salt, address _proxyOwner, bytes memory _data)\n internal\n view\n returns (address)\n {\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(address implementation) public onlyOwner {\n beacon.upgradeTo(implementation);\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/presets/pack/IERC1155Pack.sol': { + 'src/tokens/ERC1155/presets/pack/ERC1155Pack.sol': { content: - "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155Pack {\n struct PackContent {\n address[] tokenAddresses;\n uint256[][] tokenIds;\n uint256[][] amounts;\n }\n\n /**\n * Commit expired or never made.\n */\n error InvalidCommit();\n\n /**\n * Reveal is pending.\n */\n error PendingReveal();\n\n /**\n * Commit never made.\n */\n error NoCommit();\n\n /**\n * No balance.\n */\n error NoBalance();\n\n /**\n * Invalid proof.\n */\n error InvalidProof();\n\n /**\n * All packs opened.\n */\n error AllPacksOpened();\n\n /// @notice Emitted when a user make a commitment\n event Commit(address indexed user, uint256 blockNumber);\n\n /// @notice Emitted when a reveal is successful\n event Reveal(address user);\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param tokenName Token name\n * @param tokenBaseURI Base URI for token metadata\n * @param tokenContractURI Contract URI for token metadata\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @param _merkleRoot merkle root built from all possible pack contents.\n * @param _supply total amount of packs.\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n bytes32 _merkleRoot,\n uint256 _supply\n ) external;\n\n /**\n * Set all possible pack contents.\n * @param _merkleRoot merkle root built from all possible pack contents.\n * @param _supply total amount of packs.\n * @dev Updating these values before all the packs have been opened may lead to undesirable behavior.\n */\n function setPacksContent(bytes32 _merkleRoot, uint256 _supply) external;\n\n /**\n * Get random reveal index.\n * @param user address of reward recipient.\n */\n function getRevealIdx(address user) external view returns (uint256);\n\n /**\n * Commit to reveal pack content.\n * @notice this function burns user's pack.\n */\n function commit() external;\n\n /**\n * Reveal pack content.\n * @param user address of reward recipient.\n * @param packContent reward selected with random index.\n * @param proof Pack contents merkle proof.\n */\n function reveal(\n address user,\n PackContent calldata packContent,\n bytes32[] calldata proof\n ) external;\n\n /**\n * Ask for pack refund after commit expiration.\n * @param user address of pack owner.\n * @notice this function mints a pack for the user when his commit is expired.\n */\n function refundPack(address user) external;\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IERC721ItemsFunctions } from "../../../ERC721/presets/items/IERC721Items.sol";\nimport { ERC1155Items } from "../items/ERC1155Items.sol";\nimport { IERC1155ItemsFunctions } from "../items/IERC1155Items.sol";\nimport { IERC1155Pack } from "./IERC1155Pack.sol";\n\nimport { MerkleProofLib } from "solady/utils/MerkleProofLib.sol";\n\ncontract ERC1155Pack is ERC1155Items, IERC1155Pack {\n\n bytes32 internal constant PACK_ADMIN_ROLE = keccak256("PACK_ADMIN_ROLE");\n\n mapping(uint256 => bytes32) public merkleRoot;\n mapping(uint256 => uint256) public supply;\n mapping(uint256 => uint256) public remainingSupply;\n\n mapping(uint256 => mapping(address => uint256)) internal _commitments;\n mapping(uint256 => mapping(uint256 => uint256)) internal _availableIndices;\n\n constructor() ERC1155Items() { }\n\n /// @inheritdoc ERC1155Items\n function initialize(\n address owner,\n string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual override {\n _grantRole(PACK_ADMIN_ROLE, owner);\n super.initialize(\n owner,\n tokenName,\n tokenBaseURI,\n tokenContractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n }\n\n /// @inheritdoc IERC1155Pack\n function setPacksContent(bytes32 _merkleRoot, uint256 _supply, uint256 packId) external onlyRole(PACK_ADMIN_ROLE) {\n merkleRoot[packId] = _merkleRoot;\n supply[packId] = _supply;\n remainingSupply[packId] = _supply;\n }\n\n /// @inheritdoc IERC1155Pack\n function commit(\n uint256 packId\n ) external {\n if (_commitments[packId][msg.sender] != 0) {\n revert PendingReveal();\n }\n _burn(msg.sender, packId, 1);\n uint256 revealAfterBlock = block.number + 1;\n _commitments[packId][msg.sender] = revealAfterBlock;\n\n emit Commit(msg.sender, packId);\n }\n\n /// @inheritdoc IERC1155Pack\n function reveal(\n address user,\n PackContent calldata packContent,\n bytes32[] calldata proof,\n uint256 packId\n ) external {\n (uint256 randomIndex, uint256 revealIdx) = _getRevealIdx(user, packId);\n\n bytes32 leaf = keccak256(abi.encode(revealIdx, packContent));\n if (!MerkleProofLib.verify(proof, merkleRoot[packId], leaf)) {\n revert InvalidProof();\n }\n\n delete _commitments[packId][user];\n remainingSupply[packId]--;\n\n // Point this index to the last index\'s value\n _availableIndices[packId][randomIndex] = _getIndexOrDefault(remainingSupply[packId], packId);\n\n for (uint256 i = 0; i < packContent.tokenAddresses.length; i++) {\n if (packContent.isERC721[i]) {\n for (uint256 j = 0; j < packContent.tokenIds[i].length; j++) {\n IERC721ItemsFunctions(packContent.tokenAddresses[i]).mint(user, packContent.tokenIds[i][j]);\n }\n } else {\n IERC1155ItemsFunctions(packContent.tokenAddresses[i]).batchMint(\n user, packContent.tokenIds[i], packContent.amounts[i], ""\n );\n }\n }\n\n emit Reveal(user, packId);\n }\n\n /// @inheritdoc IERC1155Pack\n function refundPack(address user, uint256 packId) external {\n uint256 commitment = _commitments[packId][user];\n if (commitment == 0) {\n revert NoCommit();\n }\n if (uint256(blockhash(commitment)) != 0 || block.number <= commitment) {\n revert PendingReveal();\n }\n delete _commitments[packId][user];\n _mint(user, packId, 1, "");\n }\n\n /// @inheritdoc IERC1155Pack\n function getRevealIdx(address user, uint256 packId) public view returns (uint256 revealIdx) {\n (, revealIdx) = _getRevealIdx(user, packId);\n return revealIdx;\n }\n\n function _getRevealIdx(address user, uint256 packId) internal view returns (uint256 randomIdx, uint256 revealIdx) {\n if (remainingSupply[packId] == 0) {\n revert AllPacksOpened();\n }\n\n uint256 commitment = _commitments[packId][user];\n if (commitment == 0) {\n revert NoCommit();\n }\n bytes32 blockHash = blockhash(commitment);\n if (uint256(blockHash) == 0) {\n revert InvalidCommit();\n }\n\n randomIdx = uint256(keccak256(abi.encode(blockHash, user))) % remainingSupply[packId];\n revealIdx = _getIndexOrDefault(randomIdx, packId);\n return (randomIdx, revealIdx);\n }\n\n function _getIndexOrDefault(uint256 index, uint256 packId) internal view returns (uint256) {\n uint256 value = _availableIndices[packId][index];\n return value == 0 ? index : value;\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override returns (bool) {\n return type(IERC1155Pack).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'src/tokens/ERC1155/presets/items/ERC1155Items.sol': { + 'src/tokens/ERC1155/presets/pack/IERC1155PackFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n IERC1155Items,\n IERC1155ItemsFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol";\nimport {ERC1155BaseToken} from "@0xsequence/contracts-library/tokens/ERC1155/ERC1155BaseToken.sol";\nimport {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.sol";\n\n/**\n * An implementation of ERC-1155 capable of minting when role provided.\n */\ncontract ERC1155Items is ERC1155BaseToken, IERC1155Items {\n bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE");\n\n address private immutable initializer;\n bool private initialized;\n\n constructor() {\n initializer = msg.sender;\n }\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param tokenName Token name\n * @param tokenBaseURI Base URI for token metadata\n * @param tokenContractURI Contract URI for token metadata\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator\n )\n public\n virtual\n {\n if (msg.sender != initializer || initialized) {\n revert InvalidInitialization();\n }\n\n ERC1155BaseToken._initialize(owner, tokenName, tokenBaseURI, tokenContractURI);\n _setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator);\n\n _grantRole(MINTER_ROLE, owner);\n\n initialized = true;\n }\n\n //\n // Minting\n //\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 onlyRole(MINTER_ROLE) {\n _mint(to, tokenId, amount, data);\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 */\n function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data)\n external\n onlyRole(MINTER_ROLE)\n {\n _batchMint(to, tokenIds, amounts, data);\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(bytes4 interfaceId) public view virtual override (ERC1155BaseToken) returns (bool) {\n return type(IERC1155ItemsFunctions).interfaceId == interfaceId || ERC1155BaseToken.supportsInterface(interfaceId)\n || super.supportsInterface(interfaceId);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155PackFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Pack proxy.\n * @param proxyOwner The owner of the ERC-1155 Pack proxy\n * @param tokenOwner The owner of the ERC-1155 Pack implementation\n * @param name The name of the ERC-1155 Pack proxy\n * @param baseURI The base URI of the ERC-1155 Pack proxy\n * @param contractURI The contract URI of the ERC-1155 Pack proxy\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\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 Pack Proxy\n */\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-1155 Pack proxy\n * @param tokenOwner The owner of the ERC-1155 Pack implementation\n * @param name The name of the ERC-1155 Pack proxy\n * @param baseURI The base URI of the ERC-1155 Pack proxy\n * @param contractURI The contract URI of the ERC-1155 Pack proxy\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\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 Pack Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC1155PackFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Pack proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155PackDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155PackFactory is IERC1155PackFactoryFunctions, IERC1155PackFactorySignals { }\n' }, - 'lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol': { + 'src/proxies/TransparentUpgradeableBeaconProxy.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' + '// 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' }, - 'src/tokens/ERC1155/presets/items/IERC1155Items.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155ItemsFunctions {\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\ninterface IERC1155ItemsSignals {\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n}\n\ninterface IERC1155Items is IERC1155ItemsFunctions, IERC1155ItemsSignals {}\n' + '// 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' }, - 'src/proxies/TransparentUpgradeableBeaconProxy.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {BeaconProxy, Proxy} from "./openzeppelin/BeaconProxy.sol";\nimport {TransparentUpgradeableProxy, ERC1967Proxy} from "./openzeppelin/TransparentUpgradeableProxy.sol";\n\ninterface ITransparentUpgradeableBeaconProxy {\n function initialize(address admin, address beacon, bytes memory data) external;\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 * 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' + '// 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' }, - 'lib/openzeppelin/contracts/access/Ownable.sol': { + 'src/tokens/ERC721/presets/items/IERC721Items.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' + '// 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/openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'src/tokens/ERC1155/presets/items/ERC1155Items.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' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC1155BaseToken, ERC2981Controlled } from "../../ERC1155BaseToken.sol";\nimport { IERC1155Items, IERC1155ItemsFunctions } from "./IERC1155Items.sol";\n\n/**\n * An implementation of ERC-1155 capable of minting when role provided.\n */\ncontract ERC1155Items is ERC1155BaseToken, IERC1155Items {\n\n bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE");\n\n address private immutable initializer;\n bool private initialized;\n\n constructor() {\n initializer = msg.sender;\n }\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param tokenName Token name\n * @param tokenBaseURI Base URI for token metadata\n * @param tokenContractURI Contract URI for token metadata\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual {\n if (msg.sender != initializer || initialized) {\n revert InvalidInitialization();\n }\n\n ERC1155BaseToken._initialize(\n owner, tokenName, tokenBaseURI, tokenContractURI, implicitModeValidator, implicitModeProjectId\n );\n _setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator);\n\n _grantRole(MINTER_ROLE, owner);\n\n initialized = true;\n }\n\n //\n // Minting\n //\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 onlyRole(MINTER_ROLE) {\n _mint(to, tokenId, amount, data);\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 */\n function batchMint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data\n ) external onlyRole(MINTER_ROLE) {\n _batchMint(to, tokenIds, amounts, data);\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(ERC1155BaseToken) returns (bool) {\n return type(IERC1155ItemsFunctions).interfaceId == interfaceId\n || ERC1155BaseToken.supportsInterface(interfaceId) || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'src/tokens/ERC1155/ERC1155BaseToken.sol': { + 'src/tokens/ERC1155/presets/items/IERC1155Items.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ERC1155Supply, ERC1155\n} from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/ERC1155Supply.sol";\nimport {ERC1155Metadata} from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155Metadata.sol";\nimport {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.sol";\n\nerror InvalidInitialization();\n\n/**\n * A standard base implementation of ERC-1155 for use in Sequence library contracts.\n */\nabstract contract ERC1155BaseToken is ERC1155Supply, ERC1155Metadata, ERC2981Controlled {\n bytes32 internal constant METADATA_ADMIN_ROLE = keccak256("METADATA_ADMIN_ROLE");\n\n string private _contractURI;\n\n /**\n * Deploy contract.\n */\n constructor() ERC1155Metadata("", "") {}\n\n /**\n * Initialize the contract.\n * @param owner Owner address.\n * @param tokenName Token name.\n * @param tokenBaseURI Base URI for token metadata.\n * @param tokenContractURI Contract URI for token metadata.\n * @dev This should be called immediately after deployment.\n */\n function _initialize(\n address owner,\n string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI\n )\n internal\n {\n name = tokenName;\n baseURI = tokenBaseURI;\n _contractURI = tokenContractURI;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(ROYALTY_ADMIN_ROLE, owner);\n _grantRole(METADATA_ADMIN_ROLE, owner);\n }\n\n //\n // Metadata\n //\n\n /**\n * Update the base URI of token\'s URI.\n * @param tokenBaseURI New base URI of token\'s URI\n */\n function setBaseMetadataURI(string memory tokenBaseURI) external onlyRole(METADATA_ADMIN_ROLE) {\n _setBaseMetadataURI(tokenBaseURI);\n }\n\n /**\n * Update the name of the contract.\n * @param tokenName New contract name\n */\n function setContractName(string memory tokenName) external onlyRole(METADATA_ADMIN_ROLE) {\n _setContractName(tokenName);\n }\n\n /**\n * Update the contract URI of token\'s URI.\n * @param tokenContractURI New contract URI of token\'s URI\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\n */\n function setContractURI(string memory tokenContractURI) external onlyRole(METADATA_ADMIN_ROLE) {\n _contractURI = tokenContractURI;\n }\n\n //\n // Burn\n //\n\n /**\n * Allows the owner of the token to burn their tokens.\n * @param tokenId Id of token to burn\n * @param amount Amount of tokens to burn\n */\n function burn(uint256 tokenId, uint256 amount) public virtual {\n _burn(msg.sender, tokenId, amount);\n }\n\n /**\n * Burn tokens of given token id for each (tokenIds[i], amounts[i]) pair.\n * @param tokenIds Array of token ids to burn\n * @param amounts Array of the amount to be burned\n */\n function batchBurn(uint256[] memory tokenIds, uint256[] memory amounts) public virtual {\n _batchBurn(msg.sender, tokenIds, amounts);\n }\n\n //\n // Views\n //\n\n /**\n * Get the contract URI of token\'s URI.\n * @return Contract URI of token\'s URI\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\n */\n function contractURI() public view returns (string memory) {\n return _contractURI;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override (ERC1155Supply, ERC1155Metadata, ERC2981Controlled)\n returns (bool)\n {\n return ERC1155Supply.supportsInterface(interfaceId) || ERC1155Metadata.supportsInterface(interfaceId)\n || ERC2981Controlled.supportsInterface(interfaceId) || super.supportsInterface(interfaceId);\n }\n}\n' + '// 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' }, - 'src/tokens/common/ERC2981Controlled.sol': { + 'src/tokens/ERC1155/presets/pack/IERC1155Pack.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {IERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/IERC2981Controlled.sol";\nimport {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";\nimport {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";\n\n/**\n * An implementation of ERC-2981 that allows updates by roles.\n */\nabstract contract ERC2981Controlled is ERC2981, AccessControlEnumerable, IERC2981Controlled {\n bytes32 internal constant ROYALTY_ADMIN_ROLE = keccak256("ROYALTY_ADMIN_ROLE");\n\n //\n // Royalty\n //\n\n /**\n * Sets the royalty information that all ids in this contract will default to.\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(ROYALTY_ADMIN_ROLE) {\n _setDefaultRoyalty(receiver, feeNumerator);\n }\n\n /**\n * Sets the royalty information that a given token id in this contract will use.\n * @param tokenId The token id to set the royalty information for\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @notice This overrides the default royalty information for this token id\n */\n function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)\n external\n onlyRole(ROYALTY_ADMIN_ROLE)\n {\n _setTokenRoyalty(tokenId, receiver, feeNumerator);\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(bytes4 interfaceId)\n public\n view\n virtual\n override (ERC2981, AccessControlEnumerable)\n returns (bool)\n {\n return ERC2981.supportsInterface(interfaceId) || AccessControlEnumerable.supportsInterface(interfaceId)\n || type(IERC2981Controlled).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n}\n' + "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155Pack {\n\n struct PackContent {\n address[] tokenAddresses;\n bool[] isERC721;\n uint256[][] tokenIds;\n uint256[][] amounts;\n }\n\n /**\n * Commit expired or never made.\n */\n error InvalidCommit();\n\n /**\n * Reveal is pending.\n */\n error PendingReveal();\n\n /**\n * Commit never made.\n */\n error NoCommit();\n\n /**\n * Invalid proof.\n */\n error InvalidProof();\n\n /**\n * All packs opened.\n */\n error AllPacksOpened();\n\n /// @notice Emitted when a user make a commitment\n event Commit(address indexed user, uint256 packId);\n\n /// @notice Emitted when a reveal is successful\n event Reveal(address user, uint256 packId);\n\n /**\n * Set all possible pack contents.\n * @param _merkleRoot merkle root built from all possible pack contents.\n * @param _supply total amount of packs.\n * @param packId tokenId of pack.\n * @dev Updating these values before all the packs have been opened may lead to undesirable behavior.\n */\n function setPacksContent(bytes32 _merkleRoot, uint256 _supply, uint256 packId) external;\n\n /**\n * Get random reveal index.\n * @param user address of reward recipient.\n * @param packId tokenId of pack.\n */\n function getRevealIdx(address user, uint256 packId) external view returns (uint256);\n\n /**\n * Commit to reveal pack content.\n * @param packId tokenId of pack.\n * @notice this function burns user's pack.\n */\n function commit(\n uint256 packId\n ) external;\n\n /**\n * Reveal pack content.\n * @param user address of reward recipient.\n * @param packContent reward selected with random index.\n * @param proof Pack contents merkle proof.\n * @param packId tokenId of pack.\n */\n function reveal(\n address user,\n PackContent calldata packContent,\n bytes32[] calldata proof,\n uint256 packId\n ) external;\n\n /**\n * Ask for pack refund after commit expiration.\n * @param user address of pack owner.\n * @param packId tokenId of pack.\n * @notice this function mints a pack for the user when his commit is expired.\n */\n function refundPack(address user, uint256 packId) external;\n\n}\n" + }, + 'lib/solady/src/utils/MerkleProofLib.sol': { + content: + "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Gas optimized verification of proof of inclusion for a leaf in a Merkle tree.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/MerkleProofLib.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/MerkleProofLib.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/cryptography/MerkleProof.sol)\nlibrary MerkleProofLib {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* MERKLE PROOF VERIFICATION OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`.\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf)\n internal\n pure\n returns (bool isValid)\n {\n /// @solidity memory-safe-assembly\n assembly {\n if mload(proof) {\n // Initialize `offset` to the offset of `proof` elements in memory.\n let offset := add(proof, 0x20)\n // Left shift by 5 is equivalent to multiplying by 0x20.\n let end := add(offset, shl(5, mload(proof)))\n // Iterate over proof elements to compute root hash.\n for {} 1 {} {\n // Slot of `leaf` in scratch space.\n // If the condition is true: 0x20, otherwise: 0x00.\n let scratch := shl(5, gt(leaf, mload(offset)))\n // Store elements to hash contiguously in scratch space.\n // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.\n mstore(scratch, leaf)\n mstore(xor(scratch, 0x20), mload(offset))\n // Reuse `leaf` to store the hash to reduce stack operations.\n leaf := keccak256(0x00, 0x40)\n offset := add(offset, 0x20)\n if iszero(lt(offset, end)) { break }\n }\n }\n isValid := eq(leaf, root)\n }\n }\n\n /// @dev Returns whether `leaf` exists in the Merkle tree with `root`, given `proof`.\n function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf)\n internal\n pure\n returns (bool isValid)\n {\n /// @solidity memory-safe-assembly\n assembly {\n if proof.length {\n // Left shift by 5 is equivalent to multiplying by 0x20.\n let end := add(proof.offset, shl(5, proof.length))\n // Initialize `offset` to the offset of `proof` in the calldata.\n let offset := proof.offset\n // Iterate over proof elements to compute root hash.\n for {} 1 {} {\n // Slot of `leaf` in scratch space.\n // If the condition is true: 0x20, otherwise: 0x00.\n let scratch := shl(5, gt(leaf, calldataload(offset)))\n // Store elements to hash contiguously in scratch space.\n // Scratch space is 64 bytes (0x00 - 0x3f) and both elements are 32 bytes.\n mstore(scratch, leaf)\n mstore(xor(scratch, 0x20), calldataload(offset))\n // Reuse `leaf` to store the hash to reduce stack operations.\n leaf := keccak256(0x00, 0x40)\n offset := add(offset, 0x20)\n if iszero(lt(offset, end)) { break }\n }\n }\n isValid := eq(leaf, root)\n }\n }\n\n /// @dev Returns whether all `leaves` exist in the Merkle tree with `root`,\n /// given `proof` and `flags`.\n ///\n /// Note:\n /// - Breaking the invariant `flags.length == (leaves.length - 1) + proof.length`\n /// will always return false.\n /// - The sum of the lengths of `proof` and `leaves` must never overflow.\n /// - Any non-zero word in the `flags` array is treated as true.\n /// - The memory offset of `proof` must be non-zero\n /// (i.e. `proof` is not pointing to the scratch space).\n function verifyMultiProof(\n bytes32[] memory proof,\n bytes32 root,\n bytes32[] memory leaves,\n bool[] memory flags\n ) internal pure returns (bool isValid) {\n // Rebuilds the root by consuming and producing values on a queue.\n // The queue starts with the `leaves` array, and goes into a `hashes` array.\n // After the process, the last element on the queue is verified\n // to be equal to the `root`.\n //\n // The `flags` array denotes whether the sibling\n // should be popped from the queue (`flag == true`), or\n // should be popped from the `proof` (`flag == false`).\n /// @solidity memory-safe-assembly\n assembly {\n // Cache the lengths of the arrays.\n let leavesLength := mload(leaves)\n let proofLength := mload(proof)\n let flagsLength := mload(flags)\n\n // Advance the pointers of the arrays to point to the data.\n leaves := add(0x20, leaves)\n proof := add(0x20, proof)\n flags := add(0x20, flags)\n\n // If the number of flags is correct.\n for {} eq(add(leavesLength, proofLength), add(flagsLength, 1)) {} {\n // For the case where `proof.length + leaves.length == 1`.\n if iszero(flagsLength) {\n // `isValid = (proof.length == 1 ? proof[0] : leaves[0]) == root`.\n isValid := eq(mload(xor(leaves, mul(xor(proof, leaves), proofLength))), root)\n break\n }\n\n // The required final proof offset if `flagsLength` is not zero, otherwise zero.\n let proofEnd := add(proof, shl(5, proofLength))\n // We can use the free memory space for the queue.\n // We don't need to allocate, since the queue is temporary.\n let hashesFront := mload(0x40)\n // Copy the leaves into the hashes.\n // Sometimes, a little memory expansion costs less than branching.\n // Should cost less, even with a high free memory offset of 0x7d00.\n leavesLength := shl(5, leavesLength)\n for { let i := 0 } iszero(eq(i, leavesLength)) { i := add(i, 0x20) } {\n mstore(add(hashesFront, i), mload(add(leaves, i)))\n }\n // Compute the back of the hashes.\n let hashesBack := add(hashesFront, leavesLength)\n // This is the end of the memory for the queue.\n // We recycle `flagsLength` to save on stack variables (sometimes save gas).\n flagsLength := add(hashesBack, shl(5, flagsLength))\n\n for {} 1 {} {\n // Pop from `hashes`.\n let a := mload(hashesFront)\n // Pop from `hashes`.\n let b := mload(add(hashesFront, 0x20))\n hashesFront := add(hashesFront, 0x40)\n\n // If the flag is false, load the next proof,\n // else, pops from the queue.\n if iszero(mload(flags)) {\n // Loads the next proof.\n b := mload(proof)\n proof := add(proof, 0x20)\n // Unpop from `hashes`.\n hashesFront := sub(hashesFront, 0x20)\n }\n\n // Advance to the next flag.\n flags := add(flags, 0x20)\n\n // Slot of `a` in scratch space.\n // If the condition is true: 0x20, otherwise: 0x00.\n let scratch := shl(5, gt(a, b))\n // Hash the scratch space and push the result onto the queue.\n mstore(scratch, a)\n mstore(xor(scratch, 0x20), b)\n mstore(hashesBack, keccak256(0x00, 0x40))\n hashesBack := add(hashesBack, 0x20)\n if iszero(lt(hashesBack, flagsLength)) { break }\n }\n isValid :=\n and(\n // Checks if the last value in the queue is same as the root.\n eq(mload(sub(hashesBack, 0x20)), root),\n // And whether all the proofs are used, if required.\n eq(proofEnd, proof)\n )\n break\n }\n }\n }\n\n /// @dev Returns whether all `leaves` exist in the Merkle tree with `root`,\n /// given `proof` and `flags`.\n ///\n /// Note:\n /// - Breaking the invariant `flags.length == (leaves.length - 1) + proof.length`\n /// will always return false.\n /// - Any non-zero word in the `flags` array is treated as true.\n /// - The calldata offset of `proof` must be non-zero\n /// (i.e. `proof` is from a regular Solidity function with a 4-byte selector).\n function verifyMultiProofCalldata(\n bytes32[] calldata proof,\n bytes32 root,\n bytes32[] calldata leaves,\n bool[] calldata flags\n ) internal pure returns (bool isValid) {\n // Rebuilds the root by consuming and producing values on a queue.\n // The queue starts with the `leaves` array, and goes into a `hashes` array.\n // After the process, the last element on the queue is verified\n // to be equal to the `root`.\n //\n // The `flags` array denotes whether the sibling\n // should be popped from the queue (`flag == true`), or\n // should be popped from the `proof` (`flag == false`).\n /// @solidity memory-safe-assembly\n assembly {\n // If the number of flags is correct.\n for {} eq(add(leaves.length, proof.length), add(flags.length, 1)) {} {\n // For the case where `proof.length + leaves.length == 1`.\n if iszero(flags.length) {\n // `isValid = (proof.length == 1 ? proof[0] : leaves[0]) == root`.\n // forgefmt: disable-next-item\n isValid := eq(\n calldataload(\n xor(leaves.offset, mul(xor(proof.offset, leaves.offset), proof.length))\n ),\n root\n )\n break\n }\n\n // The required final proof offset if `flagsLength` is not zero, otherwise zero.\n let proofEnd := add(proof.offset, shl(5, proof.length))\n // We can use the free memory space for the queue.\n // We don't need to allocate, since the queue is temporary.\n let hashesFront := mload(0x40)\n // Copy the leaves into the hashes.\n // Sometimes, a little memory expansion costs less than branching.\n // Should cost less, even with a high free memory offset of 0x7d00.\n calldatacopy(hashesFront, leaves.offset, shl(5, leaves.length))\n // Compute the back of the hashes.\n let hashesBack := add(hashesFront, shl(5, leaves.length))\n // This is the end of the memory for the queue.\n // We recycle `flagsLength` to save on stack variables (sometimes save gas).\n flags.length := add(hashesBack, shl(5, flags.length))\n\n // We don't need to make a copy of `proof.offset` or `flags.offset`,\n // as they are pass-by-value (this trick may not always save gas).\n\n for {} 1 {} {\n // Pop from `hashes`.\n let a := mload(hashesFront)\n // Pop from `hashes`.\n let b := mload(add(hashesFront, 0x20))\n hashesFront := add(hashesFront, 0x40)\n\n // If the flag is false, load the next proof,\n // else, pops from the queue.\n if iszero(calldataload(flags.offset)) {\n // Loads the next proof.\n b := calldataload(proof.offset)\n proof.offset := add(proof.offset, 0x20)\n // Unpop from `hashes`.\n hashesFront := sub(hashesFront, 0x20)\n }\n\n // Advance to the next flag offset.\n flags.offset := add(flags.offset, 0x20)\n\n // Slot of `a` in scratch space.\n // If the condition is true: 0x20, otherwise: 0x00.\n let scratch := shl(5, gt(a, b))\n // Hash the scratch space and push the result onto the queue.\n mstore(scratch, a)\n mstore(xor(scratch, 0x20), b)\n mstore(hashesBack, keccak256(0x00, 0x40))\n hashesBack := add(hashesBack, 0x20)\n if iszero(lt(hashesBack, flags.length)) { break }\n }\n isValid :=\n and(\n // Checks if the last value in the queue is same as the root.\n eq(mload(sub(hashesBack, 0x20)), root),\n // And whether all the proofs are used, if required.\n eq(proofEnd, proof.offset)\n )\n break\n }\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EMPTY CALLDATA HELPERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns an empty calldata bytes32 array.\n function emptyProof() internal pure returns (bytes32[] calldata proof) {\n /// @solidity memory-safe-assembly\n assembly {\n proof.length := 0\n }\n }\n\n /// @dev Returns an empty calldata bytes32 array.\n function emptyLeaves() internal pure returns (bytes32[] calldata leaves) {\n /// @solidity memory-safe-assembly\n assembly {\n leaves.length := 0\n }\n }\n\n /// @dev Returns an empty calldata bool array.\n function emptyFlags() internal pure returns (bool[] calldata flags) {\n /// @solidity memory-safe-assembly\n assembly {\n flags.length := 0\n }\n }\n}\n" }, 'src/proxies/openzeppelin/BeaconProxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.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 * @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' + '// 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 function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(address) external;\n\n function upgradeTo(address) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\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 * @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' + '// 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' }, - 'src/tokens/ERC1155/extensions/supply/ERC1155Supply.sol': { + 'src/tokens/ERC1155/ERC1155BaseToken.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {ERC1155} from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol";\nimport {\n IERC1155Supply,\n IERC1155SupplyFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol";\n\n/**\n * An ERC-1155 extension that tracks token supply.\n */\nabstract contract ERC1155Supply is ERC1155, IERC1155Supply {\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(address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data)\n internal\n virtual\n {\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(bytes4 interfaceId) public view virtual override (ERC1155) returns (bool) {\n return type(IERC1155SupplyFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC2981Controlled } from "../common/ERC2981Controlled.sol";\nimport { SignalsImplicitModeControlled } from "../common/SignalsImplicitModeControlled.sol";\nimport { ERC1155, ERC1155Supply } from "./extensions/supply/ERC1155Supply.sol";\n\nimport { LibString } from "solady/utils/LibString.sol";\n\nerror InvalidInitialization();\n\n/**\n * A standard base implementation of ERC-1155 for use in Sequence library contracts.\n */\nabstract contract ERC1155BaseToken is ERC1155Supply, ERC2981Controlled, SignalsImplicitModeControlled {\n\n bytes32 internal constant METADATA_ADMIN_ROLE = keccak256("METADATA_ADMIN_ROLE");\n\n string public name;\n string public baseURI;\n string public contractURI;\n\n /**\n * Deploy contract.\n */\n constructor() { }\n\n /**\n * Initialize the contract.\n * @param owner Owner address.\n * @param tokenName Token name.\n * @param tokenBaseURI Base URI for token metadata.\n * @param tokenContractURI Contract URI for token metadata.\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 string memory tokenName,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) internal {\n name = tokenName;\n baseURI = tokenBaseURI;\n contractURI = tokenContractURI;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(ROYALTY_ADMIN_ROLE, owner);\n _grantRole(METADATA_ADMIN_ROLE, owner);\n\n _initializeImplicitMode(owner, implicitModeValidator, implicitModeProjectId);\n }\n\n //\n // Metadata\n //\n\n /// @inheritdoc ERC1155\n function uri(\n uint256 _id\n ) public view virtual override returns (string memory) {\n return string(abi.encodePacked(baseURI, LibString.toString(_id), ".json"));\n }\n\n /**\n * Update the base URI of token\'s URI.\n * @param tokenBaseURI New base URI of token\'s URI\n */\n function setBaseMetadataURI(\n string memory tokenBaseURI\n ) external onlyRole(METADATA_ADMIN_ROLE) {\n baseURI = tokenBaseURI;\n }\n\n /**\n * Update the name of the contract.\n * @param tokenName New contract name\n */\n function setContractName(\n string memory tokenName\n ) external onlyRole(METADATA_ADMIN_ROLE) {\n name = tokenName;\n }\n\n /**\n * Update the contract URI of token\'s URI.\n * @param tokenContractURI New contract URI of token\'s URI\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\n */\n function setContractURI(\n string memory tokenContractURI\n ) external onlyRole(METADATA_ADMIN_ROLE) {\n contractURI = tokenContractURI;\n }\n\n //\n // Burn\n //\n\n /**\n * Allows the owner of the token to burn their tokens.\n * @param tokenId Id of token to burn\n * @param amount Amount of tokens to burn\n */\n function burn(uint256 tokenId, uint256 amount) public virtual {\n _burn(msg.sender, tokenId, amount);\n }\n\n /**\n * Burn tokens of given token id for each (tokenIds[i], amounts[i]) pair.\n * @param tokenIds Array of token ids to burn\n * @param amounts Array of the amount to be burned\n */\n function batchBurn(uint256[] memory tokenIds, uint256[] memory amounts) public virtual {\n super._batchBurn(msg.sender, tokenIds, 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(ERC1155Supply, ERC2981Controlled, SignalsImplicitModeControlled) returns (bool) {\n return ERC1155Supply.supportsInterface(interfaceId) || ERC2981Controlled.supportsInterface(interfaceId)\n || SignalsImplicitModeControlled.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/tokens/ERC1155/ERC1155Metadata.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { content: - "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\nimport '../../interfaces/IERC1155Metadata.sol';\nimport '../../utils/ERC165.sol';\n\n/**\n * @notice Contract that handles metadata related methods.\n * @dev Methods assume a deterministic generation of URI based on token IDs.\n * Methods also assume that URI uses hex representation of token IDs.\n */\ncontract ERC1155Metadata is IERC1155Metadata, ERC165 {\n // URI's default URI prefix\n string public baseURI;\n string public name;\n\n // set the initial name and base URI\n constructor(string memory _name, string memory _baseURI) {\n name = _name;\n baseURI = _baseURI;\n }\n\n /***********************************|\n | Metadata Public Functions |\n |__________________________________*/\n\n /**\n * @notice A distinct Uniform Resource Identifier (URI) for a given token.\n * @dev URIs are defined in RFC 3986.\n * URIs are assumed to be deterministically generated based on token ID\n * @return URI string\n */\n function uri(uint256 _id) public view virtual override returns (string memory) {\n return string(abi.encodePacked(baseURI, _uint2str(_id), \".json\"));\n }\n\n\n /***********************************|\n | Metadata Internal Functions |\n |__________________________________*/\n\n /**\n * @notice Will emit default URI log event for corresponding token _id\n * @param _tokenIDs Array of IDs of tokens to log default URI\n */\n function _logURIs(uint256[] memory _tokenIDs) internal virtual {\n string memory baseURL = baseURI;\n string memory tokenURI;\n\n for (uint256 i = 0; i < _tokenIDs.length; i++) {\n tokenURI = string(abi.encodePacked(baseURL, _uint2str(_tokenIDs[i]), \".json\"));\n emit URI(tokenURI, _tokenIDs[i]);\n }\n }\n\n /**\n * @notice Will update the base URL of token's URI\n * @param _newBaseMetadataURI New base URL of token's URI\n */\n function _setBaseMetadataURI(string memory _newBaseMetadataURI) internal {\n baseURI = _newBaseMetadataURI;\n }\n\n /**\n * @notice Will update the name of the contract\n * @param _newName New contract name\n */\n function _setContractName(string memory _newName) internal {\n name = _newName;\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 returns (bool) {\n if (_interfaceID == type(IERC1155Metadata).interfaceId) {\n return true;\n }\n return super.supportsInterface(_interfaceID);\n }\n\n /***********************************|\n | Utility Internal Functions |\n |__________________________________*/\n\n function _uint2str(uint _i) internal pure returns (string memory _uintAsString) {\n if (_i == 0) {\n return '0';\n }\n uint j = _i;\n uint len;\n while (j != 0) {\n len++;\n j /= 10;\n }\n bytes memory bstr = new bytes(len);\n uint k = len;\n while (_i != 0) {\n k = k - 1;\n uint8 temp = (48 + uint8(_i - (_i / 10) * 10));\n bytes1 b1 = bytes1(temp);\n bstr[k] = b1;\n _i /= 10;\n }\n return string(bstr);\n }\n}\n" + '// 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' }, - 'src/tokens/common/IERC2981Controlled.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC2981ControlledFunctions {\n /**\n * Sets the royalty information that all ids in this contract will default to.\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;\n\n /**\n * Sets the royalty information that a given token id in this contract will use.\n * @param tokenId The token id to set the royalty information for\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @notice This overrides the default royalty information for this token id\n */\n function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external;\n}\n\ninterface IERC2981Controlled is IERC2981ControlledFunctions {}\n' + "// 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" }, - 'lib/openzeppelin/contracts/token/common/ERC2981.sol': { + 'src/proxies/openzeppelin/ERC1967Proxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../../interfaces/IERC2981.sol";\nimport "../../utils/introspection/ERC165.sol";\n\n/**\n * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.\n *\n * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for\n * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.\n *\n * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the\n * fee is specified in basis points by default.\n *\n * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See\n * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to\n * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.\n *\n * _Available since v4.5._\n */\nabstract contract ERC2981 is IERC2981, ERC165 {\n struct RoyaltyInfo {\n address receiver;\n uint96 royaltyFraction;\n }\n\n RoyaltyInfo private _defaultRoyaltyInfo;\n mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @inheritdoc IERC2981\n */\n function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {\n RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];\n\n if (royalty.receiver == address(0)) {\n royalty = _defaultRoyaltyInfo;\n }\n\n uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();\n\n return (royalty.receiver, royaltyAmount);\n }\n\n /**\n * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a\n * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an\n * override.\n */\n function _feeDenominator() internal pure virtual returns (uint96) {\n return 10000;\n }\n\n /**\n * @dev Sets the royalty information that all ids in this contract will default to.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: invalid receiver");\n\n _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Removes default royalty information.\n */\n function _deleteDefaultRoyalty() internal virtual {\n delete _defaultRoyaltyInfo;\n }\n\n /**\n * @dev Sets the royalty information for a specific token id, overriding the global default.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: Invalid parameters");\n\n _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Resets royalty information for the token id back to the global default.\n */\n function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n delete _tokenRoyaltyInfo[tokenId];\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/AccessControlEnumerable.sol': { + 'src/tokens/common/ERC2981Controlled.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.19;\n\nimport { IERC2981Controlled } from "./IERC2981Controlled.sol";\n\nimport { AccessControlEnumerable } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport { ERC2981 } from "openzeppelin-contracts/contracts/token/common/ERC2981.sol";\n\n/**\n * An implementation of ERC-2981 that allows updates by roles.\n */\nabstract contract ERC2981Controlled is ERC2981, AccessControlEnumerable, IERC2981Controlled {\n\n bytes32 internal constant ROYALTY_ADMIN_ROLE = keccak256("ROYALTY_ADMIN_ROLE");\n\n //\n // Royalty\n //\n\n /**\n * Sets the royalty information that all ids in this contract will default to.\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(ROYALTY_ADMIN_ROLE) {\n _setDefaultRoyalty(receiver, feeNumerator);\n }\n\n /**\n * Sets the royalty information that a given token id in this contract will use.\n * @param tokenId The token id to set the royalty information for\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @notice This overrides the default royalty information for this token id\n */\n function setTokenRoyalty(\n uint256 tokenId,\n address receiver,\n uint96 feeNumerator\n ) external onlyRole(ROYALTY_ADMIN_ROLE) {\n _setTokenRoyalty(tokenId, receiver, feeNumerator);\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(ERC2981, AccessControlEnumerable) returns (bool) {\n return ERC2981.supportsInterface(interfaceId) || AccessControlEnumerable.supportsInterface(interfaceId)\n || type(IERC2981Controlled).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/proxy/Proxy.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.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" + '// 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' }, - 'lib/openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { + 'src/tokens/ERC1155/extensions/supply/ERC1155Supply.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' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IERC1155Supply, IERC1155SupplyFunctions } from "./IERC1155Supply.sol";\n\nimport { ERC1155 } from "solady/tokens/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 override {\n super._mint(_to, _id, _amount, _data);\n\n totalSupply += _amount;\n tokenSupply[_id] += _amount;\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 override {\n super._batchMint(_to, _ids, _amounts, _data);\n\n uint256 nMint = _ids.length;\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < nMint; i++) {\n totalAmount += _amounts[i];\n tokenSupply[_ids[i]] += _amounts[i];\n }\n totalSupply += totalAmount;\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 override {\n super._burn(_from, _id, _amount);\n\n totalSupply -= _amount;\n tokenSupply[_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 override {\n super._batchBurn(_from, _ids, _amounts);\n\n uint256 nBurn = _ids.length;\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < nBurn; i++) {\n tokenSupply[_ids[i]] -= _amounts[i];\n totalAmount += _amounts[i];\n }\n totalSupply -= totalAmount;\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/proxies/openzeppelin/ERC1967Proxy.sol': { + 'lib/solady/src/utils/LibString.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/Proxy.sol";\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.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 * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n' + '// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport {LibBytes} from "./LibBytes.sol";\n\n/// @notice Library for converting numbers into strings and other string operations.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)\n///\n/// @dev Note:\n/// For performance and bytecode compactness, most of the string operations are restricted to\n/// byte strings (7-bit ASCII), except where otherwise specified.\n/// Usage of byte string operations on charsets with runes spanning two or more bytes\n/// can lead to undefined behavior.\nlibrary LibString {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STRUCTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Goated string storage struct that totally MOGs, no cap, fr.\n /// Uses less gas and bytecode than Solidity\'s native string storage. It\'s meta af.\n /// Packs length with the first 31 bytes if <255 bytes, so it’s mad tight.\n struct StringStorage {\n bytes32 _spacer;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The length of the output is too small to contain all the hex digits.\n error HexLengthInsufficient();\n\n /// @dev The length of the string is more than 32 bytes.\n error TooBigForSmallString();\n\n /// @dev The input string must be a 7-bit ASCII.\n error StringNot7BitASCII();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The constant returned when the `search` is not found in the string.\n uint256 internal constant NOT_FOUND = type(uint256).max;\n\n /// @dev Lookup for \'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\'.\n uint128 internal constant ALPHANUMERIC_7_BIT_ASCII = 0x7fffffe07fffffe03ff000000000000;\n\n /// @dev Lookup for \'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\'.\n uint128 internal constant LETTERS_7_BIT_ASCII = 0x7fffffe07fffffe0000000000000000;\n\n /// @dev Lookup for \'abcdefghijklmnopqrstuvwxyz\'.\n uint128 internal constant LOWERCASE_7_BIT_ASCII = 0x7fffffe000000000000000000000000;\n\n /// @dev Lookup for \'ABCDEFGHIJKLMNOPQRSTUVWXYZ\'.\n uint128 internal constant UPPERCASE_7_BIT_ASCII = 0x7fffffe0000000000000000;\n\n /// @dev Lookup for \'0123456789\'.\n uint128 internal constant DIGITS_7_BIT_ASCII = 0x3ff000000000000;\n\n /// @dev Lookup for \'0123456789abcdefABCDEF\'.\n uint128 internal constant HEXDIGITS_7_BIT_ASCII = 0x7e0000007e03ff000000000000;\n\n /// @dev Lookup for \'01234567\'.\n uint128 internal constant OCTDIGITS_7_BIT_ASCII = 0xff000000000000;\n\n /// @dev Lookup for \'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\\\'()*+,-./:;<=>?@[\\\\]^_`{|}~ \\t\\n\\r\\x0b\\x0c\'.\n uint128 internal constant PRINTABLE_7_BIT_ASCII = 0x7fffffffffffffffffffffff00003e00;\n\n /// @dev Lookup for \'!"#$%&\\\'()*+,-./:;<=>?@[\\\\]^_`{|}~\'.\n uint128 internal constant PUNCTUATION_7_BIT_ASCII = 0x78000001f8000001fc00fffe00000000;\n\n /// @dev Lookup for \' \\t\\n\\r\\x0b\\x0c\'.\n uint128 internal constant WHITESPACE_7_BIT_ASCII = 0x100003e00;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STRING STORAGE OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Sets the value of the string storage `$` to `s`.\n function set(StringStorage storage $, string memory s) internal {\n LibBytes.set(bytesStorage($), bytes(s));\n }\n\n /// @dev Sets the value of the string storage `$` to `s`.\n function setCalldata(StringStorage storage $, string calldata s) internal {\n LibBytes.setCalldata(bytesStorage($), bytes(s));\n }\n\n /// @dev Sets the value of the string storage `$` to the empty string.\n function clear(StringStorage storage $) internal {\n delete $._spacer;\n }\n\n /// @dev Returns whether the value stored is `$` is the empty string "".\n function isEmpty(StringStorage storage $) internal view returns (bool) {\n return uint256($._spacer) & 0xff == uint256(0);\n }\n\n /// @dev Returns the length of the value stored in `$`.\n function length(StringStorage storage $) internal view returns (uint256) {\n return LibBytes.length(bytesStorage($));\n }\n\n /// @dev Returns the value stored in `$`.\n function get(StringStorage storage $) internal view returns (string memory) {\n return string(LibBytes.get(bytesStorage($)));\n }\n\n /// @dev Returns the uint8 at index `i`. If out-of-bounds, returns 0.\n function uint8At(StringStorage storage $, uint256 i) internal view returns (uint8) {\n return LibBytes.uint8At(bytesStorage($), i);\n }\n\n /// @dev Helper to cast `$` to a `BytesStorage`.\n function bytesStorage(StringStorage storage $)\n internal\n pure\n returns (LibBytes.BytesStorage storage casted)\n {\n /// @solidity memory-safe-assembly\n assembly {\n casted.slot := $.slot\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* DECIMAL OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the base 10 decimal representation of `value`.\n function toString(uint256 value) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\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.\n result := add(mload(0x40), 0x80)\n mstore(0x40, add(result, 0x20)) // Allocate memory.\n mstore(result, 0) // Zeroize the slot after the string.\n\n let end := result // Cache the end of the memory to calculate the length later.\n let w := not(0) // Tsk.\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 for { let temp := value } 1 {} {\n result := add(result, w) // `sub(result, 1)`.\n // Store the character to the pointer.\n // The ASCII index of the \'0\' character is 48.\n mstore8(result, add(48, mod(temp, 10)))\n temp := div(temp, 10) // Keep dividing `temp` until zero.\n if iszero(temp) { break }\n }\n let n := sub(end, result)\n result := sub(result, 0x20) // Move the pointer 32 bytes back to make room for the length.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the base 10 decimal representation of `value`.\n function toString(int256 value) internal pure returns (string memory result) {\n if (value >= 0) return toString(uint256(value));\n unchecked {\n result = toString(~uint256(value) + 1);\n }\n /// @solidity memory-safe-assembly\n assembly {\n // We still have some spare memory space on the left,\n // as we have allocated 3 words (96 bytes) for up to 78 digits.\n let n := mload(result) // Load the string length.\n mstore(result, 0x2d) // Store the \'-\' character.\n result := sub(result, 1) // Move back the string pointer by a byte.\n mstore(result, add(n, 1)) // Update the string length.\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* HEXADECIMAL OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the hexadecimal representation of `value`,\n /// left-padded to an input length of `byteCount` bytes.\n /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,\n /// giving a total length of `byteCount * 2 + 2` bytes.\n /// Reverts if `byteCount` is too small for the output to contain all the digits.\n function toHexString(uint256 value, uint256 byteCount)\n internal\n pure\n returns (string memory result)\n {\n result = toHexStringNoPrefix(value, byteCount);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`,\n /// left-padded to an input length of `byteCount` bytes.\n /// The output is not prefixed with "0x" and is encoded using 2 hexadecimal digits per byte,\n /// giving a total length of `byteCount * 2` bytes.\n /// Reverts if `byteCount` is too small for the output to contain all the digits.\n function toHexStringNoPrefix(uint256 value, uint256 byteCount)\n internal\n pure\n returns (string memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n // We need 0x20 bytes for the trailing zeros padding, `byteCount * 2` bytes\n // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length.\n // We add 0x20 to the total and round down to a multiple of 0x20.\n // (0x20 + 0x20 + 0x02 + 0x20) = 0x62.\n result := add(mload(0x40), and(add(shl(1, byteCount), 0x42), not(0x1f)))\n mstore(0x40, add(result, 0x20)) // Allocate memory.\n mstore(result, 0) // Zeroize the slot after the string.\n\n let end := result // Cache the end to calculate the length later.\n // Store "0123456789abcdef" in scratch space.\n mstore(0x0f, 0x30313233343536373839616263646566)\n\n let start := sub(result, add(byteCount, byteCount))\n let w := not(1) // Tsk.\n let temp := value\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 for {} 1 {} {\n result := add(result, w) // `sub(result, 2)`.\n mstore8(add(result, 1), mload(and(temp, 15)))\n mstore8(result, mload(and(shr(4, temp), 15)))\n temp := shr(8, temp)\n if iszero(xor(result, start)) { break }\n }\n if temp {\n mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`.\n revert(0x1c, 0x04)\n }\n let n := sub(end, result)\n result := sub(result, 0x20)\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.\n /// As address are 20 bytes long, the output will left-padded to have\n /// a length of `20 * 2 + 2` bytes.\n function toHexString(uint256 value) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x".\n /// The output excludes leading "0" from the `toHexString` output.\n /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`.\n function toMinimalHexString(uint256 value) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let o := eq(byte(0, mload(add(result, 0x20))), 0x30) // Whether leading zero is present.\n let n := add(mload(result), 2) // Compute the length.\n mstore(add(result, o), 0x3078) // Store the "0x" prefix, accounting for leading zero.\n result := sub(add(result, o), 2) // Move the pointer, accounting for leading zero.\n mstore(result, sub(n, o)) // Store the length, accounting for leading zero.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output excludes leading "0" from the `toHexStringNoPrefix` output.\n /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`.\n function toMinimalHexStringNoPrefix(uint256 value)\n internal\n pure\n returns (string memory result)\n {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let o := eq(byte(0, mload(add(result, 0x20))), 0x30) // Whether leading zero is present.\n let n := mload(result) // Get the length.\n result := add(result, o) // Move the pointer, accounting for leading zero.\n mstore(result, sub(n, o)) // Store the length, accounting for leading zero.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is encoded using 2 hexadecimal digits per byte.\n /// As address are 20 bytes long, the output will left-padded to have\n /// a length of `20 * 2` bytes.\n function toHexStringNoPrefix(uint256 value) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,\n // 0x02 bytes for the prefix, and 0x40 bytes for the digits.\n // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0.\n result := add(mload(0x40), 0x80)\n mstore(0x40, add(result, 0x20)) // Allocate memory.\n mstore(result, 0) // Zeroize the slot after the string.\n\n let end := result // Cache the end to calculate the length later.\n mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.\n\n let w := not(1) // Tsk.\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 for { let temp := value } 1 {} {\n result := add(result, w) // `sub(result, 2)`.\n mstore8(add(result, 1), mload(and(temp, 15)))\n mstore8(result, mload(and(shr(4, temp), 15)))\n temp := shr(8, temp)\n if iszero(temp) { break }\n }\n let n := sub(end, result)\n result := sub(result, 0x20)\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte,\n /// and the alphabets are capitalized conditionally according to\n /// https://eips.ethereum.org/EIPS/eip-55\n function toHexStringChecksummed(address value) internal pure returns (string memory result) {\n result = toHexString(value);\n /// @solidity memory-safe-assembly\n assembly {\n let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`\n let o := add(result, 0x22)\n let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `\n let t := shl(240, 136) // `0b10001000 << 240`\n for { let i := 0 } 1 {} {\n mstore(add(i, i), mul(t, byte(i, hashed)))\n i := add(i, 1)\n if eq(i, 20) { break }\n }\n mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))\n o := add(o, 0x20)\n mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.\n function toHexString(address value) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is encoded using 2 hexadecimal digits per byte.\n function toHexStringNoPrefix(address value) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n // Allocate memory.\n // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,\n // 0x02 bytes for the prefix, and 0x28 bytes for the digits.\n // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.\n mstore(0x40, add(result, 0x80))\n mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.\n\n result := add(result, 2)\n mstore(result, 40) // Store the length.\n let o := add(result, 0x20)\n mstore(add(o, 40), 0) // Zeroize the slot after the string.\n value := shl(96, value)\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 for { let i := 0 } 1 {} {\n let p := add(o, add(i, i))\n let temp := byte(i, value)\n mstore8(add(p, 1), mload(and(temp, 15)))\n mstore8(p, mload(shr(4, temp)))\n i := add(i, 1)\n if eq(i, 20) { break }\n }\n }\n }\n\n /// @dev Returns the hex encoded string from the raw bytes.\n /// The output is encoded using 2 hexadecimal digits per byte.\n function toHexString(bytes memory raw) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(raw);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hex encoded string from the raw bytes.\n /// The output is encoded using 2 hexadecimal digits per byte.\n function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(raw)\n result := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.\n mstore(result, add(n, n)) // Store the length of the output.\n\n mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.\n let o := add(result, 0x20)\n let end := add(raw, n)\n for {} iszero(eq(raw, end)) {} {\n raw := add(raw, 1)\n mstore8(add(o, 1), mload(and(mload(raw), 15)))\n mstore8(o, mload(and(shr(4, mload(raw)), 15)))\n o := add(o, 2)\n }\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* RUNE STRING OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the number of UTF characters in the string.\n function runeCount(string memory s) internal pure returns (uint256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n if mload(s) {\n mstore(0x00, div(not(0), 255))\n mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506)\n let o := add(s, 0x20)\n let end := add(o, mload(s))\n for { result := 1 } 1 { result := add(result, 1) } {\n o := add(o, byte(0, mload(shr(250, mload(o)))))\n if iszero(lt(o, end)) { break }\n }\n }\n }\n }\n\n /// @dev Returns if this string is a 7-bit ASCII string.\n /// (i.e. all characters codes are in [0..127])\n function is7BitASCII(string memory s) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := 1\n let mask := shl(7, div(not(0), 255))\n let n := mload(s)\n if n {\n let o := add(s, 0x20)\n let end := add(o, n)\n let last := mload(end)\n mstore(end, 0)\n for {} 1 {} {\n if and(mask, mload(o)) {\n result := 0\n break\n }\n o := add(o, 0x20)\n if iszero(lt(o, end)) { break }\n }\n mstore(end, last)\n }\n }\n }\n\n /// @dev Returns if this string is a 7-bit ASCII string,\n /// AND all characters are in the `allowed` lookup.\n /// Note: If `s` is empty, returns true regardless of `allowed`.\n function is7BitASCII(string memory s, uint128 allowed) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := 1\n if mload(s) {\n let allowed_ := shr(128, shl(128, allowed))\n let o := add(s, 0x20)\n for { let end := add(o, mload(s)) } 1 {} {\n result := and(result, shr(byte(0, mload(o)), allowed_))\n o := add(o, 1)\n if iszero(and(result, lt(o, end))) { break }\n }\n }\n }\n }\n\n /// @dev Converts the bytes in the 7-bit ASCII string `s` to\n /// an allowed lookup for use in `is7BitASCII(s, allowed)`.\n /// To save runtime gas, you can cache the result in an immutable variable.\n function to7BitASCIIAllowedLookup(string memory s) internal pure returns (uint128 result) {\n /// @solidity memory-safe-assembly\n assembly {\n if mload(s) {\n let o := add(s, 0x20)\n for { let end := add(o, mload(s)) } 1 {} {\n result := or(result, shl(byte(0, mload(o)), 1))\n o := add(o, 1)\n if iszero(lt(o, end)) { break }\n }\n if shr(128, result) {\n mstore(0x00, 0xc9807e0d) // `StringNot7BitASCII()`.\n revert(0x1c, 0x04)\n }\n }\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* BYTE STRING OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n // For performance and bytecode compactness, byte string operations are restricted\n // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets.\n // Usage of byte string operations on charsets with runes spanning two or more bytes\n // can lead to undefined behavior.\n\n /// @dev Returns `subject` all occurrences of `needle` replaced with `replacement`.\n function replace(string memory subject, string memory needle, string memory replacement)\n internal\n pure\n returns (string memory)\n {\n return string(LibBytes.replace(bytes(subject), bytes(needle), bytes(replacement)));\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(string memory subject, string memory needle, uint256 from)\n internal\n pure\n returns (uint256)\n {\n return LibBytes.indexOf(bytes(subject), bytes(needle), from);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(string memory subject, string memory needle) internal pure returns (uint256) {\n return LibBytes.indexOf(bytes(subject), bytes(needle), 0);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(string memory subject, string memory needle, uint256 from)\n internal\n pure\n returns (uint256)\n {\n return LibBytes.lastIndexOf(bytes(subject), bytes(needle), from);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(string memory subject, string memory needle)\n internal\n pure\n returns (uint256)\n {\n return LibBytes.lastIndexOf(bytes(subject), bytes(needle), type(uint256).max);\n }\n\n /// @dev Returns true if `needle` is found in `subject`, false otherwise.\n function contains(string memory subject, string memory needle) internal pure returns (bool) {\n return LibBytes.contains(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns whether `subject` starts with `needle`.\n function startsWith(string memory subject, string memory needle) internal pure returns (bool) {\n return LibBytes.startsWith(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns whether `subject` ends with `needle`.\n function endsWith(string memory subject, string memory needle) internal pure returns (bool) {\n return LibBytes.endsWith(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns `subject` repeated `times`.\n function repeat(string memory subject, uint256 times) internal pure returns (string memory) {\n return string(LibBytes.repeat(bytes(subject), times));\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).\n /// `start` and `end` are byte offsets.\n function slice(string memory subject, uint256 start, uint256 end)\n internal\n pure\n returns (string memory)\n {\n return string(LibBytes.slice(bytes(subject), start, end));\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to the end of the string.\n /// `start` is a byte offset.\n function slice(string memory subject, uint256 start) internal pure returns (string memory) {\n return string(LibBytes.slice(bytes(subject), start, type(uint256).max));\n }\n\n /// @dev Returns all the indices of `needle` in `subject`.\n /// The indices are byte offsets.\n function indicesOf(string memory subject, string memory needle)\n internal\n pure\n returns (uint256[] memory)\n {\n return LibBytes.indicesOf(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns an arrays of strings based on the `delimiter` inside of the `subject` string.\n function split(string memory subject, string memory delimiter)\n internal\n pure\n returns (string[] memory result)\n {\n bytes[] memory a = LibBytes.split(bytes(subject), bytes(delimiter));\n /// @solidity memory-safe-assembly\n assembly {\n result := a\n }\n }\n\n /// @dev Returns a concatenated string of `a` and `b`.\n /// Cheaper than `string.concat()` and does not de-align the free memory pointer.\n function concat(string memory a, string memory b) internal pure returns (string memory) {\n return string(LibBytes.concat(bytes(a), bytes(b)));\n }\n\n /// @dev Returns a copy of the string in either lowercase or UPPERCASE.\n /// WARNING! This function is only compatible with 7-bit ASCII strings.\n function toCase(string memory subject, bool toUpper)\n internal\n pure\n returns (string memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(subject)\n if n {\n result := mload(0x40)\n let o := add(result, 0x20)\n let d := sub(subject, result)\n let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff)\n for { let end := add(o, n) } 1 {} {\n let b := byte(0, mload(add(d, o)))\n mstore8(o, xor(and(shr(b, flags), 0x20), b))\n o := add(o, 1)\n if eq(o, end) { break }\n }\n mstore(result, n) // Store the length.\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n }\n\n /// @dev Returns a string from a small bytes32 string.\n /// `s` must be null-terminated, or behavior will be undefined.\n function fromSmallString(bytes32 s) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let n := 0\n for {} byte(n, s) { n := add(n, 1) } {} // Scan for \'\\0\'.\n mstore(result, n) // Store the length.\n let o := add(result, 0x20)\n mstore(o, s) // Store the bytes of the string.\n mstore(add(o, n), 0) // Zeroize the slot after the string.\n mstore(0x40, add(result, 0x40)) // Allocate memory.\n }\n }\n\n /// @dev Returns the small string, with all bytes after the first null byte zeroized.\n function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n for {} byte(result, s) { result := add(result, 1) } {} // Scan for \'\\0\'.\n mstore(0x00, s)\n mstore(result, 0x00)\n result := mload(0x00)\n }\n }\n\n /// @dev Returns the string as a normalized null-terminated small string.\n function toSmallString(string memory s) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(s)\n if iszero(lt(result, 33)) {\n mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`.\n revert(0x1c, 0x04)\n }\n result := shl(shl(3, sub(32, result)), mload(add(s, result)))\n }\n }\n\n /// @dev Returns a lowercased copy of the string.\n /// WARNING! This function is only compatible with 7-bit ASCII strings.\n function lower(string memory subject) internal pure returns (string memory result) {\n result = toCase(subject, false);\n }\n\n /// @dev Returns an UPPERCASED copy of the string.\n /// WARNING! This function is only compatible with 7-bit ASCII strings.\n function upper(string memory subject) internal pure returns (string memory result) {\n result = toCase(subject, true);\n }\n\n /// @dev Escapes the string to be used within HTML tags.\n function escapeHTML(string memory s) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let end := add(s, mload(s))\n let o := add(result, 0x20)\n // Store the bytes of the packed offsets and strides into the scratch space.\n // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6.\n mstore(0x1f, 0x900094)\n mstore(0x08, 0xc0000000a6ab)\n // Store ""&'<>" into the scratch space.\n mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b))\n for {} iszero(eq(s, end)) {} {\n s := add(s, 1)\n let c := and(mload(s), 0xff)\n // Not in `["\\"","\'","&","<",">"]`.\n if iszero(and(shl(c, 1), 0x500000c400000000)) {\n mstore8(o, c)\n o := add(o, 1)\n continue\n }\n let t := shr(248, mload(c))\n mstore(o, mload(and(t, 0x1f)))\n o := add(o, shr(5, t))\n }\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Escapes the string to be used within double-quotes in a JSON.\n /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes.\n function escapeJSON(string memory s, bool addDoubleQuotes)\n internal\n pure\n returns (string memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let o := add(result, 0x20)\n if addDoubleQuotes {\n mstore8(o, 34)\n o := add(1, o)\n }\n // Store "\\\\u0000" in scratch space.\n // Store "0123456789abcdef" in scratch space.\n // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`.\n // into the scratch space.\n mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)\n // Bitmask for detecting `["\\"","\\\\"]`.\n let e := or(shl(0x22, 1), shl(0x5c, 1))\n for { let end := add(s, mload(s)) } iszero(eq(s, end)) {} {\n s := add(s, 1)\n let c := and(mload(s), 0xff)\n if iszero(lt(c, 0x20)) {\n if iszero(and(shl(c, 1), e)) {\n // Not in `["\\"","\\\\"]`.\n mstore8(o, c)\n o := add(o, 1)\n continue\n }\n mstore8(o, 0x5c) // "\\\\".\n mstore8(add(o, 1), c)\n o := add(o, 2)\n continue\n }\n if iszero(and(shl(c, 1), 0x3700)) {\n // Not in `["\\b","\\t","\\n","\\f","\\d"]`.\n mstore8(0x1d, mload(shr(4, c))) // Hex value.\n mstore8(0x1e, mload(and(c, 15))) // Hex value.\n mstore(o, mload(0x19)) // "\\\\u00XX".\n o := add(o, 6)\n continue\n }\n mstore8(o, 0x5c) // "\\\\".\n mstore8(add(o, 1), mload(add(c, 8)))\n o := add(o, 2)\n }\n if addDoubleQuotes {\n mstore8(o, 34)\n o := add(1, o)\n }\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Escapes the string to be used within double-quotes in a JSON.\n function escapeJSON(string memory s) internal pure returns (string memory result) {\n result = escapeJSON(s, false);\n }\n\n /// @dev Encodes `s` so that it can be safely used in a URI,\n /// just like `encodeURIComponent` in JavaScript.\n /// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\n /// See: https://datatracker.ietf.org/doc/html/rfc2396\n /// See: https://datatracker.ietf.org/doc/html/rfc3986\n function encodeURIComponent(string memory s) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n // Store "0123456789ABCDEF" in scratch space.\n // Uppercased to be consistent with JavaScript\'s implementation.\n mstore(0x0f, 0x30313233343536373839414243444546)\n let o := add(result, 0x20)\n for { let end := add(s, mload(s)) } iszero(eq(s, end)) {} {\n s := add(s, 1)\n let c := and(mload(s), 0xff)\n // If not in `[0-9A-Z-a-z-_.!~*\'()]`.\n if iszero(and(1, shr(c, 0x47fffffe87fffffe03ff678200000000))) {\n mstore8(o, 0x25) // \'%\'.\n mstore8(add(o, 1), mload(and(shr(4, c), 15)))\n mstore8(add(o, 2), mload(and(c, 15)))\n o := add(o, 3)\n continue\n }\n mstore8(o, c)\n o := add(o, 1)\n }\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Returns whether `a` equals `b`.\n function eq(string memory a, string memory b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))\n }\n }\n\n /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string.\n function eqs(string memory a, bytes32 b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n // These should be evaluated on compile time, as far as possible.\n let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.\n let x := not(or(m, or(b, add(m, and(b, m)))))\n let r := shl(7, iszero(iszero(shr(128, x))))\n r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))\n r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n r := or(r, shl(4, lt(0xffff, shr(r, x))))\n r := or(r, shl(3, lt(0xff, shr(r, x))))\n // forgefmt: disable-next-item\n result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),\n xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))\n }\n }\n\n /// @dev Returns 0 if `a == b`, -1 if `a < b`, +1 if `a > b`.\n /// If `a` == b[:a.length]`, and `a.length < b.length`, returns -1.\n function cmp(string memory a, string memory b) internal pure returns (int256) {\n return LibBytes.cmp(bytes(a), bytes(b));\n }\n\n /// @dev Packs a single string with its length into a single word.\n /// Returns `bytes32(0)` if the length is zero or greater than 31.\n function packOne(string memory a) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n // We don\'t need to zero right pad the string,\n // since this is our own custom non-standard packing scheme.\n result :=\n mul(\n // Load the length and the bytes.\n mload(add(a, 0x1f)),\n // `length != 0 && length < 32`. Abuses underflow.\n // Assumes that the length is valid and within the block gas limit.\n lt(sub(mload(a), 1), 0x1f)\n )\n }\n }\n\n /// @dev Unpacks a string packed using {packOne}.\n /// Returns the empty string if `packed` is `bytes32(0)`.\n /// If `packed` is not an output of {packOne}, the output behavior is undefined.\n function unpackOne(bytes32 packed) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40) // Grab the free memory pointer.\n mstore(0x40, add(result, 0x40)) // Allocate 2 words (1 for the length, 1 for the bytes).\n mstore(result, 0) // Zeroize the length slot.\n mstore(add(result, 0x1f), packed) // Store the length and bytes.\n mstore(add(add(result, 0x20), mload(result)), 0) // Right pad with zeroes.\n }\n }\n\n /// @dev Packs two strings with their lengths into a single word.\n /// Returns `bytes32(0)` if combined length is zero or greater than 30.\n function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n let aLen := mload(a)\n // We don\'t need to zero right pad the strings,\n // since this is our own custom non-standard packing scheme.\n result :=\n mul(\n or( // Load the length and the bytes of `a` and `b`.\n shl(shl(3, sub(0x1f, aLen)), mload(add(a, aLen))), mload(sub(add(b, 0x1e), aLen))),\n // `totalLen != 0 && totalLen < 31`. Abuses underflow.\n // Assumes that the lengths are valid and within the block gas limit.\n lt(sub(add(aLen, mload(b)), 1), 0x1e)\n )\n }\n }\n\n /// @dev Unpacks strings packed using {packTwo}.\n /// Returns the empty strings if `packed` is `bytes32(0)`.\n /// If `packed` is not an output of {packTwo}, the output behavior is undefined.\n function unpackTwo(bytes32 packed)\n internal\n pure\n returns (string memory resultA, string memory resultB)\n {\n /// @solidity memory-safe-assembly\n assembly {\n resultA := mload(0x40) // Grab the free memory pointer.\n resultB := add(resultA, 0x40)\n // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words.\n mstore(0x40, add(resultB, 0x40))\n // Zeroize the length slots.\n mstore(resultA, 0)\n mstore(resultB, 0)\n // Store the lengths and bytes.\n mstore(add(resultA, 0x1f), packed)\n mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA))))\n // Right pad with zeroes.\n mstore(add(add(resultA, 0x20), mload(resultA)), 0)\n mstore(add(add(resultB, 0x20), mload(resultB)), 0)\n }\n }\n\n /// @dev Directly returns `a` without copying.\n function directReturn(string memory a) internal pure {\n /// @solidity memory-safe-assembly\n assembly {\n // Assumes that the string does not start from the scratch space.\n let retStart := sub(a, 0x20)\n let retUnpaddedSize := add(mload(a), 0x40)\n // Right pad with zeroes. Just in case the string is produced\n // by a method that doesn\'t zero right pad.\n mstore(add(retStart, retUnpaddedSize), 0)\n mstore(retStart, 0x20) // Store the return offset.\n // End the transaction, returning the string.\n return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))\n }\n }\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/tokens/ERC1155/ERC1155.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.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' + '// 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' }, - 'src/tokens/ERC1155/extensions/supply/IERC1155Supply.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.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(uint256 tokenId) external returns (uint256);\n}\n\ninterface IERC1155SupplySignals {\n\n /**\n * Invalid array input length.\n */\n error InvalidArrayLength();\n}\n\ninterface IERC1155Supply is IERC1155SupplySignals {}\n' + '// 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/0xsequence/erc-1155/src/contracts/interfaces/IERC1155Metadata.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n\ninterface IERC1155Metadata {\n\n event URI(string _uri, uint256 indexed _id);\n\n /****************************************|\n | Functions |\n |_______________________________________*/\n\n /**\n * @notice A distinct Uniform Resource Identifier (URI) for a given token.\n * @dev URIs are defined in RFC 3986.\n * URIs are assumed to be deterministically generated based on token ID\n * Token IDs are assumed to be represented in their hex format in URIs\n * @return URI string\n */\n function uri(uint256 _id) external view returns (string memory);\n}\n' + '// 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/0xsequence/erc-1155/src/contracts/utils/ERC165.sol': { + 'src/tokens/common/IERC2981Controlled.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.19;\n\ninterface IERC2981ControlledFunctions {\n\n /**\n * Sets the royalty information that all ids in this contract will default to.\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;\n\n /**\n * Sets the royalty information that a given token id in this contract will use.\n * @param tokenId The token id to set the royalty information for\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @notice This overrides the default royalty information for this token id\n */\n function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external;\n\n}\n\ninterface IERC2981Controlled is IERC2981ControlledFunctions { }\n' }, - 'lib/openzeppelin/contracts/interfaces/IERC2981.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/introspection/IERC165.sol";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n /**\n * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n */\n function royaltyInfo(\n uint256 tokenId,\n uint256 salePrice\n ) external view returns (address receiver, uint256 royaltyAmount);\n}\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/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/token/common/ERC2981.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 (last updated v4.9.0) (token/common/ERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../../interfaces/IERC2981.sol";\nimport "../../utils/introspection/ERC165.sol";\n\n/**\n * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.\n *\n * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for\n * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.\n *\n * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the\n * fee is specified in basis points by default.\n *\n * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See\n * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to\n * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.\n *\n * _Available since v4.5._\n */\nabstract contract ERC2981 is IERC2981, ERC165 {\n struct RoyaltyInfo {\n address receiver;\n uint96 royaltyFraction;\n }\n\n RoyaltyInfo private _defaultRoyaltyInfo;\n mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @inheritdoc IERC2981\n */\n function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {\n RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];\n\n if (royalty.receiver == address(0)) {\n royalty = _defaultRoyaltyInfo;\n }\n\n uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();\n\n return (royalty.receiver, royaltyAmount);\n }\n\n /**\n * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a\n * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an\n * override.\n */\n function _feeDenominator() internal pure virtual returns (uint96) {\n return 10000;\n }\n\n /**\n * @dev Sets the royalty information that all ids in this contract will default to.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: invalid receiver");\n\n _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Removes default royalty information.\n */\n function _deleteDefaultRoyalty() internal virtual {\n delete _defaultRoyaltyInfo;\n }\n\n /**\n * @dev Sets the royalty information for a specific token id, overriding the global default.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: Invalid parameters");\n\n _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Resets royalty information for the token id back to the global default.\n */\n function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n delete _tokenRoyaltyInfo[tokenId];\n }\n}\n' + }, + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.sol': { + content: + '// 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' + }, + 'src/tokens/ERC1155/extensions/supply/IERC1155Supply.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' + }, + 'lib/solady/src/tokens/ERC1155.sol': { + content: + '// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC1155 implementation.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC1155.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC1155/ERC1155.sol)\n///\n/// @dev Note:\n/// - The ERC1155 standard allows for self-approvals.\n/// For performance, this implementation WILL NOT revert for such actions.\n/// Please add any checks with overrides if desired.\n/// - The transfer functions use the identity precompile (0x4)\n/// to copy memory internally.\n///\n/// If you are overriding:\n/// - Make sure all variables written to storage are properly cleaned\n// (e.g. the bool value for `isApprovedForAll` MUST be either 1 or 0 under the hood).\n/// - Check that the overridden function is actually used in the function you want to\n/// change the behavior of. Much of the code has been manually inlined for performance.\nabstract contract ERC1155 {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The lengths of the input arrays are not the same.\n error ArrayLengthsMismatch();\n\n /// @dev Cannot mint or transfer to the zero address.\n error TransferToZeroAddress();\n\n /// @dev The recipient\'s balance has overflowed.\n error AccountBalanceOverflow();\n\n /// @dev Insufficient balance.\n error InsufficientBalance();\n\n /// @dev Only the token owner or an approved account can manage the tokens.\n error NotOwnerNorApproved();\n\n /// @dev Cannot safely transfer to a contract that does not implement\n /// the ERC1155Receiver interface.\n error TransferToNonERC1155ReceiverImplementer();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Emitted when `amount` of token `id` is transferred\n /// from `from` to `to` by `operator`.\n event TransferSingle(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256 id,\n uint256 amount\n );\n\n /// @dev Emitted when `amounts` of token `ids` are transferred\n /// from `from` to `to` by `operator`.\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] amounts\n );\n\n /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.\n event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);\n\n /// @dev Emitted when the Uniform Resource Identifier (URI) for token `id`\n /// is updated to `value`. This event is not used in the base contract.\n /// You may need to emit this event depending on your URI logic.\n ///\n /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata\n event URI(string value, uint256 indexed id);\n\n /// @dev `keccak256(bytes("TransferSingle(address,address,address,uint256,uint256)"))`.\n uint256 private constant _TRANSFER_SINGLE_EVENT_SIGNATURE =\n 0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62;\n\n /// @dev `keccak256(bytes("TransferBatch(address,address,address,uint256[],uint256[])"))`.\n uint256 private constant _TRANSFER_BATCH_EVENT_SIGNATURE =\n 0x4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb;\n\n /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`.\n uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =\n 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The `ownerSlotSeed` of a given owner is given by.\n /// ```\n /// let ownerSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner))\n /// ```\n ///\n /// The balance slot of `owner` is given by.\n /// ```\n /// mstore(0x20, ownerSlotSeed)\n /// mstore(0x00, id)\n /// let balanceSlot := keccak256(0x00, 0x40)\n /// ```\n ///\n /// The operator approval slot of `owner` is given by.\n /// ```\n /// mstore(0x20, ownerSlotSeed)\n /// mstore(0x00, operator)\n /// let operatorApprovalSlot := keccak256(0x0c, 0x34)\n /// ```\n uint256 private constant _ERC1155_MASTER_SLOT_SEED = 0x9a31110384e0b0c9;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC1155 METADATA */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the URI for token `id`.\n ///\n /// You can either return the same templated URI for all token IDs,\n /// (e.g. "https://example.com/api/{id}.json"),\n /// or return a unique URI for each `id`.\n ///\n /// See: https://eips.ethereum.org/EIPS/eip-1155#metadata\n function uri(uint256 id) public view virtual returns (string memory);\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC1155 */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the amount of `id` owned by `owner`.\n function balanceOf(address owner, uint256 id) public view virtual returns (uint256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, owner)\n mstore(0x00, id)\n result := sload(keccak256(0x00, 0x40))\n }\n }\n\n /// @dev Returns whether `operator` is approved to manage the tokens of `owner`.\n function isApprovedForAll(address owner, address operator)\n public\n view\n virtual\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, owner)\n mstore(0x00, operator)\n result := sload(keccak256(0x0c, 0x34))\n }\n }\n\n /// @dev Sets whether `operator` is approved to manage the tokens of the caller.\n ///\n /// Emits a {ApprovalForAll} event.\n function setApprovalForAll(address operator, bool isApproved) public virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Convert to 0 or 1.\n isApproved := iszero(iszero(isApproved))\n // Update the `isApproved` for (`msg.sender`, `operator`).\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, caller())\n mstore(0x00, operator)\n sstore(keccak256(0x0c, 0x34), isApproved)\n // Emit the {ApprovalForAll} event.\n mstore(0x00, isApproved)\n // forgefmt: disable-next-line\n log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), shr(96, shl(96, operator)))\n }\n }\n\n /// @dev Transfers `amount` of `id` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `from` must have at least `amount` of `id`.\n /// - If the caller is not `from`,\n /// it must be approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155Received}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferSingle} event.\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) public virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from))\n let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to))\n mstore(0x20, fromSlotSeed)\n // Clear the upper 96 bits.\n from := shr(96, fromSlotSeed)\n to := shr(96, toSlotSeed)\n // Revert if `to` is the zero address.\n if iszero(to) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // If the caller is not `from`, do the authorization check.\n if iszero(eq(caller(), from)) {\n mstore(0x00, caller())\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x00, id)\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, toSlotSeed)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n // Emit a {TransferSingle} event.\n mstore(0x20, amount)\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), from, to)\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n // Do the {onERC1155Received} check if `to` is a smart contract.\n if extcodesize(to) {\n // Prepare the calldata.\n let m := mload(0x40)\n // `onERC1155Received(address,address,uint256,uint256,bytes)`.\n mstore(m, 0xf23a6e61)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), from)\n mstore(add(m, 0x60), id)\n mstore(add(m, 0x80), amount)\n mstore(add(m, 0xa0), 0xa0)\n mstore(add(m, 0xc0), data.length)\n calldatacopy(add(m, 0xe0), data.offset, data.length)\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, data.length), m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(m, 0x00, returndatasize())\n revert(m, returndatasize())\n }\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xf23a6e61))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n }\n\n /// @dev Transfers `amounts` of `ids` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `from` must have at least `amount` of `id`.\n /// - `ids` and `amounts` must have the same length.\n /// - If the caller is not `from`,\n /// it must be approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155BatchReceived}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferBatch} event.\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) public virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(ids.length, amounts.length)) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, from))\n let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, shl(96, to))\n mstore(0x20, fromSlotSeed)\n // Clear the upper 96 bits.\n from := shr(96, fromSlotSeed)\n to := shr(96, toSlotSeed)\n // Revert if `to` is the zero address.\n if iszero(to) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // If the caller is not `from`, do the authorization check.\n if iszero(eq(caller(), from)) {\n mstore(0x00, caller())\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Loop through all the `ids` and update the balances.\n {\n for { let i := shl(5, ids.length) } i {} {\n i := sub(i, 0x20)\n let amount := calldataload(add(amounts.offset, i))\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x20, fromSlotSeed)\n mstore(0x00, calldataload(add(ids.offset, i)))\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, toSlotSeed)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := shl(5, ids.length)\n mstore(add(m, 0x40), ids.length)\n calldatacopy(add(m, 0x60), ids.offset, n)\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x60, n))\n let o := add(add(m, n), 0x60)\n mstore(o, ids.length)\n calldatacopy(add(o, 0x20), amounts.offset, n)\n // Do the emit.\n log4(m, add(add(n, n), 0x80), _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), from, to)\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransferCalldata(from, to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n // Do the {onERC1155BatchReceived} check if `to` is a smart contract.\n if extcodesize(to) {\n mstore(0x00, to) // Cache `to` to prevent stack too deep.\n let m := mload(0x40)\n // Prepare the calldata.\n // `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n mstore(m, 0xbc197c81)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), from)\n // Copy the `ids`.\n mstore(add(m, 0x60), 0xa0)\n let n := shl(5, ids.length)\n mstore(add(m, 0xc0), ids.length)\n calldatacopy(add(m, 0xe0), ids.offset, n)\n // Copy the `amounts`.\n mstore(add(m, 0x80), add(0xc0, n))\n let o := add(add(m, n), 0xe0)\n mstore(o, ids.length)\n calldatacopy(add(o, 0x20), amounts.offset, n)\n // Copy the `data`.\n mstore(add(m, 0xa0), add(add(0xe0, n), n))\n o := add(add(o, n), 0x20)\n mstore(o, data.length)\n calldatacopy(add(o, 0x20), data.offset, data.length)\n let nAll := add(0x104, add(data.length, add(n, n)))\n // Revert if the call reverts.\n if iszero(call(gas(), mload(0x00), 0, add(mload(0x40), 0x1c), nAll, m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(m, 0x00, returndatasize())\n revert(m, returndatasize())\n }\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xbc197c81))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n }\n\n /// @dev Returns the amounts of `ids` for `owners.\n ///\n /// Requirements:\n /// - `owners` and `ids` must have the same length.\n function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)\n public\n view\n virtual\n returns (uint256[] memory balances)\n {\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(ids.length, owners.length)) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n balances := mload(0x40)\n mstore(balances, ids.length)\n let o := add(balances, 0x20)\n let i := shl(5, ids.length)\n mstore(0x40, add(i, o))\n // Loop through all the `ids` and load the balances.\n for {} i {} {\n i := sub(i, 0x20)\n let owner := calldataload(add(owners.offset, i))\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, shl(96, owner)))\n mstore(0x00, calldataload(add(ids.offset, i)))\n mstore(add(o, i), sload(keccak256(0x00, 0x40)))\n }\n }\n }\n\n /// @dev Returns true if this contract implements the interface defined by `interfaceId`.\n /// See: https://eips.ethereum.org/EIPS/eip-165\n /// This function call must use less than 30000 gas.\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n let s := shr(224, interfaceId)\n // ERC165: 0x01ffc9a7, ERC1155: 0xd9b67a26, ERC1155MetadataURI: 0x0e89341c.\n result := or(or(eq(s, 0x01ffc9a7), eq(s, 0xd9b67a26)), eq(s, 0x0e89341c))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL MINT FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Mints `amount` of `id` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155Received}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferSingle} event.\n function _mint(address to, uint256 id, uint256 amount, bytes memory data) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(address(0), to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, to)\n mstore(0x00, id)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n // Emit a {TransferSingle} event.\n mstore(0x20, amount)\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), 0, shr(96, to_))\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(address(0), to, _single(id), _single(amount), data);\n }\n if (_hasCode(to)) _checkOnERC1155Received(address(0), to, id, amount, data);\n }\n\n /// @dev Mints `amounts` of `ids` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `ids` and `amounts` must have the same length.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155BatchReceived}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferBatch} event.\n function _batchMint(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(address(0), to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(mload(ids), mload(amounts))) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n // Loop through all the `ids` and update the balances.\n {\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, to_))\n for { let i := shl(5, mload(ids)) } i { i := sub(i, 0x20) } {\n let amount := mload(add(amounts, i))\n // Increase and store the updated balance of `to`.\n {\n mstore(0x00, mload(add(ids, i)))\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0x40)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n n := sub(add(o, returndatasize()), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), 0, shr(96, to_))\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(address(0), to, ids, amounts, data);\n }\n if (_hasCode(to)) _checkOnERC1155BatchReceived(address(0), to, ids, amounts, data);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL BURN FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to `_burn(address(0), from, id, amount)`.\n function _burn(address from, uint256 id, uint256 amount) internal virtual {\n _burn(address(0), from, id, amount);\n }\n\n /// @dev Destroys `amount` of `id` from `from`.\n ///\n /// Requirements:\n /// - `from` must have at least `amount` of `id`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n ///\n /// Emits a {TransferSingle} event.\n function _burn(address by, address from, uint256 id, uint256 amount) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, address(0), _single(id), _single(amount), "");\n }\n /// @solidity memory-safe-assembly\n assembly {\n let from_ := shl(96, from)\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n if iszero(or(iszero(shl(96, by)), eq(shl(96, by), from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Decrease and store the updated balance of `from`.\n {\n mstore(0x00, id)\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Emit a {TransferSingle} event.\n mstore(0x20, amount)\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), shr(96, from_), 0)\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, address(0), _single(id), _single(amount), "");\n }\n }\n\n /// @dev Equivalent to `_batchBurn(address(0), from, ids, amounts)`.\n function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts)\n internal\n virtual\n {\n _batchBurn(address(0), from, ids, amounts);\n }\n\n /// @dev Destroys `amounts` of `ids` from `from`.\n ///\n /// Requirements:\n /// - `ids` and `amounts` must have the same length.\n /// - `from` must have at least `amounts` of `ids`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n ///\n /// Emits a {TransferBatch} event.\n function _batchBurn(address by, address from, uint256[] memory ids, uint256[] memory amounts)\n internal\n virtual\n {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, address(0), ids, amounts, "");\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(mload(ids), mload(amounts))) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let from_ := shl(96, from)\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n let by_ := shl(96, by)\n if iszero(or(iszero(by_), eq(by_, from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Loop through all the `ids` and update the balances.\n {\n for { let i := shl(5, mload(ids)) } i { i := sub(i, 0x20) } {\n let amount := mload(add(amounts, i))\n // Decrease and store the updated balance of `from`.\n {\n mstore(0x00, mload(add(ids, i)))\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0x40)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n n := sub(add(o, returndatasize()), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), shr(96, from_), 0)\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, address(0), ids, amounts, "");\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL APPROVAL FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Approve or remove the `operator` as an operator for `by`,\n /// without authorization checks.\n ///\n /// Emits a {ApprovalForAll} event.\n function _setApprovalForAll(address by, address operator, bool isApproved) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Convert to 0 or 1.\n isApproved := iszero(iszero(isApproved))\n // Update the `isApproved` for (`by`, `operator`).\n mstore(0x20, _ERC1155_MASTER_SLOT_SEED)\n mstore(0x14, by)\n mstore(0x00, operator)\n sstore(keccak256(0x0c, 0x34), isApproved)\n // Emit the {ApprovalForAll} event.\n mstore(0x00, isApproved)\n let m := shr(96, not(0))\n log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, and(m, by), and(m, operator))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL TRANSFER FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to `_safeTransfer(address(0), from, to, id, amount, data)`.\n function _safeTransfer(address from, address to, uint256 id, uint256 amount, bytes memory data)\n internal\n virtual\n {\n _safeTransfer(address(0), from, to, id, amount, data);\n }\n\n /// @dev Transfers `amount` of `id` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `from` must have at least `amount` of `id`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155Received}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferSingle} event.\n function _safeTransfer(\n address by,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n let from_ := shl(96, from)\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, from_))\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n let by_ := shl(96, by)\n if iszero(or(iszero(by_), eq(by_, from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x00, id)\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, or(_ERC1155_MASTER_SLOT_SEED, to_))\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n // Emit a {TransferSingle} event.\n mstore(0x20, amount)\n // forgefmt: disable-next-line\n log4(0x00, 0x40, _TRANSFER_SINGLE_EVENT_SIGNATURE, caller(), shr(96, from_), shr(96, to_))\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, _single(id), _single(amount), data);\n }\n if (_hasCode(to)) _checkOnERC1155Received(from, to, id, amount, data);\n }\n\n /// @dev Equivalent to `_safeBatchTransfer(address(0), from, to, ids, amounts, data)`.\n function _safeBatchTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n _safeBatchTransfer(address(0), from, to, ids, amounts, data);\n }\n\n /// @dev Transfers `amounts` of `ids` from `from` to `to`.\n ///\n /// Requirements:\n /// - `to` cannot be the zero address.\n /// - `ids` and `amounts` must have the same length.\n /// - `from` must have at least `amounts` of `ids`.\n /// - If `by` is not the zero address, it must be either `from`,\n /// or approved to manage the tokens of `from`.\n /// - If `to` refers to a smart contract, it must implement\n /// {ERC1155-onERC1155BatchReceived}, which is called upon a batch transfer.\n ///\n /// Emits a {TransferBatch} event.\n function _safeBatchTransfer(\n address by,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n if (_useBeforeTokenTransfer()) {\n _beforeTokenTransfer(from, to, ids, amounts, data);\n }\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(eq(mload(ids), mload(amounts))) {\n mstore(0x00, 0x3b800a46) // `ArrayLengthsMismatch()`.\n revert(0x1c, 0x04)\n }\n let from_ := shl(96, from)\n let to_ := shl(96, to)\n // Revert if `to` is the zero address.\n if iszero(to_) {\n mstore(0x00, 0xea553b34) // `TransferToZeroAddress()`.\n revert(0x1c, 0x04)\n }\n let fromSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, from_)\n let toSlotSeed := or(_ERC1155_MASTER_SLOT_SEED, to_)\n mstore(0x20, fromSlotSeed)\n // If `by` is not the zero address, and not equal to `from`,\n // check if it is approved to manage all the tokens of `from`.\n let by_ := shl(96, by)\n if iszero(or(iszero(by_), eq(by_, from_))) {\n mstore(0x00, by)\n if iszero(sload(keccak256(0x0c, 0x34))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Loop through all the `ids` and update the balances.\n {\n for { let i := shl(5, mload(ids)) } i { i := sub(i, 0x20) } {\n let amount := mload(add(amounts, i))\n // Subtract and store the updated balance of `from`.\n {\n mstore(0x20, fromSlotSeed)\n mstore(0x00, mload(add(ids, i)))\n let fromBalanceSlot := keccak256(0x00, 0x40)\n let fromBalance := sload(fromBalanceSlot)\n if gt(amount, fromBalance) {\n mstore(0x00, 0xf4d678b8) // `InsufficientBalance()`.\n revert(0x1c, 0x04)\n }\n sstore(fromBalanceSlot, sub(fromBalance, amount))\n }\n // Increase and store the updated balance of `to`.\n {\n mstore(0x20, toSlotSeed)\n let toBalanceSlot := keccak256(0x00, 0x40)\n let toBalanceBefore := sload(toBalanceSlot)\n let toBalanceAfter := add(toBalanceBefore, amount)\n if lt(toBalanceAfter, toBalanceBefore) {\n mstore(0x00, 0x01336cea) // `AccountBalanceOverflow()`.\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceAfter)\n }\n }\n }\n // Emit a {TransferBatch} event.\n {\n let m := mload(0x40)\n // Copy the `ids`.\n mstore(m, 0x40)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0x40)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n mstore(add(m, 0x20), add(0x40, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n n := sub(add(o, returndatasize()), m)\n // Do the emit.\n log4(m, n, _TRANSFER_BATCH_EVENT_SIGNATURE, caller(), shr(96, from_), shr(96, to_))\n }\n }\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, ids, amounts, data);\n }\n if (_hasCode(to)) _checkOnERC1155BatchReceived(from, to, ids, amounts, data);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* HOOKS FOR OVERRIDING */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Override this function to return true if `_beforeTokenTransfer` is used.\n /// This is to help the compiler avoid producing dead bytecode.\n function _useBeforeTokenTransfer() internal view virtual returns (bool) {\n return false;\n }\n\n /// @dev Hook that is called before any token transfer.\n /// This includes minting and burning, as well as batched variants.\n ///\n /// The same hook is called on both single and batched variants.\n /// For single transfers, the length of the `id` and `amount` arrays are 1.\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /// @dev Override this function to return true if `_afterTokenTransfer` is used.\n /// This is to help the compiler avoid producing dead bytecode.\n function _useAfterTokenTransfer() internal view virtual returns (bool) {\n return false;\n }\n\n /// @dev Hook that is called after any token transfer.\n /// This includes minting and burning, as well as batched variants.\n ///\n /// The same hook is called on both single and batched variants.\n /// For single transfers, the length of the `id` and `amount` arrays are 1.\n function _afterTokenTransfer(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PRIVATE HELPERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Helper for calling the `_afterTokenTransfer` hook.\n /// This is to help the compiler avoid producing dead bytecode.\n function _afterTokenTransferCalldata(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) private {\n if (_useAfterTokenTransfer()) {\n _afterTokenTransfer(from, to, ids, amounts, data);\n }\n }\n\n /// @dev Returns if `a` has bytecode of non-zero length.\n function _hasCode(address a) private view returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := extcodesize(a) // Can handle dirty upper bits.\n }\n }\n\n /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155Received} on `to`.\n /// Reverts if the target does not support the function correctly.\n function _checkOnERC1155Received(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the calldata.\n let m := mload(0x40)\n // `onERC1155Received(address,address,uint256,uint256,bytes)`.\n mstore(m, 0xf23a6e61)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), shr(96, shl(96, from)))\n mstore(add(m, 0x60), id)\n mstore(add(m, 0x80), amount)\n mstore(add(m, 0xa0), 0xa0)\n let n := mload(data)\n mstore(add(m, 0xc0), n)\n if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xe0), n)) }\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), add(0xc4, n), m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(m, 0x00, returndatasize())\n revert(m, returndatasize())\n }\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xf23a6e61))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Perform a call to invoke {IERC1155Receiver-onERC1155BatchReceived} on `to`.\n /// Reverts if the target does not support the function correctly.\n function _checkOnERC1155BatchReceived(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the calldata.\n let m := mload(0x40)\n // `onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)`.\n mstore(m, 0xbc197c81)\n mstore(add(m, 0x20), caller())\n mstore(add(m, 0x40), shr(96, shl(96, from)))\n // Copy the `ids`.\n mstore(add(m, 0x60), 0xa0)\n let n := add(0x20, shl(5, mload(ids)))\n let o := add(m, 0xc0)\n pop(staticcall(gas(), 4, ids, n, o, n))\n // Copy the `amounts`.\n let s := add(0xa0, returndatasize())\n mstore(add(m, 0x80), s)\n o := add(o, returndatasize())\n n := add(0x20, shl(5, mload(amounts)))\n pop(staticcall(gas(), 4, amounts, n, o, n))\n // Copy the `data`.\n mstore(add(m, 0xa0), add(s, returndatasize()))\n o := add(o, returndatasize())\n n := add(0x20, mload(data))\n pop(staticcall(gas(), 4, data, n, o, n))\n n := sub(add(o, returndatasize()), add(m, 0x1c))\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), n, m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(m, 0x00, returndatasize())\n revert(m, returndatasize())\n }\n }\n // Load the returndata and compare it with the function selector.\n if iszero(eq(mload(m), shl(224, 0xbc197c81))) {\n mstore(0x00, 0x9c05499b) // `TransferToNonERC1155ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Returns `x` in an array with a single element.\n function _single(uint256 x) private pure returns (uint256[] memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n mstore(0x40, add(result, 0x40))\n mstore(result, 1)\n mstore(add(result, 0x20), x)\n }\n }\n}\n' + }, + 'lib/solady/src/utils/LibBytes.sol': { + content: + "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Library for byte related operations.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBytes.sol)\nlibrary LibBytes {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STRUCTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Goated bytes storage struct that totally MOGs, no cap, fr.\n /// Uses less gas and bytecode than Solidity's native bytes storage. It's meta af.\n /// Packs length with the first 31 bytes if <255 bytes, so it’s mad tight.\n struct BytesStorage {\n bytes32 _spacer;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The constant returned when the `search` is not found in the bytes.\n uint256 internal constant NOT_FOUND = type(uint256).max;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* BYTE STORAGE OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Sets the value of the bytes storage `$` to `s`.\n function set(BytesStorage storage $, bytes memory s) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(s)\n let packed := or(0xff, shl(8, n))\n for { let i := 0 } 1 {} {\n if iszero(gt(n, 0xfe)) {\n i := 0x1f\n packed := or(n, shl(8, mload(add(s, i))))\n if iszero(gt(n, i)) { break }\n }\n let o := add(s, 0x20)\n mstore(0x00, $.slot)\n for { let p := keccak256(0x00, 0x20) } 1 {} {\n sstore(add(p, shr(5, i)), mload(add(o, i)))\n i := add(i, 0x20)\n if iszero(lt(i, n)) { break }\n }\n break\n }\n sstore($.slot, packed)\n }\n }\n\n /// @dev Sets the value of the bytes storage `$` to `s`.\n function setCalldata(BytesStorage storage $, bytes calldata s) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let packed := or(0xff, shl(8, s.length))\n for { let i := 0 } 1 {} {\n if iszero(gt(s.length, 0xfe)) {\n i := 0x1f\n packed := or(s.length, shl(8, shr(8, calldataload(s.offset))))\n if iszero(gt(s.length, i)) { break }\n }\n mstore(0x00, $.slot)\n for { let p := keccak256(0x00, 0x20) } 1 {} {\n sstore(add(p, shr(5, i)), calldataload(add(s.offset, i)))\n i := add(i, 0x20)\n if iszero(lt(i, s.length)) { break }\n }\n break\n }\n sstore($.slot, packed)\n }\n }\n\n /// @dev Sets the value of the bytes storage `$` to the empty bytes.\n function clear(BytesStorage storage $) internal {\n delete $._spacer;\n }\n\n /// @dev Returns whether the value stored is `$` is the empty bytes \"\".\n function isEmpty(BytesStorage storage $) internal view returns (bool) {\n return uint256($._spacer) & 0xff == uint256(0);\n }\n\n /// @dev Returns the length of the value stored in `$`.\n function length(BytesStorage storage $) internal view returns (uint256 result) {\n result = uint256($._spacer);\n /// @solidity memory-safe-assembly\n assembly {\n let n := and(0xff, result)\n result := or(mul(shr(8, result), eq(0xff, n)), mul(n, iszero(eq(0xff, n))))\n }\n }\n\n /// @dev Returns the value stored in `$`.\n function get(BytesStorage storage $) internal view returns (bytes memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let o := add(result, 0x20)\n let packed := sload($.slot)\n let n := shr(8, packed)\n for { let i := 0 } 1 {} {\n if iszero(eq(or(packed, 0xff), packed)) {\n mstore(o, packed)\n n := and(0xff, packed)\n i := 0x1f\n if iszero(gt(n, i)) { break }\n }\n mstore(0x00, $.slot)\n for { let p := keccak256(0x00, 0x20) } 1 {} {\n mstore(add(o, i), sload(add(p, shr(5, i))))\n i := add(i, 0x20)\n if iszero(lt(i, n)) { break }\n }\n break\n }\n mstore(result, n) // Store the length of the memory.\n mstore(add(o, n), 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(add(o, n), 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Returns the uint8 at index `i`. If out-of-bounds, returns 0.\n function uint8At(BytesStorage storage $, uint256 i) internal view returns (uint8 result) {\n /// @solidity memory-safe-assembly\n assembly {\n for { let packed := sload($.slot) } 1 {} {\n if iszero(eq(or(packed, 0xff), packed)) {\n if iszero(gt(i, 0x1e)) {\n result := byte(i, packed)\n break\n }\n if iszero(gt(i, and(0xff, packed))) {\n mstore(0x00, $.slot)\n let j := sub(i, 0x1f)\n result := byte(and(j, 0x1f), sload(add(keccak256(0x00, 0x20), shr(5, j))))\n }\n break\n }\n if iszero(gt(i, shr(8, packed))) {\n mstore(0x00, $.slot)\n result := byte(and(i, 0x1f), sload(add(keccak256(0x00, 0x20), shr(5, i))))\n }\n break\n }\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* BYTES OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns `subject` all occurrences of `needle` replaced with `replacement`.\n function replace(bytes memory subject, bytes memory needle, bytes memory replacement)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let needleLen := mload(needle)\n let replacementLen := mload(replacement)\n let d := sub(result, subject) // Memory difference.\n let i := add(subject, 0x20) // Subject bytes pointer.\n mstore(0x00, add(i, mload(subject))) // End of subject.\n if iszero(gt(needleLen, mload(subject))) {\n let subjectSearchEnd := add(sub(mload(0x00), needleLen), 1)\n let h := 0 // The hash of `needle`.\n if iszero(lt(needleLen, 0x20)) { h := keccak256(add(needle, 0x20), needleLen) }\n let s := mload(add(needle, 0x20))\n for { let m := shl(3, sub(0x20, and(needleLen, 0x1f))) } 1 {} {\n let t := mload(i)\n // Whether the first `needleLen % 32` bytes of `subject` and `needle` matches.\n if iszero(shr(m, xor(t, s))) {\n if h {\n if iszero(eq(keccak256(i, needleLen), h)) {\n mstore(add(i, d), t)\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n // Copy the `replacement` one word at a time.\n for { let j := 0 } 1 {} {\n mstore(add(add(i, d), j), mload(add(add(replacement, 0x20), j)))\n j := add(j, 0x20)\n if iszero(lt(j, replacementLen)) { break }\n }\n d := sub(add(d, replacementLen), needleLen)\n if needleLen {\n i := add(i, needleLen)\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n mstore(add(i, d), t)\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n }\n }\n let end := mload(0x00)\n let n := add(sub(d, add(result, 0x20)), end)\n // Copy the rest of the bytes one word at a time.\n for {} lt(i, end) { i := add(i, 0x20) } { mstore(add(i, d), mload(i)) }\n let o := add(i, d)\n mstore(o, 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(bytes memory subject, bytes memory needle, uint256 from)\n internal\n pure\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := not(0) // Initialize to `NOT_FOUND`.\n for { let subjectLen := mload(subject) } 1 {} {\n if iszero(mload(needle)) {\n result := from\n if iszero(gt(from, subjectLen)) { break }\n result := subjectLen\n break\n }\n let needleLen := mload(needle)\n let subjectStart := add(subject, 0x20)\n\n subject := add(subjectStart, from)\n let end := add(sub(add(subjectStart, subjectLen), needleLen), 1)\n let m := shl(3, sub(0x20, and(needleLen, 0x1f)))\n let s := mload(add(needle, 0x20))\n\n if iszero(and(lt(subject, end), lt(from, subjectLen))) { break }\n\n if iszero(lt(needleLen, 0x20)) {\n for { let h := keccak256(add(needle, 0x20), needleLen) } 1 {} {\n if iszero(shr(m, xor(mload(subject), s))) {\n if eq(keccak256(subject, needleLen), h) {\n result := sub(subject, subjectStart)\n break\n }\n }\n subject := add(subject, 1)\n if iszero(lt(subject, end)) { break }\n }\n break\n }\n for {} 1 {} {\n if iszero(shr(m, xor(mload(subject), s))) {\n result := sub(subject, subjectStart)\n break\n }\n subject := add(subject, 1)\n if iszero(lt(subject, end)) { break }\n }\n break\n }\n }\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(bytes memory subject, bytes memory needle) internal pure returns (uint256) {\n return indexOf(subject, needle, 0);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(bytes memory subject, bytes memory needle, uint256 from)\n internal\n pure\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n for {} 1 {} {\n result := not(0) // Initialize to `NOT_FOUND`.\n let needleLen := mload(needle)\n if gt(needleLen, mload(subject)) { break }\n let w := result\n\n let fromMax := sub(mload(subject), needleLen)\n if iszero(gt(fromMax, from)) { from := fromMax }\n\n let end := add(add(subject, 0x20), w)\n subject := add(add(subject, 0x20), from)\n if iszero(gt(subject, end)) { break }\n // As this function is not too often used,\n // we shall simply use keccak256 for smaller bytecode size.\n for { let h := keccak256(add(needle, 0x20), needleLen) } 1 {} {\n if eq(keccak256(subject, needleLen), h) {\n result := sub(subject, add(end, 1))\n break\n }\n subject := add(subject, w) // `sub(subject, 1)`.\n if iszero(gt(subject, end)) { break }\n }\n break\n }\n }\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (uint256)\n {\n return lastIndexOf(subject, needle, type(uint256).max);\n }\n\n /// @dev Returns true if `needle` is found in `subject`, false otherwise.\n function contains(bytes memory subject, bytes memory needle) internal pure returns (bool) {\n return indexOf(subject, needle) != NOT_FOUND;\n }\n\n /// @dev Returns whether `subject` starts with `needle`.\n function startsWith(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(needle)\n // Just using keccak256 directly is actually cheaper.\n let t := eq(keccak256(add(subject, 0x20), n), keccak256(add(needle, 0x20), n))\n result := lt(gt(n, mload(subject)), t)\n }\n }\n\n /// @dev Returns whether `subject` ends with `needle`.\n function endsWith(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(needle)\n let notInRange := gt(n, mload(subject))\n // `subject + 0x20 + max(subject.length - needle.length, 0)`.\n let t := add(add(subject, 0x20), mul(iszero(notInRange), sub(mload(subject), n)))\n // Just using keccak256 directly is actually cheaper.\n result := gt(eq(keccak256(t, n), keccak256(add(needle, 0x20), n)), notInRange)\n }\n }\n\n /// @dev Returns `subject` repeated `times`.\n function repeat(bytes memory subject, uint256 times)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := mload(subject) // Subject length.\n if iszero(or(iszero(times), iszero(l))) {\n result := mload(0x40)\n subject := add(subject, 0x20)\n let o := add(result, 0x20)\n for {} 1 {} {\n // Copy the `subject` one word at a time.\n for { let j := 0 } 1 {} {\n mstore(add(o, j), mload(add(subject, j)))\n j := add(j, 0x20)\n if iszero(lt(j, l)) { break }\n }\n o := add(o, l)\n times := sub(times, 1)\n if iszero(times) { break }\n }\n mstore(o, 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n }\n }\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).\n /// `start` and `end` are byte offsets.\n function slice(bytes memory subject, uint256 start, uint256 end)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := mload(subject) // Subject length.\n if iszero(gt(l, end)) { end := l }\n if iszero(gt(l, start)) { start := l }\n if lt(start, end) {\n result := mload(0x40)\n let n := sub(end, start)\n let i := add(subject, start)\n let w := not(0x1f)\n // Copy the `subject` one word at a time, backwards.\n for { let j := and(add(n, 0x1f), w) } 1 {} {\n mstore(add(result, j), mload(add(i, j)))\n j := add(j, w) // `sub(j, 0x20)`.\n if iszero(j) { break }\n }\n let o := add(add(result, 0x20), n)\n mstore(o, 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n mstore(result, n) // Store the length.\n }\n }\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to the end of the bytes.\n /// `start` is a byte offset.\n function slice(bytes memory subject, uint256 start)\n internal\n pure\n returns (bytes memory result)\n {\n result = slice(subject, start, type(uint256).max);\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).\n /// `start` and `end` are byte offsets. Faster than Solidity's native slicing.\n function sliceCalldata(bytes calldata subject, uint256 start, uint256 end)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n end := xor(end, mul(xor(end, subject.length), lt(subject.length, end)))\n start := xor(start, mul(xor(start, subject.length), lt(subject.length, start)))\n result.offset := add(subject.offset, start)\n result.length := mul(lt(start, end), sub(end, start))\n }\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to the end of the bytes.\n /// `start` is a byte offset. Faster than Solidity's native slicing.\n function sliceCalldata(bytes calldata subject, uint256 start)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n start := xor(start, mul(xor(start, subject.length), lt(subject.length, start)))\n result.offset := add(subject.offset, start)\n result.length := mul(lt(start, subject.length), sub(subject.length, start))\n }\n }\n\n /// @dev Reduces the size of `subject` to `n`.\n /// If `n` is greater than the size of `subject`, this will be a no-op.\n function truncate(bytes memory subject, uint256 n)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := subject\n mstore(mul(lt(n, mload(result)), result), n)\n }\n }\n\n /// @dev Returns a copy of `subject`, with the length reduced to `n`.\n /// If `n` is greater than the size of `subject`, this will be a no-op.\n function truncatedCalldata(bytes calldata subject, uint256 n)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result.offset := subject.offset\n result.length := xor(n, mul(xor(n, subject.length), lt(subject.length, n)))\n }\n }\n\n /// @dev Returns all the indices of `needle` in `subject`.\n /// The indices are byte offsets.\n function indicesOf(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (uint256[] memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let searchLen := mload(needle)\n if iszero(gt(searchLen, mload(subject))) {\n result := mload(0x40)\n let i := add(subject, 0x20)\n let o := add(result, 0x20)\n let subjectSearchEnd := add(sub(add(i, mload(subject)), searchLen), 1)\n let h := 0 // The hash of `needle`.\n if iszero(lt(searchLen, 0x20)) { h := keccak256(add(needle, 0x20), searchLen) }\n let s := mload(add(needle, 0x20))\n for { let m := shl(3, sub(0x20, and(searchLen, 0x1f))) } 1 {} {\n let t := mload(i)\n // Whether the first `searchLen % 32` bytes of `subject` and `needle` matches.\n if iszero(shr(m, xor(t, s))) {\n if h {\n if iszero(eq(keccak256(i, searchLen), h)) {\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n mstore(o, sub(i, add(subject, 0x20))) // Append to `result`.\n o := add(o, 0x20)\n i := add(i, searchLen) // Advance `i` by `searchLen`.\n if searchLen {\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n }\n mstore(result, shr(5, sub(o, add(result, 0x20)))) // Store the length of `result`.\n // Allocate memory for result.\n // We allocate one more word, so this array can be recycled for {split}.\n mstore(0x40, add(o, 0x20))\n }\n }\n }\n\n /// @dev Returns an arrays of bytess based on the `delimiter` inside of the `subject` bytes.\n function split(bytes memory subject, bytes memory delimiter)\n internal\n pure\n returns (bytes[] memory result)\n {\n uint256[] memory indices = indicesOf(subject, delimiter);\n /// @solidity memory-safe-assembly\n assembly {\n let w := not(0x1f)\n let indexPtr := add(indices, 0x20)\n let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1)))\n mstore(add(indicesEnd, w), mload(subject))\n mstore(indices, add(mload(indices), 1))\n for { let prevIndex := 0 } 1 {} {\n let index := mload(indexPtr)\n mstore(indexPtr, 0x60)\n if iszero(eq(index, prevIndex)) {\n let element := mload(0x40)\n let l := sub(index, prevIndex)\n mstore(element, l) // Store the length of the element.\n // Copy the `subject` one word at a time, backwards.\n for { let o := and(add(l, 0x1f), w) } 1 {} {\n mstore(add(element, o), mload(add(add(subject, prevIndex), o)))\n o := add(o, w) // `sub(o, 0x20)`.\n if iszero(o) { break }\n }\n mstore(add(add(element, 0x20), l), 0) // Zeroize the slot after the bytes.\n // Allocate memory for the length and the bytes, rounded up to a multiple of 32.\n mstore(0x40, add(element, and(add(l, 0x3f), w)))\n mstore(indexPtr, element) // Store the `element` into the array.\n }\n prevIndex := add(index, mload(delimiter))\n indexPtr := add(indexPtr, 0x20)\n if iszero(lt(indexPtr, indicesEnd)) { break }\n }\n result := indices\n if iszero(mload(delimiter)) {\n result := add(indices, 0x20)\n mstore(result, sub(mload(indices), 2))\n }\n }\n }\n\n /// @dev Returns a concatenated bytes of `a` and `b`.\n /// Cheaper than `bytes.concat()` and does not de-align the free memory pointer.\n function concat(bytes memory a, bytes memory b) internal pure returns (bytes memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let w := not(0x1f)\n let aLen := mload(a)\n // Copy `a` one word at a time, backwards.\n for { let o := and(add(aLen, 0x20), w) } 1 {} {\n mstore(add(result, o), mload(add(a, o)))\n o := add(o, w) // `sub(o, 0x20)`.\n if iszero(o) { break }\n }\n let bLen := mload(b)\n let output := add(result, aLen)\n // Copy `b` one word at a time, backwards.\n for { let o := and(add(bLen, 0x20), w) } 1 {} {\n mstore(add(output, o), mload(add(b, o)))\n o := add(o, w) // `sub(o, 0x20)`.\n if iszero(o) { break }\n }\n let totalLen := add(aLen, bLen)\n let last := add(add(result, 0x20), totalLen)\n mstore(last, 0) // Zeroize the slot after the bytes.\n mstore(result, totalLen) // Store the length.\n mstore(0x40, add(last, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Returns whether `a` equals `b`.\n function eq(bytes memory a, bytes memory b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))\n }\n }\n\n /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small bytes.\n function eqs(bytes memory a, bytes32 b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n // These should be evaluated on compile time, as far as possible.\n let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.\n let x := not(or(m, or(b, add(m, and(b, m)))))\n let r := shl(7, iszero(iszero(shr(128, x))))\n r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))\n r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n r := or(r, shl(4, lt(0xffff, shr(r, x))))\n r := or(r, shl(3, lt(0xff, shr(r, x))))\n // forgefmt: disable-next-item\n result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),\n xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))\n }\n }\n\n /// @dev Returns 0 if `a == b`, -1 if `a < b`, +1 if `a > b`.\n /// If `a` == b[:a.length]`, and `a.length < b.length`, returns -1.\n function cmp(bytes memory a, bytes memory b) internal pure returns (int256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n let aLen := mload(a)\n let bLen := mload(b)\n let n := and(xor(aLen, mul(xor(aLen, bLen), lt(bLen, aLen))), not(0x1f))\n if n {\n for { let i := 0x20 } 1 {} {\n let x := mload(add(a, i))\n let y := mload(add(b, i))\n if iszero(or(xor(x, y), eq(i, n))) {\n i := add(i, 0x20)\n continue\n }\n result := sub(gt(x, y), lt(x, y))\n break\n }\n }\n // forgefmt: disable-next-item\n if iszero(result) {\n let l := 0x201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a090807060504030201\n let x := and(mload(add(add(a, 0x20), n)), shl(shl(3, byte(sub(aLen, n), l)), not(0)))\n let y := and(mload(add(add(b, 0x20), n)), shl(shl(3, byte(sub(bLen, n), l)), not(0)))\n result := sub(gt(x, y), lt(x, y))\n if iszero(result) { result := sub(gt(aLen, bLen), lt(aLen, bLen)) }\n }\n }\n }\n\n /// @dev Directly returns `a` without copying.\n function directReturn(bytes memory a) internal pure {\n /// @solidity memory-safe-assembly\n assembly {\n // Assumes that the bytes does not start from the scratch space.\n let retStart := sub(a, 0x20)\n let retUnpaddedSize := add(mload(a), 0x40)\n // Right pad with zeroes. Just in case the bytes is produced\n // by a method that doesn't zero right pad.\n mstore(add(retStart, retUnpaddedSize), 0)\n mstore(retStart, 0x20) // Store the return offset.\n // End the transaction, returning the bytes.\n return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))\n }\n }\n\n /// @dev Directly returns `a` with minimal copying.\n function directReturn(bytes[] memory a) internal pure {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(a) // `a.length`.\n let o := add(a, 0x20) // Start of elements in `a`.\n let u := a // Highest memory slot.\n let w := not(0x1f)\n for { let i := 0 } iszero(eq(i, n)) { i := add(i, 1) } {\n let c := add(o, shl(5, i)) // Location of pointer to `a[i]`.\n let s := mload(c) // `a[i]`.\n let l := mload(s) // `a[i].length`.\n let r := and(l, 0x1f) // `a[i].length % 32`.\n let z := add(0x20, and(l, w)) // Offset of last word in `a[i]` from `s`.\n // If `s` comes before `o`, or `s` is not zero right padded.\n if iszero(lt(lt(s, o), or(iszero(r), iszero(shl(shl(3, r), mload(add(s, z))))))) {\n let m := mload(0x40)\n mstore(m, l) // Copy `a[i].length`.\n for {} 1 {} {\n mstore(add(m, z), mload(add(s, z))) // Copy `a[i]`, backwards.\n z := add(z, w) // `sub(z, 0x20)`.\n if iszero(z) { break }\n }\n let e := add(add(m, 0x20), l)\n mstore(e, 0) // Zeroize the slot after the copied bytes.\n mstore(0x40, add(e, 0x20)) // Allocate memory.\n s := m\n }\n mstore(c, sub(s, o)) // Convert to calldata offset.\n let t := add(l, add(s, 0x20))\n if iszero(lt(t, u)) { u := t }\n }\n let retStart := add(a, w) // Assumes `a` doesn't start from scratch space.\n mstore(retStart, 0x20) // Store the return offset.\n return(retStart, add(0x40, sub(u, retStart))) // End the transaction.\n }\n }\n\n /// @dev Returns the word at `offset`, without any bounds checks.\n function load(bytes memory a, uint256 offset) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(add(add(a, 0x20), offset))\n }\n }\n\n /// @dev Returns the word at `offset`, without any bounds checks.\n function loadCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes32 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := calldataload(add(a.offset, offset))\n }\n }\n\n /// @dev Returns a slice representing a static struct in the calldata. Performs bounds checks.\n function staticStructInCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := sub(a.length, 0x20)\n result.offset := add(a.offset, offset)\n result.length := sub(a.length, offset)\n if or(shr(64, or(l, a.offset)), gt(offset, l)) { revert(l, 0x00) }\n }\n }\n\n /// @dev Returns a slice representing a dynamic struct in the calldata. Performs bounds checks.\n function dynamicStructInCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := sub(a.length, 0x20)\n let s := calldataload(add(a.offset, offset)) // Relative offset of `result` from `a.offset`.\n result.offset := add(a.offset, s)\n result.length := sub(a.length, s)\n if or(shr(64, or(s, or(l, a.offset))), gt(offset, l)) { revert(l, 0x00) }\n }\n }\n\n /// @dev Returns bytes in calldata. Performs bounds checks.\n function bytesInCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := sub(a.length, 0x20)\n let s := calldataload(add(a.offset, offset)) // Relative offset of `result` from `a.offset`.\n result.offset := add(add(a.offset, s), 0x20)\n result.length := calldataload(add(a.offset, s))\n // forgefmt: disable-next-item\n if or(shr(64, or(result.length, or(s, or(l, a.offset)))),\n or(gt(add(s, result.length), l), gt(offset, l))) { revert(l, 0x00) }\n }\n }\n\n /// @dev Returns empty calldata bytes. For silencing the compiler.\n function emptyCalldata() internal pure returns (bytes calldata result) {\n /// @solidity memory-safe-assembly\n assembly {\n result.length := 0\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/interfaces/IERC1967.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC2981.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' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/introspection/IERC165.sol";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n /**\n * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n */\n function royaltyInfo(\n uint256 tokenId,\n uint256 salePrice\n ) external view returns (address receiver, uint256 royaltyAmount);\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/draft-IERC1822.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.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' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.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' + '// 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/0xsequence/erc-1155/src/contracts/interfaces/IERC1155TokenReceiver.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.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: 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/0xsequence/erc-1155/src/contracts/interfaces/IERC1155.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.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.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/0xsequence/erc-1155/src/contracts/utils/Address.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.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: 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/0xsequence/erc-1155/src/contracts/interfaces/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.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 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/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.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.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/access/IAccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.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" + '// 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/Strings.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/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' + '// 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/Math.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/Math.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' }, - 'lib/openzeppelin/contracts/utils/math/SignedMath.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/SignedMath.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' } }, settings: { 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/', + '@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/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/ERC721ItemsFactory.ts b/scripts/factories/token_library/ERC721ItemsFactory.ts index 6145139..91977bb 100644 --- a/scripts/factories/token_library/ERC721ItemsFactory.ts +++ b/scripts/factories/token_library/ERC721ItemsFactory.ts @@ -1,116 +1,238 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' -// https://github.com/0xsequence/contracts-library/blob/b32f88b298fc73ec1c4be5e845185de91f41c9ff/src/tokens/ERC721/presets/items/ERC721ItemsFactory.sol +// https://github.com/0xsequence/contracts-library/blob/73363994054ad0983ceabebb8b98ad02044a4267/src/tokens/ERC721/presets/items/ERC721ItemsFactory.sol const abi = [ { - type: 'constructor', - inputs: [{ name: 'factoryOwner', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' + inputs: [ + { + internalType: 'address', + name: 'factoryOwner', + type: 'address' + } + ], + stateMutability: 'nonpayable', + type: 'constructor' + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'proxyAddr', + type: 'address' + } + ], + name: 'ERC721ItemsDeployed', + type: 'event' + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address' + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address' + } + ], + name: 'OwnershipTransferred', + type: 'event' }, { - type: 'function', - name: 'beacon', inputs: [], + name: 'beacon', outputs: [ { + internalType: 'contract UpgradeableBeacon', name: '', - type: 'address', - internalType: 'contract UpgradeableBeacon' + type: 'address' } ], - stateMutability: 'view' + stateMutability: 'view', + type: 'function' }, { - type: 'function', - name: 'deploy', inputs: [ - { name: 'proxyOwner', type: 'address', internalType: 'address' }, - { name: 'tokenOwner', type: 'address', internalType: 'address' }, - { name: 'name', type: 'string', internalType: 'string' }, - { name: 'symbol', type: 'string', internalType: 'string' }, - { name: 'baseURI', type: 'string', internalType: 'string' }, - { name: 'contractURI', type: 'string', internalType: 'string' }, { + internalType: 'address', + name: 'proxyOwner', + type: 'address' + }, + { + internalType: 'address', + name: 'tokenOwner', + type: 'address' + }, + { + internalType: 'string', + name: 'name', + type: 'string' + }, + { + internalType: 'string', + name: 'symbol', + type: 'string' + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string' + }, + { + internalType: 'string', + name: 'contractURI', + type: 'string' + }, + { + internalType: 'address', name: 'royaltyReceiver', - type: 'address', - internalType: 'address' + type: 'address' }, { + internalType: 'uint96', name: 'royaltyFeeNumerator', - type: 'uint96', - internalType: 'uint96' + type: 'uint96' + }, + { + internalType: 'address', + name: 'implicitModeValidator', + type: 'address' + }, + { + internalType: 'bytes32', + name: 'implicitModeProjectId', + type: 'bytes32' + } + ], + name: 'deploy', + outputs: [ + { + internalType: 'address', + name: 'proxyAddr', + type: 'address' } ], - outputs: [{ name: 'proxyAddr', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' + stateMutability: 'nonpayable', + type: 'function' }, { - type: 'function', - name: 'owner', - inputs: [], - outputs: [{ name: '', type: 'address', internalType: 'address' }], - stateMutability: 'view' + inputs: [ + { + internalType: 'address', + name: 'proxyOwner', + type: 'address' + }, + { + internalType: 'address', + name: 'tokenOwner', + type: 'address' + }, + { + internalType: 'string', + name: 'name', + type: 'string' + }, + { + internalType: 'string', + name: 'symbol', + type: 'string' + }, + { + internalType: 'string', + name: 'baseURI', + type: 'string' + }, + { + internalType: 'string', + name: 'contractURI', + type: 'string' + }, + { + internalType: 'address', + name: 'royaltyReceiver', + type: 'address' + }, + { + internalType: 'uint96', + name: 'royaltyFeeNumerator', + type: 'uint96' + }, + { + internalType: 'address', + name: 'implicitModeValidator', + type: 'address' + }, + { + internalType: 'bytes32', + name: 'implicitModeProjectId', + type: 'bytes32' + } + ], + name: 'determineAddress', + outputs: [ + { + internalType: 'address', + name: 'proxyAddr', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' }, { - type: 'function', - name: 'renounceOwnership', inputs: [], - outputs: [], - stateMutability: 'nonpayable' - }, - { - type: 'function', - name: 'transferOwnership', - inputs: [{ name: 'newOwner', type: 'address', internalType: 'address' }], - outputs: [], - stateMutability: 'nonpayable' - }, - { - type: 'function', - name: 'upgradeBeacon', - inputs: [ + name: 'owner', + outputs: [ { - name: 'implementation', - type: 'address', - internalType: 'address' + internalType: 'address', + name: '', + type: 'address' } ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [], + name: 'renounceOwnership', outputs: [], - stateMutability: 'nonpayable' + stateMutability: 'nonpayable', + type: 'function' }, { - type: 'event', - name: 'ERC721ItemsDeployed', inputs: [ { - name: 'proxyAddr', - type: 'address', - indexed: false, - internalType: 'address' + internalType: 'address', + name: 'newOwner', + type: 'address' } ], - anonymous: false + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' }, { - type: 'event', - name: 'OwnershipTransferred', inputs: [ { - name: 'previousOwner', - type: 'address', - indexed: true, - internalType: 'address' - }, - { - name: 'newOwner', - type: 'address', - indexed: true, - internalType: 'address' + internalType: 'address', + name: 'implementation', + type: 'address' } ], - anonymous: false + name: 'upgradeBeacon', + outputs: [], + stateMutability: 'nonpayable', + type: 'function' } ] @@ -118,7 +240,7 @@ export class ERC721ItemsFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( abi, - '0x608034610125576001600160401b0390601f6200650738819003918201601f191683019291908484118385101761010f57816020928492604096875283398101031261012557516001600160a01b038082168203610125576100603361012a565b82519361411f94858101958187108388111761010f57620023e8823980600096039086f0908115610105578451916105ee808401928311848410176100f1579184849260209462001dfa853916815203019085f080156100e4576100d69394501660018060a01b0319600154161760015561012a565b51611c889081620001728239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461072157806325a570b8146102e757806359659e9014610294578063715018a6146101f45780638da5cb5b1461019f5763f2fde38b1461006357600080fd5b3461019b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019b5761009a6107e0565b906100a36108fc565b73ffffffffffffffffffffffffffffffffffffffff809216928315610118575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b5050346101f057817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f05773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b833461029157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102915761022b6108fc565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346101f057817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f05760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b508290346101f0576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f0576103226107e0565b9273ffffffffffffffffffffffffffffffffffffffff92602435848116810361070c5767ffffffffffffffff9360443585811161071d576103669036908301610887565b956064358681116107195761037e9036908401610887565b608435878111610715576103959036908501610887565b60a435888111610711576103ac9036908601610887565b9060c43592848416840361070c5760e435946bffffffffffffffffffffffff861686036105fd578b9c8a9b9c999a5160209e8f91808c8b8b8b8b8b898701986103f5968a6109e1565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0810182526104259082610846565b5190208d519e90918f019081118f8210176106de578f918f8f928f816068916104af93875284526001549061049f87519586938a85019889527fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090818d60601b168b87015260601b1660548501525180928585019061097b565b8101036048810184520182610846565b519020916111eb9151906104c581840183610846565b828252810191610a68833980511561068057518492918ef5169c8d156106235760015483169291908e3b1561061f578c928f918f9361054786928e9651988997889687957fcf7a1d770000000000000000000000000000000000000000000000000000000087521690850152602484015260606044840152606483019061099e565b03925af1801561061557908a91610601575b50508a3b156105fd579161059e939189979695938b51998a9889987f98dd69c8000000000000000000000000000000000000000000000000000000008a5289016109e1565b038183885af180156105f3576105df575b50507fd8ad75647a93de9d8d617559d87f1c27bc23fb6237b94054baf34aafbe85ad03838251848152a151908152f35b6105e98291610803565b61029157806105af565b83513d84823e3d90fd5b8880fd5b61060a90610803565b6105fd57888d610559565b8b513d8c823e3d90fd5b8c80fd5b506064888f8e51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b5050506064888f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b60418a7f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b600080fd5b8680fd5b8580fd5b8480fd5b8380fd5b50903461019b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019b578261075b6107e0565b6107636108fc565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561071d5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af19081156107d757506107cb575080f35b6107d490610803565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361070c57565b67ffffffffffffffff811161081757604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761081757604052565b81601f8201121561070c5780359067ffffffffffffffff821161081757604051926108da60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610846565b8284526020838301011161070c57816000926020809301838601378301015290565b73ffffffffffffffffffffffffffffffffffffffff60005416330361091d57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b83811061098e5750506000910152565b818101518382015260200161097e565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936109da8151809281875287808801910161097b565b0116010190565b9597969294610a4c6bffffffffffffffffffffffff95610a3e60c098610a30610a5a969760e060208e73ffffffffffffffffffffffffffffffffffffffff809c168152015260e08d019061099e565b908b820360408d015261099e565b9089820360608b015261099e565b90878203608089015261099e565b961660a08501521691015256fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea26469706673582212205afdfcf2db2f242d1c90fc4524ff1841da37419738805ee0571bd2744b6196ce64736f6c63430008130033a2646970667358221220a80cc5d74e0a02cb4b1f44a1dec44bba24dd9e7bd16093f5d05c61be5740ed1664736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ee02a7cc9adae68564feda64934170f02f3f12a55b74647721baba4fb366157164736f6c6343000813003360a060405234620002dc5762000014620002e1565b6200001e620002e1565b8151906001600160401b0390818311620001ee57600254906001938483811c9316958615620002d1575b60209687851014620001cd578190601f948581116200027a575b508790858311600114620002105760009262000204575b5050600019600383901b1c191690851b176002555b8051928311620001ee5760039485548581811c91168015620001e3575b82821014620001cd5783811162000182575b50809284116001146200011857509282939183926000946200010c575b50501b9160001990841b1c19161790555b6000805533608052604051613e1990816200030682396080518161396f0152f35b015192503880620000da565b919083601f1981168760005284600020946000905b888383106200016757505050106200014e575b505050811b019055620000eb565b015160001983861b60f8161c1916905538808062000140565b8587015188559096019594850194879350908101906200012d565b86600052816000208480870160051c820192848810620001c3575b0160051c019086905b828110620001b6575050620000bd565b60008155018690620001a6565b925081926200019d565b634e487b7160e01b600052602260045260246000fd5b90607f1690620000ab565b634e487b7160e01b600052604160045260246000fd5b01519050388062000079565b90879350601f198316916002600052896000209260005b8b82821062000263575050841162000249575b505050811b016002556200008e565b015160001960f88460031b161c191690553880806200023a565b8385015186558b9790950194938401930162000227565b9091506002600052876000208580850160051c8201928a8610620002c7575b918991869594930160051c01915b828110620002b757505062000062565b60008155859450899101620002a7565b9250819262000299565b92607f169262000048565b600080fd5b60405190602082016001600160401b03811183821017620001ee576040526000825256fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461026757806304634d8d1461026257806306fdde031461025d578063081812fc14610258578063095ea7b31461025357806318160ddd1461024e57806323b872dd14610249578063248a9ca3146102445780632a55205a1461023f5780632f2ff15d1461023a57806336568abe1461023557806340c10f191461023057806342842e0e1461022b57806342966c68146102265780635944c753146102215780635a4462151461021c5780635bbb2177146102175780636352211e1461021257806370a082311461020d5780637e518ec8146102085780638462151c146102035780639010d07c146101fe57806391d14854146101f9578063938e3d7b146101f457806395d89b41146101ef57806398dd69c8146101ea57806399a2557a146101e5578063a217fddf146101e0578063a22cb465146101db578063b88d4fde146101d6578063c23dc68f146101d1578063c87b56dd146101cc578063ca15c873146101c7578063d547741f146101c2578063dc8e92ea146101bd578063e8a3d485146101b85763e985e9c5146101b357600080fd5b611c80565b611bd9565b611b52565b611afb565b611acf565b611955565b6118e3565b611888565b6117b9565b61179d565b611765565b6116c7565b611620565b611521565b6114c1565b61146e565b61139a565b611260565b61120a565b6111ce565b611168565b610f9e565b610d2c565b610d10565b610ced565b610b9f565b610ad9565b610996565b6108c5565b610896565b610884565b61081f565b610700565b610686565b610587565b6104e7565b61029b565b7fffffffff0000000000000000000000000000000000000000000000000000000081160361029657565b600080fd5b346102965760206003193601126102965761031d6004356102bb8161026c565b7fffffffff000000000000000000000000000000000000000000000000000000008116807f40c10f190000000000000000000000000000000000000000000000000000000014918215610321575b505060405190151581529081906020820190565b0390f35b7fc21b8f28000000000000000000000000000000000000000000000000000000008214925090821561041e575b821561038d575b50811561037c575b811561036c575b503880610309565b6103769150613c7d565b38610364565b905061038781613c7d565b9061035d565b9091507f01ffc9a70000000000000000000000000000000000000000000000000000000081149081156103f4575b81156103ca575b509038610355565b7f5b5e139f00000000000000000000000000000000000000000000000000000000915014386103c2565b7f80ac58cd00000000000000000000000000000000000000000000000000000000811491506103bb565b7f8446a79e000000000000000000000000000000000000000000000000000000008114925061034e565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361029657565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361029657565b60a4359073ffffffffffffffffffffffffffffffffffffffff8216820361029657565b604435906bffffffffffffffffffffffff8216820361029657565b60c435906bffffffffffffffffffffffff8216820361029657565b3461029657604060031936011261029657610500610448565b6024356bffffffffffffffffffffffff811681036102965761052991610524611cf0565b613ba5565b005b60005b83811061053e5750506000910152565b818101518382015260200161052e565b90601f19601f60209361056c8151809281875287808801910161052b565b0116010190565b90602061058492818152019061054e565b90565b3461029657600080600319360112610683576040519080600d546105aa81613259565b8085529160019180831690811561063b57506001146105e0575b61031d856105d481870382610efe565b60405191829182610573565b9250600d83527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb55b8284106106235750505081016020016105d48261031d6105c4565b80546020858701810191909152909301928101610608565b86955061031d969350602092506105d49491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b82010192936105c4565b80fd5b34610296576020600319360112610296576004356106a381612a31565b156106d6576000526006602052602073ffffffffffffffffffffffffffffffffffffffff60406000205416604051908152f35b60046040517fcf4700e4000000000000000000000000000000000000000000000000000000008152fd5b604060031936011261029657610714610448565b60243573ffffffffffffffffffffffffffffffffffffffff8061073683612992565b16908133036107b6575b600083815260066020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b81600052600760205260ff6107ef3360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166107405760046040517fcfb3b942000000000000000000000000000000000000000000000000000000008152fd5b346102965760006003193601126102965760206000546001549003604051908152f35b60031960609101126102965773ffffffffffffffffffffffffffffffffffffffff90600435828116810361029657916024359081168103610296579060443590565b61052961089036610842565b91612a73565b3461029657602060031936011261029657600435600052600a6020526020600160406000200154604051908152f35b346102965760406003193601126102965760043560005260096020526040600020604051906108f382610ec1565b549073ffffffffffffffffffffffffffffffffffffffff82169182825260a01c60208201529015610988575b61095f6127106109436bffffffffffffffffffffffff6020850151166024356123dd565b04915173ffffffffffffffffffffffffffffffffffffffff1690565b6040805173ffffffffffffffffffffffffffffffffffffffff9290921682526020820192909252f35b5061099161237b565b61091f565b3461029657604060031936011261029657600435610a3e6109b561046b565b73ffffffffffffffffffffffffffffffffffffffff610a36600094808652600a6020526109e86001604088200154611e94565b808652600a60205260ff610a1f85604089209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b541615610a4257600052600b602052604060002090565b9116906127ad565b5080f35b808652600a602052610a7784604088209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533838516827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8980a4600052600b602052604060002090565b3461029657604060031936011261029657610af261046b565b3373ffffffffffffffffffffffffffffffffffffffff821603610b1b5761052990600435612287565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b3461029657604060031936011261029657610bb8610448565b60243590610bc4611dea565b6000918254918115610cc357610bfa8173ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b680100000000000000018302815401905573ffffffffffffffffffffffffffffffffffffffff600191169181811460e11b4260a01b178317610c46856000526004602052604060002090565b55830192817fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91808588858180a4015b848103610cb45750505015610c8a57815580f35b60046040517f2e076300000000000000000000000000000000000000000000000000000000008152fd5b8083918588858180a401610c76565b60046040517fb562e8dd000000000000000000000000000000000000000000000000000000008152fd5b610529610cf936610842565b9060405192610d0784610ee2565b60008452612cf4565b3461029657602060031936011261029657610529600435613721565b3461029657606060031936011261029657610d4561046b565b610d4d6104b1565b90610d56611cf0565b610d726127106bffffffffffffffffffffffff84161115613b1a565b73ffffffffffffffffffffffffffffffffffffffff811615610e3457610dd161052992610dbc610da0610f21565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b6bffffffffffffffffffffffff166020830152565b610de76004356000526009602052604060002090565b815160209092015160a01b7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff821117610edd57604052565b610e92565b6020810190811067ffffffffffffffff821117610edd57604052565b90601f601f19910116810190811067ffffffffffffffff821117610edd57604052565b60405190610f2e82610ec1565b565b67ffffffffffffffff8111610edd57601f01601f191660200190565b929192610f5882610f30565b91610f666040519384610efe565b829481845281830111610296578281602093846000960137010152565b9080601f830112156102965781602061058493359101610f4c565b346102965760406003193601126102965767ffffffffffffffff60043581811161029657610fd0903690600401610f83565b9060243581811161029657610fe9903690600401610f83565b90610ff2611e3f565b8251908111610edd5761100f8161100a600d54613259565b6132ac565b602080601f83116001146110505750819061052994600092611045575b50506000198260011b9260031b1c191617600d55613470565b01519050388061102c565b600d6000529193601f1985167fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5936000905b8282106110c35750509160019391866105299794106110aa575b505050811b01600d55613470565b015160001960f88460031b161c1916905538808061109c565b80600186978294978701518155019601940190611082565b6020908160408183019282815285518094520193019160005b828110611102575050505090565b909192938260808261115c600194895162ffffff6060809273ffffffffffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565b019501939291016110f4565b346102965760206003193601126102965767ffffffffffffffff6004358181116102965736602382011215610296578060040135918211610296573660248360051b830101116102965761031d9160246111c29201613033565b604051918291826110db565b3461029657602060031936011261029657602073ffffffffffffffffffffffffffffffffffffffff611201600435612992565b16604051908152f35b3461029657602060031936011261029657602061122d611228610448565b612931565b604051908152f35b6020600319820112610296576004359067ffffffffffffffff82116102965761058491600401610f83565b346102965761126e36611235565b611276611e3f565b805167ffffffffffffffff8111610edd5761129b81611296600c54613259565b61331d565b602080601f83116001146112d8575081926000926112cd575b50506000198260011b9260031b1c191617600c55600080f35b0151905038806112b4565b90601f1983169361130b600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c790565b926000905b868210611347575050836001951061132e575b505050811b01600c55005b015160001960f88460031b161c19169055388080611323565b80600185968294968601518155019501930190611310565b6020908160408183019282815285518094520193019160005b828110611386575050505090565b835185529381019392810192600101611378565b34610296576020600319360112610296576113b3610448565b6000806113bf83612931565b916113c9836130c3565b936113d2612f19565b5073ffffffffffffffffffffffffffffffffffffffff90811691835b858503611403576040518061031d898261135f565b61140c81612f9d565b6040810151611465575173ffffffffffffffffffffffffffffffffffffffff1683811661145c575b506001908484841614611448575b016113ee565b80611456838801978a61301f565b52611442565b91506001611434565b50600190611442565b3461029657604060031936011261029657600435600052600b602052602073ffffffffffffffffffffffffffffffffffffffff6114b16024356040600020612777565b9190546040519260031b1c168152f35b3461029657604060031936011261029657602060ff6115156114e161046b565b600435600052600a845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b346102965761152f36611235565b611537611e3f565b805167ffffffffffffffff8111610edd5761155c81611557600f54613259565b61338e565b602080601f83116001146115995750819260009261158e575b50506000198260011b9260031b1c191617600f55600080f35b015190503880611575565b90601f198316936115cc600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290565b926000905b86821061160857505083600195106115ef575b505050811b01600f55005b015160001960f88460031b161c191690553880806115e4565b806001859682949686015181550195019301906115d1565b3461029657600080600319360112610683576040519080600e5461164381613259565b8085529160019180831690811561063b575060011461166c5761031d856105d481870382610efe565b9250600e83527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b8284106116af5750505081016020016105d48261031d6105c4565b80546020858701810191909152909301928101611694565b346102965760e0600319360112610296576116e0610448565b67ffffffffffffffff9060243582811161029657611702903690600401610f83565b6044358381116102965761171a903690600401610f83565b60643584811161029657611732903690600401610f83565b6084359485116102965761174d610529953690600401610f83565b9161175661048e565b9361175f6104cc565b95613952565b346102965760606003193601126102965761031d611791611784610448565b60443590602435906130f4565b6040519182918261135f565b3461029657600060031936011261029657602060405160008152f35b34610296576040600319360112610296576117d2610448565b602435908115158092036102965773ffffffffffffffffffffffffffffffffffffffff9033600052600760205261182d8160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff851617905560405192835216907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60806003193601126102965761189c610448565b6118a461046b565b6064359167ffffffffffffffff83116102965736602384011215610296576118d9610529933690602481600401359101610f4c565b9160443591612cf4565b34610296576020600319360112610296576080611901600435612f4f565b611953604051809262ffffff6060809273ffffffffffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565bf35b34610296576020806003193601126102965760043561197381612a31565b15611aa5576040519082826000600c5461198c81613259565b80845290600190818116908115611a655750600114611a06575b50506119b492500383610efe565b8151156119f35761031d926119e56119ce6105d493612ed0565b6119df604051958694850190611f76565b90611f76565b03601f198101835282610efe565b50505061031d611a016123f5565b6105d4565b90939150600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7936000915b818310611a4d5750879450508201016119b4386119a6565b85548884018501529485019487945091830191611a35565b90506119b49593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b8201018592386119a6565b60046040517fa14c4b50000000000000000000000000000000000000000000000000000000008152fd5b3461029657602060031936011261029657600435600052600b6020526020604060002054604051908152f35b3461029657604060031936011261029657610529600435611b1a61046b565b9080600052600a602052611b35600160406000200154611e94565b612287565b67ffffffffffffffff8111610edd5760051b60200190565b34610296576020806003193601126102965760043567ffffffffffffffff8111610296573660238201121561029657806004013590611b9082611b3a565b91611b9e6040519384610efe565b80835260248484019160051b8301019136831161029657602401905b828210611bca576105298461391c565b81358152908401908401611bba565b3461029657600080600319360112610683576040519080600f54611bfc81613259565b8085529160019180831690811561063b5750600114611c255761031d856105d481870382610efe565b9250600f83527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8025b828410611c685750505081016020016105d48261031d6105c4565b80546020858701810191909152909301928101611c4d565b3461029657604060031936011261029657602060ff611515611ca0610448565b73ffffffffffffffffffffffffffffffffffffffff611cbd61046b565b91166000526007845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b3360009081527f4a209273c9c71eac8bee506e444418998f8f452896d49b4edfa61f22f2a2bd27602052604090205460ff1615611d2957565b611de66048611db4611d3a33612503565b6119e5611d456125a0565b6040519485937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006020860152611d8581518092602060378901910161052b565b84017f206973206d697373696e6720726f6c652000000000000000000000000000000060378201520190611f76565b6040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260048301610573565b0390fd5b3360009081527faa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaae602052604090205460ff1615611e2357565b611de66048611db4611e3433612503565b6119e5611d4561263d565b3360009081527f2de00acba1f3dd4b00004fa31871eaf6bd23564af8ed1bbe52ac31593862e4a2602052604090205460ff1615611e7857565b611de66048611db4611e8933612503565b6119e5611d456126da565b80600052600a60205260ff611ecd3360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b541615611ed75750565b611ee033612503565b611ee8612408565b916030611ef484612463565b536078611f0084612470565b5360415b60018111611f2357611de66048611db4856119e588611d45881561249e565b90600f8116906010821015611f71577f3031323334353637383961626364656600000000000000000000000000000000611f6c921a611f628487612480565b5360041c91612491565b611f04565b612434565b90611f896020928281519485920161052b565b0190565b73ffffffffffffffffffffffffffffffffffffffff81811660009081527f13da86008ba1c6922daee3e07db95305ef49ebced9f5467a0b8613fcc6b343e3602052604080822054611ff59493929060ff1615611ff8575b808052600b602052209116906127ad565b50565b808052600a60205261202c848383209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533838516827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4611fe4565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527f2de00acba1f3dd4b00004fa31871eaf6bd23564af8ed1bbe52ac31593862e4a26020526040808220611ff5949392907fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59060ff905b54161561210e575b8152600b602052209116906127ad565b808252600a602052612142858484209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533848616827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8580a46120fe565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527f4a209273c9c71eac8bee506e444418998f8f452896d49b4edfa61f22f2a2bd276020526040808220611ff5949392907f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119060ff906120f6565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527faa1d7351356c4ddc11907b1ee0660f579cfdf507235af2ae01ecd22a4b7ceaae6020526040808220611ff5949392907f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69060ff906120f6565b9073ffffffffffffffffffffffffffffffffffffffff6040611ff593600090808252600a60205260ff6122dc868585209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166122f3575b8152600b6020522091169061287c565b808252600a602052612327858484209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905533848616827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a46122e3565b6040519061238882610ec1565b60085473ffffffffffffffffffffffffffffffffffffffff8116835260a01c6020830152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818102929181159184041417156123f057565b6123ae565b6040519061240282610ee2565b60008252565b604051906080820182811067ffffffffffffffff821117610edd57604052604282526060366020840137565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805115611f715760200190565b805160011015611f715760210190565b908151811015611f71570160200190565b80156123f0576000190190565b156124a557565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b604051906060820182811067ffffffffffffffff821117610edd57604052602a82526040366020840137603061253883612463565b53607861254483612470565b536029905b6001821161255c5761058491501561249e565b600f8116906010821015611f71577f303132333435363738396162636465660000000000000000000000000000000061259a921a611f628486612480565b90612549565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0116125c9612408565b9060306125d583612463565b5360786125e183612470565b536041905b600182116125f95761058491501561249e565b600f8116906010821015611f71577f3031323334353637383961626364656600000000000000000000000000000000612637921a611f628486612480565b906125e6565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6612666612408565b90603061267283612463565b53607861267e83612470565b536041905b600182116126965761058491501561249e565b600f8116906010821015611f71577f30313233343536373839616263646566000000000000000000000000000000006126d4921a611f628486612480565b90612683565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a5612703612408565b90603061270f83612463565b53607861271b83612470565b536041905b600182116127335761058491501561249e565b600f8116906010821015611f71577f3031323334353637383961626364656600000000000000000000000000000000612771921a611f628486612480565b90612720565b8054821015611f715760005260206000200190600090565b916127a9918354906000199060031b92831b921b19161790565b9055565b600181019082600052816020526040600020541560001461281b57805468010000000000000000811015610edd576128066127ef826001879401855584612777565b81939154906000199060031b92831b921b19161790565b90555491600052602052604060002055600190565b505050600090565b805490811561284d576000198092019161283d8383612777565b909182549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60018101918060005282602052604060002054928315156000146129285760001992838501908582116123f05780549485019485116123f05760009585836128d0946128df98036128e5575b505050612823565b90600052602052604060002090565b55600190565b61290f612909916128f961291f9487612777565b90549060031b1c92839187612777565b9061278f565b8590600052602052604060002090565b553880806128c8565b50505050600090565b73ffffffffffffffffffffffffffffffffffffffff16801561296857600052600560205267ffffffffffffffff6040600020541690565b60046040517f8f4eb604000000000000000000000000000000000000000000000000000000008152fd5b600081815481106129c8575b60046040517fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b815260049060209180835260409283832054947c0100000000000000000000000000000000000000000000000000000000861615612a085750505061299e565b93929190935b8515612a1c57505050505090565b60001901808352818552838320549550612a0e565b60005481109081612a40575090565b905060005260046020527c0100000000000000000000000000000000000000000000000000000000604060002054161590565b90612a7d83612992565b73ffffffffffffffffffffffffffffffffffffffff808416928382841603612cca57600086815260066020526040902080549092612adb73ffffffffffffffffffffffffffffffffffffffff881633908114908414171590565b1590565b612c3b575b8216958615612c1157612b4b93612b1d92612c07575b5073ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b805460001901905573ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b805460010190557c0200000000000000000000000000000000000000000000000000000000804260a01b851717612b8c866000526004602052604060002090565b55811615612bbd575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a4565b60018401612bd5816000526004602052604060002090565b5415612be2575b50612b95565b6000548114612bdc57612bff906000526004602052604060002090565b553880612bdc565b6000905538612af6565b60046040517fea553b34000000000000000000000000000000000000000000000000000000008152fd5b612c9b612ad7612c9433612c6f8b73ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460ff1690565b15612ae05760046040517f59c896be000000000000000000000000000000000000000000000000000000008152fd5b60046040517fa1148100000000000000000000000000000000000000000000000000000000008152fd5b929190612d02828286612a73565b803b612d0f575b50505050565b612d1893612dd1565b15612d265738808080612d09565b60046040517fd1a57ed6000000000000000000000000000000000000000000000000000000008152fd5b9081602091031261029657516105848161026c565b9092610584949360809373ffffffffffffffffffffffffffffffffffffffff80921684521660208301526040820152816060820152019061054e565b3d15612dcc573d90612db282610f30565b91612dc06040519384610efe565b82523d6000602084013e565b606090565b92602091612e2893600073ffffffffffffffffffffffffffffffffffffffff6040518097819682957f150b7a02000000000000000000000000000000000000000000000000000000009b8c85523360048601612d65565b0393165af160009181612ea0575b50612e7a57612e43612da1565b80519081612e755760046040517fd1a57ed6000000000000000000000000000000000000000000000000000000008152fd5b602001fd5b7fffffffff00000000000000000000000000000000000000000000000000000000161490565b612ec291925060203d8111612ec9575b612eba8183610efe565b810190612d50565b9038612e36565b503d612eb0565b9060405160a08101604052600019608082019360008552935b0192600a90818106603001855304928315612f075760001990612ee9565b9250608083601f199203019201918252565b604051906080820182811067ffffffffffffffff821117610edd5760405260006060838281528260208201528260408201520152565b612f57612f19565b50612f60612f19565b600054821015612f985750612f7481612f9d565b6040810151612f985750612f9361058491612f8d612f19565b50612992565b612fb8565b905090565b612fa5612f19565b5060005260046020526105846040600020545b90612fc1612f19565b9173ffffffffffffffffffffffffffffffffffffffff8116835267ffffffffffffffff8160a01c1660208401527c010000000000000000000000000000000000000000000000000000000081161515604084015260e81c6060830152565b8051821015611f715760209160051b010190565b61303c82611b3a565b9161304a6040519384610efe565b808352601f1961305982611b3a565b0160005b8181106130ac57505060005b8181036130765750505090565b81811015611f71578061309060019260051b850135612f4f565b61309a828761301f565b526130a5818661301f565b5001613069565b6020906130b7612f19565b8282880101520161305d565b906130cd82611b3a565b6130da6040519182610efe565b828152601f196130ea8294611b3a565b0190602036910137565b908281101561322f576000918254808511613227575b5061311481612931565b8483101561322057828503818110613218575b505b613132816130c3565b9581156132105761314284612f4f565b918594604093613157612ad786830151151590565b6131f1575b505b87811415806131e7575b156131da5761317681612f9d565b808501516131d1575173ffffffffffffffffffffffffffffffffffffffff908116806131c8575b5090816001928716908816146131b4575b0161315e565b806131c2838a01998c61301f565b526131ae565b9650600161319d565b506001906131ae565b5050959450505050815290565b5081871415613168565b5173ffffffffffffffffffffffffffffffffffffffff1695503861315c565b945050505050565b905038613127565b5082613129565b93503861310a565b60046040517f32c1995a000000000000000000000000000000000000000000000000000000008152fd5b90600182811c921680156132a2575b602083101461327357565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691613268565b601f81116132b8575050565b600090600d82527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c83019410613313575b601f0160051c01915b82811061330857505050565b8181556001016132fc565b90925082906132f3565b601f8111613329575050565b600090600c82527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c7906020601f850160051c83019410613384575b601f0160051c01915b82811061337957505050565b81815560010161336d565b9092508290613364565b601f811161339a575050565b600090600f82527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802906020601f850160051c830194106133f5575b601f0160051c01915b8281106133ea57505050565b8181556001016133de565b90925082906133d5565b601f811161340b575050565b600090600e82527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd906020601f850160051c83019410613466575b601f0160051c01915b82811061345b57505050565b81815560010161344f565b9092508290613446565b90815167ffffffffffffffff8111610edd5761349681613491600e54613259565b6133ff565b602080601f83116001146134d157508192936000926134c6575b50506000198260011b9260031b1c191617600e55565b0151905038806134b0565b90601f19831694613504600e6000527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd90565b926000905b878210613541575050836001959610613528575b505050811b01600e55565b015160001960f88460031b161c1916905538808061351d565b80600185968294968601518155019501930190613509565b90815167ffffffffffffffff8111610edd5761357a81611296600c54613259565b602080601f83116001146135b557508192936000926135aa575b50506000198260011b9260031b1c191617600c55565b015190503880613594565b90601f198316946135e8600c6000527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c790565b926000905b87821061362557505083600195961061360c575b505050811b01600c55565b015160001960f88460031b161c19169055388080613601565b806001859682949686015181550195019301906135ed565b90815167ffffffffffffffff8111610edd5761365e81611557600f54613259565b602080601f8311600114613699575081929360009261368e575b50506000198260011b9260031b1c191617600f55565b015190503880613678565b90601f198316946136cc600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290565b926000905b8782106137095750508360019596106136f0575b505050811b01600f55565b015160001960f88460031b161c191690553880806136e5565b806001859682949686015181550195019301906136d1565b61372a81612992565b73ffffffffffffffffffffffffffffffffffffffff8116613758836000526006602052604060002090815490565b929061378073ffffffffffffffffffffffffffffffffffffffff841633908114908614171590565b6138b9575b6000936138b0575b506137b88273ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6fffffffffffffffffffffffffffffffff81540190557c03000000000000000000000000000000000000000000000000000000004260a01b831717613807856000526004602052604060002090565b557c0200000000000000000000000000000000000000000000000000000000811615613867575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a4610f2e61386260015460010190565b600155565b6001840161387f816000526004602052604060002090565b541561388c575b5061382e565b83548114613886576138a8906000526004602052604060002090565b553880613886565b8390553861378d565b6138ed612ad7612c9433612c6f8773ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b156137855760046040517f59c896be000000000000000000000000000000000000000000000000000000008152fd5b80519060005b82811061392e57505050565b61394161393b828461301f565b51613721565b60001981146123f057600101613922565b95949392919073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163314801590613b0e575b613ae45780519067ffffffffffffffff8211610edd576139be8261100a600d54613259565b60209081601f8411600114613a61575093613a07613a119484613a319b9a9895613a0c95613a2c9b996000926110455750506000198260011b9260031b1c191617600d55613470565b613559565b61363d565b613a1a84611f8d565b613a2384612083565b61052484612199565b612210565b610f2e60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006010541617601055565b600d6000529190601f1984167fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5936000905b828210613acc57505094600185613a0c95613a2c9b9995613a0795613a319f9e9c99613a119b106110aa57505050811b01600d55613470565b80600186978294978701518155019601940190613a93565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff60105416613999565b15613b2157565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff831691613bd8612710841115613b1a565b16918215613c1f577fffffffffffffffffffffffff0000000000000000000000000000000000000000916020604051613c1081610ec1565b858152015260a01b1617600855565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b613c8681613d6c565b908115613cd4575b8115613ca9575b8115613c9f575090565b6105849150613ce5565b7fffffffff000000000000000000000000000000000000000000000000000000008116159150613c95565b9050613cdf81613ce5565b90613c8e565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f5a05180f000000000000000000000000000000000000000000000000000000008214918215613d3857505090565b7f7965db0b000000000000000000000000000000000000000000000000000000001491508115613d66575090565b61058491505b7fffffffff00000000000000000000000000000000000000000000000000000000167f2a55205a000000000000000000000000000000000000000000000000000000008114908115613dbc575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea2646970667358221220db08cb5098b122879373fc1576cbeb220975504b788e70cccc47bb354eabcf5764736f6c63430008130033', + '60806040523461002f576100196100146100fa565b610169565b610021610034565b612762610397823961276290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b6101186177378038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b61419c810181811060018060401b038211176101c5576101a1829161419c612af9843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa2616c9585396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b6105ab565b61001e60003561008d565b80630defbce9146100885780631bce45831461008357806359659e901461007e578063715018a6146100795780638bdb5fd2146100745780638da5cb5b1461006f5763f2fde38b0361000e57610578565b610543565b610501565b6104ce565b610499565b6103b7565b610350565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b90610117906100ed565b810190811067ffffffffffffffff82111761013157604052565b6100f7565b90610149610142610093565b928361010d565b565b67ffffffffffffffff8111610169576101656020916100ed565b0190565b6100f7565b90826000939282370152565b9092919261018f61018a8261014b565b610136565b938185526020850190828401116101ab576101a99261016e565b565b6100e8565b9080601f830112156101ce578160206101cb9335910161017a565b90565b6100e3565b6bffffffffffffffffffffffff1690565b6101ed816101d3565b036101f457565b600080fd5b90503590610206826101e4565b565b90565b61021481610208565b0361021b57565b600080fd5b9050359061022d8261020b565b565b610140818303126103285761024782600083016100d4565b9261025583602084016100d4565b92604083013567ffffffffffffffff811161032357816102769185016101b0565b92606081013567ffffffffffffffff811161031e57826102979183016101b0565b92608082013567ffffffffffffffff811161031957836102b89184016101b0565b9260a083013567ffffffffffffffff811161031457816102d99185016101b0565b926102e78260c083016100d4565b926103116102f88460e085016101f9565b936103078161010086016100d4565b9361012001610220565b90565b6100a3565b6100a3565b6100a3565b6100a3565b61009e565b610336906100b3565b9052565b919061034e9060006020850194019061032d565b565b3461038d5761038961037861036636600461022f565b98979097969196959295949394610756565b610380610093565b9182918261033a565b0390f35b610099565b906020828203126103ac576103a9916000016100d4565b90565b61009e565b60000190565b346103e5576103cf6103ca366004610392565b61096f565b6103d7610093565b806103e1816103b1565b0390f35b610099565b60009103126103f557565b61009e565b1c90565b60018060a01b031690565b61041990600861041e93026103fa565b6103fe565b90565b9061042c9154610409565b90565b61043c6001600090610421565b90565b90565b61045661045161045b926100a8565b61043f565b6100a8565b90565b61046790610442565b90565b6104739061045e565b90565b61047f9061046a565b9052565b919061049790600060208501940190610476565b565b346104c9576104a93660046103ea565b6104c56104b461042f565b6104bc610093565b91829182610483565b0390f35b610099565b346104fc576104de3660046103ea565b6104e66109cb565b6104ee610093565b806104f8816103b1565b0390f35b610099565b3461053e5761053a61052961051736600461022f565b989790979691969592959493946109d5565b610531610093565b9182918261033a565b0390f35b610099565b34610573576105533660046103ea565b61056f61055e610a6e565b610566610093565b9182918261033a565b0390f35b610099565b346105a65761059061058b366004610392565b610b72565b610598610093565b806105a2816103b1565b0390f35b610099565b600080fd5b600090565b5190565b60209181520190565b60005b8381106105d6575050906000910152565b8060209183015181850152016105c5565b61060661060f602093610614936105fd816105b5565b938480936105b9565b958691016105c2565b6100ed565b0190565b610621906101d3565b9052565b61062e90610208565b9052565b946106a56106b0916106976106c4976106896101009b9f9e9c969861067a6106cb9f9a6106ba9a8e61066d610120820193600083019061032d565b60208184039101526105e7565b908c60408184039101526105e7565b908a820360608c01526105e7565b9088820360808a01526105e7565b9a60a087019061032d565b60c0850190610618565b60e083019061032d565b0190610625565b565b60200190565b5190565b906106e96106e48361014b565b610136565b918252565b6106f860006106d7565b90565b6107036106ee565b90565b61070f90610442565b90565b61071b90610706565b90565b6107279061045e565b90565b600080fd5b60e01b90565b600091031261074057565b61009e565b61074d610093565b3d6000823e3d90fd5b6107c990846107a7856107988c8e9f809c9a9f9d9b98999d6107766105b0565b508a9496928d8d8c90919293949561078c610093565b9a8b9960208b01610632565b6020820181038252038261010d565b6107b96107b3826106d3565b916106cd565b20906107c36106fb565b91610cf6565b986107db6107d68b610712565b61071e565b95634c62cd9b93979992949598919091873b1561089d57600099610813978b9761081e96610807610093565b9e8f9d8e9c8d9b61072f565b8b5260048b01610632565b03925af180156108985761086b575b50806108657fd8ad75647a93de9d8d617559d87f1c27bc23fb6237b94054baf34aafbe85ad039161085c610093565b9182918261033a565b0390a190565b61088b9060003d8111610891575b610883818361010d565b810190610735565b3861082d565b503d610879565b610745565b61072a565b6108b3906108ae610eb8565b6108dc565b565b60001c90565b6108c76108cc916108b5565b6103fe565b90565b6108d990546108bb565b90565b6108ee6108e960016108cf565b61046a565b90633659cfe690823b1561096a576109269261091b6000809461090f610093565b9687958694859361072f565b83526004830161033a565b03925af1801561096557610938575b50565b6109589060003d811161095e575b610950818361010d565b810190610735565b38610935565b503d610946565b610745565b61072a565b610978906108a2565b565b610982610eb8565b61098a6109b7565b565b90565b6109a361099e6109a89261098c565b61043f565b6100a8565b90565b6109b49061098f565b90565b6109c96109c460006109ab565b610f34565b565b6109d361097a565b565b979096610a1d96610a3f9a9396610a0e9695996109f06105b0565b50979995909192939495610a02610093565b9a8b9960208b01610632565b6020820181038252038261010d565b610a2f610a29826106d3565b916106cd565b2090610a396106fb565b91610f95565b90565b60018060a01b031690565b610a59610a5e916108b5565b610a42565b90565b610a6b9054610a4d565b90565b610a766105b0565b50610a816000610a61565b90565b610a9590610a90610eb8565b610b41565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610af260266040926105b9565b610afb81610a97565b0190565b610b159060208101906000818303910152610ae5565b90565b15610b1f57565b610b27610093565b62461bcd60e51b815280610b3d60048201610aff565b0390fd5b610b7090610b6b81610b64610b5e610b5960006109ab565b6100b3565b916100b3565b1415610b18565b610f34565b565b610b7b90610a84565b565b90565b610b8c610b9191610208565b610b7d565b9052565b60601b90565b610ba490610b95565b90565b610bb090610b9b565b90565b610bbf610bc4916100b3565b610ba7565b9052565b905090565b610bf2610be992602092610be0816106d3565b94858093610bc8565b938491016105c2565b0190565b60148093610c1a602084610c12610c2296610c299b9a98610b80565b018092610bb3565b018092610bb3565b0190610bcd565b90565b90565b610c43610c3e610c489261098c565b61043f565b610c2c565b90565b610c5490610442565b90565b610c6090610c4b565b90565b610c6c90610442565b90565b610c7890610c63565b90565b610c849061045e565b90565b60209181520190565b610caf610cb8602093610cbd93610ca6816106d3565b93848093610c87565b958691016105c2565b6100ed565b0190565b610ce6610cf3949293610cdc6060840195600085019061032d565b602083019061032d565b6040818403910152610c90565b90565b610d869093929193610d066105b0565b50610d468591610d37610d21610d1c60016108cf565b61046a565b8690610d2b610093565b95869460208601610bf6565b6020820181038252038261010d565b610d58610d52826106d3565b916106cd565b2061148a610d6860208201610136565b908082526112a36020830139610d816000929192610c2f565b6111c2565b92610da0610d9b610d9686610c57565b610c6f565b610c7b565b63cf7a1d779190610db9610db460016108cf565b61046a565b9392813b15610e30576000610de191610dec8296610dd5610093565b9889978896879561072f565b855260048501610cc1565b03925af18015610e2b57610dfe575b50565b610e1e9060003d8111610e24575b610e16818361010d565b810190610735565b38610dfb565b503d610e0c565b610745565b61072a565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610e69602080926105b9565b610e7281610e35565b0190565b610e8c9060208101906000818303910152610e5d565b90565b15610e9657565b610e9e610093565b62461bcd60e51b815280610eb460048201610e76565b0390fd5b610ee2610ec3610a6e565b610edc610ed6610ed161124b565b6100b3565b916100b3565b14610e8f565b565b60001b90565b90610efb60018060a01b0391610ee4565b9181191691161790565b610f0e9061045e565b90565b90565b90610f29610f24610f3092610f05565b610f11565b8254610eea565b9055565b610f3e6000610a61565b610f49826000610f14565b90610f7d610f777f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610f05565b91610f05565b91610f86610093565b80610f90816103b1565b0390a3565b6110289291610fd2610fe192610fa96105b0565b509193610fbe610fb960016108cf565b61046a565b610fc6610093565b95869460208601610bf6565b6020820181038252038261010d565b610ff3610fed826106d3565b916106cd565b2061148a61100360208201610136565b908082526112a3602083013961102161101b826106d3565b916106cd565b2090611258565b90565b6110349061045e565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b61106c601d6020926105b9565b61107581611037565b0190565b61108f906020810190600081830391015261105f565b90565b1561109957565b6110a1610093565b62461bcd60e51b8152806110b760048201611079565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110ef602080926105b9565b6110f8816110bb565b0190565b61111290602081019060008183039101526110e3565b90565b1561111c57565b611124610093565b62461bcd60e51b81528061113a600482016110fc565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61117360196020926105b9565b61117c8161113e565b0190565b6111969060208101906000818303910152611166565b90565b156111a057565b6111a8610093565b62461bcd60e51b8152806111be60048201611180565b0390fd5b9190916111cd6105b0565b506111f46111da3061102b565b316111ed6111e784610c2c565b91610c2c565b1015611092565b61121a611200836106d3565b61121361120d6000610c2f565b91610c2c565b1415611115565b60208251920190f5906112498261124261123c61123760006109ab565b6100b3565b916100b3565b1415611199565b565b6112536105b0565b503390565b90611276916112656105b0565b50906112703061102b565b91611279565b90565b90605592600b926112886105b0565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a26469706673582212203b72369d1d46611771220d986b45a922fa914be16aa4d3dbc40e20507531653264736f6c634300081b003360a060405234602b57600e603a565b6014602f565b61415b610041823960805181611ef7015261415b90f35b6035565b60405190565b600080fd5b3360805256fe60806040526004361015610013575b61134c565b61001e60003561026d565b806301ffc9a71461026857806304634d8d1461026357806306fdde031461025e578063081812fc14610259578063095ea7b3146102545780630bb310de1461024f57806318160ddd1461024a57806323b872dd14610245578063248a9ca3146102405780632a55205a1461023b5780632e73e0fd146102365780632f2ff15d1461023157806336568abe1461022c57806340c10f191461022757806342842e0e1461022257806342966c681461021d5780634c62cd9b146102185780635944c753146102135780635a4462151461020e5780636352211e1461020957806370a08231146102045780637e518ec8146101ff5780639010d07c146101fa57806391d14854146101f5578063938e3d7b146101f057806395d89b41146101eb5780639d043a66146101e6578063a217fddf146101e1578063a22cb465146101dc578063b88d4fde146101d7578063c87b56dd146101d2578063ca15c873146101cd578063d547741f146101c8578063dc8e92ea146101c3578063e8a3d485146101be578063e985e9c5146101b95763ed4c2ac70361000e57611319565b6112e3565b611280565b61124d565b61114c565b611117565b6110e2565b6110b5565b610fd7565b610f50565b610edd565b610e13565b610de0565b610daa565b610d74565b610d13565b610ca8565b610c73565b610c3f565b610bad565b610b35565b61092b565b610901565b6108cd565b610899565b610865565b610803565b6107cc565b610745565b6106b2565b610642565b6105ec565b6105a3565b610540565b6104a2565b6103d8565b6102ff565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b61029d81610288565b036102a457565b600080fd5b905035906102b682610294565b565b906020828203126102d2576102cf916000016102a9565b90565b61027e565b151590565b6102e5906102d7565b9052565b91906102fd906000602085019401906102dc565b565b3461032f5761032b61031a6103153660046102b8565b611356565b610322610273565b918291826102e9565b0390f35b610279565b60018060a01b031690565b61034890610334565b90565b6103548161033f565b0361035b57565b600080fd5b9050359061036d8261034b565b565b6bffffffffffffffffffffffff1690565b6103898161036f565b0361039057565b600080fd5b905035906103a282610380565b565b91906040838203126103cd57806103c16103ca9260008601610360565b93602001610395565b90565b61027e565b60000190565b34610407576103f16103eb3660046103a4565b906113e2565b6103f9610273565b80610403816103d2565b0390f35b610279565b600091031261041757565b61027e565b5190565b60209181520190565b60005b83811061043d575050906000910152565b80602091830151818501520161042c565b601f801991011690565b6104776104806020936104859361046e8161041c565b93848093610420565b95869101610429565b61044e565b0190565b61049f9160208201916000818403910152610458565b90565b346104d2576104b236600461040c565b6104ce6104bd611511565b6104c5610273565b91829182610489565b0390f35b610279565b90565b6104e3816104d7565b036104ea57565b600080fd5b905035906104fc826104da565b565b9060208282031261051857610515916000016104ef565b90565b61027e565b6105269061033f565b9052565b919061053e9060006020850194019061051d565b565b346105705761056c61055b6105563660046104fe565b61152c565b610563610273565b9182918261052a565b0390f35b610279565b919060408382031261059e578061059261059b9260008601610360565b936020016104ef565b90565b61027e565b6105b76105b1366004610575565b9061156f565b6105bf610273565b806105c9816103d2565b0390f35b906020828203126105e7576105e491600001610360565b90565b61027e565b3461061a576106046105ff3660046105cd565b611653565b61060c610273565b80610616816103d2565b0390f35b610279565b610628906104d7565b9052565b91906106409060006020850194019061061f565b565b346106725761065236600461040c565b61066e61065d61168d565b610665610273565b9182918261062c565b0390f35b610279565b90916060828403126106ad576106aa6106938460008501610360565b936106a18160208601610360565b936040016104ef565b90565b61027e565b6106c66106c0366004610677565b916116a3565b6106ce610273565b806106d8816103d2565b0390f35b90565b6106e8816106dc565b036106ef57565b600080fd5b90503590610701826106df565b565b9060208282031261071d5761071a916000016106f4565b90565b61027e565b61072b906106dc565b9052565b919061074390600060208501940190610722565b565b346107755761077161076061075b366004610703565b6117ed565b610768610273565b9182918261072f565b0390f35b610279565b91906040838203126107a357806107976107a092600086016104ef565b936020016104ef565b90565b61027e565b9160206107ca9294936107c36040820196600083019061051d565b019061061f565b565b346107fe576107e56107df36600461077a565b906119f6565b906107fa6107f1610273565b928392836107a8565b0390f35b610279565b346108325761081c610816366004610575565b90611c60565b610824610273565b8061082e816103d2565b0390f35b610279565b9190604083820312610860578061085461085d92600086016106f4565b93602001610360565b90565b61027e565b346108945761087e610878366004610837565b90611c95565b610886610273565b80610890816103d2565b0390f35b610279565b346108c8576108b26108ac366004610837565b90611d4b565b6108ba610273565b806108c4816103d2565b0390f35b610279565b346108fc576108e66108e0366004610575565b90611df7565b6108ee610273565b806108f8816103d2565b0390f35b610279565b61091561090f366004610677565b91611e32565b61091d610273565b80610927816103d2565b0390f35b346109595761094361093e3660046104fe565b611e6d565b61094b610273565b80610955816103d2565b0390f35b610279565b600080fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b906109889061044e565b810190811067ffffffffffffffff8211176109a257604052565b610968565b906109ba6109b3610273565b928361097e565b565b67ffffffffffffffff81116109da576109d660209161044e565b0190565b610968565b90826000939282370152565b90929192610a006109fb826109bc565b6109a7565b93818552602085019082840111610a1c57610a1a926109df565b565b610963565b9080601f83011215610a3f57816020610a3c933591016109eb565b90565b61095e565b909161012082840312610b3057610a5e8360008401610360565b92602083013567ffffffffffffffff8111610b2b5781610a7f918501610a21565b92604081013567ffffffffffffffff8111610b265782610aa0918301610a21565b92606082013567ffffffffffffffff8111610b215783610ac1918401610a21565b92608083013567ffffffffffffffff8111610b1c5781610ae2918501610a21565b92610af08260a08301610360565b92610b19610b018460c08501610395565b93610b0f8160e08601610360565b93610100016106f4565b90565b610283565b610283565b610283565b610283565b61027e565b34610b6d57610b57610b48366004610a44565b97969096959195949294611ee5565b610b5f610273565b80610b69816103d2565b0390f35b610279565b9091606082840312610ba857610ba5610b8e84600085016104ef565b93610b9c8160208601610360565b93604001610395565b90565b61027e565b34610bdc57610bc6610bc0366004610b72565b91611fc0565b610bce610273565b80610bd8816103d2565b0390f35b610279565b919091604081840312610c3a57600081013567ffffffffffffffff8111610c355783610c0e918301610a21565b92602082013567ffffffffffffffff8111610c3057610c2d9201610a21565b90565b610283565b610283565b61027e565b34610c6e57610c58610c52366004610be1565b9061220f565b610c60610273565b80610c6a816103d2565b0390f35b610279565b34610ca357610c9f610c8e610c893660046104fe565b61221b565b610c96610273565b9182918261052a565b0390f35b610279565b34610cd857610cd4610cc3610cbe3660046105cd565b612244565b610ccb610273565b9182918261062c565b0390f35b610279565b90602082820312610d0e57600082013567ffffffffffffffff8111610d0957610d069201610a21565b90565b610283565b61027e565b34610d4157610d2b610d26366004610cdd565b6122aa565b610d33610273565b80610d3d816103d2565b0390f35b610279565b9190604083820312610d6f5780610d63610d6c92600086016106f4565b936020016104ef565b90565b61027e565b34610da557610da1610d90610d8a366004610d46565b906122d0565b610d98610273565b9182918261052a565b0390f35b610279565b34610ddb57610dd7610dc6610dc0366004610837565b90612328565b610dce610273565b918291826102e9565b0390f35b610279565b34610e0e57610df8610df3366004610cdd565b61237b565b610e00610273565b80610e0a816103d2565b0390f35b610279565b34610e4357610e2336600461040c565b610e3f610e2e612386565b610e36610273565b91829182610489565b0390f35b610279565b600080fd5b908160c0910312610e5b5790565b610e48565b908160e0910312610e6e5790565b610e48565b91606083830312610ed857610e8b8260008501610360565b92602081013567ffffffffffffffff8111610ed35783610eac918301610e4d565b92604082013567ffffffffffffffff8111610ece57610ecb9201610e60565b90565b610283565b610283565b61027e565b34610f0e57610f0a610ef9610ef3366004610e73565b916126ef565b610f01610273565b9182918261072f565b0390f35b610279565b90565b60001b90565b610f30610f2b610f3592610f13565b610f16565b6106dc565b90565b610f426000610f1c565b90565b610f4d610f38565b90565b34610f8057610f6036600461040c565b610f7c610f6b610f45565b610f73610273565b9182918261072f565b0390f35b610279565b610f8e816102d7565b03610f9557565b600080fd5b90503590610fa782610f85565b565b9190604083820312610fd25780610fc6610fcf9260008601610360565b93602001610f9a565b90565b61027e565b3461100657610ff0610fea366004610fa9565b90612790565b610ff8610273565b80611002816103d2565b0390f35b610279565b600080fd5b600080fd5b909182601f8301121561104f5781359167ffffffffffffffff831161104a57602001926001830284011161104557565b611010565b61100b565b61095e565b906080828203126110b05761106c8160008401610360565b9261107a8260208501610360565b9261108883604083016104ef565b92606082013567ffffffffffffffff81116110ab576110a79201611015565b9091565b610283565b61027e565b6110cc6110c3366004611054565b93929092612847565b6110d4610273565b806110de816103d2565b0390f35b346111125761110e6110fd6110f83660046104fe565b6128a7565b611105610273565b91829182610489565b0390f35b610279565b346111475761114361113261112d366004610703565b612940565b61113a610273565b9182918261062c565b0390f35b610279565b3461117b5761116561115f366004610837565b90612990565b61116d610273565b80611177816103d2565b0390f35b610279565b67ffffffffffffffff81116111985760208091020190565b610968565b909291926111b26111ad82611180565b6109a7565b93818552602080860192028301928184116111ef57915b8383106111d65750505050565b602080916111e484866104ef565b8152019201916111c9565b611010565b9080601f830112156112125781602061120f9335910161119d565b90565b61095e565b9060208282031261124857600082013567ffffffffffffffff81116112435761124092016111f4565b90565b610283565b61027e565b3461127b57611265611260366004611217565b6129e3565b61126d610273565b80611277816103d2565b0390f35b610279565b346112b05761129036600461040c565b6112ac61129b612a43565b6112a3610273565b91829182610489565b0390f35b610279565b91906040838203126112de57806112d26112db9260008601610360565b93602001610360565b90565b61027e565b34611314576113106112ff6112f93660046112b5565b90612a59565b611307610273565b918291826102e9565b0390f35b610279565b346113475761133161132c366004610703565b612ad2565b611339610273565b80611343816103d2565b0390f35b610279565b600080fd5b600090565b61135e611351565b506376a4e23960e01b61137961137383610288565b91610288565b14908115611386575b5090565b6113909150612add565b38611382565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b906113d4916113cf6113ca611396565b612b21565b6113d6565b565b906113e091612d3b565b565b906113ec916113ba565b565b606090565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015611429575b602083101461142457565b6113f3565b91607f1691611419565b60209181520190565b600052602060002090565b906000929180549061146261145b83611409565b8094611433565b916001811690816000146114bb575060011461147e575b505050565b61148b919293945061143c565b916000925b8184106114a35750500190388080611479565b60018160209295939554848601520191019290611490565b92949550505060ff1916825215156020020190388080611479565b906114e091611447565b90565b906115036114fc926114f3610273565b938480926114d6565b038361097e565b565b61150e906114e3565b90565b6115196113ee565b506115246007611505565b90565b600090565b611534611527565b5080600052673ec412a9852d173d60c11b601c526020600020810101805460601b15611561576001015490565b63ceea21b66000526004601cfd5b61157c9133919091612db5565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b6115bb906115b66115b161157e565b612b21565b61163e565b565b90565b6115d46115cf6115d992610334565b6115bd565b610334565b90565b6115e5906115c0565b90565b6115f1906115dc565b90565b9061160560018060a01b0391610f16565b9181191691161790565b611618906115dc565b90565b90565b9061163361162e61163a9261160f565b61161b565b82546115f4565b9055565b61164a611651916115e8565b600461161e565b565b61165c906115a2565b565b600090565b60001c90565b90565b61167861167d91611663565b611669565b90565b61168a905461166c565b90565b61169561165e565b506116a0600c611680565b90565b9060001960601c918216908216918360005233673ec412a9852d173d60c11b17601c5260206000208401840190815480911683811481021561178b57508260005281600101548033148433141715611773575b611767575b838318189055601c600c206001815403905581600052601c600c2060018154019063ffffffff821684021561175257557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a4565b67ea553b3401336cea841560021b526004601cfd5b600082600101556116fb565b6030600c20546116f657634b6e7f186000526004601cfd5b67ceea21b6a1148100901560021b526004601cfd5b600090565b6117ae906106dc565b90565b906117bb906117a5565b600052602052604060002090565b90565b6117d86117dd91611663565b6117c9565b90565b6117ea90546117cc565b90565b600161180661180c926117fe6117a0565b5060026117b1565b016117e0565b90565b61182361181e611828926104d7565b6115bd565b6104d7565b90565b906118359061180f565b600052602052604060002090565b60018060a01b031690565b61185a61185f91611663565b611843565b90565b61186c905461184e565b90565b906118799061033f565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b6118a06118a59161187d565b611883565b90565b6118b29054611894565b90565b906118bf9061036f565b9052565b6118cd60406109a7565b90565b906119076118fe60006118e16118c3565b946118f86118f0838301611862565b83880161186f565b016118a8565b602084016118b5565b565b611912906118d0565b90565b61191f905161033f565b90565b61193661193161193b92610f13565b6115bd565b610334565b90565b61194790611922565b90565b611954905161036f565b90565b61196b6119666119709261036f565b6115bd565b6104d7565b90565b634e487b7160e01b600052601160045260246000fd5b61199861199e919392936104d7565b926104d7565b916119aa8382026104d7565b9281840414901517156119b957565b611973565b634e487b7160e01b600052601260045260246000fd5b6119e06119e6916104d7565b916104d7565b9081156119f1570490565b6119be565b611a19611a1e91939293611a08611527565b50611a1161165e565b50600161182b565b611909565b91611a2b60008401611915565b611a46611a40611a3b600061193e565b61033f565b9161033f565b14611a93575b6000611a88611a72611a8f93611a6c611a676020890161194a565b611957565b90611989565b611a82611a7d612e7c565b611957565b906119d4565b9301611915565b9190565b9150611a8f6000611a88611a72611aa983611909565b959350505050611a4c565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b90611af291611aed611ae8611ab4565b612b21565b611b9b565b565b611b08611b03611b0d92610f13565b6115bd565b6104d7565b90565b6001611b1c91016104d7565b90565b611b28906104d7565b6000198114611b375760010190565b611973565b90611b4960001991610f16565b9181191691161790565b90565b90611b6b611b66611b729261180f565b611b53565b8254611b3c565b9055565b611b85611b8b919392936104d7565b926104d7565b8201809211611b9657565b611973565b9190611ba76000611af4565b915b82611bbc611bb6846104d7565b916104d7565b1015611c3d575b611bd5611bd0600b611680565b612e93565b15611bfb57611bf6611bef611bea600b611680565b611b1f565b600b611b56565b611bc3565b9091611c3690611c1585611c0f600b611680565b90612ec0565b611c31611c2a611c25600b611680565b611b1f565b600b611b56565b611b10565b9190611ba9565b9250611c5e9150611c5790611c52600c611680565b611b76565b600c611b56565b565b90611c6a91611ad8565b565b90611c8791611c82611c7d826117ed565b612b21565b611c89565b565b90611c9391612f59565b565b90611c9f91611c6c565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b611cfc602f604092610420565b611d0581611ca1565b0190565b611d1f9060208101906000818303910152611cef565b90565b15611d2957565b611d31610273565b62461bcd60e51b815280611d4760048201611d09565b0390fd5b90611d7891611d7382611d6d611d67611d62612f83565b61033f565b9161033f565b14611d22565b612f90565b565b90611d9491611d8f611d8a611ab4565b612b21565b611d96565b565b90611da091612ec0565b611dbc611db5611db0600c611680565b611b1f565b600c611b56565b5b611dcf611dca600b611680565b612e93565b15611df557611df0611de9611de4600b611680565b611b1f565b600b611b56565b611dbd565b565b90611e0191611d7a565b565b90611e15611e10836109bc565b6109a7565b918252565b611e246000611e03565b90565b611e2f611e1a565b90565b91611e3f838383916116a3565b611e4882612fba565b611e52575b505050565b611e659291611e5f611e27565b92612fc7565b388080611e4d565b611e779033613058565b565b60ff1690565b611e8b611e9091611663565b611e79565b90565b611e9d9054611e7f565b90565b90611eac60ff91610f16565b9181191691161790565b611ebf906102d7565b90565b90565b90611eda611ed5611ee192611eb6565b611ec2565b8254611ea0565b9055565b96979091929594939733611f21611f1b7f000000000000000000000000000000000000000000000000000000000000000061033f565b9161033f565b14158015611f84575b611f6757611f5998611f4c97611f47958a95909192939495613122565b612d3b565b611f54611ab4565b612f59565b611f656001600a611ec5565b565b600063f92ee8a960e01b815280611f80600482016103d2565b0390fd5b50611f8f600a611e93565b611f2a565b90611faf9291611faa611fa5611396565b612b21565b611fb1565b565b91611fbe92919091613217565b565b90611fcb9291611f94565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b9061200b91612006612001611fcd565b612b21565b6121f7565b565b601f602091010490565b1b90565b9190600861203791029161203160001984612017565b92612017565b9181191691161790565b919061205761205261205f9361180f565b611b53565b90835461201b565b9055565b6120759161206f61165e565b91612041565b565b5b818110612083575050565b806120916000600193612063565b01612078565b9190601f81116120a7575b505050565b6120b36120d89361143c565b9060206120bf8461200d565b830193106120e0575b6120d19061200d565b0190612077565b3880806120a2565b91506120d1819290506120c8565b1c90565b9061210390600019906008026120ee565b191690565b81612112916120f2565b906002021790565b906121248161041c565b9067ffffffffffffffff82116121e657612148826121428554611409565b85612097565b602090601f831160011461217d5791809161216c93600092612171575b5050612108565b90555b565b90915001513880612165565b601f1983169161218c8561143c565b9260005b8181106121ce575091600293918560019694106121b4575b5050500201905561216f565b6121c4910151601f8416906120f2565b90553880806121a8565b91936020600181928787015181550195019201612190565b610968565b906121f59161211a565b565b9061220661220d9260076121eb565b60086121eb565b565b9061221991611ff1565b565b61222d90612227611527565b5061329a565b90811561223657565b63ceea21b66000526004601cfd5b61224c61165e565b50801561227457673ec412a9852d173d60c11b601c5260005263ffffffff601c600c20541690565b638f4eb6046000526004601cfd5b61229b90612296612291611fcd565b612b21565b61229d565b565b6122a89060066121eb565b565b6122b390612282565b565b906122bf906117a5565b600052602052604060002090565b90565b906122f06122eb6122f5936122e3611527565b5060036122b5565b6122cd565b6132fb565b90565b612301906115c0565b90565b61230d906122f8565b90565b9061231a90612304565b600052602052604060002090565b61235091600061234561234b9361233d611351565b5060026117b1565b01612310565b611e93565b90565b61236c90612367612362611fcd565b612b21565b61236e565b565b6123799060096121eb565b565b61238490612353565b565b61238e6113ee565b506123996008611505565b90565b60018060a01b031690565b6123b36123b891611663565b61239c565b90565b6123c590546123a7565b90565b6123d1906122f8565b90565b60e01b90565b905051906123e7826106df565b565b9060208282031261240357612400916000016123da565b90565b61027e565b50612417906020810190610360565b90565b6124239061033f565b9052565b506124369060208101906102a9565b90565b61244290610288565b9052565b506124559060208101906106f4565b90565b612461906106dc565b9052565b600080fd5b600080fd5b600080fd5b90356001602003823603038112156124b557016020813591019167ffffffffffffffff82116124b05760018202360383136124ab57565b61246a565b612465565b61246f565b60209181520190565b91906124dd816124d6816124e2956124ba565b80956109df565b61044e565b0190565b90356001604003823603038112156124fc570190565b61246f565b903560016020038236030381121561254257016020813591019167ffffffffffffffff821161253d57600182023603831361253857565b61246a565b612465565b61246f565b91906125618161255a8161256695611433565b80956109df565b61044e565b0190565b67ffffffffffffffff1690565b6125808161256a565b0361258757565b600080fd5b9050359061259982612577565b565b506125aa90602081019061258c565b90565b6125b69061256a565b9052565b906125f89060206125f06125e6604084016125d86000880188612501565b908683036000880152612547565b948281019061259b565b9101906125ad565b90565b6126a59161269761268c60c083016126236126196000870187612408565b600086019061241a565b61263d6126336020870187612427565b6020860190612439565b61265761264d6040870187612446565b6040860190612458565b6126716126676060870187612446565b6060860190612458565b61267e6080860186612474565b9085830360808701526124c3565b9260a08101906124e6565b9060a08184039101526125ba565b90565b9392906126d46040916126dc946126c7606089019260008a019061051d565b87820360208901526125fb565b940190610722565b565b6126e6610273565b3d6000823e3d90fd5b91506020906126fc6117a0565b5061270f61270a60046123bb565b6123c8565b61273b633808a90b94929461274661272760056117e0565b61272f610273565b978896879586956123d4565b8552600485016126a8565b03915afa90811561278b5760009161275d575b5090565b61277e915060203d8111612784575b612776818361097e565b8101906123e9565b38612759565b503d61276c565b6126de565b90151581601c52670a5a2e7a0000000060085233600052806030600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b67ffffffffffffffff81116127fe576127fa60209161044e565b0190565b610968565b90929192612818612813826127e0565b6109a7565b9381855260208501908284011161283457612832926109df565b565b610963565b612844913691612803565b90565b92919092612857818584916116a3565b61286084612fba565b61286c575b5050505050565b6128829461287c91949293612839565b92612fc7565b3880808080612865565b90565b6128999054611409565b90565b6128a4611e1a565b90565b6128af6113ee565b506128c26128bc82612e93565b156102d7565b612923576128d86128d3600661288c565b61288f565b6128eb6128e56000611af4565b916104d7565b1415600014612915576129119061290c612906600692613334565b91611505565b61338f565b5b90565b5061291e61289c565b612912565b600063677510db60e11b81528061293c600482016103d2565b0390fd5b61295f61295a6129649261295261165e565b5060036122b5565b6122cd565b6133bf565b90565b906129829161297d612978826117ed565b612b21565b612984565b565b9061298e91612f90565b565b9061299a91612967565b565b5190565b634e487b7160e01b600052603260045260246000fd5b906129c08261299c565b8110156129d1576020809102010190565b6129a0565b6129e090516104d7565b90565b906129ed8261299c565b906129f86000611af4565b5b80612a0c612a06856104d7565b916104d7565b1015612a3d57612a3890612a3333612a2d612a288885906129b6565b6129d6565b90613058565b611b10565b6129f9565b50915050565b612a4b6113ee565b50612a566009611505565b90565b90612a62611351565b50601c52670a5a2e7a000000006008526000526030600c205490565b612a9790612a92612a8d61157e565b612b21565b612ac5565b565b612aa290611663565b90565b90612aba612ab5612ac1926117a5565b612a99565b8254611b3c565b9055565b612ad0906005612aa5565b565b612adb90612a7e565b565b612ae5611351565b50612aef816133df565b8015612b12575b908115612b02575b5090565b612b0c915061346c565b38612afe565b50612b1c81613406565b612af6565b612b3390612b2d612f83565b90613591565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b612b90602a604092610420565b612b9981612b35565b0190565b612bb39060208101906000818303910152612b83565b90565b15612bbd57565b612bc5610273565b62461bcd60e51b815280612bdb60048201612b9d565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b612c146019602092610420565b612c1d81612bdf565b0190565b612c379060208101906000818303910152612c07565b90565b15612c4157565b612c49610273565b62461bcd60e51b815280612c5f60048201612c21565b0390fd5b612c6d60406109a7565b90565b90565b90612c88612c83612c8f92612304565b612c70565b82546115f4565b9055565b60a01b90565b90612cb36bffffffffffffffffffffffff60a01b91612c93565b9181191691161790565b612cd1612ccc612cd69261036f565b6115bd565b61036f565b90565b90565b90612cf1612cec612cf892612cbd565b612cd9565b8254612c99565b9055565b90612d2760206000612d2d94612d1f828201612d19848801611915565b90612c73565b01920161194a565b90612cdc565b565b90612d3991612cfc565b565b90612dac612db392612d6783612d60612d5a612d55612e7c565b61036f565b9161036f565b1115612bb6565b612d8d81612d86612d80612d7b600061193e565b61033f565b9161033f565b1415612c3a565b91612da3612d99612c63565b936000850161186f565b602083016118b5565b6000612d2f565b565b9060001960601c9081169181168360005280673ec412a9852d173d60c11b17601c5260206000208401840191825416918215612e4a57818385931490151715612e24575b600101557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a4565b9050816000526030600c205415612e3c578290612df9565b634b6e7f186000526004601cfd5b63ceea21b66000526004601cfd5b600090565b90565b612e74612e6f612e7992612e5d565b6115bd565b61036f565b90565b612e84612e58565b50612e90612710612e60565b90565b612e9b611351565b5080600052673ec412a9852d173d60c11b601c5260206000208101015460601b151590565b60601b60601c81600052673ec412a9852d173d60c11b601c5260206000208201820180548060601b612f4b578217905580600052601c600c2060018154019063ffffffff8216830215612f36575560007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8138a4565b67ea553b3401336cea831560021b526004601cfd5b63c991cbb16000526004601cfd5b90612f7b612f76612f8093612f6f81859061362a565b60036122b5565b6122cd565b613711565b50565b612f8b611527565b503390565b90612fb2612fad612fb793612fa681859061374c565b60036122b5565b6122cd565b6137e6565b50565b612fc2611351565b503b90565b9160209160a460405195869363150b7a0296878652338787015260601b60601c6040860152606085015260808085015280518091818060a0880152613044575b505001906000601c8401915af115613034575b60e01b90510361302657565b63d1a57ed66000526004601cfd5b3d1561301a57503d6000823e3d90fd5b818760c08801920160045afa508038613007565b6130618261221b565b5060601b60601c8160005280673ec412a9852d173d60c11b17601c52602060002082018201908154918260601b60601c918215613114578260005281600101549081811484821417901517156130fc575b60009383916130f1575b189055601c600c20600181540390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8238a4565b8483600101556130bc565b6030600c20546130b257634b6e7f186000526004601cfd5b63ceea21b66000526004601cfd5b9261314c906131456131539461313e6131919a989560076121eb565b60086121eb565b60066121eb565b60096121eb565b61316561315e610f38565b8290612f59565b613177613170611fcd565b8290612f59565b613189613182611396565b8290612f59565b919091613821565b565b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b6131c8601b602092610420565b6131d181613193565b0190565b6131eb90602081019060008183039101526131bb565b90565b156131f557565b6131fd610273565b62461bcd60e51b815280613213600482016131d5565b0390fd5b6132939061328c61329894936132478561324061323a613235612e7c565b61036f565b9161036f565b1115612bb6565b61326d8161326661326061325b600061193e565b61033f565b9161033f565b14156131ee565b93613283613279612c63565b956000870161186f565b602085016118b5565b600161182b565b612d2f565b565b6132a2611527565b5080600052673ec412a9852d173d60c11b601c5260206000208101015460601b60601c90565b90565b6132d76132dc91611663565b61180f565b90565b6132f36132ee6132f8926104d7565b6115bd565b610334565b90565b6133276133226133319361331d600061332c95613316611527565b50016132c8565b61389c565b6132cb565b6132df565b6122f8565b90565b9061333d6113ee565b506080604051019160208301604052600083528290600a6000198092955b019481810660300186530493841561337a5790600a919080929161335b565b93505082602091039203918252565b90565b90565b6133bc916133b16133ab6133b7936133a56113ee565b50613389565b91613389565b906138c3565b61338c565b90565b6133d760006133dc926133d061165e565b50016132c8565b613945565b90565b6133e7611351565b5060e01c635b5e139f8114906301ffc9a76380ac58cd82149114171790565b61340e611351565b506134188161395d565b801561345d575b8015613442575b908115613432575b5090565b61343c915061399d565b3861342e565b50600061345761345183610288565b91610288565b14613426565b506134678161399d565b61341f565b613474611351565b5061347e8161399d565b90811561348a575b5090565b61349491506139dd565b38613486565b90565b6134b16134ac6134b69261349a565b6115bd565b6104d7565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b6134f2601780926134b9565b6134fb816134be565b0190565b61352461351b926020926135128161041c565b948580936134b9565b93849101610429565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b61355c601180926134b9565b61356581613528565b0190565b61358361358e939261357d613588936134e6565b906134ff565b613550565b906134ff565b90565b906135a66135a0838390612328565b156102d7565b6135ae575050565b613626916136046135dd6135cd6135c761360995613a6b565b936132cb565b6135d7602061349d565b90613c84565b916135f56135e9610273565b93849260208401613569565b6020820181038252038261097e565b61338c565b613611610273565b91829162461bcd60e51b835260048301610489565b0390fd5b61363e613638828490612328565b156102d7565b613647575b5050565b61366a6001613665600061365d600286906117b1565b018590612310565b611ec5565b90613673612f83565b906136b06136aa6136a47f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d956117a5565b92612304565b92612304565b926136b9610273565b806136c3816103d2565b0390a43880613643565b6136d6906115c0565b90565b6136ed6136e86136f292610334565b6115bd565b6104d7565b90565b61370961370461370e926104d7565b610f16565b6106dc565b90565b9061374461373e61373961373460006137499661372c611351565b5001946136cd565b6136d9565b6136f5565b916132c8565b613e7a565b90565b613757818390612328565b613760575b5050565b613783600061377e6000613776600286906117b1565b018590612310565b611ec5565b9061378c612f83565b906137c96137c36137bd7ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b956117a5565b92612304565b92612304565b926137d2610273565b806137dc816103d2565b0390a4388061375c565b9061381961381361380e613809600061381e96613801611351565b5001946136cd565b6136d9565b6136f5565b916132c8565b613f5f565b90565b9061383761383c939261383261157e565b612f59565b614069565b565b5490565b600052602060002090565b6138568161383e565b82101561387157613868600191613842565b91020190600090565b6129a0565b61388690600861388b93026120ee565b6117c9565b90565b906138999154613876565b90565b6138bb9160006138b5926138ae6117a0565b500161384d565b9061388e565b90565b606090565b9190916138ce6138be565b5060405192601f1980835193818060208701165b80830151818a0152019081156138fd578190915082906138e2565b505050815191838601828060208601165b80840151818401520191821561392b57828091935050839061390e565b505050506020910180828501019060008252845201604052565b600061395a9161395361165e565b500161383e565b90565b613965611351565b508061398061397a63152a902d60e11b610288565b91610288565b1490811561398d575b5090565b6139979150614089565b38613989565b6139a5611351565b50806139c06139ba635a05180f60e01b610288565b91610288565b149081156139cd575b5090565b6139d791506140af565b386139c9565b6139e5611351565b5080613a006139fa634e821d3360e11b610288565b91610288565b14908115613a0d575b5090565b613a179150613406565b38613a09565b90565b60ff1690565b613a3a613a35613a3f92613a1d565b6115bd565b613a20565b90565b613a4c6014613a26565b90565b613a63613a5e613a6892613a20565b6115bd565b6104d7565b90565b613a88613a83613a9e92613a7d6113ee565b506136cd565b6136d9565b613a98613a93613a42565b613a4f565b90613c84565b90565b90565b613ab8613ab3613abd92613aa1565b6115bd565b6104d7565b90565b90613ad2613acd836127e0565b6109a7565b918252565b369037565b90613b01613ae983613ac0565b92602080613af786936127e0565b9201910390613ad7565b565b600360fc1b90565b5190565b90613b1982613b0b565b811015613b2b57600160209102010190565b6129a0565b600f60fb1b90565b90565b613b4f613b4a613b5492613b38565b6115bd565b6104d7565b90565b613b60906104d7565b60008114613b6f576001900390565b611973565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b613b93613b74565b90565b90565b613bad613ba8613bb292613b96565b6115bd565b6104d7565b90565b60f81b90565b90565b613bd2613bcd613bd792613bbb565b6115bd565b613a20565b90565b613bf990613bf3613bed613bfe94613a20565b916104d7565b906120ee565b6104d7565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b613c3560208092610420565b613c3e81613c01565b0190565b613c589060208101906000818303910152613c29565b90565b15613c6257565b613c6a610273565b62461bcd60e51b815280613c8060048201613c42565b0390fd5b9190613c8e6113ee565b50613d28613d18613cc4613cbf613caf6002613caa8791613aa4565b611989565b613cb96002613aa4565b90611b76565b613adc565b92613ccd613b03565b613ce685613ce060009360001a93611af4565b90613b0f565b53613cef613b30565b613d0885613d0260019360001a93613b3b565b90613b0f565b53613d136002613aa4565b611989565b613d226001613b3b565b90611b76565b925b83613d3e613d386001613b3b565b916104d7565b1115613da557613d4c613b8b565b81613d57600f613b99565b16916010831015613da057613d73613d9492613d9a941a613bb5565b613d838591889060001a92613b0f565b53613d8e6004613bbe565b90613bda565b93613b57565b92613d2a565b6129a0565b613dcd929350613dc890613dc2613dbc6000611af4565b916104d7565b14613c5b565b61338c565b90565b90565b600052602060002090565b5490565b613deb81613dde565b821015613e0657613dfd600191613dd3565b91020190600090565b6129a0565b9190613e21613e1c613e29936117a5565b612a99565b90835461201b565b9055565b9081549168010000000000000000831015613e5d5782613e55916001613e5b95018155613de2565b90613e0b565b565b610968565b90613e6c906117a5565b600052602052604060002090565b613e82611351565b50613e97613e918284906140ef565b156102d7565b600014613eda57613ed0613ed592613ebb613eb460008501613dd0565b8290613e2d565b6001613ec96000850161383e565b9301613e62565b611b56565b600190565b5050600090565b613ef0613ef6919392936104d7565b926104d7565b8203918211613f0157565b611973565b634e487b7160e01b600052603160045260246000fd5b613f2e91613f286117a0565b91613e0b565b565b613f3981613dde565b8015613f5a576001900390613f57613f518383613de2565b90613f1c565b55565b613f06565b613f67611351565b50613f7e613f79600183018490613e62565b611680565b9081613f93613f8d6000611af4565b916104d7565b14156000146140615761401392600161400e9284613fbc600096613fb685613b3b565b90613ee1565b613fd9613fca88850161383e565b613fd386613b3b565b90613ee1565b80613fec613fe6846104d7565b916104d7565b03614018575b505050614008614003868301613dd0565b613f30565b01613e62565b612063565b600190565b6140599261404b614037614031614054948c890161384d565b9061388e565b9361404585918c890161384d565b90613e0b565b91858501613e62565b611b56565b388080613ff2565b505050600090565b90614080614079614087936115e8565b600461161e565b6005612aa5565b565b614091611351565b506140ab6140a56301ffc9a760e01b610288565b91610288565b1490565b6140b7611351565b50806140d26140cc637965db0b60e01b610288565b91610288565b149081156140df575b5090565b6140e9915061395d565b386140db565b61410d91600161410892614101611351565b5001613e62565b611680565b61412061411a6000611af4565b916104d7565b14159056fea264697066735822122029a6d041f14c226b015d09bed1f38d00ed477c06417cdefc834389f375cb9b8964736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -126,191 +248,225 @@ export class ERC721ItemsFactory extends ContractFactory { export const ERC721ITEMSFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC721/presets/items/ERC721ItemsFactory.sol:ERC721ItemsFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { - 'node_modules/@openzeppelin/contracts/access/AccessControl.sol': { + 'src/tokens/ERC721/presets/items/ERC721ItemsFactory.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.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC721Items } from "./ERC721Items.sol";\nimport { IERC721ItemsFactory, IERC721ItemsFactoryFunctions } from "./IERC721ItemsFactory.sol";\n\n/**\n * Deployer of ERC-721 Items proxies.\n */\ncontract ERC721ItemsFactory is IERC721ItemsFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-721 Items Factory.\n * @param factoryOwner The owner of the ERC-721 Items Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC721Items impl = new ERC721Items();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721ItemsFactoryFunctions\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr) {\n bytes32 salt = keccak256(\n abi.encode(\n tokenOwner,\n name,\n symbol,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n )\n );\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC721Items(proxyAddr).initialize(\n tokenOwner,\n name,\n symbol,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n emit ERC721ItemsDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721ItemsFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(\n abi.encode(\n tokenOwner,\n name,\n symbol,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n )\n );\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' }, - 'node_modules/@openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'src/proxies/SequenceProxyFactory.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.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' }, - 'node_modules/@openzeppelin/contracts/access/IAccessControl.sol': { + 'src/tokens/ERC721/presets/items/ERC721Items.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" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC721BaseToken } from "../../ERC721BaseToken.sol";\nimport { IERC721Items, IERC721ItemsFunctions } from "./IERC721Items.sol";\n\n/**\n * An implementation of ERC-721 capable of minting when role provided.\n */\ncontract ERC721Items is ERC721BaseToken, IERC721Items {\n\n bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE");\n\n address private immutable _initializer;\n bool private _initialized;\n\n uint256 private _nextSequentialId;\n uint256 private _totalSupply;\n\n /**\n * Deploy contract.\n */\n constructor() ERC721BaseToken() {\n _initializer = msg.sender;\n }\n\n /**\n * Initialize contract.\n * @param owner The owner of the contract\n * @param tokenName Name of the token\n * @param tokenSymbol Symbol of the token\n * @param tokenBaseURI Base URI of the token\n * @param tokenContractURI Contract URI of the token\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n string memory tokenName,\n string memory tokenSymbol,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual {\n if (msg.sender != _initializer || _initialized) {\n revert InvalidInitialization();\n }\n\n ERC721BaseToken._initialize(\n owner, tokenName, tokenSymbol, tokenBaseURI, tokenContractURI, implicitModeValidator, implicitModeProjectId\n );\n _setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator);\n\n _grantRole(MINTER_ROLE, owner);\n\n _initialized = true;\n }\n\n //\n // Minting\n //\n\n /// @inheritdoc IERC721ItemsFunctions\n function mint(address to, uint256 tokenId) external onlyRole(MINTER_ROLE) {\n _mint(to, tokenId);\n _totalSupply++;\n while (_exists(_nextSequentialId)) {\n _nextSequentialId++;\n }\n }\n\n /// @inheritdoc IERC721ItemsFunctions\n function mintSequential(address to, uint256 amount) external onlyRole(MINTER_ROLE) {\n for (uint256 i = 0; i < amount; i++) {\n while (_exists(_nextSequentialId)) {\n _nextSequentialId++;\n }\n _mint(to, _nextSequentialId);\n _nextSequentialId++;\n }\n _totalSupply += amount;\n }\n\n //\n // Views\n //\n\n /// @inheritdoc IERC721ItemsFunctions\n function totalSupply() external view returns (uint256) {\n return _totalSupply;\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 returns (bool) {\n return type(IERC721ItemsFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'node_modules/@openzeppelin/contracts/access/IAccessControlEnumerable.sol': { + 'src/tokens/ERC721/presets/items/IERC721ItemsFactory.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721ItemsFactoryFunctions {\n\n /**\n * Creates an ERC-721 Items proxy.\n * @param proxyOwner The owner of the ERC-721 Items proxy\n * @param tokenOwner The owner of the ERC-721 Items implementation\n * @param name The name of the ERC-721 Items proxy\n * @param symbol The symbol of the ERC-721 Items proxy\n * @param baseURI The base URI of the ERC-721 Items proxy\n * @param contractURI The contract URI of the ERC-721 Items proxy\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\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 Items Proxy\n */\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-721 Items proxy\n * @param tokenOwner The owner of the ERC-721 Items implementation\n * @param name The name of the ERC-721 Items proxy\n * @param symbol The symbol of the ERC-721 Items proxy\n * @param baseURI The base URI of the ERC-721 Items proxy\n * @param contractURI The contract URI of the ERC-721 Items proxy\n * @param royaltyReceiver Address of who should be sent the royalty payment\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\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 Items Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n string memory baseURI,\n string memory contractURI,\n address royaltyReceiver,\n uint96 royaltyFeeNumerator,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC721ItemsFactorySignals {\n\n /**\n * Event emitted when a new ERC-721 Items proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721ItemsDeployed(address proxyAddr);\n\n}\n\ninterface IERC721ItemsFactory is IERC721ItemsFactoryFunctions, IERC721ItemsFactorySignals { }\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' }, - 'node_modules/@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' }, - 'node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.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' + '// 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' }, - 'node_modules/@openzeppelin/contracts/interfaces/IERC2981.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/introspection/IERC165.sol";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n /**\n * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n */\n function royaltyInfo(\n uint256 tokenId,\n uint256 salePrice\n ) external view returns (address receiver, uint256 royaltyAmount);\n}\n' + '// 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' }, - 'node_modules/@openzeppelin/contracts/interfaces/draft-IERC1822.sol': { + 'src/tokens/ERC721/ERC721BaseToken.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' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC2981Controlled } from "../common/ERC2981Controlled.sol";\nimport { SignalsImplicitModeControlled } from "../common/SignalsImplicitModeControlled.sol";\n\nimport { ERC721 } from "solady/tokens/ERC721.sol";\nimport { LibString } from "solady/utils/LibString.sol";\n\nerror InvalidInitialization();\n\n/**\n * A standard base implementation of ERC-721 for use in Sequence library contracts.\n */\nabstract contract ERC721BaseToken is ERC721, ERC2981Controlled, SignalsImplicitModeControlled {\n\n bytes32 internal constant METADATA_ADMIN_ROLE = keccak256("METADATA_ADMIN_ROLE");\n\n string private _tokenBaseURI;\n string private _tokenName;\n string private _tokenSymbol;\n string private _contractURI;\n\n /**\n * Initialize contract.\n * @param owner The owner of the contract\n * @param tokenName Name of the token\n * @param tokenSymbol Symbol of the token\n * @param tokenBaseURI Base URI of the token\n * @param tokenContractURI Contract URI of the token\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 string memory tokenName,\n string memory tokenSymbol,\n string memory tokenBaseURI,\n string memory tokenContractURI,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) internal {\n _tokenName = tokenName;\n _tokenSymbol = tokenSymbol;\n _tokenBaseURI = tokenBaseURI;\n _contractURI = tokenContractURI;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(METADATA_ADMIN_ROLE, owner);\n _grantRole(ROYALTY_ADMIN_ROLE, owner);\n\n _initializeImplicitMode(owner, implicitModeValidator, implicitModeProjectId);\n }\n\n //\n // Metadata\n //\n\n /**\n * Set name and symbol of token.\n * @param tokenName Name of token.\n * @param tokenSymbol Symbol of token.\n */\n function setNameAndSymbol(\n string memory tokenName,\n string memory tokenSymbol\n ) external onlyRole(METADATA_ADMIN_ROLE) {\n _tokenName = tokenName;\n _tokenSymbol = tokenSymbol;\n }\n\n /**\n * Update the base URI of token\'s URI.\n * @param tokenBaseURI New base URI of token\'s URI\n */\n function setBaseMetadataURI(\n string memory tokenBaseURI\n ) external onlyRole(METADATA_ADMIN_ROLE) {\n _tokenBaseURI = tokenBaseURI;\n }\n\n /**\n * Update the contract URI of token\'s URI.\n * @param tokenContractURI New contract URI of token\'s URI\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\n */\n function setContractURI(\n string memory tokenContractURI\n ) external onlyRole(METADATA_ADMIN_ROLE) {\n _contractURI = tokenContractURI;\n }\n\n //\n // Burn\n //\n\n /**\n * Allows the owner of the token to burn their token.\n * @param tokenId Id of token to burn\n */\n function burn(\n uint256 tokenId\n ) public virtual {\n _burn(msg.sender, tokenId);\n }\n\n /**\n * Allows the owner of the tokens to burn their tokens.\n * @param tokenIds Array of token ids to burn\n */\n function batchBurn(\n uint256[] memory tokenIds\n ) public virtual {\n uint256 nBurn = tokenIds.length;\n for (uint256 i = 0; i < nBurn; i++) {\n _burn(msg.sender, tokenIds[i]);\n }\n }\n\n //\n // Views\n //\n\n /**\n * Get the contract URI of token\'s URI.\n * @return Contract URI of token\'s URI\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\n */\n function contractURI() public view returns (string memory) {\n return _contractURI;\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(ERC721, ERC2981Controlled, SignalsImplicitModeControlled) returns (bool) {\n return ERC721.supportsInterface(interfaceId) || ERC2981Controlled.supportsInterface(interfaceId)\n || SignalsImplicitModeControlled.supportsInterface(interfaceId);\n }\n\n //\n // ERC721 Overrides\n //\n\n /// @inheritdoc ERC721\n function tokenURI(\n uint256 tokenId\n ) public view virtual override(ERC721) returns (string memory) {\n if (!_exists(tokenId)) {\n revert TokenDoesNotExist();\n }\n\n return bytes(_tokenBaseURI).length != 0 ? LibString.concat(_tokenBaseURI, LibString.toString(tokenId)) : "";\n }\n\n /// @inheritdoc ERC721\n function name() public view override(ERC721) returns (string memory) {\n return _tokenName;\n }\n\n /// @inheritdoc ERC721\n function symbol() public view override(ERC721) returns (string memory) {\n return _tokenSymbol;\n }\n\n}\n' }, - 'node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { + 'src/tokens/ERC721/presets/items/IERC721Items.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' + '// 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' }, - 'node_modules/@openzeppelin/contracts/proxy/Proxy.sol': { + 'src/proxies/openzeppelin/BeaconProxy.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" + '// 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' }, - 'node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol': { + 'src/proxies/openzeppelin/TransparentUpgradeableProxy.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' + '// 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' }, - 'node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Context.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' + '// 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' }, - 'node_modules/@openzeppelin/contracts/token/common/ERC2981.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../../interfaces/IERC2981.sol";\nimport "../../utils/introspection/ERC165.sol";\n\n/**\n * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.\n *\n * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for\n * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.\n *\n * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the\n * fee is specified in basis points by default.\n *\n * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See\n * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to\n * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.\n *\n * _Available since v4.5._\n */\nabstract contract ERC2981 is IERC2981, ERC165 {\n struct RoyaltyInfo {\n address receiver;\n uint96 royaltyFraction;\n }\n\n RoyaltyInfo private _defaultRoyaltyInfo;\n mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @inheritdoc IERC2981\n */\n function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {\n RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];\n\n if (royalty.receiver == address(0)) {\n royalty = _defaultRoyaltyInfo;\n }\n\n uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();\n\n return (royalty.receiver, royaltyAmount);\n }\n\n /**\n * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a\n * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an\n * override.\n */\n function _feeDenominator() internal pure virtual returns (uint96) {\n return 10000;\n }\n\n /**\n * @dev Sets the royalty information that all ids in this contract will default to.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: invalid receiver");\n\n _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Removes default royalty information.\n */\n function _deleteDefaultRoyalty() internal virtual {\n delete _defaultRoyaltyInfo;\n }\n\n /**\n * @dev Sets the royalty information for a specific token id, overriding the global default.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: Invalid parameters");\n\n _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Resets royalty information for the token id back to the global default.\n */\n function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n delete _tokenRoyaltyInfo[tokenId];\n }\n}\n' + '// 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' }, - 'node_modules/@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' }, - 'node_modules/@openzeppelin/contracts/utils/Context.sol': { + 'src/tokens/common/ERC2981Controlled.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' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IERC2981Controlled } from "./IERC2981Controlled.sol";\n\nimport { AccessControlEnumerable } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport { ERC2981 } from "openzeppelin-contracts/contracts/token/common/ERC2981.sol";\n\n/**\n * An implementation of ERC-2981 that allows updates by roles.\n */\nabstract contract ERC2981Controlled is ERC2981, AccessControlEnumerable, IERC2981Controlled {\n\n bytes32 internal constant ROYALTY_ADMIN_ROLE = keccak256("ROYALTY_ADMIN_ROLE");\n\n //\n // Royalty\n //\n\n /**\n * Sets the royalty information that all ids in this contract will default to.\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(ROYALTY_ADMIN_ROLE) {\n _setDefaultRoyalty(receiver, feeNumerator);\n }\n\n /**\n * Sets the royalty information that a given token id in this contract will use.\n * @param tokenId The token id to set the royalty information for\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @notice This overrides the default royalty information for this token id\n */\n function setTokenRoyalty(\n uint256 tokenId,\n address receiver,\n uint96 feeNumerator\n ) external onlyRole(ROYALTY_ADMIN_ROLE) {\n _setTokenRoyalty(tokenId, receiver, feeNumerator);\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(ERC2981, AccessControlEnumerable) returns (bool) {\n return ERC2981.supportsInterface(interfaceId) || AccessControlEnumerable.supportsInterface(interfaceId)\n || type(IERC2981Controlled).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'node_modules/@openzeppelin/contracts/utils/Create2.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.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' + '// 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' }, - 'node_modules/@openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/solady/src/tokens/ERC721.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' + '// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Simple ERC721 implementation with storage hitchhiking.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/tokens/ERC721.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol)\n/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC721/ERC721.sol)\n///\n/// @dev Note:\n/// - The ERC721 standard allows for self-approvals.\n/// For performance, this implementation WILL NOT revert for such actions.\n/// Please add any checks with overrides if desired.\n/// - For performance, methods are made payable where permitted by the ERC721 standard.\n/// - The `safeTransfer` functions use the identity precompile (0x4)\n/// to copy memory internally.\n///\n/// If you are overriding:\n/// - NEVER violate the ERC721 invariant:\n/// the balance of an owner MUST always be equal to their number of ownership slots.\n/// The transfer functions do not have an underflow guard for user token balances.\n/// - Make sure all variables written to storage are properly cleaned\n/// (e.g. the bool value for `isApprovedForAll` MUST be either 1 or 0 under the hood).\n/// - Check that the overridden function is actually used in the function you want to\n/// change the behavior of. Much of the code has been manually inlined for performance.\nabstract contract ERC721 {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev An account can hold up to 4294967295 tokens.\n uint256 internal constant _MAX_ACCOUNT_BALANCE = 0xffffffff;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Only the token owner or an approved account can manage the token.\n error NotOwnerNorApproved();\n\n /// @dev The token does not exist.\n error TokenDoesNotExist();\n\n /// @dev The token already exists.\n error TokenAlreadyExists();\n\n /// @dev Cannot query the balance for the zero address.\n error BalanceQueryForZeroAddress();\n\n /// @dev Cannot mint or transfer to the zero address.\n error TransferToZeroAddress();\n\n /// @dev The token must be owned by `from`.\n error TransferFromIncorrectOwner();\n\n /// @dev The recipient\'s balance has overflowed.\n error AccountBalanceOverflow();\n\n /// @dev Cannot safely transfer to a contract that does not implement\n /// the ERC721Receiver interface.\n error TransferToNonERC721ReceiverImplementer();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* EVENTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Emitted when token `id` is transferred from `from` to `to`.\n event Transfer(address indexed from, address indexed to, uint256 indexed id);\n\n /// @dev Emitted when `owner` enables `account` to manage the `id` token.\n event Approval(address indexed owner, address indexed account, uint256 indexed id);\n\n /// @dev Emitted when `owner` enables or disables `operator` to manage all of their tokens.\n event ApprovalForAll(address indexed owner, address indexed operator, bool isApproved);\n\n /// @dev `keccak256(bytes("Transfer(address,address,uint256)"))`.\n uint256 private constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n /// @dev `keccak256(bytes("Approval(address,address,uint256)"))`.\n uint256 private constant _APPROVAL_EVENT_SIGNATURE =\n 0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925;\n\n /// @dev `keccak256(bytes("ApprovalForAll(address,address,bool)"))`.\n uint256 private constant _APPROVAL_FOR_ALL_EVENT_SIGNATURE =\n 0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STORAGE */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The ownership data slot of `id` is given by:\n /// ```\n /// mstore(0x00, id)\n /// mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n /// let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n /// ```\n /// Bits Layout:\n /// - [0..159] `addr`\n /// - [160..255] `extraData`\n ///\n /// The approved address slot is given by: `add(1, ownershipSlot)`.\n ///\n /// See: https://notes.ethereum.org/%40vbuterin/verkle_tree_eip\n ///\n /// The balance slot of `owner` is given by:\n /// ```\n /// mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n /// mstore(0x00, owner)\n /// let balanceSlot := keccak256(0x0c, 0x1c)\n /// ```\n /// Bits Layout:\n /// - [0..31] `balance`\n /// - [32..255] `aux`\n ///\n /// The `operator` approval slot of `owner` is given by:\n /// ```\n /// mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, operator))\n /// mstore(0x00, owner)\n /// let operatorApprovalSlot := keccak256(0x0c, 0x30)\n /// ```\n uint256 private constant _ERC721_MASTER_SLOT_SEED = 0x7d8825530a5a2e7a << 192;\n\n /// @dev Pre-shifted and pre-masked constant.\n uint256 private constant _ERC721_MASTER_SLOT_SEED_MASKED = 0x0a5a2e7a00000000;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC721 METADATA */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the token collection name.\n function name() public view virtual returns (string memory);\n\n /// @dev Returns the token collection symbol.\n function symbol() public view virtual returns (string memory);\n\n /// @dev Returns the Uniform Resource Identifier (URI) for token `id`.\n function tokenURI(uint256 id) public view virtual returns (string memory);\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* ERC721 */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the owner of token `id`.\n ///\n /// Requirements:\n /// - Token `id` must exist.\n function ownerOf(uint256 id) public view virtual returns (address result) {\n result = _ownerOf(id);\n /// @solidity memory-safe-assembly\n assembly {\n if iszero(result) {\n mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.\n revert(0x1c, 0x04)\n }\n }\n }\n\n /// @dev Returns the number of tokens owned by `owner`.\n ///\n /// Requirements:\n /// - `owner` must not be the zero address.\n function balanceOf(address owner) public view virtual returns (uint256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n // Revert if the `owner` is the zero address.\n if iszero(owner) {\n mstore(0x00, 0x8f4eb604) // `BalanceQueryForZeroAddress()`.\n revert(0x1c, 0x04)\n }\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n mstore(0x00, owner)\n result := and(sload(keccak256(0x0c, 0x1c)), _MAX_ACCOUNT_BALANCE)\n }\n }\n\n /// @dev Returns the account approved to manage token `id`.\n ///\n /// Requirements:\n /// - Token `id` must exist.\n function getApproved(uint256 id) public view virtual returns (address result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n if iszero(shl(96, sload(ownershipSlot))) {\n mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.\n revert(0x1c, 0x04)\n }\n result := sload(add(1, ownershipSlot))\n }\n }\n\n /// @dev Sets `account` as the approved account to manage token `id`.\n ///\n /// Requirements:\n /// - Token `id` must exist.\n /// - The caller must be the owner of the token,\n /// or an approved operator for the token owner.\n ///\n /// Emits an {Approval} event.\n function approve(address account, uint256 id) public payable virtual {\n _approve(msg.sender, account, id);\n }\n\n /// @dev Returns whether `operator` is approved to manage the tokens of `owner`.\n function isApprovedForAll(address owner, address operator)\n public\n view\n virtual\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x1c, operator)\n mstore(0x08, _ERC721_MASTER_SLOT_SEED_MASKED)\n mstore(0x00, owner)\n result := sload(keccak256(0x0c, 0x30))\n }\n }\n\n /// @dev Sets whether `operator` is approved to manage the tokens of the caller.\n ///\n /// Emits an {ApprovalForAll} event.\n function setApprovalForAll(address operator, bool isApproved) public virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Convert to 0 or 1.\n isApproved := iszero(iszero(isApproved))\n // Update the `isApproved` for (`msg.sender`, `operator`).\n mstore(0x1c, operator)\n mstore(0x08, _ERC721_MASTER_SLOT_SEED_MASKED)\n mstore(0x00, caller())\n sstore(keccak256(0x0c, 0x30), isApproved)\n // Emit the {ApprovalForAll} event.\n mstore(0x00, isApproved)\n // forgefmt: disable-next-item\n log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, caller(), shr(96, shl(96, operator)))\n }\n }\n\n /// @dev Transfers token `id` from `from` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must exist.\n /// - `from` must be the owner of the token.\n /// - `to` cannot be the zero address.\n /// - The caller must be the owner of the token, or be approved to manage the token.\n ///\n /// Emits a {Transfer} event.\n function transferFrom(address from, address to, uint256 id) public payable virtual {\n _beforeTokenTransfer(from, to, id);\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n let bitmaskAddress := shr(96, not(0))\n from := and(bitmaskAddress, from)\n to := and(bitmaskAddress, to)\n // Load the ownership data.\n mstore(0x00, id)\n mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, caller()))\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let ownershipPacked := sload(ownershipSlot)\n let owner := and(bitmaskAddress, ownershipPacked)\n // Revert if the token does not exist, or if `from` is not the owner.\n if iszero(mul(owner, eq(owner, from))) {\n // `TokenDoesNotExist()`, `TransferFromIncorrectOwner()`.\n mstore(shl(2, iszero(owner)), 0xceea21b6a1148100)\n revert(0x1c, 0x04)\n }\n // Load, check, and update the token approval.\n {\n mstore(0x00, from)\n let approvedAddress := sload(add(1, ownershipSlot))\n // Revert if the caller is not the owner, nor approved.\n if iszero(or(eq(caller(), from), eq(caller(), approvedAddress))) {\n if iszero(sload(keccak256(0x0c, 0x30))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Delete the approved address if any.\n if approvedAddress { sstore(add(1, ownershipSlot), 0) }\n }\n // Update with the new owner.\n sstore(ownershipSlot, xor(ownershipPacked, xor(from, to)))\n // Decrement the balance of `from`.\n {\n let fromBalanceSlot := keccak256(0x0c, 0x1c)\n sstore(fromBalanceSlot, sub(sload(fromBalanceSlot), 1))\n }\n // Increment the balance of `to`.\n {\n mstore(0x00, to)\n let toBalanceSlot := keccak256(0x0c, 0x1c)\n let toBalanceSlotPacked := add(sload(toBalanceSlot), 1)\n // Revert if `to` is the zero address, or if the account balance overflows.\n if iszero(mul(to, and(toBalanceSlotPacked, _MAX_ACCOUNT_BALANCE))) {\n // `TransferToZeroAddress()`, `AccountBalanceOverflow()`.\n mstore(shl(2, iszero(to)), 0xea553b3401336cea)\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceSlotPacked)\n }\n // Emit the {Transfer} event.\n log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)\n }\n _afterTokenTransfer(from, to, id);\n }\n\n /// @dev Equivalent to `safeTransferFrom(from, to, id, "")`.\n function safeTransferFrom(address from, address to, uint256 id) public payable virtual {\n transferFrom(from, to, id);\n if (_hasCode(to)) _checkOnERC721Received(from, to, id, "");\n }\n\n /// @dev Transfers token `id` from `from` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must exist.\n /// - `from` must be the owner of the token.\n /// - `to` cannot be the zero address.\n /// - The caller must be the owner of the token, or be approved to manage the token.\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 function safeTransferFrom(address from, address to, uint256 id, bytes calldata data)\n public\n payable\n virtual\n {\n transferFrom(from, to, id);\n if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);\n }\n\n /// @dev Returns true if this contract implements the interface defined by `interfaceId`.\n /// See: https://eips.ethereum.org/EIPS/eip-165\n /// This function call must use less than 30000 gas.\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n let s := shr(224, interfaceId)\n // ERC165: 0x01ffc9a7, ERC721: 0x80ac58cd, ERC721Metadata: 0x5b5e139f.\n result := or(or(eq(s, 0x01ffc9a7), eq(s, 0x80ac58cd)), eq(s, 0x5b5e139f))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL QUERY FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns if token `id` exists.\n function _exists(uint256 id) internal view virtual returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n result := iszero(iszero(shl(96, sload(add(id, add(id, keccak256(0x00, 0x20)))))))\n }\n }\n\n /// @dev Returns the owner of token `id`.\n /// Returns the zero address instead of reverting if the token does not exist.\n function _ownerOf(uint256 id) internal view virtual returns (address result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n result := shr(96, shl(96, sload(add(id, add(id, keccak256(0x00, 0x20))))))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL DATA HITCHHIKING FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n // For performance, no events are emitted for the hitchhiking setters.\n // Please emit your own events if required.\n\n /// @dev Returns the auxiliary data for `owner`.\n /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.\n /// Auxiliary data can be set for any address, even if it does not have any tokens.\n function _getAux(address owner) internal view virtual returns (uint224 result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n mstore(0x00, owner)\n result := shr(32, sload(keccak256(0x0c, 0x1c)))\n }\n }\n\n /// @dev Set the auxiliary data for `owner` to `value`.\n /// Minting, transferring, burning the tokens of `owner` will not change the auxiliary data.\n /// Auxiliary data can be set for any address, even if it does not have any tokens.\n function _setAux(address owner, uint224 value) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n mstore(0x00, owner)\n let balanceSlot := keccak256(0x0c, 0x1c)\n let packed := sload(balanceSlot)\n sstore(balanceSlot, xor(packed, shl(32, xor(value, shr(32, packed)))))\n }\n }\n\n /// @dev Returns the extra data for token `id`.\n /// Minting, transferring, burning a token will not change the extra data.\n /// The extra data can be set on a non-existent token.\n function _getExtraData(uint256 id) internal view virtual returns (uint96 result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n result := shr(160, sload(add(id, add(id, keccak256(0x00, 0x20)))))\n }\n }\n\n /// @dev Sets the extra data for token `id` to `value`.\n /// Minting, transferring, burning a token will not change the extra data.\n /// The extra data can be set on a non-existent token.\n function _setExtraData(uint256 id, uint96 value) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let packed := sload(ownershipSlot)\n sstore(ownershipSlot, xor(packed, shl(160, xor(value, shr(160, packed)))))\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL MINT FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Mints token `id` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must not exist.\n /// - `to` cannot be the zero address.\n ///\n /// Emits a {Transfer} event.\n function _mint(address to, uint256 id) internal virtual {\n _beforeTokenTransfer(address(0), to, id);\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n to := shr(96, shl(96, to))\n // Load the ownership data.\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let ownershipPacked := sload(ownershipSlot)\n // Revert if the token already exists.\n if shl(96, ownershipPacked) {\n mstore(0x00, 0xc991cbb1) // `TokenAlreadyExists()`.\n revert(0x1c, 0x04)\n }\n // Update with the owner.\n sstore(ownershipSlot, or(ownershipPacked, to))\n // Increment the balance of the owner.\n {\n mstore(0x00, to)\n let balanceSlot := keccak256(0x0c, 0x1c)\n let balanceSlotPacked := add(sload(balanceSlot), 1)\n // Revert if `to` is the zero address, or if the account balance overflows.\n if iszero(mul(to, and(balanceSlotPacked, _MAX_ACCOUNT_BALANCE))) {\n // `TransferToZeroAddress()`, `AccountBalanceOverflow()`.\n mstore(shl(2, iszero(to)), 0xea553b3401336cea)\n revert(0x1c, 0x04)\n }\n sstore(balanceSlot, balanceSlotPacked)\n }\n // Emit the {Transfer} event.\n log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, 0, to, id)\n }\n _afterTokenTransfer(address(0), to, id);\n }\n\n /// @dev Mints token `id` to `to`, and updates the extra data for token `id` to `value`.\n /// Does NOT check if token `id` already exists (assumes `id` is auto-incrementing).\n ///\n /// Requirements:\n ///\n /// - `to` cannot be the zero address.\n ///\n /// Emits a {Transfer} event.\n function _mintAndSetExtraDataUnchecked(address to, uint256 id, uint96 value) internal virtual {\n _beforeTokenTransfer(address(0), to, id);\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n to := shr(96, shl(96, to))\n // Update with the owner and extra data.\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n sstore(add(id, add(id, keccak256(0x00, 0x20))), or(shl(160, value), to))\n // Increment the balance of the owner.\n {\n mstore(0x00, to)\n let balanceSlot := keccak256(0x0c, 0x1c)\n let balanceSlotPacked := add(sload(balanceSlot), 1)\n // Revert if `to` is the zero address, or if the account balance overflows.\n if iszero(mul(to, and(balanceSlotPacked, _MAX_ACCOUNT_BALANCE))) {\n // `TransferToZeroAddress()`, `AccountBalanceOverflow()`.\n mstore(shl(2, iszero(to)), 0xea553b3401336cea)\n revert(0x1c, 0x04)\n }\n sstore(balanceSlot, balanceSlotPacked)\n }\n // Emit the {Transfer} event.\n log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, 0, to, id)\n }\n _afterTokenTransfer(address(0), to, id);\n }\n\n /// @dev Equivalent to `_safeMint(to, id, "")`.\n function _safeMint(address to, uint256 id) internal virtual {\n _safeMint(to, id, "");\n }\n\n /// @dev Mints token `id` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must not exist.\n /// - `to` cannot be the zero address.\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 function _safeMint(address to, uint256 id, bytes memory data) internal virtual {\n _mint(to, id);\n if (_hasCode(to)) _checkOnERC721Received(address(0), to, id, data);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL BURN FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to `_burn(address(0), id)`.\n function _burn(uint256 id) internal virtual {\n _burn(address(0), id);\n }\n\n /// @dev Destroys token `id`, using `by`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must exist.\n /// - If `by` is not the zero address,\n /// it must be the owner of the token, or be approved to manage the token.\n ///\n /// Emits a {Transfer} event.\n function _burn(address by, uint256 id) internal virtual {\n address owner = ownerOf(id);\n _beforeTokenTransfer(owner, address(0), id);\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n by := shr(96, shl(96, by))\n // Load the ownership data.\n mstore(0x00, id)\n mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, by))\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let ownershipPacked := sload(ownershipSlot)\n // Reload the owner in case it is changed in `_beforeTokenTransfer`.\n owner := shr(96, shl(96, ownershipPacked))\n // Revert if the token does not exist.\n if iszero(owner) {\n mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.\n revert(0x1c, 0x04)\n }\n // Load and check the token approval.\n {\n mstore(0x00, owner)\n let approvedAddress := sload(add(1, ownershipSlot))\n // If `by` is not the zero address, do the authorization check.\n // Revert if the `by` is not the owner, nor approved.\n if iszero(or(iszero(by), or(eq(by, owner), eq(by, approvedAddress)))) {\n if iszero(sload(keccak256(0x0c, 0x30))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Delete the approved address if any.\n if approvedAddress { sstore(add(1, ownershipSlot), 0) }\n }\n // Clear the owner.\n sstore(ownershipSlot, xor(ownershipPacked, owner))\n // Decrement the balance of `owner`.\n {\n let balanceSlot := keccak256(0x0c, 0x1c)\n sstore(balanceSlot, sub(sload(balanceSlot), 1))\n }\n // Emit the {Transfer} event.\n log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, owner, 0, id)\n }\n _afterTokenTransfer(owner, address(0), id);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL APPROVAL FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns whether `account` is the owner of token `id`, or is approved to manage it.\n ///\n /// Requirements:\n /// - Token `id` must exist.\n function _isApprovedOrOwner(address account, uint256 id)\n internal\n view\n virtual\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := 1\n // Clear the upper 96 bits.\n account := shr(96, shl(96, account))\n // Load the ownership data.\n mstore(0x00, id)\n mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, account))\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let owner := shr(96, shl(96, sload(ownershipSlot)))\n // Revert if the token does not exist.\n if iszero(owner) {\n mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.\n revert(0x1c, 0x04)\n }\n // Check if `account` is the `owner`.\n if iszero(eq(account, owner)) {\n mstore(0x00, owner)\n // Check if `account` is approved to manage the token.\n if iszero(sload(keccak256(0x0c, 0x30))) {\n result := eq(account, sload(add(1, ownershipSlot)))\n }\n }\n }\n }\n\n /// @dev Returns the account approved to manage token `id`.\n /// Returns the zero address instead of reverting if the token does not exist.\n function _getApproved(uint256 id) internal view virtual returns (address result) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, id)\n mstore(0x1c, _ERC721_MASTER_SLOT_SEED)\n result := sload(add(1, add(id, add(id, keccak256(0x00, 0x20)))))\n }\n }\n\n /// @dev Equivalent to `_approve(address(0), account, id)`.\n function _approve(address account, uint256 id) internal virtual {\n _approve(address(0), account, id);\n }\n\n /// @dev Sets `account` as the approved account to manage token `id`, using `by`.\n ///\n /// Requirements:\n /// - Token `id` must exist.\n /// - If `by` is not the zero address, `by` must be the owner\n /// or an approved operator for the token owner.\n ///\n /// Emits a {Approval} event.\n function _approve(address by, address account, uint256 id) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n let bitmaskAddress := shr(96, not(0))\n account := and(bitmaskAddress, account)\n by := and(bitmaskAddress, by)\n // Load the owner of the token.\n mstore(0x00, id)\n mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, by))\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let owner := and(bitmaskAddress, sload(ownershipSlot))\n // Revert if the token does not exist.\n if iszero(owner) {\n mstore(0x00, 0xceea21b6) // `TokenDoesNotExist()`.\n revert(0x1c, 0x04)\n }\n // If `by` is not the zero address, do the authorization check.\n // Revert if `by` is not the owner, nor approved.\n if iszero(or(iszero(by), eq(by, owner))) {\n mstore(0x00, owner)\n if iszero(sload(keccak256(0x0c, 0x30))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Sets `account` as the approved account to manage `id`.\n sstore(add(1, ownershipSlot), account)\n // Emit the {Approval} event.\n log4(codesize(), 0x00, _APPROVAL_EVENT_SIGNATURE, owner, account, id)\n }\n }\n\n /// @dev Approve or remove the `operator` as an operator for `by`,\n /// without authorization checks.\n ///\n /// Emits an {ApprovalForAll} event.\n function _setApprovalForAll(address by, address operator, bool isApproved) internal virtual {\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n by := shr(96, shl(96, by))\n operator := shr(96, shl(96, operator))\n // Convert to 0 or 1.\n isApproved := iszero(iszero(isApproved))\n // Update the `isApproved` for (`by`, `operator`).\n mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, operator))\n mstore(0x00, by)\n sstore(keccak256(0x0c, 0x30), isApproved)\n // Emit the {ApprovalForAll} event.\n mstore(0x00, isApproved)\n log3(0x00, 0x20, _APPROVAL_FOR_ALL_EVENT_SIGNATURE, by, operator)\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* INTERNAL TRANSFER FUNCTIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Equivalent to `_transfer(address(0), from, to, id)`.\n function _transfer(address from, address to, uint256 id) internal virtual {\n _transfer(address(0), from, to, id);\n }\n\n /// @dev Transfers token `id` from `from` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must exist.\n /// - `from` must be the owner of the token.\n /// - `to` cannot be the zero address.\n /// - If `by` is not the zero address,\n /// it must be the owner of the token, or be approved to manage the token.\n ///\n /// Emits a {Transfer} event.\n function _transfer(address by, address from, address to, uint256 id) internal virtual {\n _beforeTokenTransfer(from, to, id);\n /// @solidity memory-safe-assembly\n assembly {\n // Clear the upper 96 bits.\n let bitmaskAddress := shr(96, not(0))\n from := and(bitmaskAddress, from)\n to := and(bitmaskAddress, to)\n by := and(bitmaskAddress, by)\n // Load the ownership data.\n mstore(0x00, id)\n mstore(0x1c, or(_ERC721_MASTER_SLOT_SEED, by))\n let ownershipSlot := add(id, add(id, keccak256(0x00, 0x20)))\n let ownershipPacked := sload(ownershipSlot)\n let owner := and(bitmaskAddress, ownershipPacked)\n // Revert if the token does not exist, or if `from` is not the owner.\n if iszero(mul(owner, eq(owner, from))) {\n // `TokenDoesNotExist()`, `TransferFromIncorrectOwner()`.\n mstore(shl(2, iszero(owner)), 0xceea21b6a1148100)\n revert(0x1c, 0x04)\n }\n // Load, check, and update the token approval.\n {\n mstore(0x00, from)\n let approvedAddress := sload(add(1, ownershipSlot))\n // If `by` is not the zero address, do the authorization check.\n // Revert if the `by` is not the owner, nor approved.\n if iszero(or(iszero(by), or(eq(by, from), eq(by, approvedAddress)))) {\n if iszero(sload(keccak256(0x0c, 0x30))) {\n mstore(0x00, 0x4b6e7f18) // `NotOwnerNorApproved()`.\n revert(0x1c, 0x04)\n }\n }\n // Delete the approved address if any.\n if approvedAddress { sstore(add(1, ownershipSlot), 0) }\n }\n // Update with the new owner.\n sstore(ownershipSlot, xor(ownershipPacked, xor(from, to)))\n // Decrement the balance of `from`.\n {\n let fromBalanceSlot := keccak256(0x0c, 0x1c)\n sstore(fromBalanceSlot, sub(sload(fromBalanceSlot), 1))\n }\n // Increment the balance of `to`.\n {\n mstore(0x00, to)\n let toBalanceSlot := keccak256(0x0c, 0x1c)\n let toBalanceSlotPacked := add(sload(toBalanceSlot), 1)\n // Revert if `to` is the zero address, or if the account balance overflows.\n if iszero(mul(to, and(toBalanceSlotPacked, _MAX_ACCOUNT_BALANCE))) {\n // `TransferToZeroAddress()`, `AccountBalanceOverflow()`.\n mstore(shl(2, iszero(to)), 0xea553b3401336cea)\n revert(0x1c, 0x04)\n }\n sstore(toBalanceSlot, toBalanceSlotPacked)\n }\n // Emit the {Transfer} event.\n log4(codesize(), 0x00, _TRANSFER_EVENT_SIGNATURE, from, to, id)\n }\n _afterTokenTransfer(from, to, id);\n }\n\n /// @dev Equivalent to `_safeTransfer(from, to, id, "")`.\n function _safeTransfer(address from, address to, uint256 id) internal virtual {\n _safeTransfer(from, to, id, "");\n }\n\n /// @dev Transfers token `id` from `from` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must exist.\n /// - `from` must be the owner of the token.\n /// - `to` cannot be the zero address.\n /// - The caller must be the owner of the token, or be approved to manage the token.\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 function _safeTransfer(address from, address to, uint256 id, bytes memory data)\n internal\n virtual\n {\n _transfer(address(0), from, to, id);\n if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);\n }\n\n /// @dev Equivalent to `_safeTransfer(by, from, to, id, "")`.\n function _safeTransfer(address by, address from, address to, uint256 id) internal virtual {\n _safeTransfer(by, from, to, id, "");\n }\n\n /// @dev Transfers token `id` from `from` to `to`.\n ///\n /// Requirements:\n ///\n /// - Token `id` must exist.\n /// - `from` must be the owner of the token.\n /// - `to` cannot be the zero address.\n /// - If `by` is not the zero address,\n /// it must be the owner of the token, or be approved to manage the token.\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 function _safeTransfer(address by, address from, address to, uint256 id, bytes memory data)\n internal\n virtual\n {\n _transfer(by, from, to, id);\n if (_hasCode(to)) _checkOnERC721Received(from, to, id, data);\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* HOOKS FOR OVERRIDING */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Hook that is called before any token transfers, including minting and burning.\n function _beforeTokenTransfer(address from, address to, uint256 id) internal virtual {}\n\n /// @dev Hook that is called after any token transfers, including minting and burning.\n function _afterTokenTransfer(address from, address to, uint256 id) internal virtual {}\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* PRIVATE HELPERS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns if `a` has bytecode of non-zero length.\n function _hasCode(address a) private view returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := extcodesize(a) // Can handle dirty upper bits.\n }\n }\n\n /// @dev Perform a call to invoke {IERC721Receiver-onERC721Received} on `to`.\n /// Reverts if the target does not support the function correctly.\n function _checkOnERC721Received(address from, address to, uint256 id, bytes memory data)\n private\n {\n /// @solidity memory-safe-assembly\n assembly {\n // Prepare the calldata.\n let m := mload(0x40)\n let onERC721ReceivedSelector := 0x150b7a02\n mstore(m, onERC721ReceivedSelector)\n mstore(add(m, 0x20), caller()) // The `operator`, which is always `msg.sender`.\n mstore(add(m, 0x40), shr(96, shl(96, from)))\n mstore(add(m, 0x60), id)\n mstore(add(m, 0x80), 0x80)\n let n := mload(data)\n mstore(add(m, 0xa0), n)\n if n { pop(staticcall(gas(), 4, add(data, 0x20), n, add(m, 0xc0), n)) }\n // Revert if the call reverts.\n if iszero(call(gas(), to, 0, add(m, 0x1c), add(n, 0xa4), m, 0x20)) {\n if returndatasize() {\n // Bubble up the revert if the call reverts.\n returndatacopy(m, 0x00, returndatasize())\n revert(m, returndatasize())\n }\n }\n // Load the returndata and compare it.\n if iszero(eq(mload(m), shl(224, onERC721ReceivedSelector))) {\n mstore(0x00, 0xd1a57ed6) // `TransferToNonERC721ReceiverImplementer()`.\n revert(0x1c, 0x04)\n }\n }\n }\n}\n' }, - 'node_modules/@openzeppelin/contracts/utils/Strings.sol': { + 'lib/solady/src/utils/LibString.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' + '// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\nimport {LibBytes} from "./LibBytes.sol";\n\n/// @notice Library for converting numbers into strings and other string operations.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibString.sol)\n/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)\n///\n/// @dev Note:\n/// For performance and bytecode compactness, most of the string operations are restricted to\n/// byte strings (7-bit ASCII), except where otherwise specified.\n/// Usage of byte string operations on charsets with runes spanning two or more bytes\n/// can lead to undefined behavior.\nlibrary LibString {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STRUCTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Goated string storage struct that totally MOGs, no cap, fr.\n /// Uses less gas and bytecode than Solidity\'s native string storage. It\'s meta af.\n /// Packs length with the first 31 bytes if <255 bytes, so it’s mad tight.\n struct StringStorage {\n bytes32 _spacer;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CUSTOM ERRORS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The length of the output is too small to contain all the hex digits.\n error HexLengthInsufficient();\n\n /// @dev The length of the string is more than 32 bytes.\n error TooBigForSmallString();\n\n /// @dev The input string must be a 7-bit ASCII.\n error StringNot7BitASCII();\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The constant returned when the `search` is not found in the string.\n uint256 internal constant NOT_FOUND = type(uint256).max;\n\n /// @dev Lookup for \'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\'.\n uint128 internal constant ALPHANUMERIC_7_BIT_ASCII = 0x7fffffe07fffffe03ff000000000000;\n\n /// @dev Lookup for \'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\'.\n uint128 internal constant LETTERS_7_BIT_ASCII = 0x7fffffe07fffffe0000000000000000;\n\n /// @dev Lookup for \'abcdefghijklmnopqrstuvwxyz\'.\n uint128 internal constant LOWERCASE_7_BIT_ASCII = 0x7fffffe000000000000000000000000;\n\n /// @dev Lookup for \'ABCDEFGHIJKLMNOPQRSTUVWXYZ\'.\n uint128 internal constant UPPERCASE_7_BIT_ASCII = 0x7fffffe0000000000000000;\n\n /// @dev Lookup for \'0123456789\'.\n uint128 internal constant DIGITS_7_BIT_ASCII = 0x3ff000000000000;\n\n /// @dev Lookup for \'0123456789abcdefABCDEF\'.\n uint128 internal constant HEXDIGITS_7_BIT_ASCII = 0x7e0000007e03ff000000000000;\n\n /// @dev Lookup for \'01234567\'.\n uint128 internal constant OCTDIGITS_7_BIT_ASCII = 0xff000000000000;\n\n /// @dev Lookup for \'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\\\'()*+,-./:;<=>?@[\\\\]^_`{|}~ \\t\\n\\r\\x0b\\x0c\'.\n uint128 internal constant PRINTABLE_7_BIT_ASCII = 0x7fffffffffffffffffffffff00003e00;\n\n /// @dev Lookup for \'!"#$%&\\\'()*+,-./:;<=>?@[\\\\]^_`{|}~\'.\n uint128 internal constant PUNCTUATION_7_BIT_ASCII = 0x78000001f8000001fc00fffe00000000;\n\n /// @dev Lookup for \' \\t\\n\\r\\x0b\\x0c\'.\n uint128 internal constant WHITESPACE_7_BIT_ASCII = 0x100003e00;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STRING STORAGE OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Sets the value of the string storage `$` to `s`.\n function set(StringStorage storage $, string memory s) internal {\n LibBytes.set(bytesStorage($), bytes(s));\n }\n\n /// @dev Sets the value of the string storage `$` to `s`.\n function setCalldata(StringStorage storage $, string calldata s) internal {\n LibBytes.setCalldata(bytesStorage($), bytes(s));\n }\n\n /// @dev Sets the value of the string storage `$` to the empty string.\n function clear(StringStorage storage $) internal {\n delete $._spacer;\n }\n\n /// @dev Returns whether the value stored is `$` is the empty string "".\n function isEmpty(StringStorage storage $) internal view returns (bool) {\n return uint256($._spacer) & 0xff == uint256(0);\n }\n\n /// @dev Returns the length of the value stored in `$`.\n function length(StringStorage storage $) internal view returns (uint256) {\n return LibBytes.length(bytesStorage($));\n }\n\n /// @dev Returns the value stored in `$`.\n function get(StringStorage storage $) internal view returns (string memory) {\n return string(LibBytes.get(bytesStorage($)));\n }\n\n /// @dev Returns the uint8 at index `i`. If out-of-bounds, returns 0.\n function uint8At(StringStorage storage $, uint256 i) internal view returns (uint8) {\n return LibBytes.uint8At(bytesStorage($), i);\n }\n\n /// @dev Helper to cast `$` to a `BytesStorage`.\n function bytesStorage(StringStorage storage $)\n internal\n pure\n returns (LibBytes.BytesStorage storage casted)\n {\n /// @solidity memory-safe-assembly\n assembly {\n casted.slot := $.slot\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* DECIMAL OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the base 10 decimal representation of `value`.\n function toString(uint256 value) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\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.\n result := add(mload(0x40), 0x80)\n mstore(0x40, add(result, 0x20)) // Allocate memory.\n mstore(result, 0) // Zeroize the slot after the string.\n\n let end := result // Cache the end of the memory to calculate the length later.\n let w := not(0) // Tsk.\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 for { let temp := value } 1 {} {\n result := add(result, w) // `sub(result, 1)`.\n // Store the character to the pointer.\n // The ASCII index of the \'0\' character is 48.\n mstore8(result, add(48, mod(temp, 10)))\n temp := div(temp, 10) // Keep dividing `temp` until zero.\n if iszero(temp) { break }\n }\n let n := sub(end, result)\n result := sub(result, 0x20) // Move the pointer 32 bytes back to make room for the length.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the base 10 decimal representation of `value`.\n function toString(int256 value) internal pure returns (string memory result) {\n if (value >= 0) return toString(uint256(value));\n unchecked {\n result = toString(~uint256(value) + 1);\n }\n /// @solidity memory-safe-assembly\n assembly {\n // We still have some spare memory space on the left,\n // as we have allocated 3 words (96 bytes) for up to 78 digits.\n let n := mload(result) // Load the string length.\n mstore(result, 0x2d) // Store the \'-\' character.\n result := sub(result, 1) // Move back the string pointer by a byte.\n mstore(result, add(n, 1)) // Update the string length.\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* HEXADECIMAL OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the hexadecimal representation of `value`,\n /// left-padded to an input length of `byteCount` bytes.\n /// The output is prefixed with "0x" encoded using 2 hexadecimal digits per byte,\n /// giving a total length of `byteCount * 2 + 2` bytes.\n /// Reverts if `byteCount` is too small for the output to contain all the digits.\n function toHexString(uint256 value, uint256 byteCount)\n internal\n pure\n returns (string memory result)\n {\n result = toHexStringNoPrefix(value, byteCount);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`,\n /// left-padded to an input length of `byteCount` bytes.\n /// The output is not prefixed with "0x" and is encoded using 2 hexadecimal digits per byte,\n /// giving a total length of `byteCount * 2` bytes.\n /// Reverts if `byteCount` is too small for the output to contain all the digits.\n function toHexStringNoPrefix(uint256 value, uint256 byteCount)\n internal\n pure\n returns (string memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n // We need 0x20 bytes for the trailing zeros padding, `byteCount * 2` bytes\n // for the digits, 0x02 bytes for the prefix, and 0x20 bytes for the length.\n // We add 0x20 to the total and round down to a multiple of 0x20.\n // (0x20 + 0x20 + 0x02 + 0x20) = 0x62.\n result := add(mload(0x40), and(add(shl(1, byteCount), 0x42), not(0x1f)))\n mstore(0x40, add(result, 0x20)) // Allocate memory.\n mstore(result, 0) // Zeroize the slot after the string.\n\n let end := result // Cache the end to calculate the length later.\n // Store "0123456789abcdef" in scratch space.\n mstore(0x0f, 0x30313233343536373839616263646566)\n\n let start := sub(result, add(byteCount, byteCount))\n let w := not(1) // Tsk.\n let temp := value\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 for {} 1 {} {\n result := add(result, w) // `sub(result, 2)`.\n mstore8(add(result, 1), mload(and(temp, 15)))\n mstore8(result, mload(and(shr(4, temp), 15)))\n temp := shr(8, temp)\n if iszero(xor(result, start)) { break }\n }\n if temp {\n mstore(0x00, 0x2194895a) // `HexLengthInsufficient()`.\n revert(0x1c, 0x04)\n }\n let n := sub(end, result)\n result := sub(result, 0x20)\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.\n /// As address are 20 bytes long, the output will left-padded to have\n /// a length of `20 * 2 + 2` bytes.\n function toHexString(uint256 value) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x".\n /// The output excludes leading "0" from the `toHexString` output.\n /// `0x00: "0x0", 0x01: "0x1", 0x12: "0x12", 0x123: "0x123"`.\n function toMinimalHexString(uint256 value) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let o := eq(byte(0, mload(add(result, 0x20))), 0x30) // Whether leading zero is present.\n let n := add(mload(result), 2) // Compute the length.\n mstore(add(result, o), 0x3078) // Store the "0x" prefix, accounting for leading zero.\n result := sub(add(result, o), 2) // Move the pointer, accounting for leading zero.\n mstore(result, sub(n, o)) // Store the length, accounting for leading zero.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output excludes leading "0" from the `toHexStringNoPrefix` output.\n /// `0x00: "0", 0x01: "1", 0x12: "12", 0x123: "123"`.\n function toMinimalHexStringNoPrefix(uint256 value)\n internal\n pure\n returns (string memory result)\n {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let o := eq(byte(0, mload(add(result, 0x20))), 0x30) // Whether leading zero is present.\n let n := mload(result) // Get the length.\n result := add(result, o) // Move the pointer, accounting for leading zero.\n mstore(result, sub(n, o)) // Store the length, accounting for leading zero.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is encoded using 2 hexadecimal digits per byte.\n /// As address are 20 bytes long, the output will left-padded to have\n /// a length of `20 * 2` bytes.\n function toHexStringNoPrefix(uint256 value) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,\n // 0x02 bytes for the prefix, and 0x40 bytes for the digits.\n // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x40) is 0xa0.\n result := add(mload(0x40), 0x80)\n mstore(0x40, add(result, 0x20)) // Allocate memory.\n mstore(result, 0) // Zeroize the slot after the string.\n\n let end := result // Cache the end to calculate the length later.\n mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.\n\n let w := not(1) // Tsk.\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 for { let temp := value } 1 {} {\n result := add(result, w) // `sub(result, 2)`.\n mstore8(add(result, 1), mload(and(temp, 15)))\n mstore8(result, mload(and(shr(4, temp), 15)))\n temp := shr(8, temp)\n if iszero(temp) { break }\n }\n let n := sub(end, result)\n result := sub(result, 0x20)\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x", encoded using 2 hexadecimal digits per byte,\n /// and the alphabets are capitalized conditionally according to\n /// https://eips.ethereum.org/EIPS/eip-55\n function toHexStringChecksummed(address value) internal pure returns (string memory result) {\n result = toHexString(value);\n /// @solidity memory-safe-assembly\n assembly {\n let mask := shl(6, div(not(0), 255)) // `0b010000000100000000 ...`\n let o := add(result, 0x22)\n let hashed := and(keccak256(o, 40), mul(34, mask)) // `0b10001000 ... `\n let t := shl(240, 136) // `0b10001000 << 240`\n for { let i := 0 } 1 {} {\n mstore(add(i, i), mul(t, byte(i, hashed)))\n i := add(i, 1)\n if eq(i, 20) { break }\n }\n mstore(o, xor(mload(o), shr(1, and(mload(0x00), and(mload(o), mask)))))\n o := add(o, 0x20)\n mstore(o, xor(mload(o), shr(1, and(mload(0x20), and(mload(o), mask)))))\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is prefixed with "0x" and encoded using 2 hexadecimal digits per byte.\n function toHexString(address value) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(value);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hexadecimal representation of `value`.\n /// The output is encoded using 2 hexadecimal digits per byte.\n function toHexStringNoPrefix(address value) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n // Allocate memory.\n // We need 0x20 bytes for the trailing zeros padding, 0x20 bytes for the length,\n // 0x02 bytes for the prefix, and 0x28 bytes for the digits.\n // The next multiple of 0x20 above (0x20 + 0x20 + 0x02 + 0x28) is 0x80.\n mstore(0x40, add(result, 0x80))\n mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.\n\n result := add(result, 2)\n mstore(result, 40) // Store the length.\n let o := add(result, 0x20)\n mstore(add(o, 40), 0) // Zeroize the slot after the string.\n value := shl(96, value)\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 for { let i := 0 } 1 {} {\n let p := add(o, add(i, i))\n let temp := byte(i, value)\n mstore8(add(p, 1), mload(and(temp, 15)))\n mstore8(p, mload(shr(4, temp)))\n i := add(i, 1)\n if eq(i, 20) { break }\n }\n }\n }\n\n /// @dev Returns the hex encoded string from the raw bytes.\n /// The output is encoded using 2 hexadecimal digits per byte.\n function toHexString(bytes memory raw) internal pure returns (string memory result) {\n result = toHexStringNoPrefix(raw);\n /// @solidity memory-safe-assembly\n assembly {\n let n := add(mload(result), 2) // Compute the length.\n mstore(result, 0x3078) // Store the "0x" prefix.\n result := sub(result, 2) // Move the pointer.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the hex encoded string from the raw bytes.\n /// The output is encoded using 2 hexadecimal digits per byte.\n function toHexStringNoPrefix(bytes memory raw) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(raw)\n result := add(mload(0x40), 2) // Skip 2 bytes for the optional prefix.\n mstore(result, add(n, n)) // Store the length of the output.\n\n mstore(0x0f, 0x30313233343536373839616263646566) // Store the "0123456789abcdef" lookup.\n let o := add(result, 0x20)\n let end := add(raw, n)\n for {} iszero(eq(raw, end)) {} {\n raw := add(raw, 1)\n mstore8(add(o, 1), mload(and(mload(raw), 15)))\n mstore8(o, mload(and(shr(4, mload(raw)), 15)))\n o := add(o, 2)\n }\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* RUNE STRING OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns the number of UTF characters in the string.\n function runeCount(string memory s) internal pure returns (uint256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n if mload(s) {\n mstore(0x00, div(not(0), 255))\n mstore(0x20, 0x0202020202020202020202020202020202020202020202020303030304040506)\n let o := add(s, 0x20)\n let end := add(o, mload(s))\n for { result := 1 } 1 { result := add(result, 1) } {\n o := add(o, byte(0, mload(shr(250, mload(o)))))\n if iszero(lt(o, end)) { break }\n }\n }\n }\n }\n\n /// @dev Returns if this string is a 7-bit ASCII string.\n /// (i.e. all characters codes are in [0..127])\n function is7BitASCII(string memory s) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := 1\n let mask := shl(7, div(not(0), 255))\n let n := mload(s)\n if n {\n let o := add(s, 0x20)\n let end := add(o, n)\n let last := mload(end)\n mstore(end, 0)\n for {} 1 {} {\n if and(mask, mload(o)) {\n result := 0\n break\n }\n o := add(o, 0x20)\n if iszero(lt(o, end)) { break }\n }\n mstore(end, last)\n }\n }\n }\n\n /// @dev Returns if this string is a 7-bit ASCII string,\n /// AND all characters are in the `allowed` lookup.\n /// Note: If `s` is empty, returns true regardless of `allowed`.\n function is7BitASCII(string memory s, uint128 allowed) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := 1\n if mload(s) {\n let allowed_ := shr(128, shl(128, allowed))\n let o := add(s, 0x20)\n for { let end := add(o, mload(s)) } 1 {} {\n result := and(result, shr(byte(0, mload(o)), allowed_))\n o := add(o, 1)\n if iszero(and(result, lt(o, end))) { break }\n }\n }\n }\n }\n\n /// @dev Converts the bytes in the 7-bit ASCII string `s` to\n /// an allowed lookup for use in `is7BitASCII(s, allowed)`.\n /// To save runtime gas, you can cache the result in an immutable variable.\n function to7BitASCIIAllowedLookup(string memory s) internal pure returns (uint128 result) {\n /// @solidity memory-safe-assembly\n assembly {\n if mload(s) {\n let o := add(s, 0x20)\n for { let end := add(o, mload(s)) } 1 {} {\n result := or(result, shl(byte(0, mload(o)), 1))\n o := add(o, 1)\n if iszero(lt(o, end)) { break }\n }\n if shr(128, result) {\n mstore(0x00, 0xc9807e0d) // `StringNot7BitASCII()`.\n revert(0x1c, 0x04)\n }\n }\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* BYTE STRING OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n // For performance and bytecode compactness, byte string operations are restricted\n // to 7-bit ASCII strings. All offsets are byte offsets, not UTF character offsets.\n // Usage of byte string operations on charsets with runes spanning two or more bytes\n // can lead to undefined behavior.\n\n /// @dev Returns `subject` all occurrences of `needle` replaced with `replacement`.\n function replace(string memory subject, string memory needle, string memory replacement)\n internal\n pure\n returns (string memory)\n {\n return string(LibBytes.replace(bytes(subject), bytes(needle), bytes(replacement)));\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(string memory subject, string memory needle, uint256 from)\n internal\n pure\n returns (uint256)\n {\n return LibBytes.indexOf(bytes(subject), bytes(needle), from);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(string memory subject, string memory needle) internal pure returns (uint256) {\n return LibBytes.indexOf(bytes(subject), bytes(needle), 0);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(string memory subject, string memory needle, uint256 from)\n internal\n pure\n returns (uint256)\n {\n return LibBytes.lastIndexOf(bytes(subject), bytes(needle), from);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(string memory subject, string memory needle)\n internal\n pure\n returns (uint256)\n {\n return LibBytes.lastIndexOf(bytes(subject), bytes(needle), type(uint256).max);\n }\n\n /// @dev Returns true if `needle` is found in `subject`, false otherwise.\n function contains(string memory subject, string memory needle) internal pure returns (bool) {\n return LibBytes.contains(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns whether `subject` starts with `needle`.\n function startsWith(string memory subject, string memory needle) internal pure returns (bool) {\n return LibBytes.startsWith(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns whether `subject` ends with `needle`.\n function endsWith(string memory subject, string memory needle) internal pure returns (bool) {\n return LibBytes.endsWith(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns `subject` repeated `times`.\n function repeat(string memory subject, uint256 times) internal pure returns (string memory) {\n return string(LibBytes.repeat(bytes(subject), times));\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).\n /// `start` and `end` are byte offsets.\n function slice(string memory subject, uint256 start, uint256 end)\n internal\n pure\n returns (string memory)\n {\n return string(LibBytes.slice(bytes(subject), start, end));\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to the end of the string.\n /// `start` is a byte offset.\n function slice(string memory subject, uint256 start) internal pure returns (string memory) {\n return string(LibBytes.slice(bytes(subject), start, type(uint256).max));\n }\n\n /// @dev Returns all the indices of `needle` in `subject`.\n /// The indices are byte offsets.\n function indicesOf(string memory subject, string memory needle)\n internal\n pure\n returns (uint256[] memory)\n {\n return LibBytes.indicesOf(bytes(subject), bytes(needle));\n }\n\n /// @dev Returns an arrays of strings based on the `delimiter` inside of the `subject` string.\n function split(string memory subject, string memory delimiter)\n internal\n pure\n returns (string[] memory result)\n {\n bytes[] memory a = LibBytes.split(bytes(subject), bytes(delimiter));\n /// @solidity memory-safe-assembly\n assembly {\n result := a\n }\n }\n\n /// @dev Returns a concatenated string of `a` and `b`.\n /// Cheaper than `string.concat()` and does not de-align the free memory pointer.\n function concat(string memory a, string memory b) internal pure returns (string memory) {\n return string(LibBytes.concat(bytes(a), bytes(b)));\n }\n\n /// @dev Returns a copy of the string in either lowercase or UPPERCASE.\n /// WARNING! This function is only compatible with 7-bit ASCII strings.\n function toCase(string memory subject, bool toUpper)\n internal\n pure\n returns (string memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(subject)\n if n {\n result := mload(0x40)\n let o := add(result, 0x20)\n let d := sub(subject, result)\n let flags := shl(add(70, shl(5, toUpper)), 0x3ffffff)\n for { let end := add(o, n) } 1 {} {\n let b := byte(0, mload(add(d, o)))\n mstore8(o, xor(and(shr(b, flags), 0x20), b))\n o := add(o, 1)\n if eq(o, end) { break }\n }\n mstore(result, n) // Store the length.\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n }\n\n /// @dev Returns a string from a small bytes32 string.\n /// `s` must be null-terminated, or behavior will be undefined.\n function fromSmallString(bytes32 s) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let n := 0\n for {} byte(n, s) { n := add(n, 1) } {} // Scan for \'\\0\'.\n mstore(result, n) // Store the length.\n let o := add(result, 0x20)\n mstore(o, s) // Store the bytes of the string.\n mstore(add(o, n), 0) // Zeroize the slot after the string.\n mstore(0x40, add(result, 0x40)) // Allocate memory.\n }\n }\n\n /// @dev Returns the small string, with all bytes after the first null byte zeroized.\n function normalizeSmallString(bytes32 s) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n for {} byte(result, s) { result := add(result, 1) } {} // Scan for \'\\0\'.\n mstore(0x00, s)\n mstore(result, 0x00)\n result := mload(0x00)\n }\n }\n\n /// @dev Returns the string as a normalized null-terminated small string.\n function toSmallString(string memory s) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(s)\n if iszero(lt(result, 33)) {\n mstore(0x00, 0xec92f9a3) // `TooBigForSmallString()`.\n revert(0x1c, 0x04)\n }\n result := shl(shl(3, sub(32, result)), mload(add(s, result)))\n }\n }\n\n /// @dev Returns a lowercased copy of the string.\n /// WARNING! This function is only compatible with 7-bit ASCII strings.\n function lower(string memory subject) internal pure returns (string memory result) {\n result = toCase(subject, false);\n }\n\n /// @dev Returns an UPPERCASED copy of the string.\n /// WARNING! This function is only compatible with 7-bit ASCII strings.\n function upper(string memory subject) internal pure returns (string memory result) {\n result = toCase(subject, true);\n }\n\n /// @dev Escapes the string to be used within HTML tags.\n function escapeHTML(string memory s) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let end := add(s, mload(s))\n let o := add(result, 0x20)\n // Store the bytes of the packed offsets and strides into the scratch space.\n // `packed = (stride << 5) | offset`. Max offset is 20. Max stride is 6.\n mstore(0x1f, 0x900094)\n mstore(0x08, 0xc0000000a6ab)\n // Store ""&'<>" into the scratch space.\n mstore(0x00, shl(64, 0x2671756f743b26616d703b262333393b266c743b2667743b))\n for {} iszero(eq(s, end)) {} {\n s := add(s, 1)\n let c := and(mload(s), 0xff)\n // Not in `["\\"","\'","&","<",">"]`.\n if iszero(and(shl(c, 1), 0x500000c400000000)) {\n mstore8(o, c)\n o := add(o, 1)\n continue\n }\n let t := shr(248, mload(c))\n mstore(o, mload(and(t, 0x1f)))\n o := add(o, shr(5, t))\n }\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Escapes the string to be used within double-quotes in a JSON.\n /// If `addDoubleQuotes` is true, the result will be enclosed in double-quotes.\n function escapeJSON(string memory s, bool addDoubleQuotes)\n internal\n pure\n returns (string memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let o := add(result, 0x20)\n if addDoubleQuotes {\n mstore8(o, 34)\n o := add(1, o)\n }\n // Store "\\\\u0000" in scratch space.\n // Store "0123456789abcdef" in scratch space.\n // Also, store `{0x08:"b", 0x09:"t", 0x0a:"n", 0x0c:"f", 0x0d:"r"}`.\n // into the scratch space.\n mstore(0x15, 0x5c75303030303031323334353637383961626364656662746e006672)\n // Bitmask for detecting `["\\"","\\\\"]`.\n let e := or(shl(0x22, 1), shl(0x5c, 1))\n for { let end := add(s, mload(s)) } iszero(eq(s, end)) {} {\n s := add(s, 1)\n let c := and(mload(s), 0xff)\n if iszero(lt(c, 0x20)) {\n if iszero(and(shl(c, 1), e)) {\n // Not in `["\\"","\\\\"]`.\n mstore8(o, c)\n o := add(o, 1)\n continue\n }\n mstore8(o, 0x5c) // "\\\\".\n mstore8(add(o, 1), c)\n o := add(o, 2)\n continue\n }\n if iszero(and(shl(c, 1), 0x3700)) {\n // Not in `["\\b","\\t","\\n","\\f","\\d"]`.\n mstore8(0x1d, mload(shr(4, c))) // Hex value.\n mstore8(0x1e, mload(and(c, 15))) // Hex value.\n mstore(o, mload(0x19)) // "\\\\u00XX".\n o := add(o, 6)\n continue\n }\n mstore8(o, 0x5c) // "\\\\".\n mstore8(add(o, 1), mload(add(c, 8)))\n o := add(o, 2)\n }\n if addDoubleQuotes {\n mstore8(o, 34)\n o := add(1, o)\n }\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Escapes the string to be used within double-quotes in a JSON.\n function escapeJSON(string memory s) internal pure returns (string memory result) {\n result = escapeJSON(s, false);\n }\n\n /// @dev Encodes `s` so that it can be safely used in a URI,\n /// just like `encodeURIComponent` in JavaScript.\n /// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\n /// See: https://datatracker.ietf.org/doc/html/rfc2396\n /// See: https://datatracker.ietf.org/doc/html/rfc3986\n function encodeURIComponent(string memory s) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n // Store "0123456789ABCDEF" in scratch space.\n // Uppercased to be consistent with JavaScript\'s implementation.\n mstore(0x0f, 0x30313233343536373839414243444546)\n let o := add(result, 0x20)\n for { let end := add(s, mload(s)) } iszero(eq(s, end)) {} {\n s := add(s, 1)\n let c := and(mload(s), 0xff)\n // If not in `[0-9A-Z-a-z-_.!~*\'()]`.\n if iszero(and(1, shr(c, 0x47fffffe87fffffe03ff678200000000))) {\n mstore8(o, 0x25) // \'%\'.\n mstore8(add(o, 1), mload(and(shr(4, c), 15)))\n mstore8(add(o, 2), mload(and(c, 15)))\n o := add(o, 3)\n continue\n }\n mstore8(o, c)\n o := add(o, 1)\n }\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n mstore(o, 0) // Zeroize the slot after the string.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Returns whether `a` equals `b`.\n function eq(string memory a, string memory b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))\n }\n }\n\n /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small string.\n function eqs(string memory a, bytes32 b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n // These should be evaluated on compile time, as far as possible.\n let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.\n let x := not(or(m, or(b, add(m, and(b, m)))))\n let r := shl(7, iszero(iszero(shr(128, x))))\n r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))\n r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n r := or(r, shl(4, lt(0xffff, shr(r, x))))\n r := or(r, shl(3, lt(0xff, shr(r, x))))\n // forgefmt: disable-next-item\n result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),\n xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))\n }\n }\n\n /// @dev Returns 0 if `a == b`, -1 if `a < b`, +1 if `a > b`.\n /// If `a` == b[:a.length]`, and `a.length < b.length`, returns -1.\n function cmp(string memory a, string memory b) internal pure returns (int256) {\n return LibBytes.cmp(bytes(a), bytes(b));\n }\n\n /// @dev Packs a single string with its length into a single word.\n /// Returns `bytes32(0)` if the length is zero or greater than 31.\n function packOne(string memory a) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n // We don\'t need to zero right pad the string,\n // since this is our own custom non-standard packing scheme.\n result :=\n mul(\n // Load the length and the bytes.\n mload(add(a, 0x1f)),\n // `length != 0 && length < 32`. Abuses underflow.\n // Assumes that the length is valid and within the block gas limit.\n lt(sub(mload(a), 1), 0x1f)\n )\n }\n }\n\n /// @dev Unpacks a string packed using {packOne}.\n /// Returns the empty string if `packed` is `bytes32(0)`.\n /// If `packed` is not an output of {packOne}, the output behavior is undefined.\n function unpackOne(bytes32 packed) internal pure returns (string memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40) // Grab the free memory pointer.\n mstore(0x40, add(result, 0x40)) // Allocate 2 words (1 for the length, 1 for the bytes).\n mstore(result, 0) // Zeroize the length slot.\n mstore(add(result, 0x1f), packed) // Store the length and bytes.\n mstore(add(add(result, 0x20), mload(result)), 0) // Right pad with zeroes.\n }\n }\n\n /// @dev Packs two strings with their lengths into a single word.\n /// Returns `bytes32(0)` if combined length is zero or greater than 30.\n function packTwo(string memory a, string memory b) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n let aLen := mload(a)\n // We don\'t need to zero right pad the strings,\n // since this is our own custom non-standard packing scheme.\n result :=\n mul(\n or( // Load the length and the bytes of `a` and `b`.\n shl(shl(3, sub(0x1f, aLen)), mload(add(a, aLen))), mload(sub(add(b, 0x1e), aLen))),\n // `totalLen != 0 && totalLen < 31`. Abuses underflow.\n // Assumes that the lengths are valid and within the block gas limit.\n lt(sub(add(aLen, mload(b)), 1), 0x1e)\n )\n }\n }\n\n /// @dev Unpacks strings packed using {packTwo}.\n /// Returns the empty strings if `packed` is `bytes32(0)`.\n /// If `packed` is not an output of {packTwo}, the output behavior is undefined.\n function unpackTwo(bytes32 packed)\n internal\n pure\n returns (string memory resultA, string memory resultB)\n {\n /// @solidity memory-safe-assembly\n assembly {\n resultA := mload(0x40) // Grab the free memory pointer.\n resultB := add(resultA, 0x40)\n // Allocate 2 words for each string (1 for the length, 1 for the byte). Total 4 words.\n mstore(0x40, add(resultB, 0x40))\n // Zeroize the length slots.\n mstore(resultA, 0)\n mstore(resultB, 0)\n // Store the lengths and bytes.\n mstore(add(resultA, 0x1f), packed)\n mstore(add(resultB, 0x1f), mload(add(add(resultA, 0x20), mload(resultA))))\n // Right pad with zeroes.\n mstore(add(add(resultA, 0x20), mload(resultA)), 0)\n mstore(add(add(resultB, 0x20), mload(resultB)), 0)\n }\n }\n\n /// @dev Directly returns `a` without copying.\n function directReturn(string memory a) internal pure {\n /// @solidity memory-safe-assembly\n assembly {\n // Assumes that the string does not start from the scratch space.\n let retStart := sub(a, 0x20)\n let retUnpaddedSize := add(mload(a), 0x40)\n // Right pad with zeroes. Just in case the string is produced\n // by a method that doesn\'t zero right pad.\n mstore(add(retStart, retUnpaddedSize), 0)\n mstore(retStart, 0x20) // Store the return offset.\n // End the transaction, returning the string.\n return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))\n }\n }\n}\n' }, - 'node_modules/@openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.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 (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' }, - 'node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.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.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" }, - 'node_modules/@openzeppelin/contracts/utils/math/Math.sol': { + 'src/proxies/openzeppelin/ERC1967Proxy.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: 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' }, - 'node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol': { + 'src/tokens/common/IERC2981Controlled.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: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC2981ControlledFunctions {\n\n /**\n * Sets the royalty information that all ids in this contract will default to.\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n */\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;\n\n /**\n * Sets the royalty information that a given token id in this contract will use.\n * @param tokenId The token id to set the royalty information for\n * @param receiver Address of who should be sent the royalty payment\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\n * @notice This overrides the default royalty information for this token id\n */\n function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external;\n\n}\n\ninterface IERC2981Controlled is IERC2981ControlledFunctions { }\n' }, - 'node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.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: 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' }, - 'node_modules/erc721a/contracts/ERC721A.sol': { + 'lib/openzeppelin-contracts/contracts/token/common/ERC2981.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\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 * 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 // =============================================================\n // CONSTRUCTOR\n // =============================================================\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n }\n\n // =============================================================\n // TOKEN COUNTING OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the starting token ID.\n * To change the starting token ID, please override this function.\n */\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\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) {\n // Counter underflow is impossible as _burnCounter cannot be incremented\n // more than `_currentIndex - _startTokenId()` times.\n unchecked {\n return _currentIndex - _burnCounter - _startTokenId();\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) {\n // Counter underflow is impossible as `_currentIndex` does not decrement,\n // and it is initialized to `_startTokenId()`.\n unchecked {\n return _currentIndex - _startTokenId();\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 // 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();\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();\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 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 * Returns the packed ownership data of `tokenId`.\n */\n function _packedOwnershipOf(uint256 tokenId) private view returns (uint256) {\n uint256 curr = tokenId;\n\n unchecked {\n if (_startTokenId() <= curr)\n if (curr < _currentIndex) {\n uint256 packed = _packedOwnerships[curr];\n // If not burned.\n if (packed & _BITMASK_BURNED == 0) {\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, `curr` will not underflow.\n //\n // We can directly compare the packed value.\n // If the address is zero, packed will be zero.\n while (packed == 0) {\n packed = _packedOwnerships[--curr];\n }\n return packed;\n }\n }\n }\n revert OwnerQueryForNonexistentToken();\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.\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) public payable virtual override {\n address owner = ownerOf(tokenId);\n\n if (_msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n revert ApprovalCallerNotOwnerNorApproved();\n }\n\n _tokenApprovals[tokenId].value = to;\n emit Approval(owner, to, tokenId);\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();\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) {\n return\n _startTokenId() <= tokenId &&\n tokenId < _currentIndex && // If within bounds,\n _packedOwnerships[tokenId] & _BITMASK_BURNED == 0; // and not burned.\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 if (address(uint160(prevOwnershipPacked)) != from) revert TransferFromIncorrectOwner();\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();\n\n if (to == address(0)) revert TransferToZeroAddress();\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 emit Transfer(from, to, tokenId);\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();\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();\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\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();\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 // - `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 uint256 toMasked;\n uint256 end = startTokenId + quantity;\n\n // Use assembly to loop and emit the `Transfer` event for gas savings.\n // The duplicated `log4` removes an extra check and reduces stack juggling.\n // The assembly, together with the surrounding Solidity code, have been\n // delicately arranged to nudge the compiler into producing optimized opcodes.\n assembly {\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n toMasked := and(to, _BITMASK_ADDRESS)\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 startTokenId // `tokenId`.\n )\n\n // The `iszero(eq(,))` check ensures that large values of `quantity`\n // that overflows uint256 will make the loop run out of gas.\n // The compiler will optimize the `iszero` away for performance.\n for {\n let tokenId := add(startTokenId, 1)\n } iszero(eq(tokenId, end)) {\n tokenId := add(tokenId, 1)\n } {\n // Emit the `Transfer` event. Similar to above.\n log4(0, 0, _TRANSFER_EVENT_SIGNATURE, 0, toMasked, tokenId)\n }\n }\n if (toMasked == 0) revert MintToZeroAddress();\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();\n if (quantity == 0) revert MintZeroQuantity();\n if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) revert MintERC2309QuantityExceedsLimit();\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 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();\n }\n } while (index < end);\n // Reentrancy protection.\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 // 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();\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 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();\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" + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/common/ERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../../interfaces/IERC2981.sol";\nimport "../../utils/introspection/ERC165.sol";\n\n/**\n * @dev Implementation of the NFT Royalty Standard, a standardized way to retrieve royalty payment information.\n *\n * Royalty information can be specified globally for all token ids via {_setDefaultRoyalty}, and/or individually for\n * specific token ids via {_setTokenRoyalty}. The latter takes precedence over the first.\n *\n * Royalty is specified as a fraction of sale price. {_feeDenominator} is overridable but defaults to 10000, meaning the\n * fee is specified in basis points by default.\n *\n * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See\n * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to\n * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported.\n *\n * _Available since v4.5._\n */\nabstract contract ERC2981 is IERC2981, ERC165 {\n struct RoyaltyInfo {\n address receiver;\n uint96 royaltyFraction;\n }\n\n RoyaltyInfo private _defaultRoyaltyInfo;\n mapping(uint256 => RoyaltyInfo) private _tokenRoyaltyInfo;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {\n return interfaceId == type(IERC2981).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @inheritdoc IERC2981\n */\n function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) {\n RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId];\n\n if (royalty.receiver == address(0)) {\n royalty = _defaultRoyaltyInfo;\n }\n\n uint256 royaltyAmount = (salePrice * royalty.royaltyFraction) / _feeDenominator();\n\n return (royalty.receiver, royaltyAmount);\n }\n\n /**\n * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a\n * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an\n * override.\n */\n function _feeDenominator() internal pure virtual returns (uint96) {\n return 10000;\n }\n\n /**\n * @dev Sets the royalty information that all ids in this contract will default to.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setDefaultRoyalty(address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: invalid receiver");\n\n _defaultRoyaltyInfo = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Removes default royalty information.\n */\n function _deleteDefaultRoyalty() internal virtual {\n delete _defaultRoyaltyInfo;\n }\n\n /**\n * @dev Sets the royalty information for a specific token id, overriding the global default.\n *\n * Requirements:\n *\n * - `receiver` cannot be the zero address.\n * - `feeNumerator` cannot be greater than the fee denominator.\n */\n function _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) internal virtual {\n require(feeNumerator <= _feeDenominator(), "ERC2981: royalty fee will exceed salePrice");\n require(receiver != address(0), "ERC2981: Invalid parameters");\n\n _tokenRoyaltyInfo[tokenId] = RoyaltyInfo(receiver, feeNumerator);\n }\n\n /**\n * @dev Resets royalty information for the token id back to the global default.\n */\n function _resetTokenRoyalty(uint256 tokenId) internal virtual {\n delete _tokenRoyaltyInfo[tokenId];\n }\n}\n' }, - 'node_modules/erc721a/contracts/IERC721A.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\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 // 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.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' }, - 'node_modules/erc721a/contracts/extensions/ERC721AQueryable.sol': { + 'lib/solady/src/utils/LibBytes.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\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) public view virtual override returns (TokenOwnership memory) {\n TokenOwnership memory ownership;\n if (tokenId < _startTokenId() || tokenId >= _nextTokenId()) {\n return ownership;\n }\n ownership = _ownershipAt(tokenId);\n if (ownership.burned) {\n return ownership;\n }\n return _ownershipOf(tokenId);\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 unchecked {\n uint256 tokenIdsLength = tokenIds.length;\n TokenOwnership[] memory ownerships = new TokenOwnership[](tokenIdsLength);\n for (uint256 i; i != tokenIdsLength; ++i) {\n ownerships[i] = explicitOwnershipOf(tokenIds[i]);\n }\n return ownerships;\n }\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 unchecked {\n if (start >= stop) revert InvalidQueryRange();\n uint256 tokenIdsIdx;\n uint256 stopLimit = _nextTokenId();\n // Set `start = max(start, _startTokenId())`.\n if (start < _startTokenId()) {\n start = _startTokenId();\n }\n // Set `stop = min(stop, stopLimit)`.\n if (stop > stopLimit) {\n stop = stopLimit;\n }\n uint256 tokenIdsMaxLength = balanceOf(owner);\n // Set `tokenIdsMaxLength = min(balanceOf(owner), stop - start)`,\n // to cater for cases where `balanceOf(owner)` is too big.\n if (start < stop) {\n uint256 rangeLength = stop - start;\n if (rangeLength < tokenIdsMaxLength) {\n tokenIdsMaxLength = rangeLength;\n }\n } else {\n tokenIdsMaxLength = 0;\n }\n uint256[] memory tokenIds = new uint256[](tokenIdsMaxLength);\n if (tokenIdsMaxLength == 0) {\n return tokenIds;\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), initialize `currOwnershipAddr`.\n // `ownership.address` will not be zero, as `start` is clamped to the valid token ID range.\n if (!ownership.burned) {\n currOwnershipAddr = ownership.addr;\n }\n for (uint256 i = start; i != stop && tokenIdsIdx != tokenIdsMaxLength; ++i) {\n ownership = _ownershipAt(i);\n if (ownership.burned) {\n continue;\n }\n if (ownership.addr != address(0)) {\n currOwnershipAddr = ownership.addr;\n }\n if (currOwnershipAddr == owner) {\n tokenIds[tokenIdsIdx++] = i;\n }\n }\n // Downsize the array to fit.\n assembly {\n mstore(tokenIds, tokenIdsIdx)\n }\n return tokenIds;\n }\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 unchecked {\n uint256 tokenIdsIdx;\n address currOwnershipAddr;\n uint256 tokenIdsLength = balanceOf(owner);\n uint256[] memory tokenIds = new uint256[](tokenIdsLength);\n TokenOwnership memory ownership;\n for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {\n ownership = _ownershipAt(i);\n if (ownership.burned) {\n continue;\n }\n if (ownership.addr != address(0)) {\n currOwnershipAddr = ownership.addr;\n }\n if (currOwnershipAddr == owner) {\n tokenIds[tokenIdsIdx++] = i;\n }\n }\n return tokenIds;\n }\n }\n}\n" + "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.4;\n\n/// @notice Library for byte related operations.\n/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibBytes.sol)\nlibrary LibBytes {\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* STRUCTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Goated bytes storage struct that totally MOGs, no cap, fr.\n /// Uses less gas and bytecode than Solidity's native bytes storage. It's meta af.\n /// Packs length with the first 31 bytes if <255 bytes, so it’s mad tight.\n struct BytesStorage {\n bytes32 _spacer;\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* CONSTANTS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev The constant returned when the `search` is not found in the bytes.\n uint256 internal constant NOT_FOUND = type(uint256).max;\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* BYTE STORAGE OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Sets the value of the bytes storage `$` to `s`.\n function set(BytesStorage storage $, bytes memory s) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(s)\n let packed := or(0xff, shl(8, n))\n for { let i := 0 } 1 {} {\n if iszero(gt(n, 0xfe)) {\n i := 0x1f\n packed := or(n, shl(8, mload(add(s, i))))\n if iszero(gt(n, i)) { break }\n }\n let o := add(s, 0x20)\n mstore(0x00, $.slot)\n for { let p := keccak256(0x00, 0x20) } 1 {} {\n sstore(add(p, shr(5, i)), mload(add(o, i)))\n i := add(i, 0x20)\n if iszero(lt(i, n)) { break }\n }\n break\n }\n sstore($.slot, packed)\n }\n }\n\n /// @dev Sets the value of the bytes storage `$` to `s`.\n function setCalldata(BytesStorage storage $, bytes calldata s) internal {\n /// @solidity memory-safe-assembly\n assembly {\n let packed := or(0xff, shl(8, s.length))\n for { let i := 0 } 1 {} {\n if iszero(gt(s.length, 0xfe)) {\n i := 0x1f\n packed := or(s.length, shl(8, shr(8, calldataload(s.offset))))\n if iszero(gt(s.length, i)) { break }\n }\n mstore(0x00, $.slot)\n for { let p := keccak256(0x00, 0x20) } 1 {} {\n sstore(add(p, shr(5, i)), calldataload(add(s.offset, i)))\n i := add(i, 0x20)\n if iszero(lt(i, s.length)) { break }\n }\n break\n }\n sstore($.slot, packed)\n }\n }\n\n /// @dev Sets the value of the bytes storage `$` to the empty bytes.\n function clear(BytesStorage storage $) internal {\n delete $._spacer;\n }\n\n /// @dev Returns whether the value stored is `$` is the empty bytes \"\".\n function isEmpty(BytesStorage storage $) internal view returns (bool) {\n return uint256($._spacer) & 0xff == uint256(0);\n }\n\n /// @dev Returns the length of the value stored in `$`.\n function length(BytesStorage storage $) internal view returns (uint256 result) {\n result = uint256($._spacer);\n /// @solidity memory-safe-assembly\n assembly {\n let n := and(0xff, result)\n result := or(mul(shr(8, result), eq(0xff, n)), mul(n, iszero(eq(0xff, n))))\n }\n }\n\n /// @dev Returns the value stored in `$`.\n function get(BytesStorage storage $) internal view returns (bytes memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let o := add(result, 0x20)\n let packed := sload($.slot)\n let n := shr(8, packed)\n for { let i := 0 } 1 {} {\n if iszero(eq(or(packed, 0xff), packed)) {\n mstore(o, packed)\n n := and(0xff, packed)\n i := 0x1f\n if iszero(gt(n, i)) { break }\n }\n mstore(0x00, $.slot)\n for { let p := keccak256(0x00, 0x20) } 1 {} {\n mstore(add(o, i), sload(add(p, shr(5, i))))\n i := add(i, 0x20)\n if iszero(lt(i, n)) { break }\n }\n break\n }\n mstore(result, n) // Store the length of the memory.\n mstore(add(o, n), 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(add(o, n), 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Returns the uint8 at index `i`. If out-of-bounds, returns 0.\n function uint8At(BytesStorage storage $, uint256 i) internal view returns (uint8 result) {\n /// @solidity memory-safe-assembly\n assembly {\n for { let packed := sload($.slot) } 1 {} {\n if iszero(eq(or(packed, 0xff), packed)) {\n if iszero(gt(i, 0x1e)) {\n result := byte(i, packed)\n break\n }\n if iszero(gt(i, and(0xff, packed))) {\n mstore(0x00, $.slot)\n let j := sub(i, 0x1f)\n result := byte(and(j, 0x1f), sload(add(keccak256(0x00, 0x20), shr(5, j))))\n }\n break\n }\n if iszero(gt(i, shr(8, packed))) {\n mstore(0x00, $.slot)\n result := byte(and(i, 0x1f), sload(add(keccak256(0x00, 0x20), shr(5, i))))\n }\n break\n }\n }\n }\n\n /*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/\n /* BYTES OPERATIONS */\n /*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/\n\n /// @dev Returns `subject` all occurrences of `needle` replaced with `replacement`.\n function replace(bytes memory subject, bytes memory needle, bytes memory replacement)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let needleLen := mload(needle)\n let replacementLen := mload(replacement)\n let d := sub(result, subject) // Memory difference.\n let i := add(subject, 0x20) // Subject bytes pointer.\n mstore(0x00, add(i, mload(subject))) // End of subject.\n if iszero(gt(needleLen, mload(subject))) {\n let subjectSearchEnd := add(sub(mload(0x00), needleLen), 1)\n let h := 0 // The hash of `needle`.\n if iszero(lt(needleLen, 0x20)) { h := keccak256(add(needle, 0x20), needleLen) }\n let s := mload(add(needle, 0x20))\n for { let m := shl(3, sub(0x20, and(needleLen, 0x1f))) } 1 {} {\n let t := mload(i)\n // Whether the first `needleLen % 32` bytes of `subject` and `needle` matches.\n if iszero(shr(m, xor(t, s))) {\n if h {\n if iszero(eq(keccak256(i, needleLen), h)) {\n mstore(add(i, d), t)\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n // Copy the `replacement` one word at a time.\n for { let j := 0 } 1 {} {\n mstore(add(add(i, d), j), mload(add(add(replacement, 0x20), j)))\n j := add(j, 0x20)\n if iszero(lt(j, replacementLen)) { break }\n }\n d := sub(add(d, replacementLen), needleLen)\n if needleLen {\n i := add(i, needleLen)\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n mstore(add(i, d), t)\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n }\n }\n let end := mload(0x00)\n let n := add(sub(d, add(result, 0x20)), end)\n // Copy the rest of the bytes one word at a time.\n for {} lt(i, end) { i := add(i, 0x20) } { mstore(add(i, d), mload(i)) }\n let o := add(i, d)\n mstore(o, 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n mstore(result, n) // Store the length.\n }\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(bytes memory subject, bytes memory needle, uint256 from)\n internal\n pure\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := not(0) // Initialize to `NOT_FOUND`.\n for { let subjectLen := mload(subject) } 1 {} {\n if iszero(mload(needle)) {\n result := from\n if iszero(gt(from, subjectLen)) { break }\n result := subjectLen\n break\n }\n let needleLen := mload(needle)\n let subjectStart := add(subject, 0x20)\n\n subject := add(subjectStart, from)\n let end := add(sub(add(subjectStart, subjectLen), needleLen), 1)\n let m := shl(3, sub(0x20, and(needleLen, 0x1f)))\n let s := mload(add(needle, 0x20))\n\n if iszero(and(lt(subject, end), lt(from, subjectLen))) { break }\n\n if iszero(lt(needleLen, 0x20)) {\n for { let h := keccak256(add(needle, 0x20), needleLen) } 1 {} {\n if iszero(shr(m, xor(mload(subject), s))) {\n if eq(keccak256(subject, needleLen), h) {\n result := sub(subject, subjectStart)\n break\n }\n }\n subject := add(subject, 1)\n if iszero(lt(subject, end)) { break }\n }\n break\n }\n for {} 1 {} {\n if iszero(shr(m, xor(mload(subject), s))) {\n result := sub(subject, subjectStart)\n break\n }\n subject := add(subject, 1)\n if iszero(lt(subject, end)) { break }\n }\n break\n }\n }\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from left to right.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function indexOf(bytes memory subject, bytes memory needle) internal pure returns (uint256) {\n return indexOf(subject, needle, 0);\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left, starting from `from`.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(bytes memory subject, bytes memory needle, uint256 from)\n internal\n pure\n returns (uint256 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n for {} 1 {} {\n result := not(0) // Initialize to `NOT_FOUND`.\n let needleLen := mload(needle)\n if gt(needleLen, mload(subject)) { break }\n let w := result\n\n let fromMax := sub(mload(subject), needleLen)\n if iszero(gt(fromMax, from)) { from := fromMax }\n\n let end := add(add(subject, 0x20), w)\n subject := add(add(subject, 0x20), from)\n if iszero(gt(subject, end)) { break }\n // As this function is not too often used,\n // we shall simply use keccak256 for smaller bytecode size.\n for { let h := keccak256(add(needle, 0x20), needleLen) } 1 {} {\n if eq(keccak256(subject, needleLen), h) {\n result := sub(subject, add(end, 1))\n break\n }\n subject := add(subject, w) // `sub(subject, 1)`.\n if iszero(gt(subject, end)) { break }\n }\n break\n }\n }\n }\n\n /// @dev Returns the byte index of the first location of `needle` in `subject`,\n /// needleing from right to left.\n /// Returns `NOT_FOUND` (i.e. `type(uint256).max`) if the `needle` is not found.\n function lastIndexOf(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (uint256)\n {\n return lastIndexOf(subject, needle, type(uint256).max);\n }\n\n /// @dev Returns true if `needle` is found in `subject`, false otherwise.\n function contains(bytes memory subject, bytes memory needle) internal pure returns (bool) {\n return indexOf(subject, needle) != NOT_FOUND;\n }\n\n /// @dev Returns whether `subject` starts with `needle`.\n function startsWith(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(needle)\n // Just using keccak256 directly is actually cheaper.\n let t := eq(keccak256(add(subject, 0x20), n), keccak256(add(needle, 0x20), n))\n result := lt(gt(n, mload(subject)), t)\n }\n }\n\n /// @dev Returns whether `subject` ends with `needle`.\n function endsWith(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (bool result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(needle)\n let notInRange := gt(n, mload(subject))\n // `subject + 0x20 + max(subject.length - needle.length, 0)`.\n let t := add(add(subject, 0x20), mul(iszero(notInRange), sub(mload(subject), n)))\n // Just using keccak256 directly is actually cheaper.\n result := gt(eq(keccak256(t, n), keccak256(add(needle, 0x20), n)), notInRange)\n }\n }\n\n /// @dev Returns `subject` repeated `times`.\n function repeat(bytes memory subject, uint256 times)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := mload(subject) // Subject length.\n if iszero(or(iszero(times), iszero(l))) {\n result := mload(0x40)\n subject := add(subject, 0x20)\n let o := add(result, 0x20)\n for {} 1 {} {\n // Copy the `subject` one word at a time.\n for { let j := 0 } 1 {} {\n mstore(add(o, j), mload(add(subject, j)))\n j := add(j, 0x20)\n if iszero(lt(j, l)) { break }\n }\n o := add(o, l)\n times := sub(times, 1)\n if iszero(times) { break }\n }\n mstore(o, 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n mstore(result, sub(o, add(result, 0x20))) // Store the length.\n }\n }\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).\n /// `start` and `end` are byte offsets.\n function slice(bytes memory subject, uint256 start, uint256 end)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := mload(subject) // Subject length.\n if iszero(gt(l, end)) { end := l }\n if iszero(gt(l, start)) { start := l }\n if lt(start, end) {\n result := mload(0x40)\n let n := sub(end, start)\n let i := add(subject, start)\n let w := not(0x1f)\n // Copy the `subject` one word at a time, backwards.\n for { let j := and(add(n, 0x1f), w) } 1 {} {\n mstore(add(result, j), mload(add(i, j)))\n j := add(j, w) // `sub(j, 0x20)`.\n if iszero(j) { break }\n }\n let o := add(add(result, 0x20), n)\n mstore(o, 0) // Zeroize the slot after the bytes.\n mstore(0x40, add(o, 0x20)) // Allocate memory.\n mstore(result, n) // Store the length.\n }\n }\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to the end of the bytes.\n /// `start` is a byte offset.\n function slice(bytes memory subject, uint256 start)\n internal\n pure\n returns (bytes memory result)\n {\n result = slice(subject, start, type(uint256).max);\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to `end` (exclusive).\n /// `start` and `end` are byte offsets. Faster than Solidity's native slicing.\n function sliceCalldata(bytes calldata subject, uint256 start, uint256 end)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n end := xor(end, mul(xor(end, subject.length), lt(subject.length, end)))\n start := xor(start, mul(xor(start, subject.length), lt(subject.length, start)))\n result.offset := add(subject.offset, start)\n result.length := mul(lt(start, end), sub(end, start))\n }\n }\n\n /// @dev Returns a copy of `subject` sliced from `start` to the end of the bytes.\n /// `start` is a byte offset. Faster than Solidity's native slicing.\n function sliceCalldata(bytes calldata subject, uint256 start)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n start := xor(start, mul(xor(start, subject.length), lt(subject.length, start)))\n result.offset := add(subject.offset, start)\n result.length := mul(lt(start, subject.length), sub(subject.length, start))\n }\n }\n\n /// @dev Reduces the size of `subject` to `n`.\n /// If `n` is greater than the size of `subject`, this will be a no-op.\n function truncate(bytes memory subject, uint256 n)\n internal\n pure\n returns (bytes memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := subject\n mstore(mul(lt(n, mload(result)), result), n)\n }\n }\n\n /// @dev Returns a copy of `subject`, with the length reduced to `n`.\n /// If `n` is greater than the size of `subject`, this will be a no-op.\n function truncatedCalldata(bytes calldata subject, uint256 n)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result.offset := subject.offset\n result.length := xor(n, mul(xor(n, subject.length), lt(subject.length, n)))\n }\n }\n\n /// @dev Returns all the indices of `needle` in `subject`.\n /// The indices are byte offsets.\n function indicesOf(bytes memory subject, bytes memory needle)\n internal\n pure\n returns (uint256[] memory result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let searchLen := mload(needle)\n if iszero(gt(searchLen, mload(subject))) {\n result := mload(0x40)\n let i := add(subject, 0x20)\n let o := add(result, 0x20)\n let subjectSearchEnd := add(sub(add(i, mload(subject)), searchLen), 1)\n let h := 0 // The hash of `needle`.\n if iszero(lt(searchLen, 0x20)) { h := keccak256(add(needle, 0x20), searchLen) }\n let s := mload(add(needle, 0x20))\n for { let m := shl(3, sub(0x20, and(searchLen, 0x1f))) } 1 {} {\n let t := mload(i)\n // Whether the first `searchLen % 32` bytes of `subject` and `needle` matches.\n if iszero(shr(m, xor(t, s))) {\n if h {\n if iszero(eq(keccak256(i, searchLen), h)) {\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n mstore(o, sub(i, add(subject, 0x20))) // Append to `result`.\n o := add(o, 0x20)\n i := add(i, searchLen) // Advance `i` by `searchLen`.\n if searchLen {\n if iszero(lt(i, subjectSearchEnd)) { break }\n continue\n }\n }\n i := add(i, 1)\n if iszero(lt(i, subjectSearchEnd)) { break }\n }\n mstore(result, shr(5, sub(o, add(result, 0x20)))) // Store the length of `result`.\n // Allocate memory for result.\n // We allocate one more word, so this array can be recycled for {split}.\n mstore(0x40, add(o, 0x20))\n }\n }\n }\n\n /// @dev Returns an arrays of bytess based on the `delimiter` inside of the `subject` bytes.\n function split(bytes memory subject, bytes memory delimiter)\n internal\n pure\n returns (bytes[] memory result)\n {\n uint256[] memory indices = indicesOf(subject, delimiter);\n /// @solidity memory-safe-assembly\n assembly {\n let w := not(0x1f)\n let indexPtr := add(indices, 0x20)\n let indicesEnd := add(indexPtr, shl(5, add(mload(indices), 1)))\n mstore(add(indicesEnd, w), mload(subject))\n mstore(indices, add(mload(indices), 1))\n for { let prevIndex := 0 } 1 {} {\n let index := mload(indexPtr)\n mstore(indexPtr, 0x60)\n if iszero(eq(index, prevIndex)) {\n let element := mload(0x40)\n let l := sub(index, prevIndex)\n mstore(element, l) // Store the length of the element.\n // Copy the `subject` one word at a time, backwards.\n for { let o := and(add(l, 0x1f), w) } 1 {} {\n mstore(add(element, o), mload(add(add(subject, prevIndex), o)))\n o := add(o, w) // `sub(o, 0x20)`.\n if iszero(o) { break }\n }\n mstore(add(add(element, 0x20), l), 0) // Zeroize the slot after the bytes.\n // Allocate memory for the length and the bytes, rounded up to a multiple of 32.\n mstore(0x40, add(element, and(add(l, 0x3f), w)))\n mstore(indexPtr, element) // Store the `element` into the array.\n }\n prevIndex := add(index, mload(delimiter))\n indexPtr := add(indexPtr, 0x20)\n if iszero(lt(indexPtr, indicesEnd)) { break }\n }\n result := indices\n if iszero(mload(delimiter)) {\n result := add(indices, 0x20)\n mstore(result, sub(mload(indices), 2))\n }\n }\n }\n\n /// @dev Returns a concatenated bytes of `a` and `b`.\n /// Cheaper than `bytes.concat()` and does not de-align the free memory pointer.\n function concat(bytes memory a, bytes memory b) internal pure returns (bytes memory result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(0x40)\n let w := not(0x1f)\n let aLen := mload(a)\n // Copy `a` one word at a time, backwards.\n for { let o := and(add(aLen, 0x20), w) } 1 {} {\n mstore(add(result, o), mload(add(a, o)))\n o := add(o, w) // `sub(o, 0x20)`.\n if iszero(o) { break }\n }\n let bLen := mload(b)\n let output := add(result, aLen)\n // Copy `b` one word at a time, backwards.\n for { let o := and(add(bLen, 0x20), w) } 1 {} {\n mstore(add(output, o), mload(add(b, o)))\n o := add(o, w) // `sub(o, 0x20)`.\n if iszero(o) { break }\n }\n let totalLen := add(aLen, bLen)\n let last := add(add(result, 0x20), totalLen)\n mstore(last, 0) // Zeroize the slot after the bytes.\n mstore(result, totalLen) // Store the length.\n mstore(0x40, add(last, 0x20)) // Allocate memory.\n }\n }\n\n /// @dev Returns whether `a` equals `b`.\n function eq(bytes memory a, bytes memory b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := eq(keccak256(add(a, 0x20), mload(a)), keccak256(add(b, 0x20), mload(b)))\n }\n }\n\n /// @dev Returns whether `a` equals `b`, where `b` is a null-terminated small bytes.\n function eqs(bytes memory a, bytes32 b) internal pure returns (bool result) {\n /// @solidity memory-safe-assembly\n assembly {\n // These should be evaluated on compile time, as far as possible.\n let m := not(shl(7, div(not(iszero(b)), 255))) // `0x7f7f ...`.\n let x := not(or(m, or(b, add(m, and(b, m)))))\n let r := shl(7, iszero(iszero(shr(128, x))))\n r := or(r, shl(6, iszero(iszero(shr(64, shr(r, x))))))\n r := or(r, shl(5, lt(0xffffffff, shr(r, x))))\n r := or(r, shl(4, lt(0xffff, shr(r, x))))\n r := or(r, shl(3, lt(0xff, shr(r, x))))\n // forgefmt: disable-next-item\n result := gt(eq(mload(a), add(iszero(x), xor(31, shr(3, r)))),\n xor(shr(add(8, r), b), shr(add(8, r), mload(add(a, 0x20)))))\n }\n }\n\n /// @dev Returns 0 if `a == b`, -1 if `a < b`, +1 if `a > b`.\n /// If `a` == b[:a.length]`, and `a.length < b.length`, returns -1.\n function cmp(bytes memory a, bytes memory b) internal pure returns (int256 result) {\n /// @solidity memory-safe-assembly\n assembly {\n let aLen := mload(a)\n let bLen := mload(b)\n let n := and(xor(aLen, mul(xor(aLen, bLen), lt(bLen, aLen))), not(0x1f))\n if n {\n for { let i := 0x20 } 1 {} {\n let x := mload(add(a, i))\n let y := mload(add(b, i))\n if iszero(or(xor(x, y), eq(i, n))) {\n i := add(i, 0x20)\n continue\n }\n result := sub(gt(x, y), lt(x, y))\n break\n }\n }\n // forgefmt: disable-next-item\n if iszero(result) {\n let l := 0x201f1e1d1c1b1a191817161514131211100f0e0d0c0b0a090807060504030201\n let x := and(mload(add(add(a, 0x20), n)), shl(shl(3, byte(sub(aLen, n), l)), not(0)))\n let y := and(mload(add(add(b, 0x20), n)), shl(shl(3, byte(sub(bLen, n), l)), not(0)))\n result := sub(gt(x, y), lt(x, y))\n if iszero(result) { result := sub(gt(aLen, bLen), lt(aLen, bLen)) }\n }\n }\n }\n\n /// @dev Directly returns `a` without copying.\n function directReturn(bytes memory a) internal pure {\n /// @solidity memory-safe-assembly\n assembly {\n // Assumes that the bytes does not start from the scratch space.\n let retStart := sub(a, 0x20)\n let retUnpaddedSize := add(mload(a), 0x40)\n // Right pad with zeroes. Just in case the bytes is produced\n // by a method that doesn't zero right pad.\n mstore(add(retStart, retUnpaddedSize), 0)\n mstore(retStart, 0x20) // Store the return offset.\n // End the transaction, returning the bytes.\n return(retStart, and(not(0x1f), add(0x1f, retUnpaddedSize)))\n }\n }\n\n /// @dev Directly returns `a` with minimal copying.\n function directReturn(bytes[] memory a) internal pure {\n /// @solidity memory-safe-assembly\n assembly {\n let n := mload(a) // `a.length`.\n let o := add(a, 0x20) // Start of elements in `a`.\n let u := a // Highest memory slot.\n let w := not(0x1f)\n for { let i := 0 } iszero(eq(i, n)) { i := add(i, 1) } {\n let c := add(o, shl(5, i)) // Location of pointer to `a[i]`.\n let s := mload(c) // `a[i]`.\n let l := mload(s) // `a[i].length`.\n let r := and(l, 0x1f) // `a[i].length % 32`.\n let z := add(0x20, and(l, w)) // Offset of last word in `a[i]` from `s`.\n // If `s` comes before `o`, or `s` is not zero right padded.\n if iszero(lt(lt(s, o), or(iszero(r), iszero(shl(shl(3, r), mload(add(s, z))))))) {\n let m := mload(0x40)\n mstore(m, l) // Copy `a[i].length`.\n for {} 1 {} {\n mstore(add(m, z), mload(add(s, z))) // Copy `a[i]`, backwards.\n z := add(z, w) // `sub(z, 0x20)`.\n if iszero(z) { break }\n }\n let e := add(add(m, 0x20), l)\n mstore(e, 0) // Zeroize the slot after the copied bytes.\n mstore(0x40, add(e, 0x20)) // Allocate memory.\n s := m\n }\n mstore(c, sub(s, o)) // Convert to calldata offset.\n let t := add(l, add(s, 0x20))\n if iszero(lt(t, u)) { u := t }\n }\n let retStart := add(a, w) // Assumes `a` doesn't start from scratch space.\n mstore(retStart, 0x20) // Store the return offset.\n return(retStart, add(0x40, sub(u, retStart))) // End the transaction.\n }\n }\n\n /// @dev Returns the word at `offset`, without any bounds checks.\n function load(bytes memory a, uint256 offset) internal pure returns (bytes32 result) {\n /// @solidity memory-safe-assembly\n assembly {\n result := mload(add(add(a, 0x20), offset))\n }\n }\n\n /// @dev Returns the word at `offset`, without any bounds checks.\n function loadCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes32 result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n result := calldataload(add(a.offset, offset))\n }\n }\n\n /// @dev Returns a slice representing a static struct in the calldata. Performs bounds checks.\n function staticStructInCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := sub(a.length, 0x20)\n result.offset := add(a.offset, offset)\n result.length := sub(a.length, offset)\n if or(shr(64, or(l, a.offset)), gt(offset, l)) { revert(l, 0x00) }\n }\n }\n\n /// @dev Returns a slice representing a dynamic struct in the calldata. Performs bounds checks.\n function dynamicStructInCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := sub(a.length, 0x20)\n let s := calldataload(add(a.offset, offset)) // Relative offset of `result` from `a.offset`.\n result.offset := add(a.offset, s)\n result.length := sub(a.length, s)\n if or(shr(64, or(s, or(l, a.offset))), gt(offset, l)) { revert(l, 0x00) }\n }\n }\n\n /// @dev Returns bytes in calldata. Performs bounds checks.\n function bytesInCalldata(bytes calldata a, uint256 offset)\n internal\n pure\n returns (bytes calldata result)\n {\n /// @solidity memory-safe-assembly\n assembly {\n let l := sub(a.length, 0x20)\n let s := calldataload(add(a.offset, offset)) // Relative offset of `result` from `a.offset`.\n result.offset := add(add(a.offset, s), 0x20)\n result.length := calldataload(add(a.offset, s))\n // forgefmt: disable-next-item\n if or(shr(64, or(result.length, or(s, or(l, a.offset)))),\n or(gt(add(s, result.length), l), gt(offset, l))) { revert(l, 0x00) }\n }\n }\n\n /// @dev Returns empty calldata bytes. For silencing the compiler.\n function emptyCalldata() internal pure returns (bytes calldata result) {\n /// @solidity memory-safe-assembly\n assembly {\n result.length := 0\n }\n }\n}\n" }, - 'node_modules/erc721a/contracts/extensions/IERC721AQueryable.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.2.3\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: 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' }, - 'src/proxies/SequenceProxyFactory.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {\r\n TransparentUpgradeableBeaconProxy,\r\n ITransparentUpgradeableBeaconProxy\r\n} from "./TransparentUpgradeableBeaconProxy.sol";\r\n\r\nimport {Create2} from "@openzeppelin/contracts/utils/Create2.sol";\r\nimport {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";\r\nimport {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";\r\n\r\n/**\r\n * An proxy factory that deploys upgradeable beacon proxies.\r\n * @dev The factory owner is able to upgrade the beacon implementation.\r\n * @dev Proxy deployers are able to override the beacon reference with their own.\r\n */\r\nabstract contract SequenceProxyFactory is Ownable {\r\n UpgradeableBeacon public beacon;\r\n\r\n /**\r\n * Initialize a Sequence Proxy Factory.\r\n * @param implementation The initial beacon implementation.\r\n * @param factoryOwner The owner of the factory.\r\n */\r\n function _initialize(address implementation, address factoryOwner) internal {\r\n beacon = new UpgradeableBeacon(implementation);\r\n Ownable._transferOwnership(factoryOwner);\r\n }\r\n\r\n /**\r\n * Deploys and initializes a new proxy instance.\r\n * @param _salt The deployment salt.\r\n * @param _proxyOwner The owner of the proxy.\r\n * @param _data The initialization data.\r\n * @return proxyAddress The address of the deployed proxy.\r\n */\r\n function _createProxy(bytes32 _salt, address _proxyOwner, bytes memory _data) internal returns (address proxyAddress) {\r\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\r\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\r\n\r\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\r\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\r\n }\r\n\r\n /**\r\n * Computes the address of a proxy instance.\r\n * @param _salt The deployment salt.\r\n * @param _proxyOwner The owner of the proxy.\r\n * @return proxy The expected address of the deployed proxy.\r\n */\r\n function _computeProxyAddress(bytes32 _salt, address _proxyOwner, bytes memory _data) internal view returns (address) {\r\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\r\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\r\n\r\n return Create2.computeAddress(saltedHash, bytecodeHash);\r\n }\r\n\r\n /**\r\n * Upgrades the beacon implementation.\r\n * @param implementation The new beacon implementation.\r\n */\r\n function upgradeBeacon(address implementation) public onlyOwner {\r\n beacon.upgradeTo(implementation);\r\n }\r\n}\r\n' + '// 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' }, - 'src/proxies/TransparentUpgradeableBeaconProxy.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {BeaconProxy, Proxy} from "./openzeppelin/BeaconProxy.sol";\r\nimport {TransparentUpgradeableProxy, ERC1967Proxy} from "./openzeppelin/TransparentUpgradeableProxy.sol";\r\n\r\ninterface ITransparentUpgradeableBeaconProxy {\r\n function initialize(address admin, address beacon, bytes memory data) external;\r\n}\r\n\r\nerror InvalidInitialization();\r\n\r\n/**\r\n * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation,\r\n * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors.\r\n * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\r\n * The proxy selectors are:\r\n * - 0xcf7a1d77: initialize\r\n * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy)\r\n * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy)\r\n * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy)\r\n * - 0xf851a440: admin (from TransparentUpgradeableProxy)\r\n * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy)\r\n */\r\ncontract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy {\r\n /**\r\n * Decode the initialization data from the msg.data and call the initialize function.\r\n */\r\n function _dispatchInitialize() private returns (bytes memory) {\r\n _requireZeroValue();\r\n\r\n (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes));\r\n initialize(admin, beacon, data);\r\n\r\n return "";\r\n }\r\n\r\n function initialize(address admin, address beacon, bytes memory data) internal {\r\n if (_admin() != address(0)) {\r\n // Redundant call. This function can only be called when the admin is not set.\r\n revert InvalidInitialization();\r\n }\r\n _changeAdmin(admin);\r\n _upgradeBeaconToAndCall(beacon, data, false);\r\n }\r\n\r\n /**\r\n * @dev If the admin is not set, the fallback function is used to initialize the proxy.\r\n * @dev If the admin is set, the fallback function is used to delegatecall the implementation.\r\n */\r\n function _fallback() internal override (TransparentUpgradeableProxy, Proxy) {\r\n if (_getAdmin() == address(0)) {\r\n bytes memory ret;\r\n bytes4 selector = msg.sig;\r\n if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) {\r\n ret = _dispatchInitialize();\r\n // solhint-disable-next-line no-inline-assembly\r\n assembly {\r\n return(add(ret, 0x20), mload(ret))\r\n }\r\n }\r\n // When the admin is not set, the fallback function is used to initialize the proxy.\r\n revert InvalidInitialization();\r\n }\r\n TransparentUpgradeableProxy._fallback();\r\n }\r\n\r\n /**\r\n * Returns the current implementation address.\r\n * @dev This is the implementation address set by the admin, or the beacon implementation.\r\n */\r\n function _implementation() internal view override (ERC1967Proxy, BeaconProxy) returns (address) {\r\n address implementation = ERC1967Proxy._implementation();\r\n if (implementation != address(0)) {\r\n return implementation;\r\n }\r\n return BeaconProxy._implementation();\r\n }\r\n}\r\n' + '// 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' }, - 'src/proxies/openzeppelin/BeaconProxy.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\r\n\r\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\r\n\r\npragma solidity ^0.8.19;\r\n\r\nimport "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";\r\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\r\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\r\n\r\n/**\r\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\r\n *\r\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\r\n * conflict with the storage layout of the implementation behind the proxy.\r\n *\r\n * _Available since v3.4._\r\n */\r\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\r\n /**\r\n * @dev Returns the current beacon address.\r\n */\r\n function _beacon() internal view virtual returns (address) {\r\n return _getBeacon();\r\n }\r\n\r\n /**\r\n * @dev Returns the current implementation address of the associated beacon.\r\n */\r\n function _implementation() internal view virtual override returns (address) {\r\n return IBeacon(_getBeacon()).implementation();\r\n }\r\n\r\n /**\r\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\r\n *\r\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\r\n *\r\n * Requirements:\r\n *\r\n * - `beacon` must be a contract.\r\n * - The implementation returned by `beacon` must be a contract.\r\n */\r\n function _setBeacon(address beacon, bytes memory data) internal virtual {\r\n _upgradeBeaconToAndCall(beacon, data, false);\r\n }\r\n}\r\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' }, - 'src/proxies/openzeppelin/ERC1967Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.sol': { content: - '// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\r\n\r\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\r\n\r\npragma solidity ^0.8.19;\r\n\r\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\r\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\r\n\r\n/**\r\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\r\n * implementation address that can be changed. This address is stored in storage in the location specified by\r\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\r\n * implementation behind the proxy.\r\n */\r\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\r\n /**\r\n * @dev Returns the current implementation address.\r\n */\r\n function _implementation() internal view virtual override returns (address impl) {\r\n return ERC1967Upgrade._getImplementation();\r\n }\r\n}\r\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' }, - 'src/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol': { content: - '// SPDX-License-Identifier: MIT\r\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\r\n\r\n/// @notice This implementation is a copy of OpenZeppelin\'s with the following changes:\r\n/// - Pragma updated\r\n/// - Imports updated\r\n/// - Constructor removed\r\n/// - Allows admin to call implementation\r\n\r\npragma solidity ^0.8.19;\r\n\r\nimport "./ERC1967Proxy.sol";\r\n\r\n/**\r\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\r\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\r\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\r\n * include them in the ABI so this interface must be used to interact with it.\r\n */\r\ninterface ITransparentUpgradeableProxy is IERC1967 {\r\n function admin() external view returns (address);\r\n\r\n function implementation() external view returns (address);\r\n\r\n function changeAdmin(address) external;\r\n\r\n function upgradeTo(address) external;\r\n\r\n function upgradeToAndCall(address, bytes memory) external payable;\r\n}\r\n\r\n/**\r\n * @dev This contract implements a proxy that is upgradeable by an admin.\r\n *\r\n * Unlike the original OpenZeppelin implementation, this contract does not prevent the admin from calling the implementation.\r\n * This potentially exposes the admin to a proxy selector attack. See\r\n * https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\r\n * When using this contract, you must ensure that the implementation function selectors do not clash with the proxy selectors.\r\n * The proxy selectors are:\r\n * - 0x3659cfe6: upgradeTo\r\n * - 0x4f1ef286: upgradeToAndCall\r\n * - 0x8f283970: changeAdmin\r\n * - 0xf851a440: admin\r\n * - 0x5c60da1b: implementation\r\n *\r\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\r\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\r\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\r\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\r\n * implementation.\r\n *\r\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\r\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\r\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\r\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\r\n */\r\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\r\n /**\r\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\r\n *\r\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\r\n * implementation provides a function with the same selector.\r\n */\r\n modifier ifAdmin() {\r\n if (msg.sender == _getAdmin()) {\r\n _;\r\n } else {\r\n _fallback();\r\n }\r\n }\r\n\r\n /**\r\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\r\n */\r\n function _fallback() internal virtual override {\r\n if (msg.sender == _getAdmin()) {\r\n bytes memory ret;\r\n bytes4 selector = msg.sig;\r\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\r\n ret = _dispatchUpgradeTo();\r\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\r\n ret = _dispatchUpgradeToAndCall();\r\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\r\n ret = _dispatchChangeAdmin();\r\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\r\n ret = _dispatchAdmin();\r\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\r\n ret = _dispatchImplementation();\r\n } else {\r\n // Call implementation\r\n return super._fallback();\r\n }\r\n assembly {\r\n return(add(ret, 0x20), mload(ret))\r\n }\r\n } else {\r\n super._fallback();\r\n }\r\n }\r\n\r\n /**\r\n * @dev Returns the current admin.\r\n *\r\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\r\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\r\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\r\n */\r\n function _dispatchAdmin() private returns (bytes memory) {\r\n _requireZeroValue();\r\n\r\n address admin = _getAdmin();\r\n return abi.encode(admin);\r\n }\r\n\r\n /**\r\n * @dev Returns the current implementation.\r\n *\r\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\r\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\r\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\r\n */\r\n function _dispatchImplementation() private returns (bytes memory) {\r\n _requireZeroValue();\r\n\r\n address implementation = _implementation();\r\n return abi.encode(implementation);\r\n }\r\n\r\n /**\r\n * @dev Changes the admin of the proxy.\r\n *\r\n * Emits an {AdminChanged} event.\r\n */\r\n function _dispatchChangeAdmin() private returns (bytes memory) {\r\n _requireZeroValue();\r\n\r\n address newAdmin = abi.decode(msg.data[4:], (address));\r\n _changeAdmin(newAdmin);\r\n\r\n return "";\r\n }\r\n\r\n /**\r\n * @dev Upgrade the implementation of the proxy.\r\n */\r\n function _dispatchUpgradeTo() private returns (bytes memory) {\r\n _requireZeroValue();\r\n\r\n address newImplementation = abi.decode(msg.data[4:], (address));\r\n _upgradeToAndCall(newImplementation, bytes(""), false);\r\n\r\n return "";\r\n }\r\n\r\n /**\r\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\r\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\r\n * proxied contract.\r\n */\r\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\r\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\r\n _upgradeToAndCall(newImplementation, data, true);\r\n\r\n return "";\r\n }\r\n\r\n /**\r\n * @dev Returns the current admin.\r\n *\r\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\r\n */\r\n function _admin() internal view virtual returns (address) {\r\n return _getAdmin();\r\n }\r\n\r\n /**\r\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\r\n * emulate some proxy functions being non-payable while still allowing value to pass through.\r\n */\r\n function _requireZeroValue() internal {\r\n require(msg.value == 0);\r\n }\r\n}\r\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" }, - 'src/tokens/ERC721/ERC721BaseToken.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC2981.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {\r\n ERC721AQueryable, IERC721AQueryable, ERC721A, IERC721A\r\n} from "erc721a/contracts/extensions/ERC721AQueryable.sol";\r\nimport {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.sol";\r\n\r\nerror InvalidInitialization();\r\n\r\n/**\r\n * A standard base implementation of ERC-721 for use in Sequence library contracts.\r\n */\r\nabstract contract ERC721BaseToken is ERC721AQueryable, ERC2981Controlled {\r\n bytes32 internal constant METADATA_ADMIN_ROLE = keccak256("METADATA_ADMIN_ROLE");\r\n\r\n string private _tokenBaseURI;\r\n string private _tokenName;\r\n string private _tokenSymbol;\r\n string private _contractURI;\r\n\r\n /**\r\n * Deploy contract.\r\n */\r\n constructor() ERC721A("", "") {}\r\n\r\n /**\r\n * Initialize contract.\r\n * @param owner The owner of the contract\r\n * @param tokenName Name of the token\r\n * @param tokenSymbol Symbol of the token\r\n * @param tokenBaseURI Base URI of the token\r\n * @param tokenContractURI Contract URI of the token\r\n * @dev This should be called immediately after deployment.\r\n */\r\n function _initialize(\r\n address owner,\r\n string memory tokenName,\r\n string memory tokenSymbol,\r\n string memory tokenBaseURI,\r\n string memory tokenContractURI\r\n )\r\n internal\r\n {\r\n _tokenName = tokenName;\r\n _tokenSymbol = tokenSymbol;\r\n _tokenBaseURI = tokenBaseURI;\r\n _contractURI = tokenContractURI;\r\n\r\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\r\n _grantRole(METADATA_ADMIN_ROLE, owner);\r\n _grantRole(ROYALTY_ADMIN_ROLE, owner);\r\n }\r\n\r\n //\r\n // Metadata\r\n //\r\n\r\n /**\r\n * Set name and symbol of token.\r\n * @param tokenName Name of token.\r\n * @param tokenSymbol Symbol of token.\r\n */\r\n function setNameAndSymbol(string memory tokenName, string memory tokenSymbol)\r\n external\r\n onlyRole(METADATA_ADMIN_ROLE)\r\n {\r\n _tokenName = tokenName;\r\n _tokenSymbol = tokenSymbol;\r\n }\r\n\r\n /**\r\n * Update the base URI of token\'s URI.\r\n * @param tokenBaseURI New base URI of token\'s URI\r\n */\r\n function setBaseMetadataURI(string memory tokenBaseURI) external onlyRole(METADATA_ADMIN_ROLE) {\r\n _tokenBaseURI = tokenBaseURI;\r\n }\r\n\r\n /**\r\n * Update the contract URI of token\'s URI.\r\n * @param tokenContractURI New contract URI of token\'s URI\r\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\r\n */\r\n function setContractURI(string memory tokenContractURI) external onlyRole(METADATA_ADMIN_ROLE) {\r\n _contractURI = tokenContractURI;\r\n }\r\n\r\n //\r\n // Burn\r\n //\r\n\r\n /**\r\n * Allows the owner of the token to burn their token.\r\n * @param tokenId Id of token to burn\r\n */\r\n function burn(uint256 tokenId) public virtual {\r\n _burn(tokenId, true);\r\n }\r\n\r\n /**\r\n * Allows the owner of the tokens to burn their tokens.\r\n * @param tokenIds Array of token ids to burn\r\n */\r\n function batchBurn(uint256[] memory tokenIds) public virtual {\r\n uint256 nBurn = tokenIds.length;\r\n for (uint256 i = 0; i < nBurn; i++) {\r\n _burn(tokenIds[i], true);\r\n }\r\n }\r\n\r\n //\r\n // Views\r\n //\r\n\r\n /**\r\n * Get the contract URI of token\'s URI.\r\n * @return Contract URI of token\'s URI\r\n * @notice Refer to https://docs.opensea.io/docs/contract-level-metadata\r\n */\r\n function contractURI() public view returns (string memory) {\r\n return _contractURI;\r\n }\r\n\r\n /**\r\n * Check interface support.\r\n * @param interfaceId Interface id\r\n * @return True if supported\r\n */\r\n function supportsInterface(bytes4 interfaceId)\r\n public\r\n view\r\n virtual\r\n override (ERC721A, IERC721A, ERC2981Controlled)\r\n returns (bool)\r\n {\r\n return interfaceId == type(IERC721A).interfaceId || interfaceId == type(IERC721AQueryable).interfaceId\r\n || ERC721A.supportsInterface(interfaceId) || ERC2981Controlled.supportsInterface(interfaceId)\r\n || super.supportsInterface(interfaceId);\r\n }\r\n\r\n //\r\n // ERC721A Overrides\r\n //\r\n\r\n /**\r\n * Override the ERC721A baseURI function.\r\n */\r\n function _baseURI() internal view override returns (string memory) {\r\n return _tokenBaseURI;\r\n }\r\n\r\n /**\r\n * Override the ERC721A name function.\r\n */\r\n function name() public view override (ERC721A, IERC721A) returns (string memory) {\r\n return _tokenName;\r\n }\r\n\r\n /**\r\n * Override the ERC721A symbol function.\r\n */\r\n function symbol() public view override (ERC721A, IERC721A) returns (string memory) {\r\n return _tokenSymbol;\r\n }\r\n}\r\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/introspection/IERC165.sol";\n\n/**\n * @dev Interface for the NFT Royalty Standard.\n *\n * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal\n * support for royalty payments across all NFT marketplaces and ecosystem participants.\n *\n * _Available since v4.5._\n */\ninterface IERC2981 is IERC165 {\n /**\n * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of\n * exchange. The royalty amount is denominated and should be paid in that same unit of exchange.\n */\n function royaltyInfo(\n uint256 tokenId,\n uint256 salePrice\n ) external view returns (address receiver, uint256 royaltyAmount);\n}\n' }, - 'src/tokens/ERC721/presets/items/ERC721Items.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {ERC721BaseToken} from "@0xsequence/contracts-library/tokens/ERC721/ERC721BaseToken.sol";\r\nimport {\r\n IERC721Items,\r\n IERC721ItemsFunctions\r\n} from "@0xsequence/contracts-library/tokens/ERC721/presets/items/IERC721Items.sol";\r\n\r\n/**\r\n * An implementation of ERC-721 capable of minting when role provided.\r\n */\r\ncontract ERC721Items is ERC721BaseToken, IERC721Items {\r\n bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE");\r\n\r\n address private immutable _initializer;\r\n bool private _initialized;\r\n\r\n /**\r\n * Deploy contract.\r\n */\r\n constructor() ERC721BaseToken() {\r\n _initializer = msg.sender;\r\n }\r\n\r\n /**\r\n * Initialize contract.\r\n * @param owner The owner of the contract\r\n * @param tokenName Name of the token\r\n * @param tokenSymbol Symbol of the token\r\n * @param tokenBaseURI Base URI of the token\r\n * @param tokenContractURI Contract URI of the token\r\n * @param royaltyReceiver Address of who should be sent the royalty payment\r\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n * @dev This should be called immediately after deployment.\r\n */\r\n function initialize(\r\n address owner,\r\n string memory tokenName,\r\n string memory tokenSymbol,\r\n string memory tokenBaseURI,\r\n string memory tokenContractURI,\r\n address royaltyReceiver,\r\n uint96 royaltyFeeNumerator\r\n )\r\n public\r\n virtual\r\n {\r\n if (msg.sender != _initializer || _initialized) {\r\n revert InvalidInitialization();\r\n }\r\n\r\n ERC721BaseToken._initialize(owner, tokenName, tokenSymbol, tokenBaseURI, tokenContractURI);\r\n _setDefaultRoyalty(royaltyReceiver, royaltyFeeNumerator);\r\n\r\n _grantRole(MINTER_ROLE, owner);\r\n\r\n _initialized = true;\r\n }\r\n\r\n //\r\n // Minting\r\n //\r\n\r\n /**\r\n * Mint tokens.\r\n * @param to Address to mint tokens to.\r\n * @param amount Amount of tokens to mint.\r\n */\r\n function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) {\r\n _mint(to, amount);\r\n }\r\n\r\n //\r\n // Views\r\n //\r\n\r\n /**\r\n * Check interface support.\r\n * @param interfaceId Interface id\r\n * @return True if supported\r\n */\r\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\r\n return type(IERC721ItemsFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\r\n }\r\n}\r\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' }, - 'src/tokens/ERC721/presets/items/ERC721ItemsFactory.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {IERC721ItemsFactory} from\r\n "@0xsequence/contracts-library/tokens/ERC721/presets/items/IERC721ItemsFactory.sol";\r\nimport {ERC721Items} from "@0xsequence/contracts-library/tokens/ERC721/presets/items/ERC721Items.sol";\r\nimport {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\r\n\r\n/**\r\n * Deployer of ERC-721 Items proxies.\r\n */\r\ncontract ERC721ItemsFactory is IERC721ItemsFactory, SequenceProxyFactory {\r\n /**\r\n * Creates an ERC-721 Items Factory.\r\n * @param factoryOwner The owner of the ERC-721 Items Factory\r\n */\r\n constructor(address factoryOwner) {\r\n ERC721Items impl = new ERC721Items();\r\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\r\n }\r\n\r\n /**\r\n * Creates an ERC-721 Items proxy.\r\n * @param proxyOwner The owner of the ERC-721 Items proxy\r\n * @param tokenOwner The owner of the ERC-721 Items implementation\r\n * @param name The name of the ERC-721 Items proxy\r\n * @param symbol The symbol of the ERC-721 Items proxy\r\n * @param baseURI The base URI of the ERC-721 Items proxy\r\n * @param contractURI The contract URI of the ERC-721 Items proxy\r\n * @param royaltyReceiver Address of who should be sent the royalty payment\r\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n * @return proxyAddr The address of the ERC-721 Items Proxy\r\n */\r\n function deploy(\r\n address proxyOwner,\r\n address tokenOwner,\r\n string memory name,\r\n string memory symbol,\r\n string memory baseURI,\r\n string memory contractURI,\r\n address royaltyReceiver,\r\n uint96 royaltyFeeNumerator\r\n )\r\n external\r\n returns (address proxyAddr)\r\n {\r\n bytes32 salt =\r\n keccak256(abi.encode(tokenOwner, name, symbol, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\r\n proxyAddr = _createProxy(salt, proxyOwner, "");\r\n ERC721Items(proxyAddr).initialize(tokenOwner, name, symbol, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator);\r\n emit ERC721ItemsDeployed(proxyAddr);\r\n return proxyAddr;\r\n }\r\n}\r\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' }, - 'src/tokens/ERC721/presets/items/IERC721Items.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\ninterface IERC721ItemsFunctions {\r\n /**\r\n * Mint tokens.\r\n * @param to Address to mint tokens to.\r\n * @param amount Amount of tokens to mint.\r\n */\r\n function mint(address to, uint256 amount) external;\r\n}\r\n\r\ninterface IERC721ItemsSignals {\r\n /**\r\n * Invalid initialization error.\r\n */\r\n error InvalidInitialization();\r\n}\r\n\r\ninterface IERC721Items is IERC721ItemsFunctions, IERC721ItemsSignals {}\r\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' }, - 'src/tokens/ERC721/presets/items/IERC721ItemsFactory.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\ninterface IERC721ItemsFactoryFunctions {\r\n /**\r\n * Creates an ERC-721 Items proxy.\r\n * @param proxyOwner The owner of the ERC-721 Items proxy\r\n * @param tokenOwner The owner of the ERC-721 Items implementation\r\n * @param name The name of the ERC-721 Items proxy\r\n * @param symbol The symbol of the ERC-721 Items proxy\r\n * @param baseURI The base URI of the ERC-721 Items proxy\r\n * @param contractURI The contract URI of the ERC-721 Items proxy\r\n * @param royaltyReceiver Address of who should be sent the royalty payment\r\n * @param royaltyFeeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n * @return proxyAddr The address of the ERC-721 Items Proxy\r\n */\r\n function deploy(\r\n address proxyOwner,\r\n address tokenOwner,\r\n string memory name,\r\n string memory symbol,\r\n string memory baseURI,\r\n string memory contractURI,\r\n address royaltyReceiver,\r\n uint96 royaltyFeeNumerator\r\n )\r\n external\r\n returns (address proxyAddr);\r\n}\r\n\r\ninterface IERC721ItemsFactorySignals {\r\n /**\r\n * Event emitted when a new ERC-721 Items proxy contract is deployed.\r\n * @param proxyAddr The address of the deployed proxy.\r\n */\r\n event ERC721ItemsDeployed(address proxyAddr);\r\n}\r\n\r\ninterface IERC721ItemsFactory is IERC721ItemsFactoryFunctions, IERC721ItemsFactorySignals {}\r\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' }, - 'src/tokens/common/ERC2981Controlled.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {IERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/IERC2981Controlled.sol";\r\nimport {ERC2981} from "@openzeppelin/contracts/token/common/ERC2981.sol";\r\nimport {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";\r\n\r\n/**\r\n * An implementation of ERC-2981 that allows updates by roles.\r\n */\r\nabstract contract ERC2981Controlled is ERC2981, AccessControlEnumerable, IERC2981Controlled {\r\n bytes32 internal constant ROYALTY_ADMIN_ROLE = keccak256("ROYALTY_ADMIN_ROLE");\r\n\r\n //\r\n // Royalty\r\n //\r\n\r\n /**\r\n * Sets the royalty information that all ids in this contract will default to.\r\n * @param receiver Address of who should be sent the royalty payment\r\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n */\r\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external onlyRole(ROYALTY_ADMIN_ROLE) {\r\n _setDefaultRoyalty(receiver, feeNumerator);\r\n }\r\n\r\n /**\r\n * Sets the royalty information that a given token id in this contract will use.\r\n * @param tokenId The token id to set the royalty information for\r\n * @param receiver Address of who should be sent the royalty payment\r\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n * @notice This overrides the default royalty information for this token id\r\n */\r\n function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)\r\n external\r\n onlyRole(ROYALTY_ADMIN_ROLE)\r\n {\r\n _setTokenRoyalty(tokenId, receiver, feeNumerator);\r\n }\r\n\r\n //\r\n // Views\r\n //\r\n\r\n /**\r\n * Check interface support.\r\n * @param interfaceId Interface id\r\n * @return True if supported\r\n */\r\n function supportsInterface(bytes4 interfaceId)\r\n public\r\n view\r\n virtual\r\n override (ERC2981, AccessControlEnumerable)\r\n returns (bool)\r\n {\r\n return ERC2981.supportsInterface(interfaceId) || AccessControlEnumerable.supportsInterface(interfaceId)\r\n || type(IERC2981Controlled).interfaceId == interfaceId || super.supportsInterface(interfaceId);\r\n }\r\n}\r\n' + '// 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' }, - 'src/tokens/common/IERC2981Controlled.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/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/contracts/utils/introspection/IERC165.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' + }, + 'lib/signals-implicit-mode/lib/sequence-v3/src/utils/LibBytes.sol': { + content: + '// 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/contracts/utils/math/Math.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\ninterface IERC2981ControlledFunctions {\r\n /**\r\n * Sets the royalty information that all ids in this contract will default to.\r\n * @param receiver Address of who should be sent the royalty payment\r\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n */\r\n function setDefaultRoyalty(address receiver, uint96 feeNumerator) external;\r\n\r\n /**\r\n * Sets the royalty information that a given token id in this contract will use.\r\n * @param tokenId The token id to set the royalty information for\r\n * @param receiver Address of who should be sent the royalty payment\r\n * @param feeNumerator The royalty fee numerator in basis points (e.g. 15% would be 1500)\r\n * @notice This overrides the default royalty information for this token id\r\n */\r\n function setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) external;\r\n}\r\n\r\ninterface IERC2981Controlled is IERC2981ControlledFunctions {}\r\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/contracts/utils/math/SignedMath.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' } }, settings: { - evmVersion: 'paris', - libraries: {}, - metadata: { bytecodeHash: 'ipfs' }, - optimizer: { enabled: true, runs: 20000 }, remappings: [ - ':@0xsequence/contracts-library/=src/', - ':@0xsequence/erc-1155/=node_modules/@0xsequence/erc-1155/', - ':@0xsequence/erc20-meta-token/=node_modules/@0xsequence/erc20-meta-token/', - ':@openzeppelin/=node_modules/@openzeppelin/', - ':ds-test/=lib/forge-std/lib/ds-test/src/', - ':erc721a-upgradeable/=node_modules/erc721a-upgradeable/', - ':erc721a/=node_modules/erc721a/', - ':forge-std/=lib/forge-std/src/', - ':murky/=lib/murky/src/', - ':openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/' + '@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/' ], - viaIR: true, + optimizer: { + enabled: false, + runs: 200 + }, + metadata: { + useLiteralContent: true, + bytecodeHash: 'ipfs', + appendCBOR: true + }, outputSelection: { '*': { '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] } - } + }, + evmVersion: 'paris', + viaIR: true, + libraries: {} } } }