diff --git a/README.md b/README.md index acb374f..a7f1be3 100644 --- a/README.md +++ b/README.md @@ -149,13 +149,13 @@ The following is a list of contracts that are deployed by this script. | SequenceMarketV2 | 0xfdb42A198a932C8D3B506Ffa5e855bC4b348a712 | | SequenceMarketV1 | 0xB537a160472183f2150d42EB1c3DD6684A55f74c | | BatchPayableHelper | 0x6166c1952c54dEd6b070B4616797E61b6c48A117 | -| ERC20ItemsFactory | 0x1063cBEe6b3Cd69B49f1B922A0D402f484b39855 | +| ERC20ItemsFactory | 0x434c9C50b0Ca6b67AbB71F667C822d5451265062 | | ERC721ItemsFactory | 0xC6064FfBaDB0687Da29721C8EC02ACa71e735a3e | -| ERC1155ItemsFactory | 0x7364fDEFe24385B2b3869504383c94cF083AcbD6 | -| ERC721SaleFactory | 0xc412172a99e657609f5f7D4b9Bea37684B8eEE4E | -| ERC1155SaleFactory | 0x52A6E7236A01B72eeb262d58F7270cb9AeD8Db4B | -| ERC721SoulboundFactory | 0x2fBFF6fd3C978ab1bBd21b878262c5289a14b6c1 | -| ERC1155SoulboundFactory | 0xaB069C041FaCAB8f4D747D91EEda5705b5caAB76 | +| ERC1155ItemsFactory | 0x024b9949FeD1c8dd7154DE653456d64Aa1093384 | +| ERC721SaleFactory | 0x2Ce46243FAb9d688CcC2B1F1B8D2c464e87A2076 | +| ERC1155SaleFactory | 0xFb89C8A7DF9A1e0299088C3fC46fd87D3FcbcDBd | +| ERC721SoulboundFactory | 0x718476DcFf820113B30fE4196905c7720F3c8a4e | +| ERC1155SoulboundFactory | 0xCCbB517AaCAb6680A2ad08ef5A593677dDE17284 | | ERC1155PackFactory | 0x5B2f47ee798eee52cE184C9eC4d60873185836d8 | | ERC721OperatorEnforcedFactory | 0x5fD880b092bD285873b16335a454D11c062a4689 | | ERC1155OperatorEnforcedFactory | 0xc89f63389ef3B53D07649D52D47F9E4afcAbb1fB | @@ -163,6 +163,7 @@ The following is a list of contracts that are deployed by this script. | ClawbackMetadata | 0x335411eAA9D63251f8c0867600Be4d0C190a3b1f | | PaymentCombiner | 0xfe0a269E288051B0815E05Fe192FC888118CB8a2 | | PaymentsFactory | 0xdC8dC7d7F0AAfbc5901DA779Ed5aab779F3E7c14 | +| ValueForwarder | 0xABAAd93EeE2a569cF0632f39B10A9f5D734777ca | | SequencePaymentsSigner-dev | 0x498399DD85CAa29A42Af499f82b271f1629ba0D7 | | SequencePayments-dev | 0xDE280948Af8A9762B6984995C8c3c7F5AEB921Bf | | SequencePaymentsSigner-next | 0x51805F2d8719a833C28EAc68aE881B2Eb70c0330 | diff --git a/scripts/deploy-contracts.ts b/scripts/deploy-contracts.ts index 01c90fb..c08053b 100644 --- a/scripts/deploy-contracts.ts +++ b/scripts/deploy-contracts.ts @@ -16,9 +16,9 @@ import { SequenceMarketV1 } from './factories/marketplace/SequenceMarketV1' import { Clawback } from './factories/token_library/Clawback' import { ClawbackMetadata } from './factories/token_library/ClawbackMetadata' import { ERC1155ItemsFactory } from './factories/token_library/ERC1155ItemsFactory' +import { ERC1155PackFactory } from './factories/token_library/ERC1155PackFactory' import { ERC1155SaleFactory } from './factories/token_library/ERC1155SaleFactory' import { ERC1155SoulboundFactory } from './factories/token_library/ERC1155SoulboundFactory' -import { ERC1155PackFactory } from './factories/token_library/ERC1155PackFactory' import { ERC20ItemsFactory } from './factories/token_library/ERC20ItemsFactory' import { ERC721ItemsFactory } from './factories/token_library/ERC721ItemsFactory' import { ERC721SaleFactory } from './factories/token_library/ERC721SaleFactory' @@ -27,6 +27,7 @@ import { ERC1155OperatorEnforcedFactory } from './factories/token_library/immuta import { ERC721OperatorEnforcedFactory } from './factories/token_library/immutable/ERC721OperatorEnforcedFactory' import { PaymentCombiner } from './factories/token_library/PaymentCombiner' import { PaymentsFactory } from './factories/token_library/PaymentsFactory' +import { ValueForwarder } from './factories/token_library/ValueForwarder' import { FactoryV1, GuestModuleV1, @@ -314,6 +315,8 @@ export const deployContracts = async (config: Config): Promise => prompt.start('Deploying Sequence Payments contracts\n') + const valueForwarder = await singletonDeployer.deploy('ValueForwarder', ValueForwarder, 0, txParams) + const paymentCombiner = await singletonDeployer.deploy('PaymentCombiner', PaymentCombiner, 0, txParams) type PaymentsDeployment = { @@ -507,6 +510,7 @@ export const deployContracts = async (config: Config): Promise => ClawbackMetadata: clawbackMetadata.address, PaymentCombiner: paymentCombiner.address, PaymentsFactory: paymentsFactory.address, + ValueForwarder: valueForwarder.address, ERC1155PackFactory: erc1155PackFactory.address } for (const { env, signerAddr, paymentsAddr } of paymentsDeployments) { @@ -521,8 +525,31 @@ export const deployContracts = async (config: Config): Promise => await verifyContracts(config, contractEntries) } catch (error: unknown) { console.error('Error deploying contracts on', config.networkName, error) + + // Check for insufficient funds error + const errorMessage = (error as Error).message ?? '' + const fundsErrorMatches = [ + /insufficient funds for gas \* price \+ value: balance (\d+), tx cost (\d+), overshot (\d+)/i, + /insufficient funds for gas \* price \+ value:.*?have (\d+) want (\d+)/i + ] + + for (const pattern of fundsErrorMatches) { + const match = errorMessage.match(pattern) + if (match) { + try { + const balance = BigNumber.from(match[1]) + const txCost = BigNumber.from(match[2]) + const shortMessage = `Insufficient funds: need ${ethers.utils.formatEther(txCost)} native tokens, have ${ethers.utils.formatEther(balance)} native tokens` + prompt.fail(`Error deploying contracts on ${config.networkName}: ${shortMessage}`) + return shortMessage + } catch (error) { + console.error('Error parsing funds error message:', error) + } + } + } + prompt.fail(`Error deploying contracts on ${config.networkName}: ${error}`) - return (error as Error).message + return errorMessage } return null } diff --git a/scripts/factories/token_library/ERC1155ItemsFactory.ts b/scripts/factories/token_library/ERC1155ItemsFactory.ts index fe3b170..a88236b 100644 --- a/scripts/factories/token_library/ERC1155ItemsFactory.ts +++ b/scripts/factories/token_library/ERC1155ItemsFactory.ts @@ -1,123 +1,14 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' -// https://github.com/0xsequence/contracts-library/blob/b32f88b298fc73ec1c4be5e845185de91f41c9ff/src/tokens/ERC1155/presets/items/ERC1155ItemsFactory.sol - -const abi = [ - { - type: 'constructor', - inputs: [{ name: 'factoryOwner', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' - }, - { - type: 'function', - name: 'beacon', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'contract UpgradeableBeacon' - } - ], - stateMutability: 'view' - }, - { - 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' - } - ], - outputs: [{ name: 'proxyAddr', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' - }, - { - type: 'function', - name: 'owner', - inputs: [], - outputs: [{ name: '', type: 'address', internalType: 'address' }], - stateMutability: 'view' - }, - { - 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: 'implementation', - type: 'address', - internalType: 'address' - } - ], - outputs: [], - stateMutability: 'nonpayable' - }, - { - type: 'event', - name: 'ERC1155ItemsDeployed', - 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' - } - ], - anonymous: false - } -] +// https://github.com/0xsequence/contracts-library/blob/8a229e34702984b948bd2ac82059388ed08cbe4b/src/tokens/ERC1155/presets/items/ERC1155ItemsFactory.sol export class ERC1155ItemsFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, - '0x608034610121576001600160401b0390601f61651238819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b82519361416594858101958187108388111761010b576123ad823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611dbf853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611c51908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce4583146106fd57806338234f4d146102e757806359659e9014610294578063715018a6146101f45780638da5cb5b1461019f5763f2fde38b1461006357600080fd5b3461019b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019b5761009a6107bc565b906100a36108d8565b73ffffffffffffffffffffffffffffffffffffffff809216928315610118575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b5050346101f057817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f05773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b833461029157807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102915761022b6108d8565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346101f057817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f05760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b50903461019b5760e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019b576103206107bc565b906024359373ffffffffffffffffffffffffffffffffffffffff9485811681036106ec5767ffffffffffffffff946044358681116106f9576103659036908301610863565b956064358181116106f55761037d9036908401610863565b6084358281116106f1576103949036908501610863565b60a435918a831683036106ec5760c435936bffffffffffffffffffffffff851685036105df578a9b899a9b9899519160209d838f948b8a8a8a8a8a8601976103dc95896109bd565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101825261040c9082610822565b519020908c5193840190848210908211176106be576104948f8f908f938f926068938287528952600154865196879485019889527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809360601b169085015260601b1660548301526104848851809285850190610957565b8101036048810184520182610822565b5190208b516111eb908f6104aa83820183610822565b828252810191610a31833980511561066157518392918df5169b8c15610605578160015416928d3b15610601578b92838f92938f8c9561052a9151988997889687957fcf7a1d770000000000000000000000000000000000000000000000000000000087521690850152602484015260606044840152606483019061097a565b03925af180156105f7579089916105e3575b5050893b156105df57918795949391610580938a5198899788977ff895481800000000000000000000000000000000000000000000000000000000895288016109bd565b038183885af180156105d5576105c1575b50507f28a530eb465a41faf2a923830d2cd4e0301e87b2cddc112bda1a86048c3a54b2838251848152a151908152f35b6105cb82916107df565b6102915780610591565b83513d84823e3d90fd5b8780fd5b6105ec906107df565b6105df57873861053c565b8a513d8b823e3d90fd5b8b80fd5b6064888f8e51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b50506064888f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b6041897f4e487b71000000000000000000000000000000000000000000000000000000006000525260246000fd5b600080fd5b8580fd5b8480fd5b8380fd5b50903461019b5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019b57826107376107bc565b61073f6108d8565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b156106f95783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af19081156107b357506107a7575080f35b6107b0906107df565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036106ec57565b67ffffffffffffffff81116107f357604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107f357604052565b81601f820112156106ec5780359067ffffffffffffffff82116107f357604051926108b660207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610822565b828452602083830101116106ec57816000926020809301838601378301015290565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108f957565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b83811061096a5750506000910152565b818101518382015260200161095a565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936109b681518092818752878088019101610957565b0116010190565b9496959160a094610a156bffffffffffffffffffffffff95610a07610a239473ffffffffffffffffffffffffffffffffffffffff8097168b5260c060208c015260c08b019061097a565b9089820360408b015261097a565b90878203606089015261097a565b961660808501521691015256fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea26469706673582212205afdfcf2db2f242d1c90fc4524ff1841da37419738805ee0571bd2744b6196ce64736f6c63430008130033a2646970667358221220cc1f17ef081ba9f042dbb30aeee84c8d1afa731998ed555149f6ae73892b120264736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ee02a7cc9adae68564feda64934170f02f3f12a55b74647721baba4fb366157164736f6c6343000813003360a060405234620002ec5762000014620002f1565b6200001e620002f1565b815190916001600160401b0390818311620001ed576005938454916001948584811c9416918215620002e1575b60209283861014620002cb578190601f9586811162000277575b5083908683116001146200020f5760009262000203575b5050600019600383901b1c191690861b1786555b8151938411620001ed576004958654908682811c92168015620001e2575b83831014620001cd5784821162000184575b5050809284116001146200011957509282939183926000946200010d575b50501b916000199060031b1c19161790555b33608052604051613e4f90816200031682396080518161024b0152f35b015192503880620000de565b919083601f1981168760005284600020946000905b888383106200016957505050106200014f575b505050811b019055620000f0565b015160001960f88460031b161c1916905538808062000141565b8587015188559096019594850194879350908101906200012e565b87600052826000209085808801821c830193858910620001c3575b01901c019086905b828110620001b65750620000c0565b60008155018690620001a7565b935082936200019f565b602288634e487b7160e01b6000525260246000fd5b91607f1691620000ae565b634e487b7160e01b600052604160045260246000fd5b0151905038806200007c565b90889350601f198316918a600052856000209260005b8782821062000260575050841162000246575b505050811b01865562000090565b015160001960f88460031b161c1916905538808062000238565b8385015186558c9790950194938401930162000225565b9091508860005283600020868085018b1c820192868610620002c1575b918a9186959493018c1c01915b828110620002b157505062000065565b600081558594508a9101620002a1565b9250819262000294565b634e487b7160e01b600052602260045260246000fd5b93607f16936200004b565b600080fd5b60405190602082016001600160401b03811183821017620001ed576040526000825256fe608080604052600436101561001357600080fd5b60003560e01c908162fdd58e14612a7e5750806301ffc9a7146129df57806304634d8d1461299d57806306fdde03146128f75780630b5ee0061461277e5780630e89341c1461261857806318160ddd146125fa57806320ec271b146124c1578063248a9ca3146124925780632693ebf2146124665780632a55205a146123835780632eb2c2d614611ebf5780632f2ff15d14611dcb57806336568abe14611d055780634e1273f414611b165780635944c753146119f85780636c0360eb14611952578063731133e9146118005780637e518ec8146116865780639010d07c1461163357806391d14854146115d8578063938e3d7b1461145e578063a217fddf14611442578063a22cb46514611391578063b390c0ab14611302578063b48ab8b614610ff0578063ca15c87314610fc4578063d547741f14610f83578063e8a3d48514610e7f578063e985e9c514610e1b578063f242432a14610a8f5763f89548181461017e57600080fd5b34610a8a5760c0600319360112610a8a57610197612ace565b60243567ffffffffffffffff8111610a8a576101b7903690600401612c26565b9060443567ffffffffffffffff8111610a8a576101d8903690600401612c26565b9060643567ffffffffffffffff8111610a8a576101f9903690600401612c26565b9073ffffffffffffffffffffffffffffffffffffffff6084351660843503610a8a576bffffffffffffffffffffffff60a4351660a43503610a8a5773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163314801590610a7e575b610a5457835167ffffffffffffffff81116107ff57610295600554612b14565b601f81116109b1575b50602094601f821160011461092d57948192939495600092610922575b50506000198260011b9260031b1c1916176005555b825167ffffffffffffffff81116107ff576102ec600454612b14565b601f81116108bd575b506020601f8211600114610839578192939460009261082e575b50506000198260011b9260031b1c1916176004555b81519167ffffffffffffffff83116107ff57610341600a54612b14565b601f811161079a575b50602090601f84116001146107115761051c939160009183610706575b50506000198260011b9260031b1c191617600a555b73ffffffffffffffffffffffffffffffffffffffff1660008181527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7602052604090205460089060ff1615610697575b6000805260096020526103ff827fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b613809565b507f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb011806000528160205260406000208360005260205260ff6040600020541615610628575b600052600960205261045a826040600020613809565b507fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a5806000528160205260406000208360005260205260ff60406000205416156105b9575b60005260096020526104b5826040600020613809565b506104c460a435608435613a72565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690816000528060205260406000208360005260205260ff604060002054161561054a575b5060005260096020526040600020613809565b50600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055005b81600052602052604060002082600052602052604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553382827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a438610509565b8060005281602052604060002083600052602052604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553383827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a461049f565b8060005281602052604060002083600052602052604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553383827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4610444565b6000805280602052604060002082600052602052604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055338260007f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a46103cc565b015190503880610367565b90601f19841691600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89260005b818110610782575091600193918661051c979410610769575b505050811b01600a5561037c565b015160001960f88460031b161c1916905538808061075b565b92936020600181928786015181550195019301610742565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f850160051c810191602086106107f5575b601f0160051c01905b8181106107e9575061034a565b600081556001016107dc565b90915081906107d3565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b01519050388061030f565b601f1982169060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9160005b8181106108a55750958360019596971061088c575b505050811b01600455610324565b015160001960f88460031b161c1916905538808061087e565b9192602060018192868b015181550194019201610869565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f830160051c81019160208410610918575b601f0160051c01905b81811061090c57506102f5565b600081556001016108ff565b90915081906108f6565b0151905038806102bb565b601f1982169560056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db09160005b88811061099957508360019596979810610980575b505050811b016005556102d0565b015160001960f88460031b161c19169055388080610972565b9192602060018192868501518155019401920161095d565b6005600052601f820160051c7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0019060208310610a2c575b601f0160051c7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db001905b818110610a20575061029e565b60008155600101610a13565b7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db091506109e9565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff600b5416610275565b600080fd5b34610a8a5760a0600319360112610a8a57610aa8612ace565b610ab0612af1565b906044356064359260843567ffffffffffffffff8111610a8a57610ad8903690600401612c26565b73ffffffffffffffffffffffffffffffffffffffff809416938433148015610df7575b15610d73578216918215610cef57846000526020956000875260406000208560005287526040600020610b2f828254612d2d565b9055836000526000875260406000208560005287526040600020610b54828254612d3a565b90558386604051878152838a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4610b935a92612f17565b610b9957005b60008794610bf696604051978896879586937ff23a6e61000000000000000000000000000000000000000000000000000000009c8d865233600487015260248601526044850152606484015260a0608484015260a4830190612be5565b0393f18015610ce3577fffffffff0000000000000000000000000000000000000000000000000000000091600091610cb6575b501603610c3257005b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152603a60248201527f45524331313535235f63616c6c6f6e4552433131353552656365697665643a2060448201527f494e56414c49445f4f4e5f524543454956455f4d4553534147450000000000006064820152fd5b610cd69150843d8611610cdc575b610cce8183612b9f565b810190612d47565b84610c29565b503d610cc4565b6040513d6000823e3d90fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f524543495049454e540000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f4f50455241544f52000000000000000000000000000000000000000000006064820152fd5b5084600052600160205260406000203360005260205260ff60406000205416610afb565b34610a8a576040600319360112610a8a57610e34612ace565b610e3c612af1565b9073ffffffffffffffffffffffffffffffffffffffff809116600052600160205260406000209116600052602052602060ff604060002054166040519015158152f35b34610a8a576000600319360112610a8a576040516000600a54610ea181612b14565b80845290600190818116908115610f3e5750600114610ee3575b610edf84610ecb81860382612b9f565b604051918291602083526020830190612be5565b0390f35b600a600090815292507fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85b828410610f26575050508101602001610ecb82610ebb565b80546020858701810191909152909301928101610f0e565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660208087019190915292151560051b85019092019250610ecb9150839050610ebb565b34610a8a576040600319360112610a8a57610fc2600435610fa2612af1565b90806000526008602052610fbd6001604060002001546134b6565b6135d4565b005b34610a8a576020600319360112610a8a5760043560005260096020526020604060002054604051908152f35b34610a8a57600319608081360112610a8a5761100a612ace565b9067ffffffffffffffff602435818111610a8a5761102c903690600401612c85565b92604435828111610a8a57611045903690600401612c85565b91606435908111610a8a5761105e903690600401612c26565b9061106761335e565b8451835181036112d85760008073ffffffffffffffffffffffffffffffffffffffff8416925b80831061124557506110a29150600254612d3a565b6002558060006040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3391806110da8a8d83612dd1565b0390a46110e75a92612f17565b6110ed57005b600061115891602095611167604051988997889687946111487fbc197c81000000000000000000000000000000000000000000000000000000009e8f885233600489015289602489015260a0604489015260a4880190612cf9565b9084878303016064880152612cf9565b91848303016084850152612be5565b0393f18015610ce3577fffffffff0000000000000000000000000000000000000000000000000000000091600091611227575b5016036111a357005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f45524331313535235f63616c6c6f6e455243313135354261746368526563656960448201527f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006064820152fd5b61123f915060203d8111610cdc57610cce8183612b9f565b8361119a565b906112cb6112d1918a60038a6112a38861129c816112638186612d8e565b51948d60005260209560008752604060002061127f848b612d8e565b5160005287526112956040600020918254612d3a565b9055612d8e565b5194612d8e565b51600052526112b86040600020918254612d3a565b90556112c4858a612d8e565b5190612d3a565b92612d7f565b919061108d565b60046040517f9d89020a000000000000000000000000000000000000000000000000000000008152fd5b34610a8a57600061131236612ce3565b61131e81600254612d2d565b600255818352600360205260408320611338828254612d2d565b905533835282602052604083208284526020526040832061135a828254612d2d565b9055604051918252602082015233907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4005b34610a8a576040600319360112610a8a576113aa612ace565b602435801515809103610a8a5733600052600160205273ffffffffffffffffffffffffffffffffffffffff60406000209216918260005260205260406000207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b34610a8a576000600319360112610a8a57602060405160008152f35b34610a8a57602080600319360112610a8a5767ffffffffffffffff600435818111610a8a57611491903690600401612c26565b9161149a613206565b82519182116107ff576114ae600a54612b14565b601f8111611574575b5080601f83116001146114f3575081926000926114e8575b50506000198260011b9260031b1c191617600a55600080f35b0151905082806114cf565b90601f19831693600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8926000905b86821061155c5750508360019510611543575b505050811b01600a55005b015160001960f88460031b161c19169055828080611538565b80600185968294968601518155019501930190611525565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f840160051c8101918385106115ce575b601f0160051c01905b8181106115c257506114b7565b600081556001016115b5565b90915081906115ac565b34610a8a576040600319360112610a8a576115f1612af1565b600435600052600860205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b34610a8a576040600319360112610a8a576004356000526009602052602073ffffffffffffffffffffffffffffffffffffffff61167660243560406000206137f1565b9190546040519260031b1c168152f35b34610a8a57602080600319360112610a8a5767ffffffffffffffff600435818111610a8a576116b9903690600401612c26565b916116c2613206565b82519182116107ff576116d6600454612b14565b601f811161179c575b5080601f831160011461171b57508192600092611710575b50506000198260011b9260031b1c191617600455600080f35b0151905082806116f7565b90601f1983169360046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b868210611784575050836001951061176b575b505050811b01600455005b015160001960f88460031b161c19169055828080611760565b8060018596829496860151815501950193019061174d565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c8101918385106117f6575b601f0160051c01905b8181106117ea57506116df565b600081556001016117dd565b90915081906117d4565b34610a8a576080600319360112610a8a57611819612ace565b60243560443560643567ffffffffffffffff8111610a8a5761183f903690600401612c26565b9261184861335e565b61185482600254612d3a565b60025582600052602093600385526040600020611872848254612d3a565b905573ffffffffffffffffffffffffffffffffffffffff8216918260005260008652604060002085600052865260406000206118af858254612d3a565b905582600060405187815286898201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a46118ef5a91612f17565b6118f557005b610bf693600087946040518097819682957ff23a6e61000000000000000000000000000000000000000000000000000000009b8c85523360048601528660248601526044850152606484015260a0608484015260a4830190612be5565b34610a8a576000600319360112610a8a57604051600060045461197481612b14565b80845290600190818116908115610f3e575060011461199d57610edf84610ecb81860382612b9f565b6004600090815292507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b8284106119e0575050508101602001610ecb82610ebb565b805460208587018101919091529093019281016119c8565b34610a8a576060600319360112610a8a57611a11612af1565b6044356bffffffffffffffffffffffff8116809103610a8a57611a32612f4d565b611a406127108211156139e7565b73ffffffffffffffffffffffffffffffffffffffff809216918215611ab8577fffffffffffffffffffffffff00000000000000000000000000000000000000009060405193611a8e85612b67565b84526020840192835260043560005260076020526040600020935116915160a01b16179055600080f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b34610a8a576040600319360112610a8a5760043567ffffffffffffffff808211610a8a5736602383011215610a8a57816004013590611b5482612c6d565b92611b626040519485612b9f565b82845260209260248486019160051b83010191368311610a8a57602401905b828210611cd957505050602435908111610a8a57611ba3903690600401612c85565b8251815103611c5557825190601f19611bd4611bbe84612c6d565b93611bcc6040519586612b9f565b808552612c6d565b01368484013760005b8451811015611c42578073ffffffffffffffffffffffffffffffffffffffff611c09611c3d9388612d8e565b5116600052600085526040600020611c218285612d8e565b516000528552604060002054611c378286612d8e565b52612d7f565b611bdd565b60405184815280610edf81870186612cf9565b608482604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602c60248201527f455243313135352362616c616e63654f6642617463683a20494e56414c49445f60448201527f41525241595f4c454e47544800000000000000000000000000000000000000006064820152fd5b813573ffffffffffffffffffffffffffffffffffffffff81168103610a8a578152908401908401611b81565b34610a8a576040600319360112610a8a57611d1e612af1565b3373ffffffffffffffffffffffffffffffffffffffff821603611d4757610fc2906004356135d4565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610a8a576040600319360112610a8a57610fc26004356009611dec612af1565b918060005260209060088252611e096001604060002001546134b6565b806000526008825273ffffffffffffffffffffffffffffffffffffffff604060002094169384600052825260ff6040600020541615611e51575b600052526040600020613809565b80600052600882526040600020846000528252604060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553384827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4611e43565b34610a8a5760a0600319360112610a8a57611ed8612ace565b611ee0612af1565b9060449067ffffffffffffffff908235828111610a8a57611f05903690600401612c85565b6064948535848111610a8a57611f1f903690600401612c85565b93608435908111610a8a57611f38903690600401612c26565b73ffffffffffffffffffffffffffffffffffffffff908185163314801561235d575b156122da57818316156122575783518651036121d457835160005b81811061214a57505060405182841690838716907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180611fb88c8b83612dd1565b0390a45a94611fc684612f17565b611fcc57005b8291604051978896879586947fbc197c810000000000000000000000000000000000000000000000000000000086523360048701521660248501528a840160a0905260a4840161201b91612cf9565b838103600319018c85015261202f91612cf9565b82810360031901608484015261204491612be5565b039216600090602095f1908115610ce3577fbc197c8100000000000000000000000000000000000000000000000000000000917fffffffff000000000000000000000000000000000000000000000000000000009160009161212c575b5016036120aa57005b7f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006084927f45524331313535235f63616c6c6f6e4552433131353542617463685265636569604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152603f6024860152840152820152fd5b612144915060203d8111610cdc57610cce8183612b9f565b856120a1565b806121586121cf928a612d8e565b51858916600052602090600082526040600020612175848b612d8e565b51600052825261218b6040600020918254612d2d565b9055612197828b612d8e565b5190868816600052600081526040600020906121b3848b612d8e565b51600052526121c86040600020918254612d3a565b9055612d7f565b611f75565b6084877f494e56414c49445f4152524159535f4c454e47544800000000000000000000008a7f45524331313535235f7361666542617463685472616e7366657246726f6d3a20604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260356024860152840152820152fd5b6084877f4e56414c49445f524543495049454e54000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260306024860152840152820152fd5b6084877f4e56414c49445f4f50455241544f5200000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152602f6024860152840152820152fd5b50818516600052600160205260406000203360005260205260ff60406000205416611f5a565b34610a8a5761239136612ce3565b906000526007602052604060002090604051916123ad83612b67565b5473ffffffffffffffffffffffffffffffffffffffff928382169182825260a01c60208201529015612444575b6bffffffffffffffffffffffff6020820151169182810292818404149015171561241557604092612710915116918351928352046020820152f35b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060405161245181612b67565b600654838116825260a01c60208201526123da565b34610a8a576020600319360112610a8a5760043560005260036020526020604060002054604051908152f35b34610a8a576020600319360112610a8a5760043560005260086020526020600160406000200154604051908152f35b34610a8a576040600319360112610a8a5767ffffffffffffffff600435818111610a8a576124f3903690600401612c85565b90602435908111610a8a5761250c903690600401612c85565b815191815183036112d8576000926000905b80821061256f575050612535600093600254612d2d565b6002557f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb6040518061256a3395339583612dd1565b0390a4005b90936125ee6125f4916125828787612d8e565b513360005260209060008252604060002061259d8a89612d8e565b5160005282526125b36040600020918254612d2d565b905560036125c18989612d8e565b51916125cd8a89612d8e565b51600052526125e26040600020918254612d2d565b90556112c48787612d8e565b94612d7f565b9061251e565b34610a8a576000600319360112610a8a576020600254604051908152f35b34610a8a57602080600319360112610a8a57612635600435612e0a565b90604051918282600060045461264a81612b14565b9060019081811690811561274357506001146126e0575b5050908161267b85600595946126cc975194859201612bc2565b017f2e6a736f6e0000000000000000000000000000000000000000000000000000008152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5810185520183612b9f565b610edf604051928284938452830190612be5565b60046000908152949593949192507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b83831061272b5750929493925050820181018361267b612661565b8054838a018701528896508795909201918101612710565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016868601525050801515028301820190508361267b612661565b34610a8a57602080600319360112610a8a5767ffffffffffffffff90600435828111610a8a576127b2903690600401612c26565b916127bb613206565b82519081116107ff576005916127d18354612b14565b601f8111612896575b5080601f8311600114612816575081929360009261280b575b50506000198260011b9260031b1c1916179055600080f35b0151905083806127f3565b90601f19831694846000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b87821061287e575050836001959610612865575b505050811b019055005b015160001960f88460031b161c1916905583808061285b565b80600185968294968601518155019501930190612847565b836000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0601f8401851c8101918385106128ed575b601f01851c01905b8181106128e157506127da565b600081556001016128d4565b90915081906128cc565b34610a8a576000600319360112610a8a57604051600060055461291981612b14565b80845290600190818116908115610f3e575060011461294257610edf84610ecb81860382612b9f565b6005600090815292507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b828410612985575050508101602001610ecb82610ebb565b8054602085870181019190915290930192810161296d565b34610a8a576040600319360112610a8a576129b6612ace565b6024356bffffffffffffffffffffffff81168103610a8a57610fc2916129da612f4d565b613a72565b34610a8a576020600319360112610a8a576004357fffffffff00000000000000000000000000000000000000000000000000000000811690818103610a8a576020917fc79b8b5f0000000000000000000000000000000000000000000000000000000014908115612a6d575b8115612a5d575b506040519015158152f35b612a679150613b4a565b82612a52565b9050612a7881613b4a565b90612a4b565b34610a8a576040600319360112610a8a5760209073ffffffffffffffffffffffffffffffffffffffff612aaf612ace565b1660005260008252604060002060243560005282526040600020548152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610a8a57565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610a8a57565b90600182811c92168015612b5d575b6020831014612b2e57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f1691612b23565b6040810190811067ffffffffffffffff8211176107ff57604052565b6080810190811067ffffffffffffffff8211176107ff57604052565b90601f601f19910116810190811067ffffffffffffffff8211176107ff57604052565b60005b838110612bd55750506000910152565b8181015183820152602001612bc5565b90601f19601f602093612c0381518092818752878088019101612bc2565b0116010190565b67ffffffffffffffff81116107ff57601f01601f191660200190565b81601f82011215610a8a57803590612c3d82612c0a565b92612c4b6040519485612b9f565b82845260208383010111610a8a57816000926020809301838601378301015290565b67ffffffffffffffff81116107ff5760051b60200190565b81601f82011215610a8a57803591612c9c83612c6d565b92612caa6040519485612b9f565b808452602092838086019260051b820101928311610a8a578301905b828210612cd4575050505090565b81358152908301908301612cc6565b6003196040910112610a8a576004359060243590565b90815180825260208080930193019160005b828110612d19575050505090565b835185529381019392810192600101612d0b565b9190820391821161241557565b9190820180921161241557565b90816020910312610a8a57517fffffffff0000000000000000000000000000000000000000000000000000000081168103610a8a5790565b60001981146124155760010190565b8051821015612da25760209160051b010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9091612de8612df693604084526040840190612cf9565b916020818403910152612cf9565b90565b908151811015612da2570160200190565b8015612edd5780816000925b612ec9575080612e2583612c0a565b92612e336040519485612b9f565b808452601f19612e4282612c0a565b01366020860137915b612e5457505090565b60001982019182116124155781600a8083049281840291848304148415171561241557612e8460ff928392612d2d565b16603001908111612415577fff00000000000000000000000000000000000000000000000000000000000000612ec29160f81b1660001a9185612df9565b5380612e4b565b91612ed5600a91612d7f565b920480612e16565b50604051612eea81612b67565b600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b3f8015159081612f25575090565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709150141590565b3360009081527fa9ced9fdc45cded6d4b7a90e36d1ee82b957a500cc22704c465e9bdf275406fd602090815260408083205490927f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119160ff1615612fb15750505050565b612fba33613689565b91845190612fc782612b83565b604282528482019260603685378251156131d957603084538251906001918210156131d95790607860218501536041915b81831161312c575050506130d05760486130cc9386936130969361308798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152613052815180928c603789019101612bc2565b8401917f206973206d697373696e6720726f6c6520000000000000000000000000000000603784015251809386840190612bc2565b01036028810187520185612b9f565b519283927f08c379a000000000000000000000000000000000000000000000000000000000845260048401526024830190612be5565b0390fd5b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f811660108110156131ac577f3031323334353637383961626364656600000000000000000000000000000000901a6131698587612df9565b5360041c92801561317f57600019019190612ff8565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f95f185554aba264de8ed412af70e5aba6acb0e648f258c912ad29ed85d11ca18602090815260408083205490927fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59160ff161561326a5750505050565b61327333613689565b9184519061328082612b83565b604282528482019260603685378251156131d957603084538251906001918210156131d95790607860218501536041915b81831161330b575050506130d05760486130cc9386936130969361308798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152613052815180928c603789019101612bc2565b909192600f811660108110156131ac577f3031323334353637383961626364656600000000000000000000000000000000901a6133488587612df9565b5360041c92801561317f576000190191906132b1565b3360009081527f51a495916474fe1a0c0fcfb65a8a97682b84a054118858cdd1f5dfd7fc0919eb602090815260408083205490927f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69160ff16156133c25750505050565b6133cb33613689565b918451906133d882612b83565b604282528482019260603685378251156131d957603084538251906001918210156131d95790607860218501536041915b818311613463575050506130d05760486130cc9386936130969361308798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152613052815180928c603789019101612bc2565b909192600f811660108110156131ac577f3031323334353637383961626364656600000000000000000000000000000000901a6134a08587612df9565b5360041c92801561317f57600019019190613409565b60009080825260209060088252604092838120338252835260ff8482205416156134e05750505050565b6134e933613689565b918451906134f682612b83565b604282528482019260603685378251156131d957603084538251906001918210156131d95790607860218501536041915b818311613581575050506130d05760486130cc9386936130969361308798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152613052815180928c603789019101612bc2565b909192600f811660108110156131ac577f3031323334353637383961626364656600000000000000000000000000000000901a6135be8587612df9565b5360041c92801561317f57600019019190613527565b90604061362092600090808252600860205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff8383205416613623575b81526009602052206138ac565b50565b80825260086020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4613613565b604051906060820182811067ffffffffffffffff8211176107ff57604052602a8252602082016040368237825115612da257603090538151600190811015612da257607860218401536029905b8082116137445750506136e65790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f811660108110156137c3577f3031323334353637383961626364656600000000000000000000000000000000901a6137808486612df9565b5360041c9180156137955760001901906136d6565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8054821015612da25760005260206000200190600090565b919060018301600090828252806020526040822054156000146138a657845494680100000000000000008610156138795783613869613852886001604098999a018555846137f1565b81939154906000199060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b906001820190600092818452826020526040842054908115156000146139e057600019918281018181116139b35782549084820191821161398657808203613951575b505050805480156139245782019161390783836137f1565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b61397161396161385293866137f1565b90549060031b1c928392866137f1565b905586528460205260408620553880806138ef565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b156139ee57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff831691613aa56127108411156139e7565b16918215613aec577fffffffffffffffffffffffff0000000000000000000000000000000000000000916020604051613add81612b67565b858152015260a01b1617600655565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b613b5381613bf0565b908115613b87575b8115613b76575b8115613b6c575090565b612df69150613cb3565b9050613b8181613cb3565b90613b62565b9050613b9281613b98565b90613b5b565b7f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000821614613bea57612df690613bf0565b50600190565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f3e85e62f0000000000000000000000000000000000000000000000000000000014908115613c40575090565b612df691507fffffffff00000000000000000000000000000000000000000000000000000000167fd9b67a26000000000000000000000000000000000000000000000000000000008114613bea577f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b613cbc81613da2565b908115613d0a575b8115613cdf575b8115613cd5575090565b612df69150613d1b565b7fffffffff000000000000000000000000000000000000000000000000000000008116159150613ccb565b9050613d1581613d1b565b90613cc4565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f5a05180f000000000000000000000000000000000000000000000000000000008214918215613d6e57505090565b7f7965db0b000000000000000000000000000000000000000000000000000000001491508115613d9c575090565b612df691505b7fffffffff00000000000000000000000000000000000000000000000000000000167f2a55205a000000000000000000000000000000000000000000000000000000008114908115613df2575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea264697066735822122057a4534969fa7bf4ea76a7fd77d1ae0f50342b9e63c841c1054e20ea6885704864736f6c63430008130033', + FACTORY_DEFAULT_ABI, + '60806040523461002f576100196100146100fa565b610169565b610021610034565b61271a610397823961271a90f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b61011861811a8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b614bc7810181811060018060401b038211176101c5576101a18291614bc7612ab1843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa261767885396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610580565b61001e60003561008d565b80631bce45831461008857806359659e901461008357806359a347bd1461007e578063715018a6146100795780638da5cb5b14610074578063cfcc59411461006f5763f2fde38b0361000e5761054d565b61050e565b6104d9565b6104a6565b610467565b6101ea565b610108565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b906020828203126100fd576100fa916000016100d4565b90565b61009e565b60000190565b346101365761012061011b3660046100e3565b61067e565b610128610093565b8061013281610102565b0390f35b610099565b600091031261014657565b61009e565b1c90565b60018060a01b031690565b61016a90600861016f930261014b565b61014f565b90565b9061017d915461015a565b90565b61018d6001600090610172565b90565b90565b6101a76101a26101ac926100a8565b610190565b6100a8565b90565b6101b890610193565b90565b6101c4906101af565b90565b6101d0906101bb565b9052565b91906101e8906000602085019401906101c7565b565b3461021a576101fa36600461013b565b610216610205610180565b61020d610093565b918291826101d4565b0390f35b610099565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061025390610229565b810190811067ffffffffffffffff82111761026d57604052565b610233565b9061028561027e610093565b9283610249565b565b67ffffffffffffffff81116102a5576102a1602091610229565b0190565b610233565b90826000939282370152565b909291926102cb6102c682610287565b610272565b938185526020850190828401116102e7576102e5926102aa565b565b610224565b9080601f8301121561030a57816020610307933591016102b6565b90565b61021f565b6bffffffffffffffffffffffff1690565b6103298161030f565b0361033057565b600080fd5b9050359061034282610320565b565b90565b61035081610344565b0361035757565b600080fd5b9050359061036982610347565b565b90916101208284031261043f5761038583600084016100d4565b9261039381602085016100d4565b92604081013567ffffffffffffffff811161043a57826103b49183016102ec565b92606082013567ffffffffffffffff811161043557836103d59184016102ec565b92608083013567ffffffffffffffff811161043057816103f69185016102ec565b926104048260a083016100d4565b9261042d6104158460c08501610335565b936104238160e086016100d4565b936101000161035c565b90565b6100a3565b6100a3565b6100a3565b61009e565b61044d906100b3565b9052565b919061046590600060208501940190610444565b565b346104a15761049d61048c61047d36600461036b565b979690969591959492946107ee565b610494610093565b91829182610451565b0390f35b610099565b346104d4576104b636600461013b565b6104be610985565b6104c6610093565b806104d081610102565b0390f35b610099565b34610509576104e936600461013b565b6105056104f46109bb565b6104fc610093565b91829182610451565b0390f35b610099565b346105485761054461053361052436600461036b565b979690969591959492946109d1565b61053b610093565b91829182610451565b0390f35b610099565b3461057b576105656105603660046100e3565b610b2a565b61056d610093565b8061057781610102565b0390f35b610099565b600080fd5b61059690610591610bb8565b6105eb565b565b60001c90565b6105aa6105af91610598565b61014f565b90565b6105bc905461059e565b90565b600080fd5b60e01b90565b60009103126105d557565b61009e565b6105e2610093565b3d6000823e3d90fd5b6105fd6105f860016105b2565b6101bb565b90633659cfe690823b15610679576106359261062a6000809461061e610093565b968795869485936105c4565b835260048301610451565b03925af1801561067457610647575b50565b6106679060003d811161066d575b61065f8183610249565b8101906105ca565b38610644565b503d610655565b6105da565b6105bf565b61068790610585565b565b600090565b5190565b60209181520190565b60005b8381106106af575050906000910152565b80602091830151818501520161069e565b6106df6106e86020936106ed936106d68161068e565b93848093610692565b9586910161069b565b610229565b0190565b6106fa9061030f565b9052565b61070790610344565b9052565b939561077461076960e0979b9a9861075b6107889761074d8a61078f9e9961073f61077e9a60006101008501940190610444565b8c60208184039101526106c0565b908a820360408c01526106c0565b9088820360608a01526106c0565b9a6080870190610444565b60a08501906106f1565b60c0830190610444565b01906106fe565b565b60200190565b5190565b906107ad6107a883610287565b610272565b918252565b6107bc600061079b565b90565b6107c76107b2565b90565b6107d390610193565b90565b6107df906107ca565b90565b6107eb906101af565b90565b61085e9098949897969397959295610804610689565b508861083c8461082d8d8a8d8d96928b908d929394610821610093565b998a9860208a0161070b565b60208201810382520382610249565b61084e61084882610797565b91610791565b20906108586107bf565b91610d5d565b9761087061086b8a6107d6565b6107e2565b94638ff83ac192969891939497863b1561092f576000986108a5968a966108b095610899610093565b9d8e9c8d9b8c9a6105c4565b8a5260048a0161070b565b03925af1801561092a576108fd575b50806108f77f28a530eb465a41faf2a923830d2cd4e0301e87b2cddc112bda1a86048c3a54b2916108ee610093565b91829182610451565b0390a190565b61091d9060003d8111610923575b6109158183610249565b8101906105ca565b386108bf565b503d61090b565b6105da565b6105bf565b61093c610bb8565b610944610971565b565b90565b61095d61095861096292610946565b610190565b6100a8565b90565b61096e90610949565b90565b61098361097e6000610965565b610eec565b565b61098d610934565b565b60018060a01b031690565b6109a66109ab91610598565b61098f565b90565b6109b8905461099a565b90565b6109c3610689565b506109ce60006109ae565b90565b96610a089396610a1796610a399a939694966109eb610689565b5096989490919293946109fc610093565b998a9860208a0161070b565b60208201810382520382610249565b610a29610a2382610797565b91610791565b2090610a336107bf565b91610f4d565b90565b610a4d90610a48610bb8565b610af9565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610aaa6026604092610692565b610ab381610a4f565b0190565b610acd9060208101906000818303910152610a9d565b90565b15610ad757565b610adf610093565b62461bcd60e51b815280610af560048201610ab7565b0390fd5b610b2890610b2381610b1c610b16610b116000610965565b6100b3565b916100b3565b1415610ad0565b610eec565b565b610b3390610a3c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6960208092610692565b610b7281610b35565b0190565b610b8c9060208101906000818303910152610b5d565b90565b15610b9657565b610b9e610093565b62461bcd60e51b815280610bb460048201610b76565b0390fd5b610be2610bc36109bb565b610bdc610bd6610bd1610fe3565b6100b3565b916100b3565b14610b8f565b565b90565b610bf3610bf891610344565b610be4565b9052565b60601b90565b610c0b90610bfc565b90565b610c1790610c02565b90565b610c26610c2b916100b3565b610c0e565b9052565b905090565b610c59610c5092602092610c4781610797565b94858093610c2f565b9384910161069b565b0190565b60148093610c81602084610c79610c8996610c909b9a98610be7565b018092610c1a565b018092610c1a565b0190610c34565b90565b90565b610caa610ca5610caf92610946565b610190565b610c93565b90565b610cbb90610193565b90565b610cc790610cb2565b90565b610cd390610193565b90565b610cdf90610cca565b90565b610ceb906101af565b90565b60209181520190565b610d16610d1f602093610d2493610d0d81610797565b93848093610cee565b9586910161069b565b610229565b0190565b610d4d610d5a949293610d4360608401956000850190610444565b6020830190610444565b6040818403910152610cf7565b90565b610ded9093929193610d6d610689565b50610dad8591610d9e610d88610d8360016105b2565b6101bb565b8690610d92610093565b95869460208601610c5d565b60208201810382520382610249565b610dbf610db982610797565b91610791565b2061148a610dcf60208201610272565b9080825261125b6020830139610de86000929192610c96565b611187565b92610e07610e02610dfd86610cbe565b610cd6565b610ce2565b63cf7a1d779190610e20610e1b60016105b2565b6101bb565b9392813b15610e97576000610e4891610e538296610e3c610093565b988997889687956105c4565b855260048501610d28565b03925af18015610e9257610e65575b50565b610e859060003d8111610e8b575b610e7d8183610249565b8101906105ca565b38610e62565b503d610e73565b6105da565b6105bf565b60001b90565b90610eb360018060a01b0391610e9c565b9181191691161790565b610ec6906101af565b90565b90565b90610ee1610edc610ee892610ebd565b610ec9565b8254610ea2565b9055565b610ef660006109ae565b610f01826000610ecc565b90610f35610f2f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610ebd565b91610ebd565b91610f3e610093565b80610f4881610102565b0390a3565b610fe09291610f8a610f9992610f61610689565b509193610f76610f7160016105b2565b6101bb565b610f7e610093565b95869460208601610c5d565b60208201810382520382610249565b610fab610fa582610797565b91610791565b2061148a610fbb60208201610272565b9080825261125b6020830139610fd9610fd382610797565b91610791565b2090611210565b90565b610feb610689565b503390565b610ff9906101af565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b611031601d602092610692565b61103a81610ffc565b0190565b6110549060208101906000818303910152611024565b90565b1561105e57565b611066610093565b62461bcd60e51b81528061107c6004820161103e565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110b460208092610692565b6110bd81611080565b0190565b6110d790602081019060008183039101526110a8565b90565b156110e157565b6110e9610093565b62461bcd60e51b8152806110ff600482016110c1565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b6111386019602092610692565b61114181611103565b0190565b61115b906020810190600081830391015261112b565b90565b1561116557565b61116d610093565b62461bcd60e51b81528061118360048201611145565b0390fd5b919091611192610689565b506111b961119f30610ff0565b316111b26111ac84610c93565b91610c93565b1015611057565b6111df6111c583610797565b6111d86111d26000610c96565b91610c93565b14156110da565b60208251920190f59061120e826112076112016111fc6000610965565b6100b3565b916100b3565b141561115e565b565b9061122e9161121d610689565b509061122830610ff0565b91611231565b90565b90605592600b92611240610689565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a2646970667358221220d353a28a00a09393e3bdd337ef6c721c7f72d7ebad899d5249255dd6e73f45d064736f6c634300081b003360a060405234602b57600e603a565b6014602f565b614b866100418239608051816125da0152614b8690f35b6035565b60405190565b600080fd5b3360805256fe60806040526004361015610013575b611806565b61001e60003561024c565b8062fdd58e1461024757806301ffc9a71461024257806304634d8d1461023d57806306fdde03146102385780630b5ee006146102335780630bb310de1461022e5780630e89341c1461022957806318160ddd1461022457806320ec271b1461021f578063248a9ca31461021a5780632693ebf2146102155780632a55205a146102105780632eb2c2d61461020b5780632f2ff15d1461020657806336568abe146102015780634e1273f4146101fc5780635944c753146101f75780636c0360eb146101f2578063731133e9146101ed5780637e518ec8146101e85780638ff83ac1146101e35780639010d07c146101de57806391d14854146101d9578063938e3d7b146101d45780639d043a66146101cf578063a217fddf146101ca578063a22cb465146101c5578063b390c0ab146101c0578063b48ab8b6146101bb578063ca15c873146101b6578063d547741f146101b1578063e8a3d485146101ac578063e985e9c5146101a7578063ed4c2ac7146101a25763f242432a0361000e576117cc565b611728565b6116f2565b61168f565b61164b565b611616565b6115df565b61151b565b6114e7565b611460565b6113ed565b611325565b6112ef565b6112b9565b611238565b61113b565b611104565b610ff3565b610faf565b610f3b565b610dc7565b610d93565b610d28565b610bcb565b610b37565b610ab1565b610a14565b6108e5565b610875565b610823565b6107d1565b6106bf565b610465565b6103c7565b61031a565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b61027b90610267565b90565b61028781610272565b0361028e57565b600080fd5b905035906102a08261027e565b565b90565b6102ae816102a2565b036102b557565b600080fd5b905035906102c7826102a5565b565b91906040838203126102f257806102e66102ef9260008601610293565b936020016102ba565b90565b61025d565b610300906102a2565b9052565b9190610318906000602085019401906102f7565b565b3461034b576103476103366103303660046102c9565b90611810565b61033e610252565b91829182610304565b0390f35b610258565b63ffffffff60e01b1690565b61036581610350565b0361036c57565b600080fd5b9050359061037e8261035c565b565b9060208282031261039a5761039791600001610371565b90565b61025d565b151590565b6103ad9061039f565b9052565b91906103c5906000602085019401906103a4565b565b346103f7576103f36103e26103dd366004610380565b611839565b6103ea610252565b918291826103b1565b0390f35b610258565b6bffffffffffffffffffffffff1690565b610416816103fc565b0361041d57565b600080fd5b9050359061042f8261040d565b565b919060408382031261045a578061044e6104579260008601610293565b93602001610422565b90565b61025d565b60000190565b346104945761047e610478366004610431565b906118db565b610486610252565b806104908161045f565b0390f35b610258565b60009103126104a457565b61025d565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b90600160028304921680156104f5575b60208310146104f057565b6104bf565b91607f16916104e5565b60209181520190565b600052602060002090565b906000929180549061052e610527836104d5565b80946104ff565b91600181169081600014610587575060011461054a575b505050565b6105579192939450610508565b916000925b81841061056f5750500190388080610545565b6001816020929593955484860152019101929061055c565b92949550505060ff1916825215156020020190388080610545565b906105ac91610513565b90565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906105d9906105af565b810190811067ffffffffffffffff8211176105f357604052565b6105b9565b9061061861061192610608610252565b938480926105a2565b03836105cf565b565b9060001061062e5761062b906105f8565b90565b6104a9565b610640600860009061061a565b90565b5190565b60209181520190565b60005b838110610664575050906000910152565b806020918301518185015201610653565b61069461069d6020936106a29361068b81610643565b93848093610647565b95869101610650565b6105af565b0190565b6106bc9160208201916000818403910152610675565b90565b346106ef576106cf366004610499565b6106eb6106da610633565b6106e2610252565b918291826106a6565b0390f35b610258565b600080fd5b600080fd5b9061071161070a610252565b92836105cf565b565b67ffffffffffffffff81116107315761072d6020916105af565b0190565b6105b9565b90826000939282370152565b9092919261075761075282610713565b6106fe565b938185526020850190828401116107735761077192610736565b565b6106f9565b9080601f830112156107965781602061079393359101610742565b90565b6106f4565b906020828203126107cc57600082013567ffffffffffffffff81116107c7576107c49201610778565b90565b610262565b61025d565b346107ff576107e96107e436600461079b565b611b1c565b6107f1610252565b806107fb8161045f565b0390f35b610258565b9060208282031261081e5761081b91600001610293565b90565b61025d565b346108515761083b610836366004610804565b611bf9565b610843610252565b8061084d8161045f565b0390f35b610258565b906020828203126108705761086d916000016102ba565b90565b61025d565b346108a5576108a161089061088b366004610856565b611d23565b610898610252565b918291826106a6565b0390f35b610258565b1c90565b90565b6108c19060086108c693026108aa565b6108ae565b90565b906108d491546108b1565b90565b6108e26000806108c9565b90565b34610915576108f5366004610499565b6109116109006108d7565b610908610252565b91829182610304565b0390f35b610258565b67ffffffffffffffff81116109325760208091020190565b6105b9565b600080fd5b9092919261095161094c8261091a565b6106fe565b938185526020808601920283019281841161098e57915b8383106109755750505050565b6020809161098384866102ba565b815201920191610968565b610937565b9080601f830112156109b1578160206109ae9335910161093c565b90565b6106f4565b919091604081840312610a0f57600081013567ffffffffffffffff8111610a0a57836109e3918301610993565b92602082013567ffffffffffffffff8111610a0557610a029201610993565b90565b610262565b610262565b61025d565b34610a4357610a2d610a273660046109b6565b90611d6d565b610a35610252565b80610a3f8161045f565b0390f35b610258565b90565b610a5481610a48565b03610a5b57565b600080fd5b90503590610a6d82610a4b565b565b90602082820312610a8957610a8691600001610a60565b90565b61025d565b610a9790610a48565b9052565b9190610aaf90600060208501940190610a8e565b565b34610ae157610add610acc610ac7366004610a6f565b611dcf565b610ad4610252565b91829182610a9b565b0390f35b610258565b90565b610afd610af8610b02926102a2565b610ae6565b6102a2565b90565b90610b0f90610ae9565b600052602052604060002090565b610b3490610b2f600191600092610b05565b6108c9565b90565b34610b6757610b63610b52610b4d366004610856565b610b1d565b610b5a610252565b91829182610304565b0390f35b610258565b9190604083820312610b955780610b89610b9292600086016102ba565b936020016102ba565b90565b61025d565b610ba390610272565b9052565b916020610bc9929493610bc260408201966000830190610b9a565b01906102f7565b565b34610bfd57610be4610bde366004610b6c565b90611fc1565b90610bf9610bf0610252565b92839283610ba7565b0390f35b610258565b600080fd5b909182601f83011215610c415781359167ffffffffffffffff8311610c3c576020019260208302840111610c3757565b610937565b610c02565b6106f4565b909182601f83011215610c805781359167ffffffffffffffff8311610c7b576020019260018302840111610c7657565b610937565b610c02565b6106f4565b9160a083830312610d2357610c9d8260008501610293565b92610cab8360208301610293565b92604082013567ffffffffffffffff8111610d1e5781610ccc918401610c07565b929093606082013567ffffffffffffffff8111610d195783610cef918401610c07565b929093608082013567ffffffffffffffff8111610d1457610d109201610c46565b9091565b610262565b610262565b610262565b61025d565b34610d6057610d4a610d3b366004610c85565b9695909594919493929361209c565b610d52610252565b80610d5c8161045f565b0390f35b610258565b9190604083820312610d8e5780610d82610d8b9260008601610a60565b93602001610293565b90565b61025d565b34610dc257610dac610da6366004610d65565b90612338565b610db4610252565b80610dbe8161045f565b0390f35b610258565b34610df657610de0610dda366004610d65565b906123ee565b610de8610252565b80610df28161045f565b0390f35b610258565b909182601f83011215610e355781359167ffffffffffffffff8311610e30576020019260208302840111610e2b57565b610937565b610c02565b6106f4565b9091604082840312610e9557600082013567ffffffffffffffff8111610e905783610e66918401610dfb565b929093602082013567ffffffffffffffff8111610e8b57610e879201610c07565b9091565b610262565b610262565b61025d565b5190565b60209181520190565b60200190565b610eb6906102a2565b9052565b90610ec781602093610ead565b0190565b60200190565b90610eee610ee8610ee184610e9a565b8093610e9e565b92610ea7565b9060005b818110610eff5750505090565b909192610f18610f126001928651610eba565b94610ecb565b9101919091610ef2565b610f389160208201916000818403910152610ed1565b90565b34610f6f57610f6b610f5a610f51366004610e3a565b92919091612422565b610f62610252565b91829182610f22565b0390f35b610258565b9091606082840312610faa57610fa7610f9084600085016102ba565b93610f9e8160208601610293565b93604001610422565b90565b61025d565b34610fde57610fc8610fc2366004610f74565b916124bf565b610fd0610252565b80610fda8161045f565b0390f35b610258565b610ff0600960009061061a565b90565b3461102357611003366004610499565b61101f61100e610fe3565b611016610252565b918291826106a6565b0390f35b610258565b67ffffffffffffffff8111611046576110426020916105af565b0190565b6105b9565b9092919261106061105b82611028565b6106fe565b9381855260208501908284011161107c5761107a92610736565b565b6106f9565b9080601f8301121561109f5781602061109c9335910161104b565b90565b6106f4565b906080828203126110ff576110bc8160008401610293565b926110ca82602085016102ba565b926110d883604083016102ba565b92606082013567ffffffffffffffff81116110fa576110f79201611081565b90565b610262565b61025d565b34611136576111206111173660046110a4565b9291909161251e565b611128610252565b806111328161045f565b0390f35b610258565b346111695761115361114e36600461079b565b612554565b61115b610252565b806111658161045f565b0390f35b610258565b919061010083820312611233576111888160008501610293565b92602081013567ffffffffffffffff811161122e57826111a9918301610778565b92604082013567ffffffffffffffff811161122957836111ca918401610778565b92606083013567ffffffffffffffff811161122457816111eb918501610778565b926111f98260808301610293565b9261122161120a8460a08501610422565b936112188160c08601610293565b9360e001610a60565b90565b610262565b610262565b610262565b61025d565b346112705761125a61124b36600461116e565b969590959491949392936125cb565b611262610252565b8061126c8161045f565b0390f35b610258565b919060408382031261129e578061129261129b9260008601610a60565b936020016102ba565b90565b61025d565b91906112b790600060208501940190610b9a565b565b346112ea576112e66112d56112cf366004611275565b90612691565b6112dd610252565b918291826112a3565b0390f35b610258565b346113205761131c61130b611305366004610d65565b906126e9565b611313610252565b918291826103b1565b0390f35b610258565b346113535761133d61133836600461079b565b61273c565b611345610252565b8061134f8161045f565b0390f35b610258565b600080fd5b908160c091031261136b5790565b611358565b908160e091031261137e5790565b611358565b916060838303126113e85761139b8260008501610293565b92602081013567ffffffffffffffff81116113e357836113bc91830161135d565b92604082013567ffffffffffffffff81116113de576113db9201611370565b90565b610262565b610262565b61025d565b3461141e5761141a611409611403366004611383565b91612a9a565b611411610252565b91829182610a9b565b0390f35b610258565b90565b60001b90565b61144061143b61144592611423565b611426565b610a48565b90565b611452600061142c565b90565b61145d611448565b90565b3461149057611470366004610499565b61148c61147b611455565b611483610252565b91829182610a9b565b0390f35b610258565b61149e8161039f565b036114a557565b600080fd5b905035906114b782611495565b565b91906040838203126114e257806114d66114df9260008601610293565b936020016114aa565b90565b61025d565b34611516576115006114fa3660046114b9565b90612b3b565b611508610252565b806115128161045f565b0390f35b610258565b3461154a5761153461152e366004610b6c565b90612b8b565b61153c610252565b806115468161045f565b0390f35b610258565b906080828203126115da576115678160008401610293565b92602083013567ffffffffffffffff81116115d55782611588918501610993565b92604081013567ffffffffffffffff81116115d057836115a9918301610993565b92606082013567ffffffffffffffff81116115cb576115c89201611081565b90565b610262565b610262565b610262565b61025d565b34611611576115fb6115f236600461154f565b92919091612bc8565b611603610252565b8061160d8161045f565b0390f35b610258565b346116465761164261163161162c366004610a6f565b612bd6565b611639610252565b91829182610304565b0390f35b610258565b3461167a5761166461165e366004610d65565b90612c26565b61166c610252565b806116768161045f565b0390f35b610258565b61168c600a60009061061a565b90565b346116bf5761169f366004610499565b6116bb6116aa61167f565b6116b2610252565b918291826106a6565b0390f35b610258565b91906040838203126116ed57806116e16116ea9260008601610293565b93602001610293565b90565b61025d565b346117235761171f61170e6117083660046116c4565b90612c32565b611716610252565b918291826103b1565b0390f35b610258565b346117565761174061173b366004610a6f565b612cc1565b611748610252565b806117528161045f565b0390f35b610258565b91909160a0818403126117c7576117758360008301610293565b926117838160208401610293565b9261179182604085016102ba565b9261179f83606083016102ba565b92608082013567ffffffffffffffff81116117c2576117be9201610c46565b9091565b610262565b61025d565b34611801576117eb6117df36600461175b565b94939093929192612ccc565b6117f3610252565b806117fd8161045f565b0390f35b610258565b600080fd5b600090565b61181861180b565b50679a31110384e0b0c960205260145260005260406000205490565b600090565b611841611834565b5063c79b8b5f60e01b61185c61185683610350565b91610350565b148015611880575b908115611870575b5090565b61187a9150612e9b565b3861186c565b5061188a81612e9b565b611864565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b906118cd916118c86118c361188f565b612edf565b6118cf565b565b906118d9916130f9565b565b906118e5916118b3565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b6119249061191f61191a6118e7565b612edf565b611b0f565b565b601f602091010490565b1b90565b9190600861195091029161194a60001984611930565b92611930565b9181191691161790565b90565b919061197361196e61197b93610ae9565b61195a565b908354611934565b9055565b6119919161198b61180b565b9161195d565b565b5b81811061199f575050565b806119ad600060019361197f565b01611994565b9190601f81116119c3575b505050565b6119cf6119f493610508565b9060206119db84611926565b830193106119fc575b6119ed90611926565b0190611993565b3880806119be565b91506119ed819290506119e4565b90611a1b90600019906008026108aa565b191690565b81611a2a91611a0a565b906002021790565b90611a3c81610643565b9067ffffffffffffffff8211611afe57611a6082611a5a85546104d5565b856119b3565b602090601f8311600114611a9557918091611a8493600092611a89575b5050611a20565b90555b565b90915001513880611a7d565b601f19831691611aa485610508565b9260005b818110611ae657509160029391856001969410611acc575b50505002019055611a87565b611adc910151601f841690611a0a565b9055388080611ac0565b91936020600181928787015181550195019201611aa8565b6105b9565b90611b0d91611a32565b565b611b1a906008611b03565b565b611b259061190b565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b611b6490611b5f611b5a611b27565b612edf565b611be4565b565b611b7a611b75611b7f92610267565b610ae6565b610267565b90565b611b8b90611b66565b90565b611b9790611b82565b90565b90611bab60018060a01b0391611426565b9181191691161790565b611bbe90611b82565b90565b90565b90611bd9611bd4611be092611bb5565b611bc1565b8254611b9a565b9055565b611bf0611bf791611b8e565b6006611bc4565b565b611c0290611b4b565b565b606090565b905090565b9060009291805490611c29611c22836104d5565b8094611c09565b91600181169081600014611c7d5750600114611c45575b505050565b611c529192939450610508565b6000905b838210611c695750500190388080611c40565b600181602092548486015201910190611c56565b92949550505060ff19168252801515020190388080611c40565b611cbc611cb392602092611caa81610643565b94858093611c09565b93849101610650565b0190565b60007f2e6a736f6e000000000000000000000000000000000000000000000000000000910152565b611cf460058092611c09565b611cfd81611cc0565b0190565b91611d12611d1d93611d1893611c0e565b90611c97565b611ce8565b90565b90565b611d6a90611d2f611c04565b50611d65611d3e600992613173565b91611d56611d4a610252565b93849260208401611d01565b602082018103825203826105cf565b611d20565b90565b611d7a91339190916132c1565b565b600090565b611d8a90610a48565b90565b90611d9790611d81565b600052602052604060002090565b60001c90565b90565b611dba611dbf91611da5565b611dab565b90565b611dcc9054611dae565b90565b6001611de8611dee92611de0611d7c565b506004611d8d565b01611dc2565b90565b600090565b90611e0090610ae9565b600052602052604060002090565b60018060a01b031690565b611e25611e2a91611da5565b611e0e565b90565b611e379054611e19565b90565b90611e4490610272565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b611e6b611e7091611e48565b611e4e565b90565b611e7d9054611e5f565b90565b90611e8a906103fc565b9052565b611e9860406106fe565b90565b90611ed2611ec96000611eac611e8e565b94611ec3611ebb838301611e2d565b838801611e3a565b01611e73565b60208401611e80565b565b611edd90611e9b565b90565b611eea9051610272565b90565b611f01611efc611f0692611423565b610ae6565b610267565b90565b611f1290611eed565b90565b611f1f90516103fc565b90565b611f36611f31611f3b926103fc565b610ae6565b6102a2565b90565b634e487b7160e01b600052601160045260246000fd5b611f63611f69919392936102a2565b926102a2565b91611f758382026102a2565b928184041490151715611f8457565b611f3e565b634e487b7160e01b600052601260045260246000fd5b611fab611fb1916102a2565b916102a2565b908115611fbc570490565b611f89565b611fe4611fe991939293611fd3611df1565b50611fdc61180b565b506003611df6565b611ed4565b91611ff660008401611ee0565b61201161200b6120066000611f09565b610272565b91610272565b1461205e575b600061205361203d61205a9361203761203260208901611f15565b611f22565b90611f54565b61204d6120486133cc565b611f22565b90611f9f565b9301611ee0565b9190565b915061205a600061205361203d6120756002611ed4565b959350505050612017565b61208b91369161093c565b90565b61209991369161104b565b90565b9693969590949192956120ad6133e3565b6122e6575b8287036122d85760601b679a31110384e0b0c9179460601b679a31110384e0b0c91791856020528560601c958360601c9384156122ca578733036122ae575b8860051b805b61224e57505050828660207f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb604051604081528b8d8160051b948286936040860152838d6060870137836060018286015260608486010190815201376080339380010190a46121646133f1565b612231575b50813b61217a575b50505050505050565b602080809786946000528060c06040519b8c9a63bc197c818c5233868d015260408c015260a060608c01528a8360051b998a9586948593015260e08d01378160c00160808c015260e0828c010192835284830137818060e0010160a08a01520101838152013780010161010401601c60405101600080515af115612222575b63bc197c8160e01b9051036122145738808080808080612171565b639c05499b6000526004601cfd5b3d156121f9573d6000823e3d90fd5b612248908690849086908a8c919287948b966133ff565b38612169565b60209003808b01358360205281880135600052604060002080548083116122a0578290039055826020526040600020908154908101908110612292578291556120f7565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c20546120f157634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b61230984886123038b87906122fd88948c96612080565b50612080565b5061208e565b506120b2565b9061232a9161232561232082611dcf565b612edf565b61232c565b565b9061233691613449565b565b906123429161230f565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b61239f602f604092610647565b6123a881612344565b0190565b6123c29060208101906000818303910152612392565b90565b156123cc57565b6123d4610252565b62461bcd60e51b8152806123ea600482016123ac565b0390fd5b9061241b916124168261241061240a612405613473565b610272565b91610272565b146123c5565b613480565b565b606090565b9392919061242e61241d565b5082036124855760405193828552602085019260051b808481016040525b6124565750505050565b602090038082013560601b679a31110384e0b0c91760205280830135600052806040600020548186015261244c565b633b800a466000526004601cfd5b906124ae92916124a96124a461188f565b612edf565b6124b0565b565b916124bd9291909161352e565b565b906124ca9291612493565b565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b9061250c9392916125076125026124cc565b612edf565b61250e565b565b9161251c93919091926135b1565b565b9061252a9392916124f0565b565b6125459061254061253b6118e7565b612edf565b612547565b565b612552906009611b03565b565b61255d9061252c565b565b60ff1690565b61257161257691611da5565b61255f565b90565b6125839054612565565b90565b9061259260ff91611426565b9181191691161790565b6125a59061039f565b90565b90565b906125c06125bb6125c79261259c565b6125a8565b8254612586565b9055565b959694939294336126046125fe7f0000000000000000000000000000000000000000000000000000000000000000610272565b91610272565b14158015612666575b6126495761263b9761262e966126299489949091929394613607565b6130f9565b6126366124cc565b613449565b6126476001600b6125ab565b565b600063f92ee8a960e01b8152806126626004820161045f565b0390fd5b50612671600b612579565b61260d565b9061268090611d81565b600052602052604060002090565b90565b906126b16126ac6126b6936126a4611df1565b506005612676565b61268e565b6136a0565b90565b6126c290611b66565b90565b6126ce906126b9565b90565b906126db906126c5565b600052602052604060002090565b61271191600061270661270c936126fe611834565b506004611d8d565b016126d1565b612579565b90565b61272d906127286127236118e7565b612edf565b61272f565b565b61273a90600a611b03565b565b61274590612714565b565b60018060a01b031690565b61275e61276391611da5565b612747565b90565b6127709054612752565b90565b61277c906126b9565b90565b60e01b90565b9050519061279282610a4b565b565b906020828203126127ae576127ab91600001612785565b90565b61025d565b506127c2906020810190610293565b90565b6127ce90610272565b9052565b506127e1906020810190610371565b90565b6127ed90610350565b9052565b50612800906020810190610a60565b90565b61280c90610a48565b9052565b600080fd5b600080fd5b600080fd5b903560016020038236030381121561286057016020813591019167ffffffffffffffff821161285b57600182023603831361285657565b612815565b612810565b61281a565b60209181520190565b9190612888816128818161288d95612865565b8095610736565b6105af565b0190565b90356001604003823603038112156128a7570190565b61281a565b90356001602003823603038112156128ed57016020813591019167ffffffffffffffff82116128e85760018202360383136128e357565b612815565b612810565b61281a565b919061290c8161290581612911956104ff565b8095610736565b6105af565b0190565b67ffffffffffffffff1690565b61292b81612915565b0361293257565b600080fd5b9050359061294482612922565b565b50612955906020810190612937565b90565b61296190612915565b9052565b906129a390602061299b6129916040840161298360008801886128ac565b9086830360008801526128f2565b9482810190612946565b910190612958565b90565b612a5091612a42612a3760c083016129ce6129c460008701876127b3565b60008601906127c5565b6129e86129de60208701876127d2565b60208601906127e4565b612a026129f860408701876127f1565b6040860190612803565b612a1c612a1260608701876127f1565b6060860190612803565b612a29608086018661281f565b90858303608087015261286e565b9260a0810190612891565b9060a0818403910152612965565b90565b939290612a7f604091612a8794612a72606089019260008a0190610b9a565b87820360208901526129a6565b940190610a8e565b565b612a91610252565b3d6000823e3d90fd5b9150602090612aa7611d7c565b50612aba612ab56006612766565b612773565b612ae6633808a90b949294612af1612ad26007611dc2565b612ada610252565b9788968795869561277f565b855260048501612a53565b03915afa908115612b3657600091612b08575b5090565b612b29915060203d8111612b2f575b612b2181836105cf565b810190612794565b38612b04565b503d612b17565b612a89565b901515679a31110384e0b0c96020523360145281600052806034600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b612b9891339190916136d9565b565b90612bb6939291612bb1612bac6124cc565b612edf565b612bb8565b565b91612bc6939190919261372b565b565b90612bd4939291612b9a565b565b612bf5612bf0612bfa92612be861180b565b506005612676565b61268e565b613814565b90565b90612c1891612c13612c0e82611dcf565b612edf565b612c1a565b565b90612c2491613480565b565b90612c3091612bfd565b565b612c3a611834565b50679a31110384e0b0c96020526014526000526034600c205490565b612c6f90612c6a612c65611b27565b612edf565b612cb4565b565b90612c7e60001991611426565b9181191691161790565b612c9190611da5565b90565b90612ca9612ca4612cb092611d81565b612c88565b8254612c71565b9055565b612cbf906007612c94565b565b612cca90612c56565b565b94909194612cd86133e3565b612e76575b60601b679a31110384e0b0c9179160601b679a31110384e0b0c917918060205260601c928260601c928315612e6857843303612e4c575b8660005260406000208054808411612e3e5783900390556020526040600020805490828201918210612e305755806020528284337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4612d766133f1565b612e0b575b823b612d8a575b505050505050565b602094829160405197889663f23a6e618852338989015260408801526060870152608086015260a0808601528160c086015260e085013760c401906000601c8401915af115612dfc575b63f23a6e6160e01b905103612dee57388080808080612d82565b639c05499b6000526004601cfd5b3d15612dd4573d6000823e3d90fd5b612e1486613834565b50612e1e81613834565b50612e2a85839061208e565b50612d7b565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c2054612d1457634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b612e7f86613834565b50612e8984613834565b50612e9585839061208e565b50612cdd565b612ea3611834565b50612ead81613854565b8015612ed0575b908115612ec0575b5090565b612eca91506138fa565b38612ebc565b50612eda81613894565b612eb4565b612ef190612eeb613473565b906139f1565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b612f4e602a604092610647565b612f5781612ef3565b0190565b612f719060208101906000818303910152612f41565b90565b15612f7b57565b612f83610252565b62461bcd60e51b815280612f9960048201612f5b565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b612fd26019602092610647565b612fdb81612f9d565b0190565b612ff59060208101906000818303910152612fc5565b90565b15612fff57565b613007610252565b62461bcd60e51b81528061301d60048201612fdf565b0390fd5b61302b60406106fe565b90565b90565b9061304661304161304d926126c5565b61302e565b8254611b9a565b9055565b60a01b90565b906130716bffffffffffffffffffffffff60a01b91613051565b9181191691161790565b61308f61308a613094926103fc565b610ae6565b6103fc565b90565b90565b906130af6130aa6130b69261307b565b613097565b8254613057565b9055565b906130e5602060006130eb946130dd8282016130d7848801611ee0565b90613031565b019201611f15565b9061309a565b565b906130f7916130ba565b565b9061316a613171926131258361311e6131186131136133cc565b6103fc565b916103fc565b1115612f74565b61314b8161314461313e6131396000611f09565b610272565b91610272565b1415612ff8565b91613161613157613021565b9360008501611e3a565b60208301611e80565b60026130ed565b565b9061317c611c04565b506080604051019160208301604052600083528290600a6000198092955b01948181066030018653049384156131b95790600a919080929161319a565b93505082602091039203918252565b6131dc6131d76131e192611423565b610ae6565b6102a2565b90565b60016131f091016102a2565b90565b634e487b7160e01b600052603260045260246000fd5b9061321382610e9a565b811015613224576020809102010190565b6131f3565b61323390516102a2565b90565b61324261324791611da5565b6108ae565b90565b6132549054613236565b90565b61326661326c919392936102a2565b926102a2565b820391821161327757565b611f3e565b9061329161328c61329892610ae9565b61195a565b8254612c71565b9055565b6132ab6132b1919392936102a2565b926102a2565b82018092116132bc57565b611f3e565b6132d19093929193848391613a8a565b6132da83610e9a565b926132e560006131c8565b926132f060006131c8565b935b846133056132ff886102a2565b916102a2565b10156133825761337661337c9161335d613328613323888a90613209565b613229565b613357613348600161334261333d8d8c613209565b613229565b90610b05565b916133528361324a565b613257565b9061327c565b61337061336b878990613209565b613229565b9061329c565b946131e4565b936132f2565b915093506133a6925061339f915061339a600061324a565b613257565b600061327c565b565b600090565b90565b6133c46133bf6133c9926133ad565b610ae6565b6103fc565b90565b6133d46133a8565b506133e06127106133b0565b90565b6133eb611834565b50600090565b6133f9611834565b50600090565b5050949293909361340e6133f1565b61341b575b505050505050565b6134316134379361343d97969092939596612080565b50612080565b5061208e565b50388080808080613413565b9061346b6134666134709361345f818590613aa5565b6005612676565b61268e565b613b8c565b50565b61347b611df1565b503390565b906134a261349d6134a793613496818590613bc7565b6005612676565b61268e565b613c61565b50565b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b6134df601b602092610647565b6134e8816134aa565b0190565b61350290602081019060008183039101526134d2565b90565b1561350c57565b613514610252565b62461bcd60e51b81528061352a600482016134ec565b0390fd5b6135aa906135a36135af949361355e8561355761355161354c6133cc565b6103fc565b916103fc565b1115612f74565b6135848161357d6135776135726000611f09565b610272565b91610272565b1415613505565b9361359a613590613021565b9560008701611e3a565b60208501611e80565b6003611df6565b6130ed565b565b6135ff91926135cb613605956135f0939086849192613c9c565b6135e86135e1826135dc600061324a565b61329c565b600061327c565b926001610b05565b916135fa8361324a565b61329c565b9061327c565b565b919261362661366b969461361f61362d946008611b03565b6009611b03565b600a611b03565b61363f613638611448565b8290613449565b61365161364a61188f565b8290613449565b61366361365c6118e7565b8290613449565b919091613d9d565b565b90565b61367c61368191611da5565b610ae9565b90565b61369861369361369d926102a2565b610ae6565b610267565b90565b6136cc6136c76136d6936136c260006136d1956136bb611df1565b500161366d565b613e18565b613670565b613684565b6126b9565b90565b613714613729936136ef61372393858391613e3a565b61370c61370582613700600061324a565b613257565b600061327c565b926001610b05565b9161371e8361324a565b613257565b9061327c565b565b9261373c9194939085849192613e55565b61374583610e9a565b9161375060006131c8565b9061375b60006131c8565b915b8261377061376a876102a2565b916102a2565b10156137ee576137966137e89161379061378b878790613209565b613229565b9061329c565b926137e36137ad6137a8878490613209565b613229565b6137dd6137ce60016137c86137c38d8890613209565b613229565b90610b05565b916137d88361324a565b61329c565b9061327c565b6131e4565b9161375d565b91509350613812925061380b9150613806600061324a565b61329c565b600061327c565b565b61382c60006138319261382561180b565b500161366d565b613f98565b90565b9061383d61241d565b506040519160408301604052600183526020830152565b61385c611834565b50633e85e62f60e01b61387761387183610350565b91610350565b14908115613884575b5090565b61388e9150613fb0565b38613880565b61389c611834565b506138a681613fd7565b80156138eb575b80156138d0575b9081156138c0575b5090565b6138ca9150614017565b386138bc565b5060006138e56138df83610350565b91610350565b146138b4565b506138f581614017565b6138ad565b613902611834565b5061390c81614017565b908115613918575b5090565b6139229150614057565b38613914565b90565b61393f61393a61394492613928565b610ae6565b6102a2565b90565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b61397b60178092611c09565b61398481613947565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b6139bc60118092611c09565b6139c581613988565b0190565b6139e36139ee93926139dd6139e89361396f565b90611c97565b6139b0565b90611c97565b90565b90613a06613a008383906126e9565b1561039f565b613a0e575050565b613a8691613a64613a3d613a2d613a27613a69956140e5565b93613670565b613a37602061392b565b906142fe565b91613a55613a49610252565b938492602084016139c9565b602082018103825203826105cf565b611d20565b613a71610252565b91829162461bcd60e51b8352600483016106a6565b0390fd5b9091613aa392613a9a6000611f09565b92909192614479565b565b613ab9613ab38284906126e9565b1561039f565b613ac2575b5050565b613ae56001613ae06000613ad860048690611d8d565b0185906126d1565b6125ab565b90613aee613473565b90613b2b613b25613b1f7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95611d81565b926126c5565b926126c5565b92613b34610252565b80613b3e8161045f565b0390a43880613abe565b613b5190611b66565b90565b613b68613b63613b6d92610267565b610ae6565b6102a2565b90565b613b84613b7f613b89926102a2565b611426565b610a48565b90565b90613bbf613bb9613bb4613baf6000613bc496613ba7611834565b500194613b48565b613b54565b613b70565b9161366d565b614669565b90565b613bd28183906126e9565b613bdb575b5050565b613bfe6000613bf96000613bf160048690611d8d565b0185906126d1565b6125ab565b90613c07613473565b90613c44613c3e613c387ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95611d81565b926126c5565b926126c5565b92613c4d610252565b80613c578161045f565b0390a43880613bd7565b90613c94613c8e613c89613c846000613c9996613c7c611834565b500194613b48565b613b54565b613b70565b9161366d565b614729565b90565b91929092613ca86133e3565b613d84575b8260601b8015613d7657679a31110384e0b0c960205283601452846000526040600020805490838201918210613d6857558160205260601c6000337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604083a4613d156133f1565b613d4f575b613d2383614833565b613d2e575b50505050565b613d4693613d3c6000611f09565b9390919293614840565b38808080613d28565b613d5884613834565b50613d6281613834565b50613d1a565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b613d8d84613834565b50613d9781613834565b50613cad565b90613db3613db89392613dae611b27565b613449565b6148d9565b565b5490565b600052602060002090565b613dd281613dba565b821015613ded57613de4600191613dbe565b91020190600090565b6131f3565b613e02906008613e0793026108aa565b611dab565b90565b90613e159154613df2565b90565b613e37916000613e3192613e2a611d7c565b5001613dc9565b90613e0a565b90565b9091613e5392613e4a6000611f09565b929091926148f9565b565b91929092613e616133e3565b613f93575b8051845103613f85578260601b8015613f775780679a31110384e0b0c917602052845160051b805b613f4057506000604051604081527f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb81885160051b602001604082019081818c60045afa503d60400160208301523d01865160051b60200181818960045afa503d01039360601c933392a4613f016133f1565b613f3b575b613f0f83614833565b613f1a575b50505050565b613f3293613f286000611f09565b93909192936149fd565b38808080613f14565b613f06565b8083015190808701516000526040600020918254908101908110613f6957602092550380613e8e565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b613e66565b6000613fad91613fa661180b565b5001613dba565b90565b613fb8611834565b5060e01c630e89341c8114906301ffc9a763d9b67a2682149114171790565b613fdf611834565b5080613ffa613ff463152a902d60e11b610350565b91610350565b14908115614007575b5090565b6140119150614ab4565b38614003565b61401f611834565b508061403a614034635a05180f60e01b610350565b91610350565b14908115614047575b5090565b6140519150614ada565b38614043565b61405f611834565b508061407a614074634e821d3360e11b610350565b91610350565b14908115614087575b5090565b6140919150613894565b38614083565b90565b60ff1690565b6140b46140af6140b992614097565b610ae6565b61409a565b90565b6140c660146140a0565b90565b6140dd6140d86140e29261409a565b610ae6565b6102a2565b90565b6141026140fd614118926140f7611c04565b50613b48565b613b54565b61411261410d6140bc565b6140c9565b906142fe565b90565b90565b61413261412d6141379261411b565b610ae6565b6102a2565b90565b9061414c61414783611028565b6106fe565b918252565b369037565b9061417b6141638361413a565b926020806141718693611028565b9201910390614151565b565b600360fc1b90565b5190565b9061419382614185565b8110156141a557600160209102010190565b6131f3565b600f60fb1b90565b90565b6141c96141c46141ce926141b2565b610ae6565b6102a2565b90565b6141da906102a2565b600081146141e9576001900390565b611f3e565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b61420d6141ee565b90565b90565b61422761422261422c92614210565b610ae6565b6102a2565b90565b60f81b90565b90565b61424c61424761425192614235565b610ae6565b61409a565b90565b6142739061426d6142676142789461409a565b916102a2565b906108aa565b6102a2565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b6142af60208092610647565b6142b88161427b565b0190565b6142d290602081019060008183039101526142a3565b90565b156142dc57565b6142e4610252565b62461bcd60e51b8152806142fa600482016142bc565b0390fd5b9190614308611c04565b506143a261439261433e6143396143296002614324879161411e565b611f54565b614333600261411e565b9061329c565b614156565b9261434761417d565b6143608561435a60009360001a936131c8565b90614189565b536143696141aa565b6143828561437c60019360001a936141b5565b90614189565b5361438d600261411e565b611f54565b61439c60016141b5565b9061329c565b925b836143b86143b260016141b5565b916102a2565b111561441f576143c6614205565b816143d1600f614213565b1691601083101561441a576143ed61440e92614414941a61422f565b6143fd8591889060001a92614189565b536144086004614238565b90614254565b936141d1565b926143a4565b6131f3565b6144479293506144429061443c61443660006131c8565b916102a2565b146142d5565b611d20565b90565b9061445c61445783610713565b6106fe565b918252565b61446b600061444a565b90565b614476614461565b90565b919392906144856133e3565b6145b1575b81518551036145a35760601b9182679a31110384e0b0c9176020528060601b83811490151715614581575b50835160051b805b61454b57507f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb6000939460405192839160408352805160051b60200180916040850192839160045afa503d60400160208401523d019081815160051b602001809260045afa503d01039260601c923392a46145366133f1565b61453d575b565b61454561446e565b5061453b565b80820151908086015160005260406000208054928381116145735760209303905503806144bd565b63f4d678b86000526004601cfd5b6000526034600c20541561459557386144b5565b634b6e7f186000526004601cfd5b633b800a466000526004601cfd5b6145b961446e565b5061448a565b90565b600052602060002090565b5490565b6145da816145cd565b8210156145f5576145ec6001916145c2565b91020190600090565b6131f3565b919061461061460b61461893611d81565b612c88565b908354611934565b9055565b908154916801000000000000000083101561464c578261464491600161464a950181556145d1565b906145fa565b565b6105b9565b9061465b90611d81565b600052602052604060002090565b614671611834565b50614686614680828490614b1a565b1561039f565b6000146146c9576146bf6146c4926146aa6146a3600085016145bf565b829061461c565b60016146b860008501613dba565b9301614651565b61327c565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b6146f8916146f2611d7c565b916145fa565b565b614703816145cd565b801561472457600190039061472161471b83836145d1565b906146e6565b55565b6146d0565b614731611834565b50614748614743600183018490614651565b61324a565b908161475d61475760006131c8565b916102a2565b141560001461482b576147dd9260016147d89284614786600096614780856141b5565b90613257565b6147a3614794888501613dba565b61479d866141b5565b90613257565b806147b66147b0846102a2565b916102a2565b036147e2575b5050506147d26147cd8683016145bf565b6146fa565b01614651565b61197f565b600190565b614823926148156148016147fb61481e948c8901613dc9565b90613e0a565b9361480f85918c8901613dc9565b906145fa565b91858501614651565b61327c565b3880806147bc565b505050600090565b61483b611834565b503b90565b919360209360405195869463f23a6e618652338787015260601b60601c60408601526060850152608084015260a08084015280518091818060c08701526148c5575b505060c401906000601c8401915af1156148b6575b63f23a6e6160e01b9051036148a857565b639c05499b6000526004601cfd5b3d15614897573d6000823e3d90fd5b818660e08701920160045afa508038614882565b906148f06148e96148f793611b8e565b6006611bc4565b6007612c94565b565b909291926149056133e3565b6149db575b60601b9081679a31110384e0b0c917602052818160601b148160601b1517156149b9575b50826000526040600020908154918284116149ab57836000930390558260205260601c337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604084a461497f6133f1565b614988575b5050565b61499461499a92613834565b50613834565b506149a361446e565b503880614984565b63f4d678b86000526004601cfd5b6000526034600c2054156149cd573861492e565b634b6e7f186000526004601cfd5b6149e484613834565b506149ee83613834565b506149f761446e565b5061490a565b919360209360405195869463bc197c818652338787015260601b60601c604086015260a06060860152805160051b8601809160c0870192839160045afa503d60a001908160808701523d019182815160051b8801809260045afa503d0160a08501523d01908181518601809260045afa50601c8301903d0103906000601c8401915af115614aa5575b63bc197c8160e01b905103614a9757565b639c05499b6000526004601cfd5b3d15614a86573d6000823e3d90fd5b614abc611834565b50614ad6614ad06301ffc9a760e01b610350565b91610350565b1490565b614ae2611834565b5080614afd614af7637965db0b60e01b610350565b91610350565b14908115614b0a575b5090565b614b149150613fd7565b38614b06565b614b38916001614b3392614b2c611834565b5001614651565b61324a565b614b4b614b4560006131c8565b916102a2565b14159056fea26469706673582212201008807002fe6072ba72743479d7976a506937a4e756aa0aef6ad714bef8804e64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -125,215 +16,233 @@ export class ERC1155ItemsFactory extends ContractFactory { export const ERC1155ITEMSFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC1155/presets/items/ERC1155ItemsFactory.sol:ERC1155ItemsFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { - 'node_modules/@0xsequence/erc-1155/contracts/interfaces/IERC1155.sol': { + 'src/tokens/ERC1155/presets/items/ERC1155ItemsFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\nimport \'./IERC165.sol\';\n\n\ninterface IERC1155 is IERC165 {\n\n /****************************************|\n | Events |\n |_______________________________________*/\n\n /**\n * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning\n * Operator MUST be msg.sender\n * When minting/creating tokens, the `_from` field MUST be set to `0x0`\n * When burning/destroying tokens, the `_to` field MUST be set to `0x0`\n * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID\n * To broadcast the existence of a token ID with no initial balance, the contract SHOULD emit the TransferSingle event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0\n */\n event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount);\n\n /**\n * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning\n * Operator MUST be msg.sender\n * When minting/creating tokens, the `_from` field MUST be set to `0x0`\n * When burning/destroying tokens, the `_to` field MUST be set to `0x0`\n * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID\n * To broadcast the existence of multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0\n */\n event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts);\n\n /**\n * @dev MUST emit when an approval is updated\n */\n event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);\n\n\n /****************************************|\n | Functions |\n |_______________________________________*/\n\n /**\n * @notice Transfers amount of an _id from the _from address to the _to address specified\n * @dev MUST emit TransferSingle event on success\n * Caller must be approved to manage the _from account\'s tokens (see isApprovedForAll)\n * MUST throw if `_to` is the zero address\n * MUST throw if balance of sender for token `_id` is lower than the `_amount` sent\n * MUST throw on any other error\n * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external;\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @dev MUST emit TransferBatch event on success\n * Caller must be approved to manage the _from account\'s tokens (see isApprovedForAll)\n * MUST throw if `_to` is the zero address\n * MUST throw if length of `_ids` is not the same as length of `_amounts`\n * MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_amounts` sent\n * MUST throw on any other error\n * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`\n * Transfers and events MUST occur in the array order they were submitted (_ids[0] before _ids[1], etc)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external;\n\n /**\n * @notice Get the balance of an account\'s Tokens\n * @param _owner The address of the token holder\n * @param _id ID of the Token\n * @return The _owner\'s balance of the Token type requested\n */\n function balanceOf(address _owner, uint256 _id) external view returns (uint256);\n\n /**\n * @notice Get the balance of multiple account/token pairs\n * @param _owners The addresses of the token holders\n * @param _ids ID of the Tokens\n * @return The _owner\'s balance of the Token types requested (i.e. balance for each (owner, id) pair)\n */\n function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);\n\n /**\n * @notice Enable or disable approval for a third party ("operator") to manage all of caller\'s tokens\n * @dev MUST emit the ApprovalForAll event on success\n * @param _operator Address to add to the set of authorized operators\n * @param _approved True if the operator is approved, false to revoke approval\n */\n function setApprovalForAll(address _operator, bool _approved) external;\n\n /**\n * @notice Queries the approval status of an operator for a given owner\n * @param _owner The owner of the Tokens\n * @param _operator Address of authorized operator\n * @return isOperator True if the operator is approved, false if not\n */\n function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator);\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC1155Items } from "./ERC1155Items.sol";\nimport { IERC1155ItemsFactory, IERC1155ItemsFactoryFunctions } from "./IERC1155ItemsFactory.sol";\n\n/**\n * Deployer of ERC-1155 Items proxies.\n */\ncontract ERC1155ItemsFactory is IERC1155ItemsFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Items Factory.\n * @param factoryOwner The owner of the ERC-1155 Items Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Items impl = new ERC1155Items();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155ItemsFactoryFunctions\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 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 ERC1155Items(proxyAddr).initialize(\n tokenOwner,\n name,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n emit ERC1155ItemsDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155ItemsFactoryFunctions\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 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' }, - 'node_modules/@0xsequence/erc-1155/contracts/interfaces/IERC1155Metadata.sol': { + 'src/proxies/SequenceProxyFactory.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: 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/@0xsequence/erc-1155/contracts/interfaces/IERC1155TokenReceiver.sol': { + 'src/tokens/ERC1155/presets/items/ERC1155Items.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.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' }, - 'node_modules/@0xsequence/erc-1155/contracts/interfaces/IERC165.sol': { + 'src/tokens/ERC1155/presets/items/IERC1155ItemsFactory.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: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155ItemsFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Items proxy.\n * @param proxyOwner The owner of the ERC-1155 Items proxy\n * @param tokenOwner The owner of the ERC-1155 Items implementation\n * @param name The name of the ERC-1155 Items proxy\n * @param baseURI The base URI of the ERC-1155 Items proxy\n * @param contractURI The contract URI of the ERC-1155 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-1155 Items 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 Items proxy\n * @param tokenOwner The owner of the ERC-1155 Items implementation\n * @param name The name of the ERC-1155 Items proxy\n * @param baseURI The base URI of the ERC-1155 Items proxy\n * @param contractURI The contract URI of the ERC-1155 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-1155 Items 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 IERC1155ItemsFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Items proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155ItemsDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155ItemsFactory is IERC1155ItemsFactoryFunctions, IERC1155ItemsFactorySignals { }\n' }, - 'node_modules/@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol': { + 'src/proxies/TransparentUpgradeableBeaconProxy.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: 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/@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155Metadata.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.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) (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/@0xsequence/erc-1155/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: - 'pragma solidity ^0.8.0;\n\n/**\n * Utility library of inline functions on addresses\n */\nlibrary Address {\n\n // Default hash for EOA accounts returned by extcodehash\n bytes32 constant internal ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n\n /**\n * Returns whether the target address is a contract\n * @dev This function will return false if invoked during the constructor of a contract.\n * @param _address address of the account to check\n * @return Whether the target address is a contract\n */\n function isContract(address _address) internal view returns (bool) {\n bytes32 codehash;\n\n // Currently there is no better way to check if there is a contract in an address\n // than to check the size of the code at that address or if it has a non-zero code hash or account hash\n assembly { codehash := extcodehash(_address) }\n return (codehash != 0x0 && codehash != ACCOUNT_HASH);\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts 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/@0xsequence/erc-1155/contracts/utils/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.sol': { content: - 'pragma solidity ^0.8.0;\nimport "../interfaces/IERC165.sol";\n\nabstract contract ERC165 is IERC165 {\n /**\n * @notice Query if a contract implements an interface\n * @param _interfaceID The interface identifier, as specified in ERC-165\n * @return `true` if the contract implements `_interfaceID`\n */\n function supportsInterface(bytes4 _interfaceID) public view virtual override returns (bool) {\n return _interfaceID == this.supportsInterface.selector;\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/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/access/AccessControl.sol': { + 'src/tokens/ERC1155/ERC1155BaseToken.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 { 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' }, - 'node_modules/@openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'src/tokens/ERC1155/presets/items/IERC1155Items.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\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' }, - 'node_modules/@openzeppelin/contracts/access/IAccessControl.sol': { + 'src/proxies/openzeppelin/BeaconProxy.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 (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/access/IAccessControlEnumerable.sol': { + 'src/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (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/access/Ownable.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Context.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: 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/interfaces/IERC1967.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.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/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/interfaces/IERC2981.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Address.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/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/interfaces/draft-IERC1822.sol': { + 'src/tokens/common/ERC2981Controlled.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 { 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/proxy/ERC1967/ERC1967Upgrade.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.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 { 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/proxy/Proxy.sol': { + 'src/tokens/ERC1155/extensions/supply/ERC1155Supply.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 { 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' }, - 'node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol': { + 'lib/solady/src/utils/LibString.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\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/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.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 (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/token/common/ERC2981.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.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.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/Address.sol': { + 'src/proxies/openzeppelin/ERC1967Proxy.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' + '// 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/Context.sol': { + 'src/tokens/common/IERC2981Controlled.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\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/Create2.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.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: 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/@openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/openzeppelin-contracts/contracts/token/common/ERC2981.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\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/@openzeppelin/contracts/utils/Strings.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.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.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/@openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'src/tokens/ERC1155/extensions/supply/IERC1155Supply.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: 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' }, - 'node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol': { + 'lib/solady/src/tokens/ERC1155.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\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' }, - 'node_modules/@openzeppelin/contracts/utils/math/Math.sol': { + 'lib/solady/src/utils/LibBytes.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' + "// SPDX-License-Identifier: 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/@openzeppelin/contracts/utils/math/SignedMath.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (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' }, - 'node_modules/@openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.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) (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/SequenceProxyFactory.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 {\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.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/TransparentUpgradeableBeaconProxy.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.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 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/BeaconProxy.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.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 (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/ERC1967Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.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) (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/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC2981.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) (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/ERC1155/ERC1155BaseToken.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 {\r\n ERC1155Supply, ERC1155\r\n} from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/ERC1155Supply.sol";\r\nimport {ERC1155Metadata} from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155Metadata.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-1155 for use in Sequence library contracts.\r\n */\r\nabstract contract ERC1155BaseToken is ERC1155Supply, ERC1155Metadata, ERC2981Controlled {\r\n bytes32 internal constant METADATA_ADMIN_ROLE = keccak256("METADATA_ADMIN_ROLE");\r\n\r\n string private _contractURI;\r\n\r\n /**\r\n * Deploy contract.\r\n */\r\n constructor() ERC1155Metadata("", "") {}\r\n\r\n /**\r\n * Initialize the contract.\r\n * @param owner Owner address.\r\n * @param tokenName Token name.\r\n * @param tokenBaseURI Base URI for token metadata.\r\n * @param tokenContractURI Contract URI for token metadata.\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 tokenBaseURI,\r\n string memory tokenContractURI\r\n )\r\n internal\r\n {\r\n name = tokenName;\r\n baseURI = tokenBaseURI;\r\n _contractURI = tokenContractURI;\r\n\r\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\r\n _grantRole(ROYALTY_ADMIN_ROLE, owner);\r\n _grantRole(METADATA_ADMIN_ROLE, owner);\r\n }\r\n\r\n //\r\n // Metadata\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 _setBaseMetadataURI(tokenBaseURI);\r\n }\r\n\r\n /**\r\n * Update the name of the contract.\r\n * @param tokenName New contract name\r\n */\r\n function setContractName(string memory tokenName) external onlyRole(METADATA_ADMIN_ROLE) {\r\n _setContractName(tokenName);\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 tokens.\r\n * @param tokenId Id of token to burn\r\n * @param amount Amount of tokens to burn\r\n */\r\n function burn(uint256 tokenId, uint256 amount) public virtual {\r\n _burn(msg.sender, tokenId, amount);\r\n }\r\n\r\n /**\r\n * Burn tokens of given token id for each (tokenIds[i], amounts[i]) pair.\r\n * @param tokenIds Array of token ids to burn\r\n * @param amounts Array of the amount to be burned\r\n */\r\n function batchBurn(uint256[] memory tokenIds, uint256[] memory amounts) public virtual {\r\n _batchBurn(msg.sender, tokenIds, amounts);\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 (ERC1155Supply, ERC1155Metadata, ERC2981Controlled)\r\n returns (bool)\r\n {\r\n return ERC1155Supply.supportsInterface(interfaceId) || ERC1155Metadata.supportsInterface(interfaceId)\r\n || ERC2981Controlled.supportsInterface(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/ERC1155/extensions/supply/ERC1155Supply.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 {ERC1155} from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol";\r\nimport {\r\n IERC1155Supply,\r\n IERC1155SupplyFunctions\r\n} from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol";\r\n\r\n/**\r\n * An ERC-1155 extension that tracks token supply.\r\n */\r\nabstract contract ERC1155Supply is ERC1155, IERC1155Supply {\r\n // Current supply\r\n uint256 public totalSupply;\r\n mapping(uint256 => uint256) public tokenSupply;\r\n\r\n /**\r\n * Mint _amount of tokens of a given id\r\n * @param _to The address to mint tokens to\r\n * @param _id Token id to mint\r\n * @param _amount The amount to be minted\r\n * @param _data Data to pass if receiver is contract\r\n */\r\n function _mint(address _to, uint256 _id, uint256 _amount, bytes memory _data) internal virtual {\r\n totalSupply += _amount;\r\n tokenSupply[_id] += _amount;\r\n balances[_to][_id] += _amount;\r\n\r\n emit TransferSingle(msg.sender, address(0x0), _to, _id, _amount);\r\n\r\n _callonERC1155Received(address(0x0), _to, _id, _amount, gasleft(), _data);\r\n }\r\n\r\n /**\r\n * Mint tokens for each ids in _ids\r\n * @param _to The address to mint tokens to\r\n * @param _ids Array of ids to mint\r\n * @param _amounts Array of amount of tokens to mint per id\r\n * @param _data Data to pass if receiver is contract\r\n */\r\n function _batchMint(address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data)\r\n internal\r\n virtual\r\n {\r\n uint256 nMint = _ids.length;\r\n if (nMint != _amounts.length) {\r\n revert InvalidArrayLength();\r\n }\r\n\r\n // Executing all minting\r\n uint256 totalAmount = 0;\r\n for (uint256 i = 0; i < nMint; i++) {\r\n // Update storage balance\r\n balances[_to][_ids[i]] += _amounts[i];\r\n tokenSupply[_ids[i]] += _amounts[i];\r\n totalAmount += _amounts[i];\r\n }\r\n totalSupply += totalAmount;\r\n\r\n emit TransferBatch(msg.sender, address(0x0), _to, _ids, _amounts);\r\n\r\n // Calling onReceive method if recipient is contract\r\n _callonERC1155BatchReceived(address(0x0), _to, _ids, _amounts, gasleft(), _data);\r\n }\r\n\r\n /**\r\n * Burn _amount of tokens of a given token id\r\n * @param _from The address to burn tokens from\r\n * @param _id Token id to burn\r\n * @param _amount The amount to be burned\r\n */\r\n function _burn(address _from, uint256 _id, uint256 _amount) internal virtual {\r\n // Supply\r\n totalSupply -= _amount;\r\n tokenSupply[_id] -= _amount;\r\n\r\n // Balances\r\n balances[_from][_id] -= _amount;\r\n\r\n // Emit event\r\n emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount);\r\n }\r\n\r\n /**\r\n * Burn tokens of given token id for each (_ids[i], _amounts[i]) pair\r\n * @param _from The address to burn tokens from\r\n * @param _ids Array of token ids to burn\r\n * @param _amounts Array of the amount to be burned\r\n */\r\n function _batchBurn(address _from, uint256[] memory _ids, uint256[] memory _amounts) internal virtual {\r\n uint256 nBurn = _ids.length;\r\n if (nBurn != _amounts.length) {\r\n revert InvalidArrayLength();\r\n }\r\n\r\n uint256 totalAmount = 0;\r\n for (uint256 i = 0; i < nBurn; i++) {\r\n // Update balances\r\n balances[_from][_ids[i]] -= _amounts[i];\r\n tokenSupply[_ids[i]] -= _amounts[i];\r\n totalAmount += _amounts[i];\r\n }\r\n totalSupply -= totalAmount;\r\n\r\n // Emit batch mint event\r\n emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts);\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 (ERC1155) returns (bool) {\r\n return type(IERC1155SupplyFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\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/ERC1155/extensions/supply/IERC1155Supply.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 IERC1155SupplyFunctions {\r\n\r\n /**\r\n * Returns the total supply of ERC1155 tokens.\r\n */\r\n function totalSupply() external returns (uint256);\r\n\r\n /**\r\n * Returns the total supply of a given ERC1155 token.\r\n * @param tokenId The ERC1155 token id.\r\n */\r\n function tokenSupply(uint256 tokenId) external returns (uint256);\r\n}\r\n\r\ninterface IERC1155SupplySignals {\r\n\r\n /**\r\n * Invalid array input length.\r\n */\r\n error InvalidArrayLength();\r\n}\r\n\r\ninterface IERC1155Supply is IERC1155SupplySignals {}\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/ERC1155/presets/items/ERC1155Items.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\nimport {\r\n IERC1155Items,\r\n IERC1155ItemsFunctions\r\n} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol";\r\nimport {ERC1155BaseToken} from "@0xsequence/contracts-library/tokens/ERC1155/ERC1155BaseToken.sol";\r\nimport {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.sol";\r\n\r\n/**\r\n * An implementation of ERC-1155 capable of minting when role provided.\r\n */\r\ncontract ERC1155Items is ERC1155BaseToken, IERC1155Items {\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 constructor() {\r\n initializer = msg.sender;\r\n }\r\n\r\n /**\r\n * Initialize the contract.\r\n * @param owner Owner address\r\n * @param tokenName Token name\r\n * @param tokenBaseURI Base URI for token metadata\r\n * @param tokenContractURI Contract URI for token metadata\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 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 ERC1155BaseToken._initialize(owner, tokenName, 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 tokenId Token ID to mint.\r\n * @param amount Amount of tokens to mint.\r\n * @param data Data to pass if receiver is contract.\r\n */\r\n function mint(address to, uint256 tokenId, uint256 amount, bytes memory data) external onlyRole(MINTER_ROLE) {\r\n _mint(to, tokenId, amount, data);\r\n }\r\n\r\n /**\r\n * Mint tokens.\r\n * @param to Address to mint tokens to.\r\n * @param tokenIds Token IDs to mint.\r\n * @param amounts Amounts of tokens to mint.\r\n * @param data Data to pass if receiver is contract.\r\n */\r\n function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data)\r\n external\r\n onlyRole(MINTER_ROLE)\r\n {\r\n _batchMint(to, tokenIds, amounts, data);\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 override (ERC1155BaseToken) returns (bool) {\r\n return type(IERC1155ItemsFunctions).interfaceId == interfaceId || ERC1155BaseToken.supportsInterface(interfaceId)\r\n || super.supportsInterface(interfaceId);\r\n }\r\n}\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/ERC1155/presets/items/ERC1155ItemsFactory.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 {ERC1155Items} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/ERC1155Items.sol";\r\nimport {IERC1155ItemsFactory} from\r\n "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155ItemsFactory.sol";\r\nimport {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\r\n\r\n/**\r\n * Deployer of ERC-1155 Items proxies.\r\n */\r\ncontract ERC1155ItemsFactory is IERC1155ItemsFactory, SequenceProxyFactory {\r\n /**\r\n * Creates an ERC-1155 Items Factory.\r\n * @param factoryOwner The owner of the ERC-1155 Items Factory\r\n */\r\n constructor(address factoryOwner) {\r\n ERC1155Items impl = new ERC1155Items();\r\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\r\n }\r\n\r\n /**\r\n * Creates an ERC-1155 Items proxy.\r\n * @param proxyOwner The owner of the ERC-1155 Items proxy\r\n * @param tokenOwner The owner of the ERC-1155 Items implementation\r\n * @param name The name of the ERC-1155 Items proxy\r\n * @param baseURI The base URI of the ERC-1155 Items proxy\r\n * @param contractURI The contract URI of the ERC-1155 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-1155 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 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 = keccak256(abi.encode(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\r\n proxyAddr = _createProxy(salt, proxyOwner, "");\r\n ERC1155Items(proxyAddr).initialize(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator);\r\n emit ERC1155ItemsDeployed(proxyAddr);\r\n return proxyAddr;\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/ERC1155/presets/items/IERC1155Items.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\ninterface IERC1155ItemsFunctions {\r\n /**\r\n * Mint tokens.\r\n * @param to Address to mint tokens to.\r\n * @param tokenId Token ID to mint.\r\n * @param amount Amount of tokens to mint.\r\n * @param data Data to pass if receiver is contract.\r\n */\r\n function mint(address to, uint256 tokenId, uint256 amount, bytes memory data) external;\r\n\r\n /**\r\n * Mint tokens.\r\n * @param to Address to mint tokens to.\r\n * @param tokenIds Token IDs to mint.\r\n * @param amounts Amounts of tokens to mint.\r\n * @param data Data to pass if receiver is contract.\r\n */\r\n function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data) external;\r\n}\r\n\r\ninterface IERC1155ItemsSignals {\r\n /**\r\n * Invalid initialization error.\r\n */\r\n error InvalidInitialization();\r\n}\r\n\r\ninterface IERC1155Items is IERC1155ItemsFunctions, IERC1155ItemsSignals {}\r\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" }, - 'src/tokens/ERC1155/presets/items/IERC1155ItemsFactory.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.sol': { + content: + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport "./math/Math.sol";\nimport "./math/SignedMath.sol";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = "0123456789abcdef";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = "0";\n buffer[1] = "x";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, "Strings: hex length insufficient");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n' + }, + 'lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\ninterface IERC1155ItemsFactoryFunctions {\r\n /**\r\n * Creates an ERC-1155 Items proxy.\r\n * @param proxyOwner The owner of the ERC-1155 Items proxy\r\n * @param tokenOwner The owner of the ERC-1155 Items implementation\r\n * @param name The name of the ERC-1155 Items proxy\r\n * @param baseURI The base URI of the ERC-1155 Items proxy\r\n * @param contractURI The contract URI of the ERC-1155 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-1155 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 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 IERC1155ItemsFactorySignals {\r\n /**\r\n * Event emitted when a new ERC-1155 Items proxy contract is deployed.\r\n * @param proxyAddr The address of the deployed proxy.\r\n */\r\n event ERC1155ItemsDeployed(address proxyAddr);\r\n}\r\n\r\ninterface IERC1155ItemsFactory is IERC1155ItemsFactoryFunctions, IERC1155ItemsFactorySignals {}\r\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' }, - 'src/tokens/common/ERC2981Controlled.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/utils/LibBytes.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.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' }, - 'src/tokens/common/IERC2981Controlled.sol': { + '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: {} } } } diff --git a/scripts/factories/token_library/ERC1155PackFactory.ts b/scripts/factories/token_library/ERC1155PackFactory.ts index c2509d5..6a4881a 100644 --- a/scripts/factories/token_library/ERC1155PackFactory.ts +++ b/scripts/factories/token_library/ERC1155PackFactory.ts @@ -1,235 +1,13 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' // https://github.com/0xsequence/contracts-library/blob/73363994054ad0983ceabebb8b98ad02044a4267/src/tokens/ERC1155/presets/pack/ERC1155PackFactory.sol -const abi = [ - { - 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' - }, - { - inputs: [], - name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - 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' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'upgradeBeacon', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] - export class ERC1155PackFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, + FACTORY_DEFAULT_ABI, '60806040523461002f576100196100146100fa565b610169565b610021610034565b61271a610397823961271a90f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b61011861950d8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b615fba810181811060018060401b038211176101c5576101a18291615fba612ab1843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa2618a6b85396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610580565b61001e60003561008d565b80631bce45831461008857806359659e901461008357806359a347bd1461007e578063715018a6146100795780638da5cb5b14610074578063cfcc59411461006f5763f2fde38b0361000e5761054d565b61050e565b6104d9565b6104a6565b610467565b6101ea565b610108565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b906020828203126100fd576100fa916000016100d4565b90565b61009e565b60000190565b346101365761012061011b3660046100e3565b61067e565b610128610093565b8061013281610102565b0390f35b610099565b600091031261014657565b61009e565b1c90565b60018060a01b031690565b61016a90600861016f930261014b565b61014f565b90565b9061017d915461015a565b90565b61018d6001600090610172565b90565b90565b6101a76101a26101ac926100a8565b610190565b6100a8565b90565b6101b890610193565b90565b6101c4906101af565b90565b6101d0906101bb565b9052565b91906101e8906000602085019401906101c7565b565b3461021a576101fa36600461013b565b610216610205610180565b61020d610093565b918291826101d4565b0390f35b610099565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061025390610229565b810190811067ffffffffffffffff82111761026d57604052565b610233565b9061028561027e610093565b9283610249565b565b67ffffffffffffffff81116102a5576102a1602091610229565b0190565b610233565b90826000939282370152565b909291926102cb6102c682610287565b610272565b938185526020850190828401116102e7576102e5926102aa565b565b610224565b9080601f8301121561030a57816020610307933591016102b6565b90565b61021f565b6bffffffffffffffffffffffff1690565b6103298161030f565b0361033057565b600080fd5b9050359061034282610320565b565b90565b61035081610344565b0361035757565b600080fd5b9050359061036982610347565b565b90916101208284031261043f5761038583600084016100d4565b9261039381602085016100d4565b92604081013567ffffffffffffffff811161043a57826103b49183016102ec565b92606082013567ffffffffffffffff811161043557836103d59184016102ec565b92608083013567ffffffffffffffff811161043057816103f69185016102ec565b926104048260a083016100d4565b9261042d6104158460c08501610335565b936104238160e086016100d4565b936101000161035c565b90565b6100a3565b6100a3565b6100a3565b61009e565b61044d906100b3565b9052565b919061046590600060208501940190610444565b565b346104a15761049d61048c61047d36600461036b565b979690969591959492946107ee565b610494610093565b91829182610451565b0390f35b610099565b346104d4576104b636600461013b565b6104be610985565b6104c6610093565b806104d081610102565b0390f35b610099565b34610509576104e936600461013b565b6105056104f46109bb565b6104fc610093565b91829182610451565b0390f35b610099565b346105485761054461053361052436600461036b565b979690969591959492946109d1565b61053b610093565b91829182610451565b0390f35b610099565b3461057b576105656105603660046100e3565b610b2a565b61056d610093565b8061057781610102565b0390f35b610099565b600080fd5b61059690610591610bb8565b6105eb565b565b60001c90565b6105aa6105af91610598565b61014f565b90565b6105bc905461059e565b90565b600080fd5b60e01b90565b60009103126105d557565b61009e565b6105e2610093565b3d6000823e3d90fd5b6105fd6105f860016105b2565b6101bb565b90633659cfe690823b15610679576106359261062a6000809461061e610093565b968795869485936105c4565b835260048301610451565b03925af1801561067457610647575b50565b6106679060003d811161066d575b61065f8183610249565b8101906105ca565b38610644565b503d610655565b6105da565b6105bf565b61068790610585565b565b600090565b5190565b60209181520190565b60005b8381106106af575050906000910152565b80602091830151818501520161069e565b6106df6106e86020936106ed936106d68161068e565b93848093610692565b9586910161069b565b610229565b0190565b6106fa9061030f565b9052565b61070790610344565b9052565b939561077461076960e0979b9a9861075b6107889761074d8a61078f9e9961073f61077e9a60006101008501940190610444565b8c60208184039101526106c0565b908a820360408c01526106c0565b9088820360608a01526106c0565b9a6080870190610444565b60a08501906106f1565b60c0830190610444565b01906106fe565b565b60200190565b5190565b906107ad6107a883610287565b610272565b918252565b6107bc600061079b565b90565b6107c76107b2565b90565b6107d390610193565b90565b6107df906107ca565b90565b6107eb906101af565b90565b61085e9098949897969397959295610804610689565b508861083c8461082d8d8a8d8d96928b908d929394610821610093565b998a9860208a0161070b565b60208201810382520382610249565b61084e61084882610797565b91610791565b20906108586107bf565b91610d5d565b9761087061086b8a6107d6565b6107e2565b94638ff83ac192969891939497863b1561092f576000986108a5968a966108b095610899610093565b9d8e9c8d9b8c9a6105c4565b8a5260048a0161070b565b03925af1801561092a576108fd575b50806108f77fe3049ee698743dac343b02bfe6b441269ca8b5f5dd610b74d96c1c02034ee566916108ee610093565b91829182610451565b0390a190565b61091d9060003d8111610923575b6109158183610249565b8101906105ca565b386108bf565b503d61090b565b6105da565b6105bf565b61093c610bb8565b610944610971565b565b90565b61095d61095861096292610946565b610190565b6100a8565b90565b61096e90610949565b90565b61098361097e6000610965565b610eec565b565b61098d610934565b565b60018060a01b031690565b6109a66109ab91610598565b61098f565b90565b6109b8905461099a565b90565b6109c3610689565b506109ce60006109ae565b90565b96610a089396610a1796610a399a939694966109eb610689565b5096989490919293946109fc610093565b998a9860208a0161070b565b60208201810382520382610249565b610a29610a2382610797565b91610791565b2090610a336107bf565b91610f4d565b90565b610a4d90610a48610bb8565b610af9565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610aaa6026604092610692565b610ab381610a4f565b0190565b610acd9060208101906000818303910152610a9d565b90565b15610ad757565b610adf610093565b62461bcd60e51b815280610af560048201610ab7565b0390fd5b610b2890610b2381610b1c610b16610b116000610965565b6100b3565b916100b3565b1415610ad0565b610eec565b565b610b3390610a3c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6960208092610692565b610b7281610b35565b0190565b610b8c9060208101906000818303910152610b5d565b90565b15610b9657565b610b9e610093565b62461bcd60e51b815280610bb460048201610b76565b0390fd5b610be2610bc36109bb565b610bdc610bd6610bd1610fe3565b6100b3565b916100b3565b14610b8f565b565b90565b610bf3610bf891610344565b610be4565b9052565b60601b90565b610c0b90610bfc565b90565b610c1790610c02565b90565b610c26610c2b916100b3565b610c0e565b9052565b905090565b610c59610c5092602092610c4781610797565b94858093610c2f565b9384910161069b565b0190565b60148093610c81602084610c79610c8996610c909b9a98610be7565b018092610c1a565b018092610c1a565b0190610c34565b90565b90565b610caa610ca5610caf92610946565b610190565b610c93565b90565b610cbb90610193565b90565b610cc790610cb2565b90565b610cd390610193565b90565b610cdf90610cca565b90565b610ceb906101af565b90565b60209181520190565b610d16610d1f602093610d2493610d0d81610797565b93848093610cee565b9586910161069b565b610229565b0190565b610d4d610d5a949293610d4360608401956000850190610444565b6020830190610444565b6040818403910152610cf7565b90565b610ded9093929193610d6d610689565b50610dad8591610d9e610d88610d8360016105b2565b6101bb565b8690610d92610093565b95869460208601610c5d565b60208201810382520382610249565b610dbf610db982610797565b91610791565b2061148a610dcf60208201610272565b9080825261125b6020830139610de86000929192610c96565b611187565b92610e07610e02610dfd86610cbe565b610cd6565b610ce2565b63cf7a1d779190610e20610e1b60016105b2565b6101bb565b9392813b15610e97576000610e4891610e538296610e3c610093565b988997889687956105c4565b855260048501610d28565b03925af18015610e9257610e65575b50565b610e859060003d8111610e8b575b610e7d8183610249565b8101906105ca565b38610e62565b503d610e73565b6105da565b6105bf565b60001b90565b90610eb360018060a01b0391610e9c565b9181191691161790565b610ec6906101af565b90565b90565b90610ee1610edc610ee892610ebd565b610ec9565b8254610ea2565b9055565b610ef660006109ae565b610f01826000610ecc565b90610f35610f2f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610ebd565b91610ebd565b91610f3e610093565b80610f4881610102565b0390a3565b610fe09291610f8a610f9992610f61610689565b509193610f76610f7160016105b2565b6101bb565b610f7e610093565b95869460208601610c5d565b60208201810382520382610249565b610fab610fa582610797565b91610791565b2061148a610fbb60208201610272565b9080825261125b6020830139610fd9610fd382610797565b91610791565b2090611210565b90565b610feb610689565b503390565b610ff9906101af565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b611031601d602092610692565b61103a81610ffc565b0190565b6110549060208101906000818303910152611024565b90565b1561105e57565b611066610093565b62461bcd60e51b81528061107c6004820161103e565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110b460208092610692565b6110bd81611080565b0190565b6110d790602081019060008183039101526110a8565b90565b156110e157565b6110e9610093565b62461bcd60e51b8152806110ff600482016110c1565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b6111386019602092610692565b61114181611103565b0190565b61115b906020810190600081830391015261112b565b90565b1561116557565b61116d610093565b62461bcd60e51b81528061118360048201611145565b0390fd5b919091611192610689565b506111b961119f30610ff0565b316111b26111ac84610c93565b91610c93565b1015611057565b6111df6111c583610797565b6111d86111d26000610c96565b91610c93565b14156110da565b60208251920190f59061120e826112076112016111fc6000610965565b6100b3565b916100b3565b141561115e565b565b9061122e9161121d610689565b509061122830610ff0565b91611231565b90565b90605592600b92611240610689565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a26469706673582212206e335c4448e2e24431a6987ffd08b7c2fa55316f79d6fcecb28f14c7b57e92d764736f6c634300081b003360a060405234602b57600e603a565b6014602f565b615f696100518239608051816149130152615f6990f35b6035565b60405190565b600080fd5b60406042565b565b6048604a565b565b3360805256fe60806040526004361015610013575b611bc5565b61001e6000356102cc565b8062fdd58e146102c757806301ffc9a7146102c257806304634d8d146102bd57806306fdde03146102b85780630b5ee006146102b35780630bb310de146102ae5780630e89341c146102a9578063167a59f7146102a457806318160ddd1461029f57806320ec271b1461029a578063248a9ca3146102955780632693ebf2146102905780632a55205a1461028b5780632eb2c2d6146102865780632f2ff15d14610281578063354030231461027c57806336568abe146102775780633c70b3571461027257806347fda41a1461026d5780634e1273f41461026857806350336a03146102635780635377ab8f1461025e5780635944c753146102595780636c0360eb14610254578063731133e91461024f5780637e518ec81461024a5780638ff83ac1146102455780639010d07c1461024057806391d148541461023b578063938e3d7b146102365780639d043a6614610231578063a217fddf1461022c578063a22cb46514610227578063b390c0ab14610222578063b48ab8b61461021d578063ca15c87314610218578063d547741f14610213578063d67b333b1461020e578063e8a3d48514610209578063e985e9c514610204578063ed4c2ac7146101ff578063f242432a146101fa5763f4f98ad50361000e57611b92565b611b58565b611ab4565b611a7e565b611a1b565b6119d4565b6118d2565b61189d565b611866565b6117a2565b61176e565b6116e7565b611674565b6115ac565b611576565b611540565b6114bf565b6113c2565b61138b565b61127a565b611236565b6111c5565b611191565b61111d565b610fa8565b610f59565b610eca565b610e95565b610e47565b610ddc565b610c7f565b610beb565b610b65565b610ac8565b610999565b61092a565b6108f5565b6108a3565b610851565b61073f565b6104e5565b610447565b61039a565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6102fb906102e7565b90565b610307816102f2565b0361030e57565b600080fd5b90503590610320826102fe565b565b90565b61032e81610322565b0361033557565b600080fd5b9050359061034782610325565b565b9190604083820312610372578061036661036f9260008601610313565b9360200161033a565b90565b6102dd565b61038090610322565b9052565b919061039890600060208501940190610377565b565b346103cb576103c76103b66103b0366004610349565b90611bcf565b6103be6102d2565b91829182610384565b0390f35b6102d8565b63ffffffff60e01b1690565b6103e5816103d0565b036103ec57565b600080fd5b905035906103fe826103dc565b565b9060208282031261041a57610417916000016103f1565b90565b6102dd565b151590565b61042d9061041f565b9052565b919061044590600060208501940190610424565b565b346104775761047361046261045d366004610400565b611bf8565b61046a6102d2565b91829182610431565b0390f35b6102d8565b6bffffffffffffffffffffffff1690565b6104968161047c565b0361049d57565b600080fd5b905035906104af8261048d565b565b91906040838203126104da57806104ce6104d79260008601610313565b936020016104a2565b90565b6102dd565b60000190565b34610514576104fe6104f83660046104b1565b90611c84565b6105066102d2565b80610510816104df565b0390f35b6102d8565b600091031261052457565b6102dd565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610575575b602083101461057057565b61053f565b91607f1691610565565b60209181520190565b600052602060002090565b90600092918054906105ae6105a783610555565b809461057f565b9160018116908160001461060757506001146105ca575b505050565b6105d79192939450610588565b916000925b8184106105ef57505001903880806105c5565b600181602092959395548486015201910192906105dc565b92949550505060ff19168252151560200201903880806105c5565b9061062c91610593565b90565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906106599061062f565b810190811067ffffffffffffffff82111761067357604052565b610639565b90610698610691926106886102d2565b93848092610622565b038361064f565b565b906000106106ae576106ab90610678565b90565b610529565b6106c0600860009061069a565b90565b5190565b60209181520190565b60005b8381106106e4575050906000910152565b8060209183015181850152016106d3565b61071461071d6020936107229361070b816106c3565b938480936106c7565b958691016106d0565b61062f565b0190565b61073c91602082019160008184039101526106f5565b90565b3461076f5761074f366004610519565b61076b61075a6106b3565b6107626102d2565b91829182610726565b0390f35b6102d8565b600080fd5b600080fd5b9061079161078a6102d2565b928361064f565b565b67ffffffffffffffff81116107b1576107ad60209161062f565b0190565b610639565b90826000939282370152565b909291926107d76107d282610793565b61077e565b938185526020850190828401116107f3576107f1926107b6565b565b610779565b9080601f8301121561081657816020610813933591016107c2565b90565b610774565b9060208282031261084c57600082013567ffffffffffffffff81116108475761084492016107f8565b90565b6102e2565b6102dd565b3461087f5761086961086436600461081b565b611ec5565b6108716102d2565b8061087b816104df565b0390f35b6102d8565b9060208282031261089e5761089b91600001610313565b90565b6102dd565b346108d1576108bb6108b6366004610884565b611fa2565b6108c36102d2565b806108cd816104df565b0390f35b6102d8565b906020828203126108f0576108ed9160000161033a565b90565b6102dd565b346109255761092161091061090b3660046108d6565b6120cc565b6109186102d2565b91829182610726565b0390f35b6102d8565b346109595761094361093d366004610349565b90612203565b61094b6102d2565b80610955816104df565b0390f35b6102d8565b1c90565b90565b61097590600861097a930261095e565b610962565b90565b906109889154610965565b90565b61099660008061097d565b90565b346109c9576109a9366004610519565b6109c56109b461098b565b6109bc6102d2565b91829182610384565b0390f35b6102d8565b67ffffffffffffffff81116109e65760208091020190565b610639565b600080fd5b90929192610a05610a00826109ce565b61077e565b9381855260208086019202830192818411610a4257915b838310610a295750505050565b60208091610a37848661033a565b815201920191610a1c565b6109eb565b9080601f83011215610a6557816020610a62933591016109f0565b90565b610774565b919091604081840312610ac357600081013567ffffffffffffffff8111610abe5783610a97918301610a47565b92602082013567ffffffffffffffff8111610ab957610ab69201610a47565b90565b6102e2565b6102e2565b6102dd565b34610af757610ae1610adb366004610a6a565b906122fe565b610ae96102d2565b80610af3816104df565b0390f35b6102d8565b90565b610b0881610afc565b03610b0f57565b600080fd5b90503590610b2182610aff565b565b90602082820312610b3d57610b3a91600001610b14565b90565b6102dd565b610b4b90610afc565b9052565b9190610b6390600060208501940190610b42565b565b34610b9557610b91610b80610b7b366004610b23565b612357565b610b886102d2565b91829182610b4f565b0390f35b6102d8565b90565b610bb1610bac610bb692610322565b610b9a565b610322565b90565b90610bc390610b9d565b600052602052604060002090565b610be890610be3600191600092610bb9565b61097d565b90565b34610c1b57610c17610c06610c013660046108d6565b610bd1565b610c0e6102d2565b91829182610384565b0390f35b6102d8565b9190604083820312610c495780610c3d610c46926000860161033a565b9360200161033a565b90565b6102dd565b610c57906102f2565b9052565b916020610c7d929493610c7660408201966000830190610c4e565b0190610377565b565b34610cb157610c98610c92366004610c20565b90612549565b90610cad610ca46102d2565b92839283610c5b565b0390f35b6102d8565b600080fd5b909182601f83011215610cf55781359167ffffffffffffffff8311610cf0576020019260208302840111610ceb57565b6109eb565b610cb6565b610774565b909182601f83011215610d345781359167ffffffffffffffff8311610d2f576020019260018302840111610d2a57565b6109eb565b610cb6565b610774565b9160a083830312610dd757610d518260008501610313565b92610d5f8360208301610313565b92604082013567ffffffffffffffff8111610dd25781610d80918401610cbb565b929093606082013567ffffffffffffffff8111610dcd5783610da3918401610cbb565b929093608082013567ffffffffffffffff8111610dc857610dc49201610cfa565b9091565b6102e2565b6102e2565b6102e2565b6102dd565b34610e1457610dfe610def366004610d39565b96959095949194939293612624565b610e066102d2565b80610e10816104df565b0390f35b6102d8565b9190604083820312610e425780610e36610e3f9260008601610b14565b93602001610313565b90565b6102dd565b34610e7657610e60610e5a366004610e19565b906128c0565b610e686102d2565b80610e72816104df565b0390f35b6102d8565b610e9290610e8d600d91600092610bb9565b61097d565b90565b34610ec557610ec1610eb0610eab3660046108d6565b610e7b565b610eb86102d2565b91829182610384565b0390f35b6102d8565b34610ef957610ee3610edd366004610e19565b90612976565b610eeb6102d2565b80610ef5816104df565b0390f35b6102d8565b90610f0890610b9d565b600052602052604060002090565b90565b610f29906008610f2e930261095e565b610f16565b90565b90610f3c9154610f19565b90565b610f5690610f51600c91600092610efe565b610f31565b90565b34610f8957610f85610f74610f6f3660046108d6565b610f3f565b610f7c6102d2565b91829182610b4f565b0390f35b6102d8565b610fa590610fa0600e91600092610bb9565b61097d565b90565b34610fd857610fd4610fc3610fbe3660046108d6565b610f8e565b610fcb6102d2565b91829182610384565b0390f35b6102d8565b909182601f830112156110175781359167ffffffffffffffff831161101257602001926020830284011161100d57565b6109eb565b610cb6565b610774565b909160408284031261107757600082013567ffffffffffffffff81116110725783611048918401610fdd565b929093602082013567ffffffffffffffff811161106d576110699201610cbb565b9091565b6102e2565b6102e2565b6102dd565b5190565b60209181520190565b60200190565b61109890610322565b9052565b906110a98160209361108f565b0190565b60200190565b906110d06110ca6110c38461107c565b8093611080565b92611089565b9060005b8181106110e15750505090565b9091926110fa6110f4600192865161109c565b946110ad565b91019190916110d4565b61111a91602082019160008184039101526110b3565b90565b346111515761114d61113c61113336600461101c565b929190916129aa565b6111446102d2565b91829182611104565b0390f35b6102d8565b909160608284031261118c576111896111728460008501610b14565b93611180816020860161033a565b9360400161033a565b90565b6102dd565b346111c0576111aa6111a4366004611156565b91612b00565b6111b26102d2565b806111bc816104df565b0390f35b6102d8565b346111f6576111f26111e16111db366004610349565b90612b0d565b6111e96102d2565b91829182610384565b0390f35b6102d8565b90916060828403126112315761122e611217846000850161033a565b936112258160208601610313565b936040016104a2565b90565b6102dd565b346112655761124f6112493660046111fb565b91612b51565b6112576102d2565b80611261816104df565b0390f35b6102d8565b611277600960009061069a565b90565b346112aa5761128a366004610519565b6112a661129561126a565b61129d6102d2565b91829182610726565b0390f35b6102d8565b67ffffffffffffffff81116112cd576112c960209161062f565b0190565b610639565b909291926112e76112e2826112af565b61077e565b9381855260208501908284011161130357611301926107b6565b565b610779565b9080601f8301121561132657816020611323933591016112d2565b90565b610774565b90608082820312611386576113438160008401610313565b92611351826020850161033a565b9261135f836040830161033a565b92606082013567ffffffffffffffff81116113815761137e9201611308565b90565b6102e2565b6102dd565b346113bd576113a761139e36600461132b565b92919091612bb0565b6113af6102d2565b806113b9816104df565b0390f35b6102d8565b346113f0576113da6113d536600461081b565b612be6565b6113e26102d2565b806113ec816104df565b0390f35b6102d8565b9190610100838203126114ba5761140f8160008501610313565b92602081013567ffffffffffffffff81116114b557826114309183016107f8565b92604082013567ffffffffffffffff81116114b057836114519184016107f8565b92606083013567ffffffffffffffff81116114ab57816114729185016107f8565b926114808260808301610313565b926114a86114918460a085016104a2565b9361149f8160c08601610313565b9360e001610b14565b90565b6102e2565b6102e2565b6102e2565b6102dd565b346114f7576114e16114d23660046113f5565b96959095949194939293612bf1565b6114e96102d2565b806114f3816104df565b0390f35b6102d8565b919060408382031261152557806115196115229260008601610b14565b9360200161033a565b90565b6102dd565b919061153e90600060208501940190610c4e565b565b346115715761156d61155c6115563660046114fc565b90612c38565b6115646102d2565b9182918261152a565b0390f35b6102d8565b346115a7576115a361159261158c366004610e19565b90612c9f565b61159a6102d2565b91829182610431565b0390f35b6102d8565b346115da576115c46115bf36600461081b565b612cf2565b6115cc6102d2565b806115d6816104df565b0390f35b6102d8565b600080fd5b908160c09103126115f25790565b6115df565b908160e09103126116055790565b6115df565b9160608383031261166f576116228260008501610313565b92602081013567ffffffffffffffff811161166a57836116439183016115e4565b92604082013567ffffffffffffffff81116116655761166292016115f7565b90565b6102e2565b6102e2565b6102dd565b346116a5576116a161169061168a36600461160a565b91613055565b6116986102d2565b91829182610b4f565b0390f35b6102d8565b90565b60001b90565b6116c76116c26116cc926116aa565b6116ad565b610afc565b90565b6116d960006116b3565b90565b6116e46116cf565b90565b34611717576116f7366004610519565b6117136117026116dc565b61170a6102d2565b91829182610b4f565b0390f35b6102d8565b6117258161041f565b0361172c57565b600080fd5b9050359061173e8261171c565b565b9190604083820312611769578061175d6117669260008601610313565b93602001611731565b90565b6102dd565b3461179d57611787611781366004611740565b906130f6565b61178f6102d2565b80611799816104df565b0390f35b6102d8565b346117d1576117bb6117b5366004610c20565b90613146565b6117c36102d2565b806117cd816104df565b0390f35b6102d8565b90608082820312611861576117ee8160008401610313565b92602083013567ffffffffffffffff811161185c578261180f918501610a47565b92604081013567ffffffffffffffff81116118575783611830918301610a47565b92606082013567ffffffffffffffff81116118525761184f9201611308565b90565b6102e2565b6102e2565b6102e2565b6102dd565b34611898576118826118793660046117d6565b92919091613183565b61188a6102d2565b80611894816104df565b0390f35b6102d8565b346118cd576118c96118b86118b3366004610b23565b613191565b6118c06102d2565b91829182610384565b0390f35b6102d8565b34611901576118eb6118e5366004610e19565b906131e1565b6118f36102d2565b806118fd816104df565b0390f35b6102d8565b908160809103126119145790565b6115df565b909182601f830112156119535781359167ffffffffffffffff831161194e57602001926020830284011161194957565b6109eb565b610cb6565b610774565b9190916080818403126119cf576119728360008301610313565b92602082013567ffffffffffffffff81116119ca5781611993918401611906565b92604083013567ffffffffffffffff81116119c5576119b7836119c2928601611919565b93909460600161033a565b90565b6102e2565b6102e2565b6102dd565b34611a06576119f06119e7366004611958565b9392909261391f565b6119f86102d2565b80611a02816104df565b0390f35b6102d8565b611a18600a60009061069a565b90565b34611a4b57611a2b366004610519565b611a47611a36611a0b565b611a3e6102d2565b91829182610726565b0390f35b6102d8565b9190604083820312611a795780611a6d611a769260008601610313565b93602001610313565b90565b6102dd565b34611aaf57611aab611a9a611a94366004611a50565b90613d16565b611aa26102d2565b91829182610431565b0390f35b6102d8565b34611ae257611acc611ac7366004610b23565b613d62565b611ad46102d2565b80611ade816104df565b0390f35b6102d8565b91909160a081840312611b5357611b018360008301610313565b92611b0f8160208401610313565b92611b1d826040850161033a565b92611b2b836060830161033a565b92608082013567ffffffffffffffff8111611b4e57611b4a9201610cfa565b9091565b6102e2565b6102dd565b34611b8d57611b77611b6b366004611ae7565b94939093929192613d6d565b611b7f6102d2565b80611b89816104df565b0390f35b6102d8565b34611bc057611baa611ba53660046108d6565b613f61565b611bb26102d2565b80611bbc816104df565b0390f35b6102d8565b600080fd5b600090565b611bd7611bca565b50679a31110384e0b0c960205260145260005260406000205490565b600090565b611c00611bf3565b506337bc219560e01b611c1b611c15836103d0565b916103d0565b14908115611c28575b5090565b611c329150614040565b38611c24565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b90611c7691611c71611c6c611c38565b614096565b611c78565b565b90611c82916142b0565b565b90611c8e91611c5c565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b611ccd90611cc8611cc3611c90565b614096565b611eb8565b565b601f602091010490565b1b90565b91906008611cf9910291611cf360001984611cd9565b92611cd9565b9181191691161790565b90565b9190611d1c611d17611d2493610b9d565b611d03565b908354611cdd565b9055565b611d3a91611d34611bca565b91611d06565b565b5b818110611d48575050565b80611d566000600193611d28565b01611d3d565b9190601f8111611d6c575b505050565b611d78611d9d93610588565b906020611d8484611ccf565b83019310611da5575b611d9690611ccf565b0190611d3c565b388080611d67565b9150611d9681929050611d8d565b90611dc4906000199060080261095e565b191690565b81611dd391611db3565b906002021790565b90611de5816106c3565b9067ffffffffffffffff8211611ea757611e0982611e038554610555565b85611d5c565b602090601f8311600114611e3e57918091611e2d93600092611e32575b5050611dc9565b90555b565b90915001513880611e26565b601f19831691611e4d85610588565b9260005b818110611e8f57509160029391856001969410611e75575b50505002019055611e30565b611e85910151601f841690611db3565b9055388080611e69565b91936020600181928787015181550195019201611e51565b610639565b90611eb691611ddb565b565b611ec3906008611eac565b565b611ece90611cb4565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b611f0d90611f08611f03611ed0565b614096565b611f8d565b565b611f23611f1e611f28926102e7565b610b9a565b6102e7565b90565b611f3490611f0f565b90565b611f4090611f2b565b90565b90611f5460018060a01b03916116ad565b9181191691161790565b611f6790611f2b565b90565b90565b90611f82611f7d611f8992611f5e565b611f6a565b8254611f43565b9055565b611f99611fa091611f37565b6006611f6d565b565b611fab90611ef4565b565b606090565b905090565b9060009291805490611fd2611fcb83610555565b8094611fb2565b916001811690816000146120265750600114611fee575b505050565b611ffb9192939450610588565b6000905b8382106120125750500190388080611fe9565b600181602092548486015201910190611fff565b92949550505060ff19168252801515020190388080611fe9565b61206561205c92602092612053816106c3565b94858093611fb2565b938491016106d0565b0190565b60007f2e6a736f6e000000000000000000000000000000000000000000000000000000910152565b61209d60058092611fb2565b6120a681612069565b0190565b916120bb6120c6936120c193611fb7565b90612040565b612091565b90565b90565b612113906120d8611fad565b5061210e6120e760099261432a565b916120ff6120f36102d2565b938492602084016120aa565b6020820181038252038261064f565b6120c9565b90565b9061212090610b9d565b600052602052604060002090565b61213790611f0f565b90565b6121439061212e565b90565b906121509061213a565b600052602052604060002090565b60001c90565b6121706121759161215e565b610962565b90565b6121829054612164565b90565b61219961219461219e926116aa565b610b9a565b610322565b90565b6121ad6121b29161215e565b610b9d565b90565b90565b6121cc6121c76121d1926121b5565b610b9a565b610322565b90565b906121e66121e183610793565b61077e565b918252565b6121f560006121d4565b90565b6122006121eb565b90565b9061222261221d612216600f8490612116565b8490612146565b612178565b806122366122306000612185565b91610322565b146122e15761224581406121a1565b6122586122526000612185565b91610322565b14159081156122c4575b506122a7576122a59161228b600061228661227f600f8690612116565b8490612146565b611d28565b9061229660016121b8565b9061229f6121f8565b9261437f565b565b600063156f904360e21b8152806122c0600482016104df565b0390fd5b90506122d96122d34392610322565b91610322565b111538612262565b6000637de832b560e11b8152806122fa600482016104df565b0390fd5b61230b9133919091614427565b565b600090565b61231b90610afc565b90565b9061232890612312565b600052602052604060002090565b6123426123479161215e565b610f16565b90565b6123549054612336565b90565b60016123706123769261236861230d565b50600461231e565b0161234a565b90565b600090565b9061238890610b9d565b600052602052604060002090565b60018060a01b031690565b6123ad6123b29161215e565b612396565b90565b6123bf90546123a1565b90565b906123cc906102f2565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b6123f36123f8916123d0565b6123d6565b90565b61240590546123e7565b90565b906124129061047c565b9052565b612420604061077e565b90565b9061245a6124516000612434612416565b9461244b6124438383016123b5565b8388016123c2565b016123fb565b60208401612408565b565b61246590612423565b90565b61247290516102f2565b90565b61248961248461248e926116aa565b610b9a565b6102e7565b90565b61249a90612475565b90565b6124a7905161047c565b90565b6124be6124b96124c39261047c565b610b9a565b610322565b90565b634e487b7160e01b600052601160045260246000fd5b6124eb6124f191939293610322565b92610322565b916124fd838202610322565b92818404149015171561250c57565b6124c6565b634e487b7160e01b600052601260045260246000fd5b61253361253991610322565b91610322565b908115612544570490565b612511565b61256c6125719193929361255b612379565b50612564611bca565b50600361237e565b61245c565b9161257e60008401612468565b61259961259361258e6000612491565b6102f2565b916102f2565b146125e6575b60006125db6125c56125e2936125bf6125ba6020890161249d565b6124aa565b906124dc565b6125d56125d0614532565b6124aa565b90612527565b9301612468565b9190565b91506125e260006125db6125c56125fd600261245c565b95935050505061259f565b6126139136916109f0565b90565b6126219136916112d2565b90565b969396959094919295612635614549565b61286e575b8287036128605760601b679a31110384e0b0c9179460601b679a31110384e0b0c91791856020528560601c958360601c93841561285257873303612836575b8860051b805b6127d657505050828660207f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb604051604081528b8d8160051b948286936040860152838d6060870137836060018286015260608486010190815201376080339380010190a46126ec614557565b6127b9575b50813b612702575b50505050505050565b602080809786946000528060c06040519b8c9a63bc197c818c5233868d015260408c015260a060608c01528a8360051b998a9586948593015260e08d01378160c00160808c015260e0828c010192835284830137818060e0010160a08a01520101838152013780010161010401601c60405101600080515af1156127aa575b63bc197c8160e01b90510361279c57388080808080806126f9565b639c05499b6000526004601cfd5b3d15612781573d6000823e3d90fd5b6127d0908690849086908a8c919287948b96614565565b386126f1565b60209003808b013583602052818801356000526040600020805480831161282857829003905582602052604060002090815490810190811061281a5782915561267f565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c205461267957634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b612891848861288b8b879061288588948c96612608565b50612608565b50612616565b5061263a565b906128b2916128ad6128a882612357565b614096565b6128b4565b565b906128be916145af565b565b906128ca91612897565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b612927602f6040926106c7565b612930816128cc565b0190565b61294a906020810190600081830391015261291a565b90565b1561295457565b61295c6102d2565b62461bcd60e51b81528061297260048201612934565b0390fd5b906129a39161299e8261299861299261298d6145d9565b6102f2565b916102f2565b1461294d565b6145e6565b565b606090565b939291906129b66129a5565b508203612a0d5760405193828552602085019260051b808481016040525b6129de5750505050565b602090038082013560601b679a31110384e0b0c9176020528083013560005280604060002054818601526129d4565b633b800a466000526004601cfd5b7fbaa5ee745de68a3095827d2ee7dd2043afc932834d02cc1b8be3da78577f6c1a90565b90612a5a9291612a55612a50612a1b565b614096565b612abf565b565b90612a69600019916116ad565b9181191691161790565b612a7c9061215e565b90565b90612a94612a8f612a9b92612312565b612a73565b8254612a5c565b9055565b90612ab4612aaf612abb92610b9d565b611d03565b8254612a5c565b9055565b612afe9291612adc612af992612ad7600c8690610efe565b612a7f565b612af181612aec600d8690610bb9565b612a9f565b91600e610bb9565b612a9f565b565b90612b0b9291612a3f565b565b90612b2091612b1a611bca565b50614656565b905090565b90612b409291612b3b612b36611c38565b614096565b612b42565b565b91612b4f9291909161483c565b565b90612b5c9291612b25565b565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b90612b9e939291612b99612b94612b5e565b614096565b612ba0565b565b91612bae939190919261437f565b565b90612bbc939291612b82565b565b612bd790612bd2612bcd611c90565b614096565b612bd9565b565b612be4906009611eac565b565b612bef90612bbe565b565b91612c1b97959391969492612c0e612c07612a1b565b82906145af565b9690919293949596614904565b565b90612c2790612312565b600052602052604060002090565b90565b90612c58612c53612c5d93612c4b612379565b506005612c1d565b612c35565b6149ce565b90565b90612c6a9061213a565b600052602052604060002090565b60ff1690565b612c8a612c8f9161215e565b612c78565b90565b612c9c9054612c7e565b90565b612cc7916000612cbc612cc293612cb4611bf3565b50600461231e565b01612c60565b612c92565b90565b612ce390612cde612cd9611c90565b614096565b612ce5565b565b612cf090600a611eac565b565b612cfb90612cca565b565b60018060a01b031690565b612d14612d199161215e565b612cfd565b90565b612d269054612d08565b90565b612d329061212e565b90565b600080fd5b60e01b90565b90505190612d4d82610aff565b565b90602082820312612d6957612d6691600001612d40565b90565b6102dd565b50612d7d906020810190610313565b90565b612d89906102f2565b9052565b50612d9c9060208101906103f1565b90565b612da8906103d0565b9052565b50612dbb906020810190610b14565b90565b612dc790610afc565b9052565b600080fd5b600080fd5b600080fd5b9035600160200382360303811215612e1b57016020813591019167ffffffffffffffff8211612e16576001820236038313612e1157565b612dd0565b612dcb565b612dd5565b60209181520190565b9190612e4381612e3c81612e4895612e20565b80956107b6565b61062f565b0190565b9035600160400382360303811215612e62570190565b612dd5565b9035600160200382360303811215612ea857016020813591019167ffffffffffffffff8211612ea3576001820236038313612e9e57565b612dd0565b612dcb565b612dd5565b9190612ec781612ec081612ecc9561057f565b80956107b6565b61062f565b0190565b67ffffffffffffffff1690565b612ee681612ed0565b03612eed57565b600080fd5b90503590612eff82612edd565b565b50612f10906020810190612ef2565b90565b612f1c90612ed0565b9052565b90612f5e906020612f56612f4c60408401612f3e6000880188612e67565b908683036000880152612ead565b9482810190612f01565b910190612f13565b90565b61300b91612ffd612ff260c08301612f89612f7f6000870187612d6e565b6000860190612d80565b612fa3612f996020870187612d8d565b6020860190612d9f565b612fbd612fb36040870187612dac565b6040860190612dbe565b612fd7612fcd6060870187612dac565b6060860190612dbe565b612fe46080860186612dda565b908583036080870152612e29565b9260a0810190612e4c565b9060a0818403910152612f20565b90565b93929061303a6040916130429461302d606089019260008a0190610c4e565b8782036020890152612f61565b940190610b42565b565b61304c6102d2565b3d6000823e3d90fd5b915060209061306261230d565b506130756130706006612d1c565b612d29565b6130a1633808a90b9492946130ac61308d600761234a565b6130956102d2565b97889687958695612d3a565b85526004850161300e565b03915afa9081156130f1576000916130c3575b5090565b6130e4915060203d81116130ea575b6130dc818361064f565b810190612d4f565b386130bf565b503d6130d2565b613044565b901515679a31110384e0b0c96020523360145281600052806034600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b6131539133919091614a07565b565b9061317193929161316c613167612b5e565b614096565b613173565b565b916131819391909192614a59565b565b9061318f939291613155565b565b6131b06131ab6131b5926131a3611bca565b506005612c1d565b612c35565b614b42565b90565b906131d3916131ce6131c982612357565b614096565b6131d5565b565b906131df916145e6565b565b906131eb916131b8565b565b903560016020038236030381121561322e57016020813591019167ffffffffffffffff821161322957602082023603831361322457565b612dd0565b612dcb565b612dd5565b60209181520190565b90565b9061324c81602093612d80565b0190565b60200190565b916132648261326a92613233565b9261323c565b90816000905b82821061327e575050505090565b909192936132a061329a6001926132958886612d6e565b61323f565b95613250565b920190929192613270565b90356001602003823603038112156132ec57016020813591019167ffffffffffffffff82116132e75760208202360383136132e257565b612dd0565b612dcb565b612dd5565b60209181520190565b90565b6133069061041f565b9052565b90613317816020936132fd565b0190565b5061332a906020810190611731565b90565b60200190565b9161334182613347926132f1565b926132fa565b90816000905b82821061335b575050505090565b9091929361337d613377600192613372888661331b565b61330a565b9561332d565b92019092919261334d565b90356001602003823603038112156133c957016020813591019167ffffffffffffffff82116133c45760208202360383136133bf57565b612dd0565b612dcb565b612dd5565b60209181520190565b90565b60209181520190565b600080fd5b9037565b9091826133f8916133da565b9160018060fb1b03811161341b578291602061341792029384916133e8565b0190565b6133e3565b9061342b92916133ec565b90565b903560016020038236030381121561346f57016020813591019167ffffffffffffffff821161346a57602082023603831361346557565b612dd0565b612dcb565b612dd5565b60200190565b9181613485916133ce565b9081613496602083028401946133d7565b92836000925b8484106134ac5750505050505090565b90919293949560206134d86134d283856001950388526134cc8b8861342e565b90613420565b98613474565b94019401929493919061349c565b6135649161355661354b6135306135156080850161350760008801886131ed565b908783036000890152613256565b61352260208701876132ab565b908683036020880152613333565b61353d6040860186613388565b90858303604087015261347a565b926060810190613388565b91606081850391015261347a565b90565b9161358b9261357e60408201936000830190610377565b60208184039101526134e6565b90565b60200190565b5190565b67ffffffffffffffff81116135b05760208091020190565b610639565b909291926135ca6135c582613598565b61077e565b938185526020808601920283019281841161360757915b8383106135ee5750505050565b602080916135fc8486610b14565b8152019201916135e1565b6109eb565b6136179136916135b5565b90565b61362390610322565b60008114613632576001900390565b6124c6565b9061364190610b9d565b600052602052604060002090565b600161365b9101610322565b90565b600080fd5b600080fd5b600080fd5b9035906001602003813603038212156136af570180359067ffffffffffffffff82116136aa576020019160208202360383136136a557565b613668565b613663565b61365e565b5090565b9035906001602003813603038212156136fa570180359067ffffffffffffffff82116136f5576020019160208202360383136136f057565b613668565b613663565b61365e565b634e487b7160e01b600052603260045260246000fd5b9190811015613725576020020190565b6136ff565b356137348161171c565b90565b9190811015613747576020020190565b6136ff565b35613756816102fe565b90565b61376290611f0f565b90565b61376e90613759565b90565b61377a9061212e565b90565b9035906001602003813603038212156137bf570180359067ffffffffffffffff82116137ba576020019160208202360383136137b557565b613668565b613663565b61365e565b903590600160200381360303821215613806570180359067ffffffffffffffff8211613801576020019160208202360383136137fc57565b613668565b613663565b61365e565b9082101561382657602061382292028101906137c4565b9091565b6136ff565b600091031261383657565b6102dd565b90918261384791611080565b9160018060fb1b03811161386a578291602061386692029384916133e8565b0190565b6133e3565b60209181520190565b6138846000809261386f565b0190565b93916138d295916138c4946138b6926138a9608089019360008a0190610c4e565b878303602089015261383b565b91848303604086015261383b565b906060818303910152613878565b90565b5090565b6138e290611f0f565b90565b6138ee906138d9565b90565b6138fa9061212e565b90565b919081101561390d576020020190565b6136ff565b3561391c81610325565b90565b9261399c6139a29161399793969794613939878a90614656565b9590956139678a9161395861394c6102d2565b93849260208401613567565b6020820181038252038261064f565b61397961397382613594565b9161358e565b20919261399061398b600c8d90610efe565b61234a565b929361360c565b614b62565b1561041f565b613cf957613a28906139ca60006139c56139be600f8a90612116565b8790612146565b611d28565b6139f06139d9600e8890610bb9565b6139ea6139e582612178565b61361a565b90612a9f565b613a23613a11613a0a613a05600e8a90610bb9565b612178565b8890614bb3565b91613a1e60108990613637565b610bb9565b612a9f565b613a326000612185565b935b84613a5d613a57613a52613a4c88600081019061366d565b906136b4565b610322565b91610322565b1015613cb957613a83613a7e613a778660208101906136b8565b8891613715565b61372a565b600014613bc857613a946000612185565b5b80613ac8613ac2613abd613ab7613ab08a604081019061377d565b8c9161380b565b906138d5565b610322565b91610322565b1015613bb657613afe613af9613af4613aef613ae889600081019061366d565b8b91613737565b61374c565b6138e5565b6138f1565b906340c10f1985613b2f613b2a613b23613b1c8b604081019061377d565b8d9161380b565b86916138fd565b613912565b93803b15613bb157613b5560008094613b60613b496102d2565b98899687958694612d3a565b845260048401610c5b565b03925af1918215613bac57613b7a92613b7f575b5061364f565b613a95565b613b9f9060003d8111613ba5575b613b97818361064f565b81019061382b565b38613b74565b503d613b8d565b613044565b612d35565b5093613bc2905b61364f565b93613a34565b93613bf9613bf4613bef613bea613be388600081019061366d565b8691613737565b61374c565b613765565b613771565b9063b48ab8b69184613c19613c1288604081019061377d565b859161380b565b929094613c34613c2d8a606081019061377d565b879161380b565b91833b15613cb457613c68613c5d93600097938894613c516102d2565b9b8c998a988997612d3a565b875260048701613888565b03925af1918215613caf57613bc292613c82575b50613bbd565b613ca29060003d8111613ca8575b613c9a818361064f565b81019061382b565b38613c7c565b503d613c90565b613044565b612d35565b92509250907ff254aace0ef98d6ac1a0d84c95648f8e3f7a1881dbb43393709ecd004b00f10391613cf4613ceb6102d2565b92839283610c5b565b0390a1565b60006309bde33960e01b815280613d12600482016104df565b0390fd5b613d1e611bf3565b50679a31110384e0b0c96020526014526000526034600c205490565b613d5390613d4e613d49611ed0565b614096565b613d55565b565b613d60906007612a7f565b565b613d6b90613d3a565b565b94909194613d79614549565b613f17575b60601b679a31110384e0b0c9179160601b679a31110384e0b0c917918060205260601c928260601c928315613f0957843303613eed575b8660005260406000208054808411613edf5783900390556020526040600020805490828201918210613ed15755806020528284337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4613e17614557565b613eac575b823b613e2b575b505050505050565b602094829160405197889663f23a6e618852338989015260408801526060870152608086015260a0808601528160c086015260e085013760c401906000601c8401915af115613e9d575b63f23a6e6160e01b905103613e8f57388080808080613e23565b639c05499b6000526004601cfd5b3d15613e75573d6000823e3d90fd5b613eb586614c02565b50613ebf81614c02565b50613ecb858390612616565b50613e1c565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c2054613db557634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b613f2086614c02565b50613f2a84614c02565b50613f36858390612616565b50613d7e565b613f4b613f5191939293610322565b92610322565b8201809211613f5c57565b6124c6565b613f7f613f7a613f73600f8490612116565b3390612146565b612178565b613f92613f8c6000612185565b91610322565b0361402357613fac3382613fa660016121b8565b91614a07565b613fde613fc343613fbd60016121b8565b90613f3c565b613fd9613fd2600f8590612116565b3390612146565b612a9f565b3361401e61400c7f5e1dd8c4451717d5ca4ffbefdada35e22e0871220b9ed9dd03a351f0938c5ed79261213a565b926140156102d2565b91829182610384565b0390a2565b600063156f904360e21b81528061403c600482016104df565b0390fd5b614048611bf3565b5063c79b8b5f60e01b61406361405d836103d0565b916103d0565b148015614087575b908115614077575b5090565b6140819150614c22565b38614073565b5061409181614c22565b61406b565b6140a8906140a26145d9565b90614d2f565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b614105602a6040926106c7565b61410e816140aa565b0190565b61412890602081019060008183039101526140f8565b90565b1561413257565b61413a6102d2565b62461bcd60e51b81528061415060048201614112565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b61418960196020926106c7565b61419281614154565b0190565b6141ac906020810190600081830391015261417c565b90565b156141b657565b6141be6102d2565b62461bcd60e51b8152806141d460048201614196565b0390fd5b6141e2604061077e565b90565b90565b906141fd6141f86142049261213a565b6141e5565b8254611f43565b9055565b60a01b90565b906142286bffffffffffffffffffffffff60a01b91614208565b9181191691161790565b61424661424161424b9261047c565b610b9a565b61047c565b90565b90565b9061426661426161426d92614232565b61424e565b825461420e565b9055565b9061429c602060006142a29461429482820161428e848801612468565b906141e8565b01920161249d565b90614251565b565b906142ae91614271565b565b90614321614328926142dc836142d56142cf6142ca614532565b61047c565b9161047c565b111561412b565b614302816142fb6142f56142f06000612491565b6102f2565b916102f2565b14156141af565b9161431861430e6141d8565b93600085016123c2565b60208301612408565b60026142a4565b565b90614333611fad565b506080604051019160208301604052600083528290600a6000198092955b01948181066030018653049384156143705790600a9190809291614351565b93505082602091039203918252565b6143cd91926143996143d3956143be939086849192614dc8565b6143b66143af826143aa6000612178565b613f3c565b6000612a9f565b926001610bb9565b916143c883612178565b613f3c565b90612a9f565b565b906143df8261107c565b8110156143f0576020809102010190565b6136ff565b6143ff9051610322565b90565b61441161441791939293610322565b92610322565b820391821161442257565b6124c6565b6144379093929193848391614ec9565b6144408361107c565b9261444b6000612185565b926144566000612185565b935b8461446b61446588610322565b91610322565b10156144e8576144dc6144e2916144c361448e614489888a906143d5565b6143f5565b6144bd6144ae60016144a86144a38d8c6143d5565b6143f5565b90610bb9565b916144b883612178565b614402565b90612a9f565b6144d66144d18789906143d5565b6143f5565b90613f3c565b9461364f565b93614458565b9150935061450c925061450591506145006000612178565b614402565b6000612a9f565b565b600090565b90565b61452a61452561452f92614513565b610b9a565b61047c565b90565b61453a61450e565b50614546612710614516565b90565b614551611bf3565b50600090565b61455f611bf3565b50600090565b50509492939093614574614557565b614581575b505050505050565b61459761459d936145a397969092939596612608565b50612608565b50612616565b50388080808080614579565b906145d16145cc6145d6936145c5818590614ee4565b6005612c1d565b612c35565b614fcb565b50565b6145e1612379565b503390565b9061460861460361460d936145fc818590615006565b6005612c1d565b612c35565b6150a0565b50565b91602061463292949361462b60408201966000830190610b42565b0190610c4e565b565b61464061464691610322565b91610322565b908115614651570690565b612511565b919091614661611bca565b5061466a611bca565b5061467f61467a600e8590610bb9565b612178565b61469261468c6000612185565b91610322565b1461479b576146b56146b06146a9600f8690612116565b8390612146565b612178565b806146c96146c36000612185565b91610322565b1461477e5740906146d9826121a1565b6146ec6146e66000612185565b91610322565b146147615761473d6147579161472561475e9461471661470a6102d2565b93849260208401614610565b6020820181038252038261064f565b61473761473182613594565b9161358e565b206121a1565b61475161474c600e8790610bb9565b612178565b90614634565b9283614bb3565b90565b600063b7b3378760e01b81528061477a600482016104df565b0390fd5b6000637de832b560e11b815280614797600482016104df565b0390fd5b6000630b56c82b60e31b8152806147b4600482016104df565b0390fd5b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b6147ed601b6020926106c7565b6147f6816147b8565b0190565b61481090602081019060008183039101526147e0565b90565b1561481a57565b6148226102d2565b62461bcd60e51b815280614838600482016147fa565b0390fd5b6148b8906148b16148bd949361486c8561486561485f61485a614532565b61047c565b9161047c565b111561412b565b6148928161488b6148856148806000612491565b6102f2565b916102f2565b1415614813565b936148a861489e6141d8565b95600087016123c2565b60208501612408565b600361237e565b6142a4565b565b906148cb60ff916116ad565b9181191691161790565b6148de9061041f565b90565b90565b906148f96148f4614900926148d5565b6148e1565b82546148bf565b9055565b9596949392943361493d6149377f00000000000000000000000000000000000000000000000000000000000000006102f2565b916102f2565b1415801561499f575b61498257614974976149679661496294899490919293946150db565b6142b0565b61496f612b5e565b6145af565b6149806001600b6148e4565b565b600063f92ee8a960e01b81528061499b600482016104df565b0390fd5b506149aa600b612c92565b614946565b90565b6149c66149c16149cb92610322565b610b9a565b6102e7565b90565b6149fa6149f5614a04936149f060006149ff956149e9612379565b50016149af565b615179565b6121a1565b6149b2565b61212e565b90565b614a42614a5793614a1d614a519385839161519b565b614a3a614a3382614a2e6000612178565b614402565b6000612a9f565b926001610bb9565b91614a4c83612178565b614402565b90612a9f565b565b92614a6a91949390858491926151b6565b614a738361107c565b91614a7e6000612185565b90614a896000612185565b915b82614a9e614a9887610322565b91610322565b1015614b1c57614ac4614b1691614abe614ab98787906143d5565b6143f5565b90613f3c565b92614b11614adb614ad68784906143d5565b6143f5565b614b0b614afc6001614af6614af18d88906143d5565b6143f5565b90610bb9565b91614b0683612178565b613f3c565b90612a9f565b61364f565b91614a8b565b91509350614b409250614b399150614b346000612178565b613f3c565b6000612a9f565b565b614b5a6000614b5f92614b53611bca565b50016149af565b6152f9565b90565b919091614b6d611bf3565b508051614b7a575b501490565b9060208201915160051b8201905b8251811160051b9081526020835191185260206040600020920191818310614b885791505038614b75565b90614bd5614bce614bda92614bc6611bca565b506010613637565b8390610bb9565b612178565b80614bee614be86000612185565b91610322565b14600014614bfb57505b90565b9050614bf8565b90614c0b6129a5565b506040519160408301604052600183526020830152565b614c2a611bf3565b50614c3481615311565b8015614c57575b908115614c47575b5090565b614c5191506153b7565b38614c43565b50614c6181615351565b614c3b565b90565b614c7d614c78614c8292614c66565b610b9a565b610322565b90565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b614cb960178092611fb2565b614cc281614c85565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b614cfa60118092611fb2565b614d0381614cc6565b0190565b614d21614d2c9392614d1b614d2693614cad565b90612040565b614cee565b90612040565b90565b90614d44614d3e838390612c9f565b1561041f565b614d4c575050565b614dc491614da2614d7b614d6b614d65614da795615433565b936121a1565b614d756020614c69565b9061560c565b91614d93614d876102d2565b93849260208401614d07565b6020820181038252038261064f565b6120c9565b614daf6102d2565b91829162461bcd60e51b835260048301610726565b0390fd5b91929092614dd4614549565b614eb0575b8260601b8015614ea257679a31110384e0b0c960205283601452846000526040600020805490838201918210614e9457558160205260601c6000337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604083a4614e41614557565b614e7b575b614e4f83615758565b614e5a575b50505050565b614e7293614e686000612491565b9390919293615765565b38808080614e54565b614e8484614c02565b50614e8e81614c02565b50614e46565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b614eb984614c02565b50614ec381614c02565b50614dd9565b9091614ee292614ed96000612491565b929091926157fe565b565b614ef8614ef2828490612c9f565b1561041f565b614f01575b5050565b614f246001614f1f6000614f176004869061231e565b018590612c60565b6148e4565b90614f2d6145d9565b90614f6a614f64614f5e7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95612312565b9261213a565b9261213a565b92614f736102d2565b80614f7d816104df565b0390a43880614efd565b614f9090611f0f565b90565b614fa7614fa2614fac926102e7565b610b9a565b610322565b90565b614fc3614fbe614fc892610322565b6116ad565b610afc565b90565b90614ffe614ff8614ff3614fee600061500396614fe6611bf3565b500194614f87565b614f93565b614faf565b916149af565b6159ee565b90565b615011818390612c9f565b61501a575b5050565b61503d600061503860006150306004869061231e565b018590612c60565b6148e4565b906150466145d9565b9061508361507d6150777ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95612312565b9261213a565b9261213a565b9261508c6102d2565b80615096816104df565b0390a43880615016565b906150d36150cd6150c86150c360006150d8966150bb611bf3565b500194614f87565b614f93565b614faf565b916149af565b615aae565b90565b91926150fa61513f96946150f3615101946008611eac565b6009611eac565b600a611eac565b61511361510c6116cf565b82906145af565b61512561511e611c38565b82906145af565b615137615130611c90565b82906145af565b919091615bb8565b565b5490565b600052602060002090565b61515981615141565b8210156151745761516b600191615145565b91020190600090565b6136ff565b6151989160006151929261518b61230d565b5001615150565b90610f31565b90565b90916151b4926151ab6000612491565b92909192615bd5565b565b919290926151c2614549565b6152f4575b80518451036152e6578260601b80156152d85780679a31110384e0b0c917602052845160051b805b6152a157506000604051604081527f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb81885160051b602001604082019081818c60045afa503d60400160208301523d01865160051b60200181818960045afa503d01039360601c933392a4615262614557565b61529c575b61527083615758565b61527b575b50505050565b615293936152896000612491565b9390919293615cd9565b38808080615275565b615267565b80830151908087015160005260406000209182549081019081106152ca576020925503806151ef565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b6151c7565b600061530e91615307611bca565b5001615141565b90565b615319611bf3565b50633e85e62f60e01b61533461532e836103d0565b916103d0565b14908115615341575b5090565b61534b9150615d90565b3861533d565b615359611bf3565b5061536381615db7565b80156153a8575b801561538d575b90811561537d575b5090565b6153879150615df7565b38615379565b5060006153a261539c836103d0565b916103d0565b14615371565b506153b281615df7565b61536a565b6153bf611bf3565b506153c981615df7565b9081156153d5575b5090565b6153df9150615e37565b386153d1565b90565b60ff1690565b6154026153fd615407926153e5565b610b9a565b6153e8565b90565b61541460146153ee565b90565b61542b615426615430926153e8565b610b9a565b610322565b90565b61545061544b61546692615445611fad565b50614f87565b614f93565b61546061545b61540a565b615417565b9061560c565b90565b90565b61548061547b61548592615469565b610b9a565b610322565b90565b9061549a615495836112af565b61077e565b918252565b369037565b906154c96154b183615488565b926020806154bf86936112af565b920191039061549f565b565b600360fc1b90565b906154dd82613594565b8110156154ef57600160209102010190565b6136ff565b600f60fb1b90565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b61551b6154fc565b90565b90565b61553561553061553a9261551e565b610b9a565b610322565b90565b60f81b90565b90565b61555a61555561555f92615543565b610b9a565b6153e8565b90565b6155819061557b615575615586946153e8565b91610322565b9061095e565b610322565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b6155bd602080926106c7565b6155c681615589565b0190565b6155e090602081019060008183039101526155b1565b90565b156155ea57565b6155f26102d2565b62461bcd60e51b815280615608600482016155ca565b0390fd5b9190615616611fad565b506156b06156a061564c6156476156376002615632879161546c565b6124dc565b615641600261546c565b90613f3c565b6154a4565b926156556154cb565b61566e8561566860009360001a93612185565b906154d3565b536156776154f4565b6156908561568a60019360001a936121b8565b906154d3565b5361569b600261546c565b6124dc565b6156aa60016121b8565b90613f3c565b925b836156c66156c060016121b8565b91610322565b111561572d576156d4615513565b816156df600f615521565b16916010831015615728576156fb61571c92615722941a61553d565b61570b8591889060001a926154d3565b536157166004615546565b90615562565b9361361a565b926156b2565b6136ff565b6157559293506157509061574a6157446000612185565b91610322565b146155e3565b6120c9565b90565b615760611bf3565b503b90565b919360209360405195869463f23a6e618652338787015260601b60601c60408601526060850152608084015260a08084015280518091818060c08701526157ea575b505060c401906000601c8401915af1156157db575b63f23a6e6160e01b9051036157cd57565b639c05499b6000526004601cfd5b3d156157bc573d6000823e3d90fd5b818660e08701920160045afa5080386157a7565b9193929061580a614549565b615936575b81518551036159285760601b9182679a31110384e0b0c9176020528060601b83811490151715615906575b50835160051b805b6158d057507f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb6000939460405192839160408352805160051b60200180916040850192839160045afa503d60400160208401523d019081815160051b602001809260045afa503d01039260601c923392a46158bb614557565b6158c2575b565b6158ca6121f8565b506158c0565b80820151908086015160005260406000208054928381116158f8576020930390550380615842565b63f4d678b86000526004601cfd5b6000526034600c20541561591a573861583a565b634b6e7f186000526004601cfd5b633b800a466000526004601cfd5b61593e6121f8565b5061580f565b90565b600052602060002090565b5490565b61595f81615952565b82101561597a57615971600191615947565b91020190600090565b6136ff565b919061599561599061599d93612312565b612a73565b908354611cdd565b9055565b90815491680100000000000000008310156159d157826159c99160016159cf95018155615956565b9061597f565b565b610639565b906159e090612312565b600052602052604060002090565b6159f6611bf3565b50615a0b615a05828490615e77565b1561041f565b600014615a4e57615a44615a4992615a2f615a2860008501615944565b82906159a1565b6001615a3d60008501615141565b93016159d6565b612a9f565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b615a7d91615a7761230d565b9161597f565b565b615a8881615952565b8015615aa9576001900390615aa6615aa08383615956565b90615a6b565b55565b615a55565b615ab6611bf3565b50615acd615ac86001830184906159d6565b612178565b9081615ae2615adc6000612185565b91610322565b1415600014615bb057615b62926001615b5d9284615b0b600096615b05856121b8565b90614402565b615b28615b19888501615141565b615b22866121b8565b90614402565b80615b3b615b3584610322565b91610322565b03615b67575b505050615b57615b52868301615944565b615a7f565b016159d6565b611d28565b600190565b615ba892615b9a615b86615b80615ba3948c8901615150565b90610f31565b93615b9485918c8901615150565b9061597f565b918585016159d6565b612a9f565b388080615b41565b505050600090565b90615bce615bd39392615bc9611ed0565b6145af565b615ead565b565b90929192615be1614549565b615cb7575b60601b9081679a31110384e0b0c917602052818160601b148160601b151715615c95575b5082600052604060002090815491828411615c8757836000930390558260205260601c337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604084a4615c5b614557565b615c64575b5050565b615c70615c7692614c02565b50614c02565b50615c7f6121f8565b503880615c60565b63f4d678b86000526004601cfd5b6000526034600c205415615ca95738615c0a565b634b6e7f186000526004601cfd5b615cc084614c02565b50615cca83614c02565b50615cd36121f8565b50615be6565b919360209360405195869463bc197c818652338787015260601b60601c604086015260a06060860152805160051b8601809160c0870192839160045afa503d60a001908160808701523d019182815160051b8801809260045afa503d0160a08501523d01908181518601809260045afa50601c8301903d0103906000601c8401915af115615d81575b63bc197c8160e01b905103615d7357565b639c05499b6000526004601cfd5b3d15615d62573d6000823e3d90fd5b615d98611bf3565b5060e01c630e89341c8114906301ffc9a763d9b67a2682149114171790565b615dbf611bf3565b5080615dda615dd463152a902d60e11b6103d0565b916103d0565b14908115615de7575b5090565b615df19150615ecd565b38615de3565b615dff611bf3565b5080615e1a615e14635a05180f60e01b6103d0565b916103d0565b14908115615e27575b5090565b615e319150615ef3565b38615e23565b615e3f611bf3565b5080615e5a615e54634e821d3360e11b6103d0565b916103d0565b14908115615e67575b5090565b615e719150615351565b38615e63565b615e95916001615e9092615e89611bf3565b50016159d6565b612178565b615ea8615ea26000612185565b91610322565b141590565b90615ec4615ebd615ecb93611f37565b6006611f6d565b6007612a7f565b565b615ed5611bf3565b50615eef615ee96301ffc9a760e01b6103d0565b916103d0565b1490565b615efb611bf3565b5080615f16615f10637965db0b60e01b6103d0565b916103d0565b14908115615f23575b5090565b615f2d9150615db7565b38615f1f56fea2646970667358221220fdfd08eb90c8ee402a9baa171b1d2feff740a3c0392aafd7f5be7219ff4ddece64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) diff --git a/scripts/factories/token_library/ERC1155SaleFactory.ts b/scripts/factories/token_library/ERC1155SaleFactory.ts index 7924af0..843c557 100644 --- a/scripts/factories/token_library/ERC1155SaleFactory.ts +++ b/scripts/factories/token_library/ERC1155SaleFactory.ts @@ -1,176 +1,14 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' -// https://github.com/0xsequence/contracts-library/blob/dc28b8bf2d1dfe49441bde4893900e15712083a2/src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol - -const abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'factoryOwner', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - name: 'ERC1155SaleDeployed', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'previousOwner', - type: 'address' - }, - { - indexed: true, - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'OwnershipTransferred', - type: 'event' - }, - { - inputs: [], - name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'items', - type: 'address' - } - ], - name: 'deploy', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'items', - type: 'address' - } - ], - name: 'determineAddress', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'upgradeBeacon', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] +// https://github.com/0xsequence/contracts-library/blob/ff6b02ec8ccd9321b6ef8318e5c0d45585721f3b/src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol export class ERC1155SaleFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, - '608034610121576001600160401b0390601f6155e638819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b82519361321494858101958187108388111761010b576123d2823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611de4853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611c76908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461079057806359659e901461073d578063715018a6146106a05780638da5cb5b1461064b578063d9181cd3146102ee578063e657f693146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561084f565b906100ae6108bd565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b8284346102eb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb57506101e461084f565b906101ed610877565b916055600b6101fa61089a565b845173ffffffffffffffffffffffffffffffffffffffff968716602080830191825292909716604080830191909152815290957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09161025a60608261099b565b519020906102ab86519161026d8361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff9661029f8860015416948a519586938d850198896109ff565b0390810183528261099b565b5190206111eb85516102bf8883018261099b565b81815287810191610a5683395190209085519186830152868201523081520160ff815320915191168152f35b80fd5b5090346101a65760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a65761032761084f565b92610330610877565b61033861089a565b908351946020968787018761037586868490602090939293604083019473ffffffffffffffffffffffffffffffffffffffff809216845216910152565b03976103a77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0998a810183528261099b565b5190208651916103b68361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff91816103f98c6103ed878d88600154169051958694850197886109ff565b038c810183528261099b565b5190206111eb895161040d8d83018261099b565b8181528c810191610a5683398051156105f057518492918af516988915610594578260015416938a3b156105905791608491601f8a95946104988f8e51998a9889977fcf7a1d77000000000000000000000000000000000000000000000000000000008952168c880152602487015260606044870152825192839182606489015288880191016109dc565b01168101030181838b5af1801561058657908591610572575b5050853b1561056e5784517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316918101918252929091166020820152829082908190604001038183885af1801561056457610550575b50507f346f0211197dd599e2e2a8c828f6e7dc39e8a49171ce0a728428e8b778c61eea838251848152a151908152f35b61055a829161093c565b6102eb5780610520565b83513d84823e3d90fd5b8380fd5b61057b9061093c565b61056e5783386104b1565b86513d87823e3d90fd5b8880fd5b6064858c8b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b6064878e808e51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b83346102eb57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb576106d76108bd565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a657826107ca61084f565b6107d26108bd565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561056e5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af1908115610846575061083a575080f35b6108439061093c565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108de57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b67ffffffffffffffff811161095057604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff82111761095057604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761095057604052565b60005b8381106109ef5750506000910152565b81810151838201526020016109df565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610a5082518093602086850191016109dc565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea2646970667358221220a592f27f25373407ca73911ddc0bbaa6ea0e0d6dfcce18bb6b5765f70d2e1a1764736f6c63430008130033a2646970667358221220cacf10d5c818ae8f15d105a3e217b088abc54a07a2101d07f54bee5abff11c7164736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ff9f63e676c96c753988d58c9eed378dc3ae25dde2df2114b6217eba7bb9455964736f6c6343000813003360808060405234610016576131f8908161001c8239f35b600080fdfe61010080604052600436101561001457600080fd5b600080608052803560e01c91826301ffc9a714611ee3575081630869678c14611ead578163119cd50c14611e44578163248a9ca314611e155781632f2ff15d14611d135781633013ce2914611cdd57816336568abe14611c1757816344004cc114611b765781634782f77914611b0a578163485cc955146117e15781634f651ccd1461168657816360e606f6146109ce5781636a326ab1146109685781639010d07c1461091357816391d14854146108bc57816397559600146107a0578163a217fddf14610782578163bad436611461070d57508063ca15c873146106df578063d547741f14610699578063f07f04ff1461028e5763ff81434e1461011857600080fd5b34610288576020806003193601126102885760043567ffffffffffffffff81116102885761014a9036906004016121c5565b919061015583612115565b9261016360405194856120d4565b8084527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe061019082612115565b01836080515b828110610272575050506080515b81811061022c57838560405190828201838352815180915283604084019201936080515b8281106101d55784840385f35b9091928260a08261021d6001948a5160808091805184526020810151602085015267ffffffffffffffff80604083015116604086015260608201511660608501520151910152565b019601910194929190946101c8565b8061023b61026d928486613030565b356080515260098552610252604060805120612d81565b61025c8288612cf6565b526102678187612cf6565b50612cc9565b6101a4565b61027a613055565b828289010152018490610196565b60805180fd5b346102885760c06003193601126102885760043567ffffffffffffffff8111610288576102bf9036906004016121c5565b9060243567ffffffffffffffff8111610288576102e09036906004016121c5565b909160443567ffffffffffffffff8111610288576103029036906004016121c5565b929060643567ffffffffffffffff8111610288576103249036906004016121c5565b95909160843567ffffffffffffffff8111610288576103479036906004016121c5565b9460a43567ffffffffffffffff8111610288576103689036906004016121c5565b9590946103736124c9565b828c1480159061068f575b8015610685575b801561067b575b8015610671575b6105eb5760805180995b8d8b106103aa5760805180f35b6103b58b8f83613030565b3591828c15159182610666575b505061063c578a808e8c859e6103d8918b613030565b6103e190613040565b916103ec9188613030565b6103f590613040565b67ffffffffffffffff169067ffffffffffffffff16108015610615575b6105eb578d8f93808f918d8f91868f918f8f918f8f91928f8087848f8f90988e8e859b8f878f818f819f8f839f61044c8580948193613030565b359c61045792613030565b359661046292613030565b61046b90613040565b9661047592613030565b61047e90613040565b9361048892613030565b35936040519561049787612051565b8652602090818701928352604087019467ffffffffffffffff168552606087019367ffffffffffffffff168452608087019586526080515260099052608051604090209451855551600185015560028401915167ffffffffffffffff168254915160401b6fffffffffffffffff000000000000000016917fffffffffffffffffffffffffffffffff00000000000000000000000000000000161717905551906003015561054392613030565b359b61054e92613030565b359a61055992613030565b61056290613040565b9561056c92613030565b61057590613040565b9261057f92613030565b6040805194855260208501959095529383019490945267ffffffffffffffff908116606083015290921660808301523560a08201527f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f969060c090a16105e390612cc9565b9a915061039d565b60046040517f85d4a748000000000000000000000000000000000000000000000000000000008152fd5b50610629610624828d8a613030565b613040565b67ffffffffffffffff4291161115610412565b60046040517f340bc4c9000000000000000000000000000000000000000000000000000000008152fd5b1015905082386103c2565b50868c1415610393565b50878c141561038c565b508a8c1415610385565b50898c141561037e565b34610288576040600319360112610288576106d96004356106b8611fef565b9080608051526106d4600160406080518060205220015461263f565b6127e0565b60805180f35b3461028857602060031936011261028857600435608051526001602052602060406080512054604051908152f35b346102885760806003193601126102885760243567ffffffffffffffff81116102885761073e9036906004016121c5565b6044929192359173ffffffffffffffffffffffffffffffffffffffff8316830361077f576020610775606435858588600435613080565b6040519015158152f35b80fd5b34610288576080518060031936011261077f57602090604051908152f35b346102885760a06003193601126102885760043590602435916044359167ffffffffffffffff9081841680940361077f57506107da61203a565b92608435916107e76124c9565b84169080821080156108b2575b6105eb577f8fd3ac39fbb3d5e9c906dd9ec439dc6e584b8fa3ce02d5b67d589b22b22152a99560a09584608060405161082c81612051565b88815284602082015285604082015286606082015201528560055581600655827fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffff00000000000000006007549360401b1692161717600755836008556040519485526020850152604084015260608301526080820152a160805180f35b50428211156107f4565b346102885760406003193601126102885760ff60406020926108dc611fef565b6004356080515273ffffffffffffffffffffffffffffffffffffffff83608051808852209116825284522054166040519015158152f35b3461028857604060031936011261028857600435608051526001602052602073ffffffffffffffffffffffffffffffffffffffff610958602435604060805120612a97565b9190546040519260031b1c168152f35b346102885760206003193601126102885773ffffffffffffffffffffffffffffffffffffffff610996612017565b61099e6124c9565b167fffffffffffffffffffffffff0000000000000000000000000000000000000000600454161760045560805180f35b60e0600319360112610288576109e2612017565b60243567ffffffffffffffff811161028857610a0290369060040161212d565b60443567ffffffffffffffff811161028857610a2290369060040161212d565b916064359167ffffffffffffffff83116102885736602384011215610288578260040135610a4f8161218b565b93610a5d60405195866120d4565b818552366024838301011161028857602482910160208601376020608051918501015273ffffffffffffffffffffffffffffffffffffffff60843516608435036102885767ffffffffffffffff60c4351161028857610ac49391933660c4356004016121c5565b9060c052926080519283928496610ad9612d3e565b60a052610b0767ffffffffffffffff604060a05101511667ffffffffffffffff606060a05101511690613008565b60805160e08190529094905b835160e0511015610d2057610b2a60e05185612cf6565b51968760e05115159182610d15575b505061063c5786610b4c60e05187612cf6565b519181608051526009602052610b66604060805120612d81565b610b8d67ffffffffffffffff60408301511667ffffffffffffffff60608401511690613008565b15610c0557505086610bd45750610bbd90610bb7600199610bb18360a05151612893565b906128d5565b9a6128d5565b96610bc960e051612cc9565b60e052989698610b13565b602490604051907f035acf500000000000000000000000000000000000000000000000000000000082526004820152fd5b9099916080820151908c82610c2b575b5050508291610bb1610bbd94610bb79351612893565b81610c3b91339060c05186613080565b15610c92575060808051339052600260209081528151604080822094909152929052512080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600117905581610bb18c610c15565b8c604051927f265c66a80000000000000000000000000000000000000000000000000000000084526004840152608060248401528060848401527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811161028857829060051b60a4928160c0518585013733604484015260648301528101030190fd5b10159050878c610b39565b88889194939461142d575b5073ffffffffffffffffffffffffffffffffffffffff600454168073ffffffffffffffffffffffffffffffffffffffff60843516036113ef575060a435818110611399575060843573ffffffffffffffffffffffffffffffffffffffff166112e45780340361128d57505b73ffffffffffffffffffffffffffffffffffffffff60035460081c1660805190835182905b8082106110ba575050600654908115158061102c575b610f645750505073ffffffffffffffffffffffffffffffffffffffff60035460081c1690813b156102885760405180927fb48ab8b600000000000000000000000000000000000000000000000000000000825273ffffffffffffffffffffffffffffffffffffffff86166004830152608060248301528180610e83610e6e610e5c608484018a612d0a565b6003198482030160448501528b612d0a565b6003198382030160648401526080519661279d565b0391608051905af18015610f5757610f06575b7f23519238b590c499a2abcf44a33b5f431ac6ca51c22fad26bc2c3d08b97eaa2173ffffffffffffffffffffffffffffffffffffffff84610efd87610eef87604051958695168552606060208601526060850190612d0a565b908382036040850152612d0a565b0390a160805180f35b919067ffffffffffffffff8311610f265760409290925290610efd610e96565b7f4e487b71000000000000000000000000000000000000000000000000000000006080515260416004526024608051fd5b6040513d608051823e3d90fd5b906020600492604051938480927f18160ddd000000000000000000000000000000000000000000000000000000008252608051905af1918215610f575760805192610ff6575b50610ff2906040519384937fa9227830000000000000000000000000000000000000000000000000000000008552600485016040919493926060820195825260208201520152565b0390fd5b9091506020813d602011611024575b81611012602093836120d4565b81010312610288575190610ff2610faa565b3d9150611005565b506040517f18160ddd000000000000000000000000000000000000000000000000000000008152602081600481608051865af18015610f575784849160805190611082575b61107c9293506128d5565b11610dd1565b5050506020813d6020116110b2575b8161109e602093836120d4565b810103126102885751829081908590611071565b3d9150611091565b90926110c68487612cf6565b5160805152600960205260016040608051200154801515806111ec575b61110c5750611100611106916110f9868b612cf6565b51906128d5565b93612cc9565b90610dbb565b83858a602061111b838c612cf6565b516024604051809681937f2693ebf20000000000000000000000000000000000000000000000000000000083526004830152608051905af1928315610f5757608051936111b6575b50610ff29161117191612cf6565b51926040519384937fa9227830000000000000000000000000000000000000000000000000000000008552600485016040919493926060820195825260208201520152565b9092506020813d6020116111e4575b816111d2602093836120d4565b81010312610288575191610ff2611163565b3d91506111c5565b506111f78588612cf6565b51604051907f2693ebf20000000000000000000000000000000000000000000000000000000082526004820152602081602481608051895af18015610f5757829160805191611256575b50611250906110f9888d612cf6565b116110e3565b9150506020813d602011611285575b81611272602093836120d4565b8101031261028857518190611250611241565b3d9150611265565b6040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260843573ffffffffffffffffffffffffffffffffffffffff1660048201526024810191909152346044820152606490fd5b341561132a5760646040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260805160048201526080516024820152346044820152fd5b61139490604051907f23b872dd00000000000000000000000000000000000000000000000000000000602083015233602483015230604483015260648201526064815261137681612051565b73ffffffffffffffffffffffffffffffffffffffff60843516612dc9565b610d96565b6040517f1eabcfbe00000000000000000000000000000000000000000000000000000000815260843573ffffffffffffffffffffffffffffffffffffffff16600482015260248101929092526044820152606490fd5b606491604051917f1eabcfbe000000000000000000000000000000000000000000000000000000008352600483015260248201526080516044820152fd5b608060a05101519081611441575b50610d2b565b336080515260026020526080518260408220915260205260ff6040608051205416158061155e575b156114bc5750336080515260026020526080519060408220915260205260406080512060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055858061143b565b604051917f265c66a80000000000000000000000000000000000000000000000000000000083526004830152608060248301528060848301527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8111610288578160a49160051b8060c051848401373360448301527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60648301528101030190fd5b509491959260409491945160208101907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1682527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6034820152603481526115c98161209c565b519020966115d687612115565b976115e4604051998a6120d4565b87895260208901368960051b60c05101116102885760c051905b8960051b60c05101821061167657505095608051965b895188101561166457611627888b612cf6565b51608051818310156116525750906080515260205261164c6040608051205b97612cc9565b96611614565b5260205261164c604060805120611646565b90939650839194979295985014611469565b81358152602091820191016115fe565b346102885760c0600319360112610288576044356024356004356116a861203a565b67ffffffffffffffff6084358181169591928682036102885760a435926116cd6124c9565b8482169788811080156117d7575b6105eb576003610efd967f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f969a6040519361171485612051565b8b85526020850192868452604086019283526060860191825260808601938a85528c60805152600960205260406080512096518755516001870155600286019251167fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffff00000000000000008454935160401b1692161717905551910155604051968796879260a09492979695919760c085019885526020850152604084015267ffffffffffffffff80921660608401521660808201520152565b50428111156116db565b34610288576040600319360112610288576117fa612017565b611802611fef565b6003549060ff8216611ae05774ffffffffffffffffffffffffffffffffffffffff007fffffffffffffffffffffff0000000000000000000000000000000000000000ff9160081b16911617600355608051805261196860805160209281845273ffffffffffffffffffffffffffffffffffffffff604083209116809252835260805160ff60408220541615611a72575b506080518052600183818095526118ae83604060805120612aaf565b507f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280608051526080518083528460408220915282528060805160ff60408220541615611a05575b50506080515281815261190e83604060805120612aaf565b507f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec80608051526080518083528460408220915282528060805160ff60408220541615611998575b50506080515252604060805120612aaf565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600354161760035560805180f35b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a48087611956565b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a480876118f6565b80526080518084528160408220915283526080516040812060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790558133917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a483611892565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b3461028857604060031936011261028857611b23612017565b611b2b6121f6565b60805180808093602435905af1611b40612f0c565b5015611b4c5760805180f35b60046040517f750b219c000000000000000000000000000000000000000000000000000000008152fd5b3461028857606060031936011261028857611b8f612017565b611b97611fef565b611b9f6121f6565b604051907fa9059cbb00000000000000000000000000000000000000000000000000000000602083015273ffffffffffffffffffffffffffffffffffffffff8091166024830152604435604483015260448252608082019282841067ffffffffffffffff851117610f26576106d99360405216612dc9565b3461028857604060031936011261028857611c30611fef565b3373ffffffffffffffffffffffffffffffffffffffff821603611c59576106d9906004356127e0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610288576080518060031936011261077f57602073ffffffffffffffffffffffffffffffffffffffff60045416604051908152f35b3461028857604060031936011261028857611da16004356001611d34611fef565b91806080515260805190611d5283604060209480865220015461263f565b80608051526080519384835273ffffffffffffffffffffffffffffffffffffffff60408620911680955282528060805160ff60408220541615611da85750506080515252604060805120612aaf565b5060805180f35b5260805180835284604082209152825260805160408120847fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905584827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d339380a48086611956565b346102885760206003193601126102885760043560805152602060016040608051808452200154604051908152f35b34610288576080518060031936011261077f57611e5f613055565b5060a0611e6a612d3e565b611eab604051809260808091805184526020810151602085015267ffffffffffffffff80604083015116604086015260608201511660608501520151910152565bf35b3461028857602060031936011261028857611ec6613055565b5060043560805152600960205260a0611e6a604060805120612d81565b34611feb576020600319360112611feb576004357fffffffff000000000000000000000000000000000000000000000000000000008116809103611fe75760209250807fb68139110000000000000000000000000000000000000000000000000000000014908115611f57575b5015158152f35b7f5a05180f00000000000000000000000000000000000000000000000000000000811491508115611f8a575b5083611f50565b7f7965db0b00000000000000000000000000000000000000000000000000000000811491508115611fbd575b5083611f83565b7f01ffc9a70000000000000000000000000000000000000000000000000000000091501483611fb6565b8280fd5b5080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361201257565b600080fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361201257565b6064359067ffffffffffffffff8216820361201257565b60a0810190811067ffffffffffffffff82111761206d57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761206d57604052565b6080810190811067ffffffffffffffff82111761206d57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761206d57604052565b67ffffffffffffffff811161206d5760051b60200190565b81601f820112156120125780359161214483612115565b9261215260405194856120d4565b808452602092838086019260051b820101928311612012578301905b82821061217c575050505090565b8135815290830190830161216e565b67ffffffffffffffff811161206d57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b9181601f840112156120125782359167ffffffffffffffff8311612012576020808501948460051b01011161201257565b3360009081527f20be27040b8e00df40bca0df34743417f3574a156386188f7d7f14369e5ee82b602090815260408083205490927f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec9160ff161561225a5750505050565b61226333612922565b91845190612270826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b8183116123d157505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b8401917f206973206d697373696e6720726f6c652000000000000000000000000000000060378401525180938684019061277a565b010360288101875201856120d4565b519283927f08c379a00000000000000000000000000000000000000000000000000000000084526004840152602483019061279d565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61240e85876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0191906122a1565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f6058ee1f1c102e8ac9ef0c4319964e42c1ab00dfba021f8302fd0802656934ac602090815260408083205490927f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c29160ff161561252d5750505050565b61253633612922565b91845190612543826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b8183116125ce57505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61260b85876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190612574565b600090808252602090828252604092838120338252835260ff8482205416156126685750505050565b61267133612922565b9184519061267e826120b8565b6042825284820192606036853782511561249c576030845382519060019182101561249c5790607860218501536041915b81831161270957505050612375576048610ff293869361233f9361233098519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a8601526122fb815180928c60378901910161277a565b909192600f8116601081101561246f577f3031323334353637383961626364656600000000000000000000000000000000901a61274685876128e2565b5360041c928015612442577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0191906126af565b60005b83811061278d5750506000910152565b818101518382015260200161277d565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f6020936127d98151809281875287808801910161277a565b0116010190565b90604061282b926000908082528160205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff838320541661282e575b8152600160205220612b70565b50565b808252816020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a461281e565b818102929181159184041417156128a657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b919082018092116128a657565b9081518110156128f3570160200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040519061292f8261209c565b602a82526020820160403682378251156128f3576030905381516001908110156128f357607860218401536029905b8082116129cc57505061296e5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015612a69577f3031323334353637383961626364656600000000000000000000000000000000901a612a0884866128e2565b5360041c918015612a3b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019061295e565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b80548210156128f35760005260206000200190600090565b91906001830160009082825280602052604082205415600014612b6a5784549468010000000000000000861015612b3d5783612b2d612af8886001604098999a01855584612a97565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014612cc2577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91828101818111612c9557825490848201918211612c6857808203612c33575b50505080548015612c0657820191612be98383612a97565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b612c53612c43612af89386612a97565b90549060031b1c92839286612a97565b90558652846020526040862055388080612bd1565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146128a65760010190565b80518210156128f35760209160051b010190565b90815180825260208080930193019160005b828110612d2a575050505090565b835185529381019392810192600101612d1c565b60405190612d4b82612051565b816005548152600654602082015260075467ffffffffffffffff90818116604084015260401c1660608201526080600854910152565b90604051612d8e81612051565b6080600382948054845260018101546020850152600281015467ffffffffffffffff90818116604087015260401c1660608501520154910152565b73ffffffffffffffffffffffffffffffffffffffff1690604051604081019080821067ffffffffffffffff83111761206d57612e49916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af1612e43612f0c565b91612f3c565b805191821591848315612ee8575b505050905015612e645750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b919381809450010312611feb5782015190811515820361077f575080388084612e57565b3d15612f37573d90612f1d8261218b565b91612f2b60405193846120d4565b82523d6000602084013e565b606090565b91929015612fb75750815115612f50575090565b3b15612f595790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b825190915015612fca5750805190602001fd5b610ff2906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260206004840152602483019061279d565b908015918215613026575b50811561301e575090565b905042101590565b4210915038613013565b91908110156128f35760051b0190565b3567ffffffffffffffff811681036120125790565b6040519061306282612051565b60006080838281528260208201528260408201528260608201520152565b91929060009073ffffffffffffffffffffffffffffffffffffffff8316825260209060028252604093848420868552835260ff85852054161597886130cb575b505050505050505090565b909192939597508496989451907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008583019360601b1683526034820152603481526131158161209c565b5190209061312288612115565b9761312f8751998a6120d4565b8089528389019060051b8201913683116131be578490915b8383106131ae57505050509183925b8751841015613199576131698489612cf6565b519081811015613189578552825261318385852093612cc9565b92613156565b9085528252613183858520611100565b945095505050501438808080808080806130c0565b8235815291810191859101613147565b8680fdfea26469706673582212200c951b38aeb19ea68e45ccc53d57fe854abf845aa0d3e3c417ffc2a5e258f8eb64736f6c63430008130033', + FACTORY_DEFAULT_ABI, + '60806040523461002f576100196100146100fa565b610169565b610021610034565b6125d461039782396125d490f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b6101186183af8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b614fa2810181811060018060401b038211176101c5576101a18291614fa261296b843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa261790d85396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610403565b61001e60003561008d565b80631a4b671d146100885780631bce45831461008357806359659e901461007e57806369b3934d14610079578063715018a6146100745780638da5cb5b1461006f5763f2fde38b0361000e576103d0565b61039b565b610368565b61032c565b6102f7565b610215565b6101b4565b60e01c90565b60405190565b600080fd5b600080fd5b90565b6100af816100a3565b036100b657565b600080fd5b905035906100c8826100a6565b565b60018060a01b031690565b6100de906100ca565b90565b6100ea816100d5565b036100f157565b600080fd5b90503590610103826100e1565b565b90565b61011181610105565b0361011857565b600080fd5b9050359061012a82610108565b565b909160c08284031261018c5761014583600084016100bb565b9261015381602085016100f6565b9261016182604083016100f6565b9261018961017284606085016100f6565b9361018081608086016100f6565b9360a00161011d565b90565b61009e565b61019a906100d5565b9052565b91906101b290600060208501940190610191565b565b346101eb576101e76101d66101ca36600461012c565b9493909392919261052f565b6101de610093565b9182918261019e565b0390f35b610099565b9060208282031261020a57610207916000016100f6565b90565b61009e565b60000190565b346102435761022d6102283660046101f0565b61068c565b610235610093565b8061023f8161020f565b0390f35b610099565b600091031261025357565b61009e565b1c90565b60018060a01b031690565b61027790600861027c9302610258565b61025c565b90565b9061028a9154610267565b90565b61029a600160009061027f565b90565b90565b6102b46102af6102b9926100ca565b61029d565b6100ca565b90565b6102c5906102a0565b90565b6102d1906102bc565b90565b6102dd906102c8565b9052565b91906102f5906000602085019401906102d4565b565b3461032757610307366004610248565b61032361031261028d565b61031a610093565b918291826102e1565b0390f35b610099565b346103635761035f61034e61034236600461012c565b949390939291926106fa565b610356610093565b9182918261019e565b0390f35b610099565b3461039657610378366004610248565b61038061087f565b610388610093565b806103928161020f565b0390f35b610099565b346103cb576103ab366004610248565b6103c76103b66108b5565b6103be610093565b9182918261019e565b0390f35b610099565b346103fe576103e86103e33660046101f0565b6109c2565b6103f0610093565b806103fa8161020f565b0390f35b610099565b600080fd5b600090565b610416906100a3565b9052565b61042390610105565b9052565b909594926104739461046261046c9261045860809661044e60a088019c600089019061040d565b6020870190610191565b6040850190610191565b6060830190610191565b019061041a565b565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061049f90610475565b810190811067ffffffffffffffff8211176104b957604052565b61047f565b60200190565b5190565b906104db6104d4610093565b9283610495565b565b67ffffffffffffffff81116104fb576104f7602091610475565b0190565b61047f565b9061051261050d836104dd565b6104c8565b918252565b6105216000610500565b90565b61052c610517565b90565b61056e9291946105909661055f92610545610408565b509395919091610553610093565b96879560208701610427565b60208201810382520382610495565b61058061057a826104c4565b916104be565b209061058a610524565b91610aa1565b90565b6105a49061059f610bba565b6105f9565b565b60001c90565b6105b86105bd916105a6565b61025c565b90565b6105ca90546105ac565b90565b600080fd5b60e01b90565b60009103126105e357565b61009e565b6105f0610093565b3d6000823e3d90fd5b61060b61060660016105c0565b6102c8565b90633659cfe690823b1561068757610643926106386000809461062c610093565b968795869485936105d2565b83526004830161019e565b03925af1801561068257610655575b50565b6106759060003d811161067b575b61066d8183610495565b8101906105d8565b38610652565b503d610663565b6105e8565b6105cd565b61069590610593565b565b6106a0906102a0565b90565b6106ac90610697565b90565b6106b8906102bc565b90565b6106f16106f8946106e76060949897956106dd608086019a6000870190610191565b6020850190610191565b6040830190610191565b019061041a565b565b9061075c9193929361070a610408565b5061073a859161072b86898b9161071f610093565b96879560208701610427565b60208201810382520382610495565b61074c610746826104c4565b916104be565b2090610756610524565b91610cad565b9361076e610769866106a3565b6106af565b906363acc14d93929490823b15610829576000946107aa869261079f94610793610093565b998a98899788966105d2565b8652600486016106bb565b03925af18015610824576107f7575b50806107f17f346f0211197dd599e2e2a8c828f6e7dc39e8a49171ce0a728428e8b778c61eea916107e8610093565b9182918261019e565b0390a190565b6108179060003d811161081d575b61080f8183610495565b8101906105d8565b386107b9565b503d610805565b6105e8565b6105cd565b610836610bba565b61083e61086b565b565b90565b61085761085261085c92610840565b61029d565b6100ca565b90565b61086890610843565b90565b61087d610878600061085f565b610e3c565b565b61088761082e565b565b60018060a01b031690565b6108a06108a5916105a6565b610889565b90565b6108b29054610894565b90565b6108bd610408565b506108c860006108a8565b90565b6108dc906108d7610bba565b610991565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b61094260266040926108de565b61094b816108e7565b0190565b6109659060208101906000818303910152610935565b90565b1561096f57565b610977610093565b62461bcd60e51b81528061098d6004820161094f565b0390fd5b6109c0906109bb816109b46109ae6109a9600061085f565b6100d5565b916100d5565b1415610968565b610e3c565b565b6109cb906108cb565b565b90565b6109dc6109e191610105565b6109cd565b9052565b60601b90565b6109f4906109e5565b90565b610a00906109eb565b90565b610a0f610a14916100d5565b6109f7565b9052565b905090565b60005b838110610a31575050906000910152565b806020918301518185015201610a20565b610a67610a5e92602092610a55816104c4565b94858093610a18565b93849101610a1d565b0190565b60148093610a8f602084610a87610a9796610a9e9b9a986109d0565b018092610a03565b018092610a03565b0190610a42565b90565b610b349291610ade610aed92610ab5610408565b509193610aca610ac560016105c0565b6102c8565b610ad2610093565b95869460208601610a6b565b60208201810382520382610495565b610aff610af9826104c4565b916104be565b2061148a610b0f602082016104c8565b908082526111156020830139610b2d610b27826104c4565b916104be565b2090610ea9565b90565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6b602080926108de565b610b7481610b37565b0190565b610b8e9060208101906000818303910152610b5f565b90565b15610b9857565b610ba0610093565b62461bcd60e51b815280610bb660048201610b78565b0390fd5b610be4610bc56108b5565b610bde610bd8610bd3610eca565b6100d5565b916100d5565b14610b91565b565b610bfa610bf5610bff92610840565b61029d565b6100a3565b90565b610c0b906102a0565b90565b610c1790610c02565b90565b610c23906102a0565b90565b610c2f90610c1a565b90565b610c3b906102bc565b90565b60209181520190565b610c66610c6f602093610c7493610c5d816104c4565b93848093610c3e565b95869101610a1d565b610475565b0190565b610c9d610caa949293610c9360608401956000850190610191565b6020830190610191565b6040818403910152610c47565b90565b610d3d9093929193610cbd610408565b50610cfd8591610cee610cd8610cd360016105c0565b6102c8565b8690610ce2610093565b95869460208601610a6b565b60208201810382520382610495565b610d0f610d09826104c4565b916104be565b2061148a610d1f602082016104c8565b908082526111156020830139610d386000929192610be6565b611062565b92610d57610d52610d4d86610c0e565b610c26565b610c32565b63cf7a1d779190610d70610d6b60016105c0565b6102c8565b9392813b15610de7576000610d9891610da38296610d8c610093565b988997889687956105d2565b855260048501610c78565b03925af18015610de257610db5575b50565b610dd59060003d8111610ddb575b610dcd8183610495565b8101906105d8565b38610db2565b503d610dc3565b6105e8565b6105cd565b60001b90565b90610e0360018060a01b0391610dec565b9181191691161790565b610e16906102bc565b90565b90565b90610e31610e2c610e3892610e0d565b610e19565b8254610df2565b9055565b610e4660006108a8565b610e51826000610e1c565b90610e85610e7f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610e0d565b91610e0d565b91610e8e610093565b80610e988161020f565b0390a3565b610ea6906102bc565b90565b90610ec791610eb6610408565b5090610ec130610e9d565b916110eb565b90565b610ed2610408565b503390565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b610f0c601d6020926108de565b610f1581610ed7565b0190565b610f2f9060208101906000818303910152610eff565b90565b15610f3957565b610f41610093565b62461bcd60e51b815280610f5760048201610f19565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b610f8f602080926108de565b610f9881610f5b565b0190565b610fb29060208101906000818303910152610f83565b90565b15610fbc57565b610fc4610093565b62461bcd60e51b815280610fda60048201610f9c565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61101360196020926108de565b61101c81610fde565b0190565b6110369060208101906000818303910152611006565b90565b1561104057565b611048610093565b62461bcd60e51b81528061105e60048201611020565b0390fd5b91909161106d610408565b5061109461107a30610e9d565b3161108d611087846100a3565b916100a3565b1015610f32565b6110ba6110a0836104c4565b6110b36110ad6000610be6565b916100a3565b1415610fb5565b60208251920190f5906110e9826110e26110dc6110d7600061085f565b6100d5565b916100d5565b1415611039565b565b90605592600b926110fa610408565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a2646970667358221220e4017702d245f60c5abf556451ec1816e94c2280e9885e04b6e2f912ad89e01364736f6c634300081b0033608060405234601c57600e6020565b614f7661002c8239614f7690f35b6026565b60405190565b600080fdfe60a06040526004361015610013575b6112a5565b61001e6000356101ad565b806301ffc9a7146101a85780630869678c146101a35780630bb310de1461019e578063119cd50c14610199578063248a9ca3146101945780632f2ff15d1461018f5780633013ce291461018a57806336568abe1461018557806344004cc1146101805780634782f7791461017b5780634f651ccd1461017657806360e606f61461017157806363acc14d1461016c5780636a326ab1146101675780639010d07c1461016257806391d148541461015d5780639d043a6614610158578063a217fddf14610153578063bad436611461014e578063c81ee65014610149578063ca15c87314610144578063d547741f1461013f578063ed4c2ac71461013a578063f07f04ff146101355763ff81434e0361000e5761126f565b611105565b610f54565b610f20565b610eeb565b610e8e565b610de4565b610d4c565b610cd9565b610c0e565b610bd8565b610b77565b610b40565b610ac6565b6107e9565b61072c565b6106ca565b61065b565b610626565b6105cf565b61056c565b6104d1565b6103f8565b610363565b61023f565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b6101dd816101c8565b036101e457565b600080fd5b905035906101f6826101d4565b565b906020828203126102125761020f916000016101e9565b90565b6101be565b151590565b61022590610217565b9052565b919061023d9060006020850194019061021c565b565b3461026f5761026b61025a6102553660046101f8565b6112af565b6102626101b3565b91829182610229565b0390f35b6101b9565b90565b61028081610274565b0361028757565b600080fd5b9050359061029982610277565b565b906020828203126102b5576102b29160000161028c565b90565b6101be565b6102c390610274565b9052565b67ffffffffffffffff1690565b6102dd906102c7565b9052565b90565b6102ed906102e1565b9052565b9060808061034b9361030b600082015160008601906102ba565b61031d602082015160208601906102ba565b61032f604082015160408601906102d4565b610341606082015160608601906102d4565b01519101906102e4565b565b919061036190600060a085019401906102f1565b565b346103935761038f61037e61037936600461029b565b611509565b6103866101b3565b9182918261034d565b0390f35b6101b9565b60018060a01b031690565b6103ac90610398565b90565b6103b8816103a3565b036103bf57565b600080fd5b905035906103d1826103af565b565b906020828203126103ed576103ea916000016103c4565b90565b6101be565b60000190565b346104265761041061040b3660046103d3565b6115fa565b6104186101b3565b80610422816103f2565b0390f35b6101b9565b600091031261043657565b6101be565b9060c0806104b993610455600082015160008601906102ba565b610467602082015160208601906102ba565b610479604082015160408601906102ba565b61048b606082015160608601906102ba565b61049d608082015160808601906102d4565b6104af60a082015160a08601906102d4565b01519101906102e4565b565b91906104cf90600060e0850194019061043b565b565b34610501576104e136600461042b565b6104fd6104ec61173e565b6104f46101b3565b918291826104bb565b0390f35b6101b9565b61050f816102e1565b0361051657565b600080fd5b9050359061052882610506565b565b90602082820312610544576105419160000161051b565b90565b6101be565b610552906102e1565b9052565b919061056a90600060208501940190610549565b565b3461059c5761059861058761058236600461052a565b61177d565b61058f6101b3565b91829182610556565b0390f35b6101b9565b91906040838203126105ca57806105be6105c7926000860161051b565b936020016103c4565b90565b6101be565b346105fe576105e86105e23660046105a1565b906117c8565b6105f06101b3565b806105fa816103f2565b0390f35b6101b9565b61060c906103a3565b9052565b919061062490600060208501940190610603565b565b346106565761063636600461042b565b610652610641611805565b6106496101b3565b91829182610610565b0390f35b6101b9565b3461068a5761067461066e3660046105a1565b906118ce565b61067c6101b3565b80610686816103f2565b0390f35b6101b9565b90916060828403126106c5576106c26106ab84600085016103c4565b936106b981602086016103c4565b9360400161028c565b90565b6101be565b346106f9576106e36106dd36600461068f565b9161196d565b6106eb6101b3565b806106f5816103f2565b0390f35b6101b9565b9190604083820312610727578061071b61072492600086016103c4565b9360200161028c565b90565b6101be565b3461075b5761074561073f3660046106fe565b90611a50565b61074d6101b3565b80610757816103f2565b0390f35b6101b9565b610769816102c7565b0361077057565b600080fd5b9050359061078282610760565b565b909160c0828403126107e45761079d836000840161028c565b926107ab816020850161028c565b926107b9826040830161028c565b926107e16107ca8460608501610775565b936107d88160808601610775565b9360a00161051b565b90565b6101be565b3461081e576108086107fc366004610784565b94939093929192611e42565b6108106101b3565b8061081a816103f2565b0390f35b6101b9565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061085290610828565b810190811067ffffffffffffffff82111761086c57604052565b610832565b9061088461087d6101b3565b9283610848565b565b67ffffffffffffffff811161089e5760208091020190565b610832565b600080fd5b909291926108bd6108b882610886565b610871565b93818552602080860192028301928184116108fa57915b8383106108e15750505050565b602080916108ef848661028c565b8152019201916108d4565b6108a3565b9080601f8301121561091d5781602061091a933591016108a8565b90565b610823565b600080fd5b67ffffffffffffffff811161094557610941602091610828565b0190565b610832565b90826000939282370152565b9092919261096b61096682610927565b610871565b93818552602085019082840111610987576109859261094a565b565b610922565b9080601f830112156109aa578160206109a793359101610956565b90565b610823565b600080fd5b909182601f830112156109ee5781359167ffffffffffffffff83116109e95760200192602083028401116109e457565b6108a3565b6109af565b610823565b9060e082820312610ac157610a0b81600084016103c4565b92602083013567ffffffffffffffff8111610abc5782610a2c9185016108ff565b92604081013567ffffffffffffffff8111610ab75783610a4d9183016108ff565b92606082013567ffffffffffffffff8111610ab25781610a6e91840161098c565b92610a7c82608085016103c4565b92610a8a8360a0830161028c565b9260c082013567ffffffffffffffff8111610aad57610aa992016109b4565b9091565b6101c3565b6101c3565b6101c3565b6101c3565b6101be565b610ae3610ad43660046109f3565b96959095949194939293612038565b610aeb6101b3565b80610af5816103f2565b0390f35b608081830312610b3b57610b1082600083016103c4565b92610b38610b2184602085016103c4565b93610b2f81604086016103c4565b9360600161051b565b90565b6101be565b34610b7257610b5c610b53366004610af9565b92919091612231565b610b646101b3565b80610b6e816103f2565b0390f35b6101b9565b34610ba557610b8f610b8a3660046103d3565b612301565b610b976101b3565b80610ba1816103f2565b0390f35b6101b9565b9190604083820312610bd35780610bc7610bd0926000860161051b565b9360200161028c565b90565b6101be565b34610c0957610c05610bf4610bee366004610baa565b90612327565b610bfc6101b3565b91829182610610565b0390f35b6101b9565b34610c3f57610c3b610c2a610c243660046105a1565b90612367565b610c326101b3565b91829182610229565b0390f35b6101b9565b600080fd5b908160c0910312610c575790565b610c44565b908160e0910312610c6a5790565b610c44565b91606083830312610cd457610c8782600085016103c4565b92602081013567ffffffffffffffff8111610ccf5783610ca8918301610c49565b92604082013567ffffffffffffffff8111610cca57610cc79201610c5c565b90565b6101c3565b6101c3565b6101be565b34610d0a57610d06610cf5610cef366004610c6f565b9161268b565b610cfd6101b3565b91829182610556565b0390f35b6101b9565b90565b60001b90565b610d2c610d27610d3192610d0f565b610d12565b6102e1565b90565b610d3e6000610d18565b90565b610d49610d34565b90565b34610d7c57610d5c36600461042b565b610d78610d67610d41565b610d6f6101b3565b91829182610556565b0390f35b6101b9565b91608083830312610ddf57610d99826000850161051b565b9260208101359167ffffffffffffffff8311610dda57610dbe84610dd79484016109b4565b939094610dce81604086016103c4565b9360600161051b565b90565b6101c3565b6101be565b34610e1857610e14610e03610dfa366004610d81565b9392909261284e565b610e0b6101b3565b91829182610229565b0390f35b6101b9565b60e081830312610e8957610e34826000830161028c565b92610e42836020840161028c565b92610e50816040850161028c565b92610e5e826060830161028c565b92610e86610e6f8460808501610775565b93610e7d8160a08601610775565b9360c00161051b565b90565b6101be565b34610ec357610ead610ea1366004610e1d565b95949094939193612b95565b610eb56101b3565b80610ebf816103f2565b0390f35b6101b9565b610ed190610274565b9052565b9190610ee990600060208501940190610ec8565b565b34610f1b57610f17610f06610f0136600461052a565b612bab565b610f0e6101b3565b91829182610ed5565b0390f35b6101b9565b34610f4f57610f39610f333660046105a1565b90612bfb565b610f416101b3565b80610f4b816103f2565b0390f35b6101b9565b34610f8257610f6c610f6736600461052a565b612c2f565b610f746101b3565b80610f7e816103f2565b0390f35b6101b9565b909182601f83011215610fc15781359167ffffffffffffffff8311610fbc576020019260208302840111610fb757565b6108a3565b6109af565b610823565b909182601f830112156110005781359167ffffffffffffffff8311610ffb576020019260208302840111610ff657565b6108a3565b6109af565b610823565b909160c08284031261110057600082013567ffffffffffffffff81116110fb5783611031918401610f87565b929093602082013567ffffffffffffffff81116110f65781611054918401610f87565b929093604082013567ffffffffffffffff81116110f15783611077918401610f87565b929093606082013567ffffffffffffffff81116110ec578161109a918401610fc6565b929093608082013567ffffffffffffffff81116110e757836110bd918401610fc6565b92909360a082013567ffffffffffffffff81116110e2576110de92016109b4565b9091565b6101c3565b6101c3565b6101c3565b6101c3565b6101c3565b6101c3565b6101be565b346111435761112d611118366004611005565b9a99909998919897929796939695949561315e565b6111356101b3565b8061113f816103f2565b0390f35b6101b9565b9060208282031261117a57600082013567ffffffffffffffff8111611175576111719201610f87565b9091565b6101c3565b6101be565b5190565b60209181520190565b60200190565b906080806111ec936111ac600082015160008601906102ba565b6111be602082015160208601906102ba565b6111d0604082015160408601906102d4565b6111e2606082015160608601906102d4565b01519101906102e4565b565b906111fb8160a093611192565b0190565b60200190565b9061122261121c6112158461117f565b8093611183565b9261118c565b9060005b8181106112335750505090565b90919261124c61124660019286516111ee565b946111ff565b9101919091611226565b61126c9160208201916000818403910152611205565b90565b346112a05761129c61128b611285366004611148565b90613223565b6112936101b3565b91829182611256565b0390f35b6101b9565b600080fd5b600090565b6112b76112aa565b5063b681391160e01b6112d26112cc836101c8565b916101c8565b1480156112f6575b9081156112e6575b5090565b6112f091506132fb565b386112e2565b50611300816132c1565b6112da565b61130f60a0610871565b90565b600090565b600090565b600090565b611329611305565b9060208080808086611339611312565b815201611344611312565b81520161134f611317565b81520161135a611317565b81520161136561131c565b81525050565b611373611321565b90565b90565b61138d61138861139292610274565b611376565b610274565b90565b9061139f90611379565b600052602052604060002090565b60001c90565b90565b6113c26113c7916113ad565b6113b3565b90565b6113d490546113b6565b90565b906113e190610274565b9052565b67ffffffffffffffff1690565b6113fe611403916113ad565b6113e5565b90565b61141090546113f2565b90565b9061141d906102c7565b9052565b60401c90565b61143361143891611421565b6113e5565b90565b6114459054611427565b90565b90565b61145761145c916113ad565b611448565b90565b611469905461144b565b90565b90611476906102e1565b9052565b906114fb6114f2600361148b611305565b946114a461149b600083016113ca565b600088016113d7565b6114bc6114b3600183016113ca565b602088016113d7565b6114d46114cb60028301611406565b60408801611413565b6114ec6114e36002830161143b565b60608801611413565b0161145f565b6080840161146c565b565b6115069061147a565b90565b6115206115259161151861136b565b50600d611395565b6114fd565b90565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b6115659061156061155b611528565b613329565b6115e5565b565b61157b61157661158092610398565b611376565b610398565b90565b61158c90611567565b90565b61159890611583565b90565b906115ac60018060a01b0391610d12565b9181191691161790565b6115bf90611583565b90565b90565b906115da6115d56115e1926115b6565b6115c2565b825461159b565b9055565b6115f16115f89161158f565b60036115c5565b565b6116039061154c565b565b61160f60e0610871565b90565b61161a611605565b9060208080808080808861162c611312565b815201611637611312565b815201611642611312565b81520161164d611312565b815201611658611317565b815201611663611317565b81520161166e61131c565b81525050565b61167c611612565b90565b906117306117276005611690611605565b946116a96116a0600083016113ca565b600088016113d7565b6116c16116b8600183016113ca565b602088016113d7565b6116d96116d0600283016113ca565b604088016113d7565b6116f16116e8600383016113ca565b606088016113d7565b61170961170060048301611406565b60808801611413565b6117216117186004830161143b565b60a08801611413565b0161145f565b60c0840161146c565b565b61173b9061167f565b90565b611746611674565b506117516007611732565b90565b600090565b611762906102e1565b90565b9061176f90611759565b600052602052604060002090565b600161179661179c9261178e611754565b506000611765565b0161145f565b90565b906117ba916117b56117b08261177d565b613329565b6117bc565b565b906117c69161333d565b565b906117d29161179f565b565b600090565b60018060a01b031690565b6117f06117f5916113ad565b6117d9565b90565b61180290546117e4565b90565b61180d6117d4565b5061181860066117f8565b90565b60209181520190565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b61187f602f60409261181b565b61188881611824565b0190565b6118a29060208101906000818303910152611872565b90565b156118ac57565b6118b46101b3565b62461bcd60e51b8152806118ca6004820161188c565b0390fd5b906118fb916118f6826118f06118ea6118e5613367565b6103a3565b916103a3565b146118a5565b613374565b565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec90565b9061193c92916119376119326118fd565b613329565b611956565b565b61194790611567565b90565b6119539061193e565b90565b9161196361196b9361194a565b9190916133f3565b565b906119789291611921565b565b906119949161198f61198a6118fd565b613329565b6119fe565b565b905090565b6119a760008092611996565b0190565b6119b49061199b565b90565b906119c96119c483610927565b610871565b918252565b606090565b3d6000146119f0576119e43d6119b7565b903d6000602084013e5b565b6119f86119ce565b906119ee565b6000611a2d92819290611a0f6101b3565b9081611a1a816119ab565b03925af1611a266119d3565b5015610217565b611a3357565b6000631d42c86760e21b815280611a4c600482016103f2565b0390fd5b90611a5a9161197a565b565b7f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c290565b90611a9e9594939291611a99611a94611a5c565b613329565b611d0e565b565b611ab4611aaf611ab9926102c7565b611376565b610274565b90565b611ad0611acb611ad592610d0f565b611376565b610274565b90565b611ae260a0610871565b90565b611aef9051610274565b90565b90611aff60001991610d12565b9181191691161790565b90565b90611b21611b1c611b2892611379565b611b09565b8254611af2565b9055565b611b3690516102c7565b90565b90611b4c67ffffffffffffffff91610d12565b9181191691161790565b611b6a611b65611b6f926102c7565b611376565b6102c7565b90565b90565b90611b8a611b85611b9192611b56565b611b72565b8254611b39565b9055565b60401b90565b90611bb66fffffffffffffffff000000000000000091611b95565b9181191691161790565b90611bd5611bd0611bdc92611b56565b611b72565b8254611b9b565b9055565b611bea90516102e1565b90565b611bf6906113ad565b90565b90611c0e611c09611c1592611759565b611bed565b8254611af2565b9055565b90611c9160806003611c9794611c3e60008201611c3860008801611ae5565b90611b0c565b611c5760018201611c5160208801611ae5565b90611b0c565b611c7060028201611c6a60408801611b2c565b90611b75565b611c8960028201611c8360608801611b2c565b90611bc0565b019201611be0565b90611bf9565b565b90611ca391611c19565b565b611cae906102c7565b9052565b9194611cfb611d0592989795611cf160a096611ce7611d0c9a611cdd60c08a019e60008b0190610ec8565b6020890190610ec8565b6040870190610ec8565b6060850190611ca5565b6080830190611ca5565b0190610549565b565b919390929481611d26611d20886102c7565b916102c7565b108015611e27575b611e0a5784611d46611d406000611abc565b91610274565b14611ded57611de892611daf85611d9e88611d958b611d8c8991611d838a95611d7a611d70611ad8565b9960008b016113d7565b602089016113d7565b60408701611413565b60608501611413565b6080830161146c565b611daa600d8490611395565b611c99565b9394959190917f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f9696611ddf6101b3565b96879687611cb2565b0390a1565b60006310ba94e960e31b815280611e06600482016103f2565b0390fd5b60006310ba94e960e31b815280611e23600482016103f2565b0390fd5b5081611e3b611e3542610274565b91611aa0565b1115611d2e565b90611e509594939291611a80565b565b5190565b60081c90565b611e68611e6d91611e56565b6117d9565b90565b611e7a9054611e5c565b90565b611e8690611567565b90565b611e9290611e7d565b90565b611e9e90611567565b90565b611eaa90611e95565b90565b600080fd5b60e01b90565b6000910312611ec357565b6101be565b60209181520190565b60200190565b90611ee4816020936102ba565b0190565b60200190565b90611f0b611f05611efe84611e52565b8093611ec8565b92611ed1565b9060005b818110611f1c5750505090565b909192611f35611f2f6001928651611ed7565b94611ee8565b9101919091611f0f565b5190565b60209181520190565b60005b838110611f60575050906000910152565b806020918301518185015201611f4f565b611f90611f99602093611f9e93611f8781611f3f565b93848093611f43565b95869101611f4c565b610828565b0190565b92611fce611fdc92611fea9694611fc160808801926000890190610603565b8682036020880152611eee565b908482036040860152611eee565b916060818403910152611f71565b90565b611ff56101b3565b3d6000823e3d90fd5b9161203593916120279161201a60608601926000870190610603565b8482036020860152611eee565b916040818403910152611eee565b90565b949293919596909661204988611e52565b61206361205d6120588a611e52565b610274565b91610274565b036121565761207993889388909192939461360d565b61209361208e6120896005611e70565b611e89565b611ea1565b63b48ab8b690839086938690823b15612151576000946120d186926120c6946120ba6101b3565b998a9889978896611eb2565b865260048601611fa2565b03925af1801561214c5761211f575b5091909161211a7f23519238b590c499a2abcf44a33b5f431ac6ca51c22fad26bc2c3d08b97eaa21936121116101b3565b93849384611ffe565b0390a1565b61213f9060003d8111612145575b6121378183610848565b810190611eb8565b386120e0565b503d61212d565b611fed565b611ead565b600063340bc4c960e01b81528061216f600482016103f2565b0390fd5b60ff1690565b61218561218a916113ad565b612173565b90565b6121979054612179565b90565b60081b90565b906121b3610100600160a81b039161219a565b9181191691161790565b6121c690611e95565b90565b90565b906121e16121dc6121e8926121bd565b6121c9565b82546121a0565b9055565b906121f860ff91610d12565b9181191691161790565b61220b90610217565b90565b90565b9061222661222161222d92612202565b61220e565b82546121ec565b9055565b92909261223e600561218d565b61229c5761225061228e9460056121cc565b61226261225b610d34565b829061333d565b61227461226d611a5c565b829061333d565b61228661227f6118fd565b829061333d565b919091613b0e565b61229a60016005612211565b565b600063f92ee8a960e01b8152806122b5600482016103f2565b0390fd5b6122d2906122cd6122c8611a5c565b613329565b6122f4565b565b906122e96122e46122f0926121bd565b6121c9565b825461159b565b9055565b6122ff9060066122d4565b565b61230a906122b9565b565b9061231690611759565b600052602052604060002090565b90565b9061234761234261234c9361233a6117d4565b50600161230c565b612324565b613b5e565b90565b90612359906121bd565b600052602052604060002090565b61238e9160006123836123899361237c6112aa565b5082611765565b0161234f565b61218d565b90565b60018060a01b031690565b6123a86123ad916113ad565b612391565b90565b6123ba905461239c565b90565b6123c690611e95565b90565b905051906123d682610506565b565b906020828203126123f2576123ef916000016123c9565b90565b6101be565b506124069060208101906103c4565b90565b612412906103a3565b9052565b506124259060208101906101e9565b90565b612431906101c8565b9052565b5061244490602081019061051b565b90565b600080fd5b600080fd5b600080fd5b903560016020038236030381121561249757016020813591019167ffffffffffffffff821161249257600182023603831361248d57565b61244c565b612447565b612451565b60209181520190565b91906124bf816124b8816124c49561249c565b809561094a565b610828565b0190565b90356001604003823603038112156124de570190565b612451565b903560016020038236030381121561252457016020813591019167ffffffffffffffff821161251f57600182023603831361251a57565b61244c565b612447565b612451565b60209181520190565b919061254c816125458161255195612529565b809561094a565b610828565b0190565b50612564906020810190610775565b90565b906125a590602061259d6125936040840161258560008801886124e3565b908683036000880152612532565b9482810190612555565b9101906102d4565b90565b6126529161264461263960c083016125d06125c660008701876123f7565b6000860190612409565b6125ea6125e06020870187612416565b6020860190612428565b6126046125fa6040870187612435565b60408601906102e4565b61261e6126146060870187612435565b60608601906102e4565b61262b6080860186612456565b9085830360808701526124a5565b9260a08101906124c8565b9060a0818403910152612567565b90565b93929061268160409161268994612674606089019260008a0190610603565b87820360208901526125a8565b940190610549565b565b9150602090612698611754565b506126ab6126a660036123b0565b6123bd565b6126d7633808a90b9492946126e26126c3600461145f565b6126cb6101b3565b97889687958695611eb2565b855260048501612655565b03915afa908115612727576000916126f9575b5090565b61271a915060203d8111612720575b6127128183610848565b8101906123d8565b386126f5565b503d612708565b611fed565b90612736906121bd565b600052602052604060002090565b9061274e90611759565b600052602052604060002090565b60601b90565b61276b9061275c565b90565b61277790612762565b90565b61278661278b916103a3565b61276e565b9052565b90565b61279e6127a3916102e1565b61278f565b9052565b6014816127ba6127c2936020969561277a565b018092612792565b0190565b60200190565b67ffffffffffffffff81116127e45760208091020190565b610832565b909291926127fe6127f9826127cc565b610871565b938185526020808601920283019281841161283b57915b8383106128225750505050565b60208091612830848661051b565b815201920191612815565b6108a3565b61284b9136916127e9565b90565b909392919261285b6112aa565b5061288361287d6128786128716002879061272c565b8590612744565b61218d565b15610217565b9485612892575b505050505090565b6128e79550906128c96128e293929592946128ba6128ae6101b3565b938492602084016127a7565b60208201810382520382610848565b6128db6128d582611f3f565b916127c6565b2093612840565b613b97565b388080808061288a565b9061291096959493929161290b612906611a5c565b613329565b612a46565b565b61291c60e0610871565b90565b906129c960c060056129cf946129446000820161293e60008801611ae5565b90611b0c565b61295d6001820161295760208801611ae5565b90611b0c565b6129766002820161297060408801611ae5565b90611b0c565b61298f6003820161298960608801611ae5565b90611b0c565b6129a8600482016129a260808801611b2c565b90611b75565b6129c1600482016129bb60a08801611b2c565b90611bc0565b019201611be0565b90611bf9565b565b906129db9161291f565b565b949290979695939160e0860198600087016129f791610ec8565b60208601612a0491610ec8565b60408501612a1191610ec8565b60608401612a1e91610ec8565b60808301612a2b91611ca5565b60a08201612a3891611ca5565b60c001612a4491610549565b565b92959093919480612a5f612a59856102c7565b916102c7565b108015612b7a575b612b5d5786612a7f612a796000611abc565b91610274565b14612b405783612b016000612afa88612af187612ae8888f8f612ad6612b3b9f928f92612acd90612ac4612adf969b91939597999b612abc612912565b9e8f016113d7565b60208d016113d7565b60408b016113d7565b606089016113d7565b60808701611413565b60a08501611413565b60c0830161146c565b60076129d1565b949596929091927f099eb0c4bcb0e32c2243e81b424e1960f39d7ac2fe1598742f19aa8aec203acb97612b326101b3565b978897886129dd565b0390a1565b60006310ba94e960e31b815280612b59600482016103f2565b0390fd5b60006310ba94e960e31b815280612b76600482016103f2565b0390fd5b5080612b8e612b8842610274565b91611aa0565b1115612a67565b90612ba49695949392916128f1565b565b600090565b612bca612bc5612bcf92612bbd612ba6565b50600161230c565b612324565b613bc1565b90565b90612bed91612be8612be38261177d565b613329565b612bef565b565b90612bf991613374565b565b90612c0591612bd2565b565b612c2090612c1b612c16611528565b613329565b612c22565b565b612c2d906004611bf9565b565b612c3890612c07565b565b90612c5e9b9a999897969594939291612c59612c54611a5c565b613329565b612cf7565b565b5090565b5090565b5090565b6001612c789101610274565b90565b634e487b7160e01b600052603260045260246000fd5b9190811015612ca1576020020190565b612c7b565b35612cb081610277565b90565b9190811015612cc3576020020190565b612c7b565b35612cd281610760565b90565b9190811015612ce5576020020190565b612c7b565b35612cf481610506565b90565b909a9599969398949291979a612d0e828290612c60565b612d2a612d24612d1f8c8790612c60565b610274565b91610274565b1415801561312f575b80156130ff575b80156130cf575b80156130a0575b61308357612d54612ba6565b91612d5f6000611abc565b5b80612d7d612d77612d72858790612c60565b610274565b91610274565b101561307357612d97612d9283858491612c91565b612ca6565b9381612dac612da66000611abc565b91610274565b14159081613057575b5061303a57838e8e612dfb612df5612df0612deb8d8f9b612ddd612de2919d89908c91612cb3565b612cc8565b95908991612cb3565b612cc8565b6102c7565b916102c7565b1090811561300a575b50612fed57612e1d612e188e898591612c91565b612ca6565b612e30612e2a6000611abc565b91610274565b14612fd0578d8f918d8f918d8f918d8f918d8f9187828d90612e5192612c91565b612e5a90612ca6565b898d85612e6692612c91565b612e6f90612ca6565b8d8d8d888390612e7e92612cb3565b612e8790612cc8565b90898390612e9492612cb3565b612e9d90612cc8565b918b908b612eaa92612cd5565b612eb390612cea565b92612ebc611ad8565b946000860190612ecb916113d7565b6020850190612ed9916113d7565b6040840190612ee791611413565b6060830190612ef591611413565b6080820190612f039161146c565b600d82612f0f91611395565b90612f1991611c99565b96908b90612f2692612c91565b612f2f90612ca6565b96908a90612f3c92612c91565b612f4590612ca6565b96908990612f5292612cb3565b612f5b90612cc8565b96908890612f6892612cb3565b612f7190612cc8565b91908790612f7e92612cd5565b612f8790612cea565b907f8ced76aee4b96a1e218e7903610fc7d648023d9075677163a5b31396cb280f9695612fb26101b3565b958695612fbf9587611cb2565b0390a1612fcb90612c6c565b612d60565b60006310ba94e960e31b815280612fe9600482016103f2565b0390fd5b60006310ba94e960e31b815280613006600482016103f2565b0390fd5b613020915061301b908b8591612cb3565b612cc8565b61303261302c42610274565b91611aa0565b11158f612e04565b600063340bc4c960e01b815280613053600482016103f2565b0390fd5b905061306b61306586610274565b91610274565b101538612db5565b5050505050505050505050505050565b60006310ba94e960e31b81528061309c600482016103f2565b0390fd5b506130ac828290612c60565b6130c86130c26130bd8b8b90612c68565b610274565b91610274565b1415612d48565b508b6130f86130f26130ed6130e5868690612c60565b938a90612c64565b610274565b91610274565b1415612d41565b508a61312861312261311d613115868690612c60565b938990612c64565b610274565b91610274565b1415612d3a565b5061313b828290612c60565b61315761315161314c8d8890612c60565b610274565b91610274565b1415612d33565b906131729b9a999897969594939291612c3a565b565b606090565b67ffffffffffffffff81116131915760208091020190565b610832565b906131a86131a383613179565b610871565b918252565b6131b5611321565b90565b60005b8281106131c757505050565b6020906131d26131ad565b81840152016131bb565b906132016131e983613196565b926020806131f78693613179565b92019103906131b8565b565b9061320d8261117f565b81101561321e576020809102010190565b612c7b565b61322b613174565b5061323f61323a828490612c60565b6131dc565b9161324a6000611abc565b5b8061326861326261325d868690612c60565b610274565b91610274565b10156132bb576132b6906132af613294600d61328e61328988888791612c91565b612ca6565b90611395565b8661329f84926114fd565b6132a98383613203565b52613203565b5150612c6c565b61324b565b50505090565b6132c96112aa565b50806132de6132d860006101c8565b916101c8565b149081156132eb575b5090565b6132f59150613be1565b386132e7565b6133036112aa565b5061330d81613be1565b908115613319575b5090565b6133239150613c21565b38613315565b61333b90613335613367565b90613da9565b565b9061335f61335a61336493613353818590613e42565b600161230c565b612324565b613f0c565b50565b61336f6117d4565b503390565b9061339661339161339b9361338a818590613f47565b600161230c565b612324565b613fe0565b50565b6133a790611e95565b90565b63ffffffff1690565b6133c76133c26133cc926133aa565b611eb2565b6101c8565b90565b9160206133f19294936133ea60408201966000830190610603565b0190610ec8565b565b9161343760049261342861343c959361340f63a9059cbb6133b3565b926134186101b3565b96879460208601908152016133cf565b60208201810382520383610848565b61418e565b565b9061344882611e52565b811015613459576020809102010190565b612c7b565b91602061348092949361347960408201966000830190610ec8565b0190610ec8565b565b61349661349161349b92610274565b610d12565b6102e1565b90565b634e487b7160e01b600052601160045260246000fd5b6134c36134c991939293610274565b92610274565b916134d5838202610274565b9281840414901517156134e457565b61349e565b6134f86134fe91939293610274565b92610274565b820180921161350957565b61349e565b61351d61352391939293610274565b92610274565b820391821161352e57565b61349e565b61353c90611abc565b9052565b60409061356a613571949695939661356060608401986000850190610603565b6020830190610ec8565b0190613533565b565b60409061359d6135a4949695939661359360608401986000850190610603565b6020830190610ec8565b0190610ec8565b565b6135ba6135b56135bf92610d0f565b611376565b610398565b90565b6135cb906135a6565b90565b6135d790611e95565b90565b60409061360461360b94969593966135fa60608401986000850190610603565b6020830190613533565b0190610ec8565b565b93959190949560805261361e612ba6565b90613627612ba6565b95613630612ba6565b9561363b6007611732565b9461366f61364b60808801611b2c565b61366961366361365d60a08b01611b2c565b92611aa0565b91611aa0565b906141fb565b9360009761367b612ba6565b995b8a61369861369261368d88611e52565b610274565b91610274565b1015613978576136b16136ac868d9061343e565b611ae5565b978b6136c66136c06000611abc565b91610274565b1415908161395c575b5061393f57876136e76136e28d8961343e565b611ae5565b9a6136fc6136f7600d8490611395565b6114fd565b61372f61370b60408301611b2c565b61372961372361371d60608601611b2c565b92611aa0565b91611aa0565b906141fb565b60001461386b57505061374460008b01611ae5565b61375661375083610274565b91610274565b118015613846575b801561383f575b613820575061377760036007016113ca565b6137896137838c610274565b91610274565b106137f35760019b8960400161379e90611ae5565b8b6137a8916134b4565b6137b1916134e9565b99806007600301906137c2826113ca565b906137cc9161350e565b6137d591611b0c565b6137ea916137e4915b906134e9565b9a612c6c565b999a989a61367d565b8961380160036007016113ca565b61381c6000928392639e4c446160e01b84526004840161345e565b0390fd5b61383b9060009182916235acf560e41b835260048301610ed5565b0390fd5b5087613765565b5061385360208b01611ae5565b61386561385f83610274565b91610274565b1061375e565b61387d919e916020829e949e01611ae5565b61388f61388985610274565b91610274565b1061391357918f6138e66137ea95938f6138d96000886138d361390e976138e0956138bf60806137e49e01611be0565b916080516138cd3393613482565b936142f2565b01611ae5565b85906134b4565b906134e9565b9d61390860016138f88593600d611395565b0191613903836113ca565b61350e565b90611b0c565b6137de565b6139206020849201611ae5565b61393b6000928392639e4c446160e01b84526004840161345e565b0390fd5b600063340bc4c960e01b815280613958600482016103f2565b0390fd5b905061397061396a8a610274565b91610274565b1015386136cf565b5097945097509893505050613ae0575b5050816139a66139a061399b60066117f8565b6103a3565b916103a3565b03613ab557806139be6139b885610274565b91610274565b10613a925750806139e06139da6139d560006135c2565b6103a3565b916103a3565b14600014613a2557346139fb6139f584610274565b91610274565b03613a055750505b565b613a21346000938493630f55e7df60e11b855260048501613573565b0390fd5b9034613a3a613a346000611abc565b91610274565b11600014613a6f57613a4c60006135c2565b600090613a6b346000938493630f55e7df60e11b8552600485016135da565b0390fd5b613a7b613a8d9261194a565b9033613a86306135ce565b91926143c5565b613a03565b82613ab18391926000938493630f55e7df60e11b855260048501613573565b0390fd5b82613ac060066117f8565b613adc600080938493630f55e7df60e11b855260048501613540565b0390fd5b613aef60c0613b079301611be0565b90608051903391613b01600019613482565b936142f2565b3880613988565b90613b24613b299392613b1f611528565b61333d565b614414565b565b90565b613b3a613b3f916113ad565b611379565b90565b613b56613b51613b5b92610274565b611376565b610398565b90565b613b8a613b85613b9493613b806000613b8f95613b796117d4565b5001613b2b565b614496565b613b2e565b613b42565b611e95565b90565b613bb1613bbd9293613bb792613bab6112aa565b506144dc565b926102e1565b916102e1565b1490565b613bd96000613bde92613bd2612ba6565b5001613b2b565b614547565b90565b613be96112aa565b5080613c04613bfe635a05180f60e01b6101c8565b916101c8565b14908115613c11575b5090565b613c1b915061455f565b38613c0d565b613c296112aa565b5080613c44613c3e634e821d3360e11b6101c8565b916101c8565b14908115613c51575b5090565b613c5b91506132c1565b38613c4d565b90565b613c78613c73613c7d92613c61565b611376565b610274565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b613cb960178092613c80565b613cc281613c85565b0190565b5190565b613cef613ce692602092613cdd81613cc6565b94858093613c80565b93849101611f4c565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b613d2760118092613c80565b613d3081613cf3565b0190565b613d4e613d599392613d48613d5393613cad565b90613cca565b613d1b565b90613cca565b90565b90565b613d7e613d87602093613d8c93613d7581613cc6565b9384809361181b565b95869101611f4c565b610828565b0190565b613da69160208201916000818403910152613d5f565b90565b90613dbe613db8838390612367565b15610217565b613dc6575050565b613e3e91613e1c613df5613de5613ddf613e21956145f2565b93613b2e565b613def6020613c64565b906147f0565b91613e0d613e016101b3565b93849260208401613d34565b60208201810382520382610848565b613d5c565b613e296101b3565b91829162461bcd60e51b835260048301613d90565b0390fd5b613e56613e50828490612367565b15610217565b613e5f575b5050565b613e816001613e7c6000613e74818690611765565b01859061234f565b612211565b90613e8a613367565b90613ec7613ec1613ebb7f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95611759565b926121bd565b926121bd565b92613ed06101b3565b80613eda816103f2565b0390a43880613e5b565b613eed90611567565b90565b613f04613eff613f0992610398565b611376565b610274565b90565b90613f3f613f39613f34613f2f6000613f4496613f276112aa565b500194613ee4565b613ef0565b613482565b91613b2b565b614a10565b90565b613f52818390612367565b613f5b575b5050565b613f7d6000613f786000613f70818690611765565b01859061234f565b612211565b90613f86613367565b90613fc3613fbd613fb77ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95611759565b926121bd565b926121bd565b92613fcc6101b3565b80613fd6816103f2565b0390a43880613f57565b9061401361400d614008614003600061401896613ffb6112aa565b500194613ee4565b613ef0565b613482565b91613b2b565b614b06565b90565b67ffffffffffffffff811161403957614035602091610828565b0190565b610832565b9061405061404b8361401b565b610871565b918252565b60007f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564910152565b614087602061403e565b9061409460208301614055565b565b61409e61407d565b90565b6140aa81610217565b036140b157565b600080fd5b905051906140c3826140a1565b565b906020828203126140df576140dc916000016140b6565b90565b6101be565b60207f6f74207375636365656400000000000000000000000000000000000000000000917f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201520152565b61413f602a60409261181b565b614148816140e4565b0190565b6141629060208101906000818303910152614132565b90565b1561416c57565b6141746101b3565b62461bcd60e51b81528061418a6004820161414c565b0390fd5b6141d89161419e6141ad9261339e565b906141a7614096565b91614c10565b6141b681611f3f565b6141c96141c36000611abc565b91610274565b149081156141da575b50614165565b565b6141f5915060206141ea82611f3f565b8183010191016140c5565b386141d2565b6142036112aa565b50816142186142126000611abc565b91610274565b1490811561424b575b5090811561422e575b5090565b905061424361423d4292610274565b91610274565b10153861422a565b905061426061425a4292610274565b91610274565b1038614221565b60209181520190565b600080fd5b9037565b90918261428591614267565b9160018060fb1b0381116142a857829160206142a49202938491614275565b0190565b614270565b906142de6142e9916142f0969897956060956142d160808701936000880190610549565b8583036020870152614279565b966040830190610603565b0190610549565b565b92938361431061430a6143056000610d18565b6102e1565b916102e1565b0361431d575b5050505050565b61433561432f8584868991869361284e565b15610217565b614365575050509061435661435b92614351600193600261272c565b612744565b612211565b3880808080614316565b8461438e918593949190916143786101b3565b9586956304cb8cd560e31b8752600487016142ad565b0390fd5b6040906143bc6143c394969593966143b260608401986000850190610603565b6020830190610603565b0190610ec8565b565b61441293916143fe60049461440d93946143e26323b872dd6133b3565b939190916143ee6101b3565b9788956020870190815201614392565b60208201810382520383610848565b61418e565b565b9061442b6144246144329361158f565b60036115c5565b6004611bf9565b565b5490565b600052602060002090565b61444c81614434565b8210156144675761445e600191614438565b91020190600090565b612c7b565b1c90565b614480906008614485930261446c565b611448565b90565b906144939154614470565b90565b6144b59160006144af926144a8611754565b5001614443565b90614488565b90565b5190565b906144c6826144b8565b8110156144d7576020809102010190565b612c7b565b91906144e6611754565b506144f16000611abc565b905b8161450e614508614503876144b8565b610274565b91610274565b10156145405761453461453a9161452e6145298786906144bc565b611be0565b90614c33565b91612c6c565b906144f3565b9192505090565b600061455c91614555612ba6565b5001614434565b90565b6145676112aa565b508061458261457c637965db0b60e01b6101c8565b916101c8565b1490811561458f575b5090565b6145999150614c73565b3861458b565b606090565b90565b60ff1690565b6145c16145bc6145c6926145a4565b611376565b6145a7565b90565b6145d360146145ad565b90565b6145ea6145e56145ef926145a7565b611376565b610274565b90565b61460f61460a6146259261460461459f565b50613ee4565b613ef0565b61461f61461a6145c9565b6145d6565b906147f0565b90565b90565b61463f61463a61464492614628565b611376565b610274565b90565b369037565b90614671614659836119b7565b926020806146678693610927565b9201910390614647565b565b600360fc1b90565b9061468582611f3f565b81101561469757600160209102010190565b612c7b565b600f60fb1b90565b90565b6146bb6146b66146c0926146a4565b611376565b610274565b90565b6146cc90610274565b600081146146db576001900390565b61349e565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b6146ff6146e0565b90565b90565b61471961471461471e92614702565b611376565b610274565b90565b60f81b90565b90565b61473e61473961474392614727565b611376565b6145a7565b90565b6147659061475f61475961476a946145a7565b91610274565b9061446c565b610274565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b6147a16020809261181b565b6147aa8161476d565b0190565b6147c49060208101906000818303910152614795565b90565b156147ce57565b6147d66101b3565b62461bcd60e51b8152806147ec600482016147ae565b0390fd5b91906147fa61459f565b5061489461488461483061482b61481b6002614816879161462b565b6134b4565b614825600261462b565b906134e9565b61464c565b92614839614673565b6148528561484c60009360001a93611abc565b9061467b565b5361485b61469c565b6148748561486e60019360001a936146a7565b9061467b565b5361487f600261462b565b6134b4565b61488e60016146a7565b906134e9565b925b836148aa6148a460016146a7565b91610274565b1115614911576148b86146f7565b816148c3600f614705565b1691601083101561490c576148df61490092614906941a614721565b6148ef8591889060001a9261467b565b536148fa600461472a565b90614746565b936146c3565b92614896565b612c7b565b6149399293506149349061492e6149286000611abc565b91610274565b146147c7565b613d5c565b90565b90565b600052602060002090565b5490565b6149578161494a565b8210156149725761496960019161493f565b91020190600090565b612c7b565b1b90565b9190600861499791029161499160001984614977565b92614977565b9181191691161790565b91906149b76149b26149bf93611759565b611bed565b90835461497b565b9055565b90815491680100000000000000008310156149f357826149eb9160016149f19501815561494e565b906149a1565b565b610832565b90614a0290611759565b600052602052604060002090565b614a186112aa565b50614a2d614a27828490614c99565b15610217565b600014614a7057614a66614a6b92614a51614a4a6000850161493c565b82906149c3565b6001614a5f60008501614434565b93016149f8565b611b0c565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b614a9f91614a99611754565b916149a1565b565b614aaa8161494a565b8015614acb576001900390614ac8614ac2838361494e565b90614a8d565b55565b614a77565b9190614ae6614ae1614aee93611379565b611b09565b90835461497b565b9055565b614b0491614afe612ba6565b91614ad0565b565b614b0e6112aa565b50614b25614b206001830184906149f8565b6113ca565b9081614b3a614b346000611abc565b91610274565b1415600014614c0857614bba926001614bb59284614b63600096614b5d856146a7565b9061350e565b614b80614b71888501614434565b614b7a866146a7565b9061350e565b80614b93614b8d84610274565b91610274565b03614bbf575b505050614baf614baa86830161493c565b614aa1565b016149f8565b614af2565b600190565b614c0092614bf2614bde614bd8614bfb948c8901614443565b90614488565b93614bec85918c8901614443565b906149a1565b918585016149f8565b611b0c565b388080614b99565b505050600090565b90614c309291614c1e6119ce565b5090614c2a6000611abc565b91614d85565b90565b614c3b611754565b5080614c4f614c49846102e1565b916102e1565b10600014614c655790614c6191614ddf565b5b90565b614c6e91614ddf565b614c62565b614c7b6112aa565b50614c95614c8f6301ffc9a760e01b6101c8565b916101c8565b1490565b614cb7916001614cb292614cab6112aa565b50016149f8565b6113ca565b614cca614cc46000611abc565b91610274565b141590565b614cd890611e95565b90565b60207f722063616c6c0000000000000000000000000000000000000000000000000000917f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201520152565b614d36602660409261181b565b614d3f81614cdb565b0190565b614d599060208101906000818303910152614d29565b90565b15614d6357565b614d6b6101b3565b62461bcd60e51b815280614d8160048201614d43565b0390fd5b9160008091614ddc9593614d976119ce565b50614dbe614da430614ccf565b31614db7614db185610274565b91610274565b1015614d5c565b8591602082019151925af191614dd26119d3565b9092909192614e7a565b90565b614de7611754565b50600052602052604060002090565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b614e2b601d60209261181b565b614e3481614df6565b0190565b614e4e9060208101906000818303910152614e1e565b90565b15614e5857565b614e606101b3565b62461bcd60e51b815280614e7660048201614e38565b0390fd5b919290614e856119ce565b50600014614ecb5750614e9782611f3f565b614eaa614ea46000611abc565b91610274565b14614eb4575b5090565b614ec0614ec591614f1f565b614e51565b38614eb0565b8290614ed682611f3f565b614ee9614ee36000611abc565b91610274565b11600014614efa5750805190602001fd5b614f1b90614f066101b3565b91829162461bcd60e51b835260048301613d90565b0390fd5b614f276112aa565b503b614f3c614f366000611abc565b91610274565b119056fea26469706673582212209b133d36303e49007373f2ed22cf983ed518061b7d81d902daa498b0e0d6ef5764736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -178,223 +16,215 @@ export class ERC1155SaleFactory extends ContractFactory { export const ERC1155SALEFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol:ERC1155SaleFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC1155/utility/sale/ERC1155SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\nimport { ERC1155Sale } from "@0xsequence/contracts-library/tokens/ERC1155/utility/sale/ERC1155Sale.sol";\nimport {\n IERC1155SaleFactory,\n IERC1155SaleFactoryFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/utility/sale/IERC1155SaleFactory.sol";\n\n/**\n * Deployer of ERC-1155 Sale proxies.\n */\ncontract ERC1155SaleFactory is IERC1155SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Sale Factory.\n * @param factoryOwner The owner of the ERC-1155 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Sale impl = new ERC1155Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function deploy(address proxyOwner, address tokenOwner, address items) external returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(tokenOwner, items));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Sale(proxyAddr).initialize(tokenOwner, items);\n emit ERC1155SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(tokenOwner, items));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC1155Sale } from "./ERC1155Sale.sol";\nimport { IERC1155SaleFactory, IERC1155SaleFactoryFunctions } from "./IERC1155SaleFactory.sol";\n\n/**\n * Deployer of ERC-1155 Sale proxies.\n */\ncontract ERC1155SaleFactory is IERC1155SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Sale Factory.\n * @param factoryOwner The owner of the ERC-1155 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Sale impl = new ERC1155Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function deploy(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(nonce, tokenOwner, items, implicitModeValidator, implicitModeProjectId));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Sale(proxyAddr).initialize(tokenOwner, items, implicitModeValidator, implicitModeProjectId);\n emit ERC1155SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155SaleFactoryFunctions\n function determineAddress(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(nonce, tokenOwner, items, implicitModeValidator, implicitModeProjectId));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' }, 'src/proxies/SequenceProxyFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ITransparentUpgradeableBeaconProxy,\n TransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";\nimport { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";\nimport { Create2 } from "@openzeppelin/contracts/utils/Create2.sol";\n\n/**\n * An proxy factory that deploys upgradeable beacon proxies.\n * @dev The factory owner is able to upgrade the beacon implementation.\n * @dev Proxy deployers are able to override the beacon reference with their own.\n */\nabstract contract SequenceProxyFactory is Ownable {\n\n UpgradeableBeacon public beacon;\n\n /**\n * Initialize a Sequence Proxy Factory.\n * @param implementation The initial beacon implementation.\n * @param factoryOwner The owner of the factory.\n */\n function _initialize(address implementation, address factoryOwner) internal {\n beacon = new UpgradeableBeacon(implementation);\n Ownable._transferOwnership(factoryOwner);\n }\n\n /**\n * Deploys and initializes a new proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @param _data The initialization data.\n * @return proxyAddress The address of the deployed proxy.\n */\n function _createProxy(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal returns (address proxyAddress) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\n\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\n }\n\n /**\n * Computes the address of a proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @return proxy The expected address of the deployed proxy.\n */\n function _computeProxyAddress(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal view returns (address) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\n\n return Create2.computeAddress(saltedHash, bytecodeHash);\n }\n\n /**\n * Upgrades the beacon implementation.\n * @param implementation The new beacon implementation.\n */\n function upgradeBeacon(\n address implementation\n ) public onlyOwner {\n beacon.upgradeTo(implementation);\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ITransparentUpgradeableBeaconProxy,\n TransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol";\nimport { UpgradeableBeacon } from "openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol";\nimport { Create2 } from "openzeppelin-contracts/contracts/utils/Create2.sol";\n\n/**\n * An proxy factory that deploys upgradeable beacon proxies.\n * @dev The factory owner is able to upgrade the beacon implementation.\n * @dev Proxy deployers are able to override the beacon reference with their own.\n */\nabstract contract SequenceProxyFactory is Ownable {\n\n UpgradeableBeacon public beacon;\n\n /**\n * Initialize a Sequence Proxy Factory.\n * @param implementation The initial beacon implementation.\n * @param factoryOwner The owner of the factory.\n */\n function _initialize(address implementation, address factoryOwner) internal {\n beacon = new UpgradeableBeacon(implementation);\n Ownable._transferOwnership(factoryOwner);\n }\n\n /**\n * Deploys and initializes a new proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @param _data The initialization data.\n * @return proxyAddress The address of the deployed proxy.\n */\n function _createProxy(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal returns (address proxyAddress) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\n\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\n }\n\n /**\n * Computes the address of a proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @return proxy The expected address of the deployed proxy.\n */\n function _computeProxyAddress(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal view returns (address) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\n\n return Create2.computeAddress(saltedHash, bytecodeHash);\n }\n\n /**\n * Upgrades the beacon implementation.\n * @param implementation The new beacon implementation.\n */\n function upgradeBeacon(\n address implementation\n ) public onlyOwner {\n beacon.upgradeTo(implementation);\n }\n\n}\n' }, 'src/tokens/ERC1155/utility/sale/ERC1155Sale.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC1155Supply } from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/ERC1155Supply.sol";\nimport {\n IERC1155Sale,\n IERC1155SaleFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/utility/sale/IERC1155Sale.sol";\n\nimport { MerkleProofSingleUse } from "@0xsequence/contracts-library/tokens/common/MerkleProofSingleUse.sol";\nimport {\n AccessControlEnumerable,\n IERC20,\n SafeERC20,\n WithdrawControlled\n} from "@0xsequence/contracts-library/tokens/common/WithdrawControlled.sol";\n\nimport { IERC1155SupplyFunctions } from\n "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol";\nimport { IERC1155ItemsFunctions } from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/IERC1155Items.sol";\nimport { IERC1155 } from "@0xsequence/erc-1155/contracts/interfaces/IERC1155.sol";\n\ncontract ERC1155Sale is IERC1155Sale, WithdrawControlled, MerkleProofSingleUse {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n\n // ERC20 token address for payment. address(0) indicated payment in ETH.\n address private _paymentToken;\n\n SaleDetails private _globalSaleDetails;\n mapping(uint256 => SaleDetails) private _tokenSaleDetails;\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param items The ERC-1155 Items contract address\n * @dev This should be called immediately after deployment.\n */\n function initialize(address owner, address items) public virtual {\n if (_initialized) {\n revert InvalidInitialization();\n }\n\n _items = items;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(MINT_ADMIN_ROLE, owner);\n _grantRole(WITHDRAW_ROLE, owner);\n\n _initialized = true;\n }\n\n /**\n * Checks if the current block.timestamp is out of the give timestamp range.\n * @param _startTime Earliest acceptable timestamp (inclusive).\n * @param _endTime Latest acceptable timestamp (exclusive).\n * @dev A zero endTime value is always considered out of bounds.\n */\n function _blockTimeOutOfBounds(uint256 _startTime, uint256 _endTime) private view returns (bool) {\n // 0 end time indicates inactive sale.\n return _endTime == 0 || block.timestamp < _startTime || block.timestamp >= _endTime; // solhint-disable-line not-rely-on-time\n }\n\n /**\n * Checks the sale is active and takes payment.\n * @param _tokenIds Token IDs to mint.\n * @param _amounts Amounts of tokens to mint.\n * @param _expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param _maxTotal Maximum amount of payment tokens.\n * @param _proof Merkle proof for allowlist minting.\n */\n function _payForActiveMint(\n uint256[] memory _tokenIds,\n uint256[] memory _amounts,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n uint256 lastTokenId;\n uint256 totalCost;\n uint256 totalAmount;\n\n SaleDetails memory gSaleDetails = _globalSaleDetails;\n bool globalSaleInactive = _blockTimeOutOfBounds(gSaleDetails.startTime, gSaleDetails.endTime);\n bool globalMerkleCheckRequired = false;\n for (uint256 i; i < _tokenIds.length; i++) {\n uint256 tokenId = _tokenIds[i];\n // Test tokenIds ordering\n if (i != 0 && lastTokenId >= tokenId) {\n revert InvalidTokenIds();\n }\n lastTokenId = tokenId;\n\n uint256 amount = _amounts[i];\n\n // Active sale test\n SaleDetails memory saleDetails = _tokenSaleDetails[tokenId];\n bool tokenSaleInactive = _blockTimeOutOfBounds(saleDetails.startTime, saleDetails.endTime);\n if (tokenSaleInactive) {\n // Prefer token sale\n if (globalSaleInactive) {\n // Both sales inactive\n revert SaleInactive(tokenId);\n }\n // Use global sale details\n globalMerkleCheckRequired = true;\n totalCost += gSaleDetails.cost * amount;\n } else {\n // Use token sale details\n requireMerkleProof(saleDetails.merkleRoot, _proof, msg.sender, bytes32(tokenId));\n totalCost += saleDetails.cost * amount;\n }\n totalAmount += amount;\n }\n\n if (globalMerkleCheckRequired) {\n // Check it once outside the loop only when required\n requireMerkleProof(gSaleDetails.merkleRoot, _proof, msg.sender, bytes32(type(uint256).max));\n }\n\n if (_expectedPaymentToken != _paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_paymentToken, totalCost, 0);\n }\n if (_maxTotal < totalCost) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, totalCost, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != totalCost) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, totalCost, msg.value);\n }\n } else if (msg.value > 0) {\n // Paid in ERC20, but sent ETH\n revert InsufficientPayment(address(0), 0, msg.value);\n } else {\n // Paid in ERC20\n SafeERC20.safeTransferFrom(IERC20(_expectedPaymentToken), msg.sender, address(this), totalCost);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev tokenIds must be sorted ascending without duplicates.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data,\n address expectedPaymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n _payForActiveMint(tokenIds, amounts, expectedPaymentToken, maxTotal, proof);\n\n IERC1155SupplyFunctions items = IERC1155SupplyFunctions(_items);\n uint256 totalAmount = 0;\n uint256 nMint = tokenIds.length;\n for (uint256 i = 0; i < nMint; i++) {\n // Update storage balance\n uint256 tokenSupplyCap = _tokenSaleDetails[tokenIds[i]].supplyCap;\n if (tokenSupplyCap > 0 && items.tokenSupply(tokenIds[i]) + amounts[i] > tokenSupplyCap) {\n revert InsufficientSupply(items.tokenSupply(tokenIds[i]), amounts[i], tokenSupplyCap);\n }\n totalAmount += amounts[i];\n }\n uint256 totalSupplyCap = _globalSaleDetails.supplyCap;\n if (totalSupplyCap > 0 && items.totalSupply() + totalAmount > totalSupplyCap) {\n revert InsufficientSupply(items.totalSupply(), totalAmount, totalSupplyCap);\n }\n\n IERC1155ItemsFunctions(_items).batchMint(to, tokenIds, amounts, data);\n emit ItemsMinted(to, tokenIds, amounts);\n }\n\n //\n // Admin\n //\n\n /**\n * Set the payment token.\n * @param paymentTokenAddr The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @dev This should be set before the sale starts.\n */\n function setPaymentToken(\n address paymentTokenAddr\n ) public onlyRole(MINT_ADMIN_ROLE) {\n _paymentToken = paymentTokenAddr;\n }\n\n /**\n * Set the global sale details.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param supplyCap The maximum number of tokens that can be minted.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n */\n function setGlobalSaleDetails(\n uint256 cost,\n uint256 supplyCap,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _globalSaleDetails = SaleDetails(cost, supplyCap, startTime, endTime, merkleRoot);\n emit GlobalSaleDetailsUpdated(cost, supplyCap, startTime, endTime, merkleRoot);\n }\n\n /**\n * Set the sale details for an individual token.\n * @param tokenId The token ID to set the sale details for.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param supplyCap The maximum number of tokens that can be minted.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n */\n function setTokenSaleDetails(\n uint256 tokenId,\n uint256 cost,\n uint256 supplyCap,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] = SaleDetails(cost, supplyCap, startTime, endTime, merkleRoot);\n emit TokenSaleDetailsUpdated(tokenId, cost, supplyCap, startTime, endTime, merkleRoot);\n }\n\n /**\n * Set the sale details for a batch of tokens.\n * @param tokenIds The token IDs to set the sale details for.\n * @param costs The amount of payment tokens to accept for each token minted.\n * @param supplyCaps The maximum number of tokens that can be minted.\n * @param startTimes The start time of the sale. Tokens cannot be minted before this time.\n * @param endTimes The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoots The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n * @dev tokenIds must be sorted ascending without duplicates.\n */\n function setTokenSaleDetailsBatch(\n uint256[] calldata tokenIds,\n uint256[] calldata costs,\n uint256[] calldata supplyCaps,\n uint64[] calldata startTimes,\n uint64[] calldata endTimes,\n bytes32[] calldata merkleRoots\n ) public onlyRole(MINT_ADMIN_ROLE) {\n if (\n tokenIds.length != costs.length || tokenIds.length != supplyCaps.length\n || tokenIds.length != startTimes.length || tokenIds.length != endTimes.length\n || tokenIds.length != merkleRoots.length\n ) {\n revert InvalidSaleDetails();\n }\n\n uint256 lastTokenId;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n uint256 tokenId = tokenIds[i];\n if (i != 0 && lastTokenId >= tokenId) {\n revert InvalidTokenIds();\n }\n lastTokenId = tokenId;\n\n // solhint-disable-next-line not-rely-on-time\n if (endTimes[i] < startTimes[i] || endTimes[i] <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] =\n SaleDetails(costs[i], supplyCaps[i], startTimes[i], endTimes[i], merkleRoots[i]);\n emit TokenSaleDetailsUpdated(tokenId, costs[i], supplyCaps[i], startTimes[i], endTimes[i], merkleRoots[i]);\n }\n }\n\n //\n // Views\n //\n\n /**\n * Get global sales details.\n * @return Sale details.\n * @notice Global sales details apply to all tokens.\n * @notice Global sales details are overriden when token sale is active.\n */\n function globalSaleDetails() external view returns (SaleDetails memory) {\n return _globalSaleDetails;\n }\n\n /**\n * Get token sale details.\n * @param tokenId Token ID to get sale details for.\n * @return Sale details.\n * @notice Token sale details override global sale details.\n */\n function tokenSaleDetails(\n uint256 tokenId\n ) external view returns (SaleDetails memory) {\n return _tokenSaleDetails[tokenId];\n }\n\n /**\n * Get sale details for multiple tokens.\n * @param tokenIds Array of token IDs to retrieve sale details for.\n * @return Array of sale details corresponding to each token ID.\n * @notice Each token\'s sale details override the global sale details if set.\n */\n function tokenSaleDetailsBatch(\n uint256[] calldata tokenIds\n ) external view returns (SaleDetails[] memory) {\n SaleDetails[] memory details = new SaleDetails[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n details[i] = _tokenSaleDetails[tokenIds[i]];\n }\n return details;\n }\n\n /**\n * Get payment token.\n * @return Payment token address.\n * @notice address(0) indicates payment in ETH.\n */\n function paymentToken() external view returns (address) {\n return _paymentToken;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable) returns (bool) {\n return type(IERC1155SaleFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { MerkleProofSingleUse } from "../../../common/MerkleProofSingleUse.sol";\nimport { SignalsImplicitModeControlled } from "../../../common/SignalsImplicitModeControlled.sol";\nimport { AccessControlEnumerable, IERC20, SafeERC20, WithdrawControlled } from "../../../common/WithdrawControlled.sol";\nimport { IERC1155ItemsFunctions } from "../../presets/items/IERC1155Items.sol";\nimport { IERC1155Sale, IERC1155SaleFunctions } from "./IERC1155Sale.sol";\n\ncontract ERC1155Sale is IERC1155Sale, WithdrawControlled, MerkleProofSingleUse, SignalsImplicitModeControlled {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n\n // ERC20 token address for payment. address(0) indicated payment in ETH.\n address private _paymentToken;\n\n GlobalSaleDetails private _globalSaleDetails;\n mapping(uint256 => SaleDetails) private _tokenSaleDetails;\n\n /**\n * Initialize the contract.\n * @param owner Owner address\n * @param items The ERC-1155 Items contract address\n * @param implicitModeValidator Implicit session validator address\n * @param implicitModeProjectId Implicit session project id\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual {\n if (_initialized) {\n revert InvalidInitialization();\n }\n\n _items = items;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(MINT_ADMIN_ROLE, owner);\n _grantRole(WITHDRAW_ROLE, owner);\n\n _initializeImplicitMode(owner, implicitModeValidator, implicitModeProjectId);\n\n _initialized = true;\n }\n\n /**\n * Checks if the current block.timestamp is out of the give timestamp range.\n * @param _startTime Earliest acceptable timestamp (inclusive).\n * @param _endTime Latest acceptable timestamp (exclusive).\n * @dev A zero endTime value is always considered out of bounds.\n */\n function _blockTimeOutOfBounds(uint256 _startTime, uint256 _endTime) private view returns (bool) {\n // 0 end time indicates inactive sale.\n return _endTime == 0 || block.timestamp < _startTime || block.timestamp >= _endTime; // solhint-disable-line not-rely-on-time\n }\n\n /**\n * Checks the sale is active, valid and takes payment.\n * @param _tokenIds Token IDs to mint.\n * @param _amounts Amounts of tokens to mint.\n * @param _expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param _maxTotal Maximum amount of payment tokens.\n * @param _proof Merkle proof for allowlist minting.\n */\n function _validateMint(\n uint256[] memory _tokenIds,\n uint256[] memory _amounts,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n uint256 lastTokenId;\n uint256 totalCost;\n uint256 totalAmount;\n\n GlobalSaleDetails memory gSaleDetails = _globalSaleDetails;\n bool globalSaleInactive = _blockTimeOutOfBounds(gSaleDetails.startTime, gSaleDetails.endTime);\n bool globalMerkleCheckRequired = false;\n for (uint256 i; i < _tokenIds.length; i++) {\n uint256 tokenId = _tokenIds[i];\n // Test tokenIds ordering\n if (i != 0 && lastTokenId >= tokenId) {\n revert InvalidTokenIds();\n }\n lastTokenId = tokenId;\n\n uint256 amount = _amounts[i];\n\n // Active sale test\n SaleDetails memory saleDetails = _tokenSaleDetails[tokenId];\n bool tokenSaleInactive = _blockTimeOutOfBounds(saleDetails.startTime, saleDetails.endTime);\n if (tokenSaleInactive) {\n // Prefer token sale\n if (gSaleDetails.minTokenId > tokenId || gSaleDetails.maxTokenId < tokenId || globalSaleInactive) {\n // Both sales inactive\n revert SaleInactive(tokenId);\n }\n // Use global sale details\n if (_globalSaleDetails.remainingSupply < amount) {\n revert InsufficientSupply(_globalSaleDetails.remainingSupply, amount);\n }\n globalMerkleCheckRequired = true;\n totalCost += gSaleDetails.cost * amount;\n _globalSaleDetails.remainingSupply -= amount;\n } else {\n // Use token sale details\n if (saleDetails.remainingSupply < amount) {\n revert InsufficientSupply(saleDetails.remainingSupply, amount);\n }\n requireMerkleProof(saleDetails.merkleRoot, _proof, msg.sender, bytes32(tokenId));\n totalCost += saleDetails.cost * amount;\n _tokenSaleDetails[tokenId].remainingSupply -= amount;\n }\n totalAmount += amount;\n }\n\n if (globalMerkleCheckRequired) {\n // Check it once outside the loop only when required\n requireMerkleProof(gSaleDetails.merkleRoot, _proof, msg.sender, bytes32(type(uint256).max));\n }\n\n if (_expectedPaymentToken != _paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_paymentToken, totalCost, 0);\n }\n if (_maxTotal < totalCost) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, totalCost, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != totalCost) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, totalCost, msg.value);\n }\n } else if (msg.value > 0) {\n // Paid in ERC20, but sent ETH\n revert InsufficientPayment(address(0), 0, msg.value);\n } else {\n // Paid in ERC20\n SafeERC20.safeTransferFrom(IERC20(_expectedPaymentToken), msg.sender, address(this), totalCost);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev tokenIds must be sorted ascending without duplicates.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data,\n address expectedPaymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n if (tokenIds.length != amounts.length) {\n revert InvalidTokenIds();\n }\n _validateMint(tokenIds, amounts, expectedPaymentToken, maxTotal, proof);\n IERC1155ItemsFunctions(_items).batchMint(to, tokenIds, amounts, data);\n emit ItemsMinted(to, tokenIds, amounts);\n }\n\n //\n // Admin\n //\n\n /**\n * Set the payment token.\n * @param paymentTokenAddr The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @dev This should be set before the sale starts.\n */\n function setPaymentToken(\n address paymentTokenAddr\n ) public onlyRole(MINT_ADMIN_ROLE) {\n _paymentToken = paymentTokenAddr;\n }\n\n /**\n * Set the global sale details.\n * @param minTokenId The minimum token ID to apply the sale to.\n * @param maxTokenId The maximum token ID to apply the sale to.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param remainingSupply The maximum number of tokens that can be minted by the items contract.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n */\n function setGlobalSaleDetails(\n uint256 minTokenId,\n uint256 maxTokenId,\n uint256 cost,\n uint256 remainingSupply,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n if (remainingSupply == 0) {\n revert InvalidSaleDetails();\n }\n _globalSaleDetails =\n GlobalSaleDetails(minTokenId, maxTokenId, cost, remainingSupply, startTime, endTime, merkleRoot);\n emit GlobalSaleDetailsUpdated(minTokenId, maxTokenId, cost, remainingSupply, startTime, endTime, merkleRoot);\n }\n\n /**\n * Set the sale details for an individual token.\n * @param tokenId The token ID to set the sale details for.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param remainingSupply The maximum number of tokens that can be minted by this contract.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n */\n function setTokenSaleDetails(\n uint256 tokenId,\n uint256 cost,\n uint256 remainingSupply,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n if (remainingSupply == 0) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] = SaleDetails(cost, remainingSupply, startTime, endTime, merkleRoot);\n emit TokenSaleDetailsUpdated(tokenId, cost, remainingSupply, startTime, endTime, merkleRoot);\n }\n\n /**\n * Set the sale details for a batch of tokens.\n * @param tokenIds The token IDs to set the sale details for.\n * @param costs The amount of payment tokens to accept for each token minted.\n * @param remainingSupplies The maximum number of tokens that can be minted by this contract.\n * @param startTimes The start time of the sale. Tokens cannot be minted before this time.\n * @param endTimes The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoots The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n * @notice The payment token is set globally.\n * @dev tokenIds must be sorted ascending without duplicates.\n */\n function setTokenSaleDetailsBatch(\n uint256[] calldata tokenIds,\n uint256[] calldata costs,\n uint256[] calldata remainingSupplies,\n uint64[] calldata startTimes,\n uint64[] calldata endTimes,\n bytes32[] calldata merkleRoots\n ) public onlyRole(MINT_ADMIN_ROLE) {\n if (\n tokenIds.length != costs.length || tokenIds.length != remainingSupplies.length\n || tokenIds.length != startTimes.length || tokenIds.length != endTimes.length\n || tokenIds.length != merkleRoots.length\n ) {\n revert InvalidSaleDetails();\n }\n\n uint256 lastTokenId;\n for (uint256 i = 0; i < tokenIds.length; i++) {\n uint256 tokenId = tokenIds[i];\n if (i != 0 && lastTokenId >= tokenId) {\n revert InvalidTokenIds();\n }\n lastTokenId = tokenId;\n\n // solhint-disable-next-line not-rely-on-time\n if (endTimes[i] < startTimes[i] || endTimes[i] <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n if (remainingSupplies[i] == 0) {\n revert InvalidSaleDetails();\n }\n _tokenSaleDetails[tokenId] =\n SaleDetails(costs[i], remainingSupplies[i], startTimes[i], endTimes[i], merkleRoots[i]);\n emit TokenSaleDetailsUpdated(\n tokenId, costs[i], remainingSupplies[i], startTimes[i], endTimes[i], merkleRoots[i]\n );\n }\n }\n\n //\n // Views\n //\n\n /**\n * Get global sales details.\n * @return Sale details.\n * @notice Global sales details apply to all tokens.\n * @notice Global sales details are overriden when token sale is active.\n */\n function globalSaleDetails() external view returns (GlobalSaleDetails memory) {\n return _globalSaleDetails;\n }\n\n /**\n * Get token sale details.\n * @param tokenId Token ID to get sale details for.\n * @return Sale details.\n * @notice Token sale details override global sale details.\n */\n function tokenSaleDetails(\n uint256 tokenId\n ) external view returns (SaleDetails memory) {\n return _tokenSaleDetails[tokenId];\n }\n\n /**\n * Get sale details for multiple tokens.\n * @param tokenIds Array of token IDs to retrieve sale details for.\n * @return Array of sale details corresponding to each token ID.\n * @notice Each token\'s sale details override the global sale details if set.\n */\n function tokenSaleDetailsBatch(\n uint256[] calldata tokenIds\n ) external view returns (SaleDetails[] memory) {\n SaleDetails[] memory details = new SaleDetails[](tokenIds.length);\n for (uint256 i = 0; i < tokenIds.length; i++) {\n details[i] = _tokenSaleDetails[tokenIds[i]];\n }\n return details;\n }\n\n /**\n * Get payment token.\n * @return Payment token address.\n * @notice address(0) indicates payment in ETH.\n */\n function paymentToken() external view returns (address) {\n return _paymentToken;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(WithdrawControlled, SignalsImplicitModeControlled) returns (bool) {\n return type(IERC1155SaleFunctions).interfaceId == interfaceId\n || WithdrawControlled.supportsInterface(interfaceId)\n || SignalsImplicitModeControlled.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC1155/utility/sale/IERC1155SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Sale proxy contract\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-1155 Items contract.\n */\n function deploy(address proxyOwner, address tokenOwner, address items) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactory is IERC1155SaleFactoryFunctions, IERC1155SaleFactorySignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Sale proxy contract\n * @param nonce Nonce for randomizing the deployment address.\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-1155 Items contract.\n */\n function deploy(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param nonce Nonce for randomizing the deployment address.\n * @param proxyOwner The owner of the ERC-1155 Sale proxy\n * @param tokenOwner The owner of the ERC-1155 Sale implementation\n * @param items The ERC-1155 Items contract address\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-1155 Sale Proxy\n */\n function determineAddress(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155SaleFactory is IERC1155SaleFactoryFunctions, IERC1155SaleFactorySignals { }\n' }, 'src/proxies/TransparentUpgradeableBeaconProxy.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { BeaconProxy, Proxy } from "./openzeppelin/BeaconProxy.sol";\nimport { ERC1967Proxy, TransparentUpgradeableProxy } from "./openzeppelin/TransparentUpgradeableProxy.sol";\n\ninterface ITransparentUpgradeableBeaconProxy {\n\n function initialize(address admin, address beacon, bytes memory data) external;\n\n}\n\nerror InvalidInitialization();\n\n/**\n * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation,\n * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors.\n * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * The proxy selectors are:\n * - 0xcf7a1d77: initialize\n * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy)\n * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy)\n * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy)\n * - 0xf851a440: admin (from TransparentUpgradeableProxy)\n * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy)\n */\ncontract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy {\n\n /**\n * Decode the initialization data from the msg.data and call the initialize function.\n */\n function _dispatchInitialize() private returns (bytes memory) {\n _requireZeroValue();\n\n (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes));\n initialize(admin, beacon, data);\n\n return "";\n }\n\n function initialize(address admin, address beacon, bytes memory data) internal {\n if (_admin() != address(0)) {\n // Redundant call. This function can only be called when the admin is not set.\n revert InvalidInitialization();\n }\n _changeAdmin(admin);\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev If the admin is not set, the fallback function is used to initialize the proxy.\n * @dev If the admin is set, the fallback function is used to delegatecall the implementation.\n */\n function _fallback() internal override(TransparentUpgradeableProxy, Proxy) {\n if (_getAdmin() == address(0)) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) {\n ret = _dispatchInitialize();\n // solhint-disable-next-line no-inline-assembly\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n }\n // When the admin is not set, the fallback function is used to initialize the proxy.\n revert InvalidInitialization();\n }\n TransparentUpgradeableProxy._fallback();\n }\n\n /**\n * Returns the current implementation address.\n * @dev This is the implementation address set by the admin, or the beacon implementation.\n */\n function _implementation() internal view override(ERC1967Proxy, BeaconProxy) returns (address) {\n address implementation = ERC1967Proxy._implementation();\n if (implementation != address(0)) {\n return implementation;\n }\n return BeaconProxy._implementation();\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/access/Ownable.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/Context.sol";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), "Ownable: caller is not the owner");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), "Ownable: new owner is the zero address");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IBeacon.sol";\nimport "../../access/Ownable.sol";\nimport "../../utils/Address.sol";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");\n _implementation = newImplementation;\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/Create2.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as \'counterfactual interactions\'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n require(address(this).balance >= amount, "Create2: insufficient balance");\n require(bytecode.length != 0, "Create2: bytecode length is zero");\n /// @solidity memory-safe-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), "Create2: Failed on deploy");\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract\'s address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := keccak256(start, 85)\n }\n }\n}\n' }, - 'src/tokens/ERC1155/extensions/supply/ERC1155Supply.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n IERC1155Supply,\n IERC1155SupplyFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/extensions/supply/IERC1155Supply.sol";\nimport { ERC1155 } from "@0xsequence/erc-1155/contracts/tokens/ERC1155/ERC1155.sol";\n\n/**\n * An ERC-1155 extension that tracks token supply.\n */\nabstract contract ERC1155Supply is ERC1155, IERC1155Supply {\n\n // Current supply\n uint256 public totalSupply;\n mapping(uint256 => uint256) public tokenSupply;\n\n /**\n * Mint _amount of tokens of a given id\n * @param _to The address to mint tokens to\n * @param _id Token id to mint\n * @param _amount The amount to be minted\n * @param _data Data to pass if receiver is contract\n */\n function _mint(address _to, uint256 _id, uint256 _amount, bytes memory _data) internal virtual {\n totalSupply += _amount;\n tokenSupply[_id] += _amount;\n balances[_to][_id] += _amount;\n\n emit TransferSingle(msg.sender, address(0x0), _to, _id, _amount);\n\n _callonERC1155Received(address(0x0), _to, _id, _amount, gasleft(), _data);\n }\n\n /**\n * Mint tokens for each ids in _ids\n * @param _to The address to mint tokens to\n * @param _ids Array of ids to mint\n * @param _amounts Array of amount of tokens to mint per id\n * @param _data Data to pass if receiver is contract\n */\n function _batchMint(\n address _to,\n uint256[] memory _ids,\n uint256[] memory _amounts,\n bytes memory _data\n ) internal virtual {\n uint256 nMint = _ids.length;\n if (nMint != _amounts.length) {\n revert InvalidArrayLength();\n }\n\n // Executing all minting\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < nMint; i++) {\n // Update storage balance\n balances[_to][_ids[i]] += _amounts[i];\n tokenSupply[_ids[i]] += _amounts[i];\n totalAmount += _amounts[i];\n }\n totalSupply += totalAmount;\n\n emit TransferBatch(msg.sender, address(0x0), _to, _ids, _amounts);\n\n // Calling onReceive method if recipient is contract\n _callonERC1155BatchReceived(address(0x0), _to, _ids, _amounts, gasleft(), _data);\n }\n\n /**\n * Burn _amount of tokens of a given token id\n * @param _from The address to burn tokens from\n * @param _id Token id to burn\n * @param _amount The amount to be burned\n */\n function _burn(address _from, uint256 _id, uint256 _amount) internal virtual {\n // Supply\n totalSupply -= _amount;\n tokenSupply[_id] -= _amount;\n\n // Balances\n balances[_from][_id] -= _amount;\n\n // Emit event\n emit TransferSingle(msg.sender, _from, address(0x0), _id, _amount);\n }\n\n /**\n * Burn tokens of given token id for each (_ids[i], _amounts[i]) pair\n * @param _from The address to burn tokens from\n * @param _ids Array of token ids to burn\n * @param _amounts Array of the amount to be burned\n */\n function _batchBurn(address _from, uint256[] memory _ids, uint256[] memory _amounts) internal virtual {\n uint256 nBurn = _ids.length;\n if (nBurn != _amounts.length) {\n revert InvalidArrayLength();\n }\n\n uint256 totalAmount = 0;\n for (uint256 i = 0; i < nBurn; i++) {\n // Update balances\n balances[_from][_ids[i]] -= _amounts[i];\n tokenSupply[_ids[i]] -= _amounts[i];\n totalAmount += _amounts[i];\n }\n totalSupply -= totalAmount;\n\n // Emit batch mint event\n emit TransferBatch(msg.sender, _from, address(0x0), _ids, _amounts);\n }\n\n //\n // Views\n //\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(ERC1155) returns (bool) {\n return type(IERC1155SupplyFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' - }, - 'src/tokens/ERC1155/utility/sale/IERC1155Sale.sol': { - content: - "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFunctions {\n\n struct SaleDetails {\n uint256 cost;\n uint256 supplyCap; // 0 supply cap indicates unlimited supply\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Get global sales details.\n * @return Sale details.\n * @notice Global sales details apply to all tokens.\n * @notice Global sales details are overriden when token sale is active.\n */\n function globalSaleDetails() external view returns (SaleDetails memory);\n\n /**\n * Get token sale details.\n * @param tokenId Token ID to get sale details for.\n * @return Sale details.\n * @notice Token sale details override global sale details.\n */\n function tokenSaleDetails(\n uint256 tokenId\n ) external view returns (SaleDetails memory);\n\n /**\n * Get sale details for multiple tokens.\n * @param tokenIds Array of token IDs to retrieve sale details for.\n * @return Array of sale details corresponding to each token ID.\n * @notice Each token's sale details override the global sale details if set.\n */\n function tokenSaleDetailsBatch(\n uint256[] calldata tokenIds\n ) external view returns (SaleDetails[] memory);\n\n /**\n * Get payment token.\n * @return Payment token address.\n * @notice address(0) indicates payment in ETH.\n */\n function paymentToken() external view returns (address);\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev tokenIds must be sorted ascending without duplicates.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) external payable;\n\n}\n\ninterface IERC1155SaleSignals {\n\n event GlobalSaleDetailsUpdated(\n uint256 cost, uint256 supplyCap, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event TokenSaleDetailsUpdated(\n uint256 tokenId, uint256 cost, uint256 supplyCap, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256[] tokenIds, uint256[] amounts);\n\n /**\n * Contract already initialized.\n */\n error InvalidInitialization();\n\n /**\n * Sale details supplied are invalid.\n */\n error InvalidSaleDetails();\n\n /**\n * Sale is not active globally.\n */\n error GlobalSaleInactive();\n\n /**\n * Sale is not active.\n * @param tokenId Invalid Token ID.\n */\n error SaleInactive(uint256 tokenId);\n\n /**\n * Insufficient tokens for payment.\n * @param currency Currency address. address(0) indicates ETH.\n * @param expected Expected amount of tokens.\n * @param actual Actual amount of tokens.\n */\n error InsufficientPayment(address currency, uint256 expected, uint256 actual);\n\n /**\n * Invalid token IDs.\n */\n error InvalidTokenIds();\n\n /**\n * Insufficient supply of tokens.\n */\n error InsufficientSupply(uint256 currentSupply, uint256 requestedAmount, uint256 maxSupply);\n\n}\n\ninterface IERC1155Sale is IERC1155SaleFunctions, IERC1155SaleSignals { }\n" - }, 'src/tokens/common/MerkleProofSingleUse.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IMerkleProofSingleUse } from "@0xsequence/contracts-library/tokens/common/IMerkleProofSingleUse.sol";\nimport { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";\n\n/**\n * Require single use merkle proofs per address.\n */\nabstract contract MerkleProofSingleUse is IMerkleProofSingleUse {\n\n // Stores proofs used by an address\n mapping(address => mapping(bytes32 => bool)) private _proofUsed;\n\n /**\n * Requires the given merkle proof to be valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @notice Fails when the proof is invalid or the proof has already been claimed by this address.\n * @dev This function reverts on failure.\n */\n function requireMerkleProof(bytes32 root, bytes32[] calldata proof, address addr, bytes32 salt) internal {\n if (root != bytes32(0)) {\n if (!checkMerkleProof(root, proof, addr, salt)) {\n revert MerkleProofInvalid(root, proof, addr, salt);\n }\n _proofUsed[addr][root] = true;\n }\n }\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) public view returns (bool) {\n return !_proofUsed[addr][root] && MerkleProof.verify(proof, root, keccak256(abi.encodePacked(addr, salt)));\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IMerkleProofSingleUse } from "./IMerkleProofSingleUse.sol";\n\nimport { MerkleProof } from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol";\n\n/**\n * Require single use merkle proofs per address.\n */\nabstract contract MerkleProofSingleUse is IMerkleProofSingleUse {\n\n // Stores proofs used by an address\n mapping(address => mapping(bytes32 => bool)) private _proofUsed;\n\n /**\n * Requires the given merkle proof to be valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @notice Fails when the proof is invalid or the proof has already been claimed by this address.\n * @dev This function reverts on failure.\n */\n function requireMerkleProof(bytes32 root, bytes32[] calldata proof, address addr, bytes32 salt) internal {\n if (root != bytes32(0)) {\n if (!checkMerkleProof(root, proof, addr, salt)) {\n revert MerkleProofInvalid(root, proof, addr, salt);\n }\n _proofUsed[addr][root] = true;\n }\n }\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) public view returns (bool) {\n return !_proofUsed[addr][root] && MerkleProof.verify(proof, root, keccak256(abi.encodePacked(addr, salt)));\n }\n\n}\n' }, - 'src/tokens/common/WithdrawControlled.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IWithdrawControlled } from "@0xsequence/contracts-library/tokens/common/IWithdrawControlled.sol";\n\nimport { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";\nimport { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";\n\n/**\n * An abstract contract that allows ETH and ERC20 tokens stored in the contract to be withdrawn.\n */\nabstract contract WithdrawControlled is AccessControlEnumerable, IWithdrawControlled {\n\n bytes32 internal constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");\n\n //\n // Withdraw\n //\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawERC20(address token, address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n SafeERC20.safeTransfer(IERC20(token), to, value);\n }\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawETH(address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n (bool success,) = to.call{ value: value }("");\n if (!success) {\n revert WithdrawFailed();\n }\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { AccessControlEnumerable } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport {\n IERC165,\n IImplicitProjectValidation,\n SignalsImplicitMode\n} from "signals-implicit-mode/src/helper/SignalsImplicitMode.sol";\n\n/**\n * An abstract contract that allows implicit session access for a given project.\n */\nabstract contract SignalsImplicitModeControlled is AccessControlEnumerable, SignalsImplicitMode {\n\n bytes32 internal constant _IMPLICIT_MODE_ADMIN_ROLE = keccak256("IMPLICIT_MODE_ADMIN_ROLE");\n\n function _initializeImplicitMode(address owner, address validator, bytes32 projectId) internal {\n _grantRole(_IMPLICIT_MODE_ADMIN_ROLE, owner);\n _initializeSignalsImplicitMode(validator, projectId);\n }\n\n /**\n * Updates the validator for implicit mode validation.\n * @param validator The validator address.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeValidator(\n address validator\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _validator = IImplicitProjectValidation(validator);\n }\n\n /**\n * Updates the settings for implicit mode validation.\n * @param projectId The project id.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeProjectId(\n bytes32 projectId\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _projectId = projectId;\n }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable, SignalsImplicitMode) returns (bool) {\n return\n AccessControlEnumerable.supportsInterface(interfaceId) || SignalsImplicitMode.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'src/tokens/ERC1155/extensions/supply/IERC1155Supply.sol': { + 'src/tokens/common/WithdrawControlled.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SupplyFunctions {\n\n /**\n * Returns the total supply of ERC1155 tokens.\n */\n function totalSupply() external returns (uint256);\n\n /**\n * Returns the total supply of a given ERC1155 token.\n * @param tokenId The ERC1155 token id.\n */\n function tokenSupply(\n uint256 tokenId\n ) external returns (uint256);\n\n}\n\ninterface IERC1155SupplySignals {\n\n /**\n * Invalid array input length.\n */\n error InvalidArrayLength();\n\n}\n\ninterface IERC1155Supply is IERC1155SupplySignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IWithdrawControlled } from "./IWithdrawControlled.sol";\n\nimport { AccessControlEnumerable, ERC165 } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport { IERC20, SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";\n\n/**\n * An abstract contract that allows ETH and ERC20 tokens stored in the contract to be withdrawn.\n */\nabstract contract WithdrawControlled is AccessControlEnumerable, IWithdrawControlled {\n\n bytes32 internal constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");\n\n //\n // Withdraw\n //\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawERC20(address token, address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n SafeERC20.safeTransfer(IERC20(token), to, value);\n }\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawETH(address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n (bool success,) = to.call{ value: value }("");\n if (!success) {\n revert WithdrawFailed();\n }\n }\n\n /// @inheritdoc ERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable) returns (bool) {\n return interfaceId == type(IWithdrawControlled).interfaceId\n || AccessControlEnumerable.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC1155/presets/items/IERC1155Items.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenId Token ID to mint.\n * @param amount Amount of tokens to mint.\n * @param data Data to pass if receiver is contract.\n */\n function mint(address to, uint256 tokenId, uint256 amount, bytes memory data) external;\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n */\n function batchMint(address to, uint256[] memory tokenIds, uint256[] memory amounts, bytes memory data) external;\n\n}\n\ninterface IERC1155ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC1155Items is IERC1155ItemsFunctions, IERC1155ItemsSignals { }\n' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC1155.sol': { + 'src/tokens/ERC1155/utility/sale/IERC1155Sale.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\nimport \'./IERC165.sol\';\n\n\ninterface IERC1155 is IERC165 {\n\n /****************************************|\n | Events |\n |_______________________________________*/\n\n /**\n * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning\n * Operator MUST be msg.sender\n * When minting/creating tokens, the `_from` field MUST be set to `0x0`\n * When burning/destroying tokens, the `_to` field MUST be set to `0x0`\n * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID\n * To broadcast the existence of a token ID with no initial balance, the contract SHOULD emit the TransferSingle event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0\n */\n event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _amount);\n\n /**\n * @dev Either TransferSingle or TransferBatch MUST emit when tokens are transferred, including zero amount transfers as well as minting or burning\n * Operator MUST be msg.sender\n * When minting/creating tokens, the `_from` field MUST be set to `0x0`\n * When burning/destroying tokens, the `_to` field MUST be set to `0x0`\n * The total amount transferred from address 0x0 minus the total amount transferred to 0x0 may be used by clients and exchanges to be added to the "circulating supply" for a given token ID\n * To broadcast the existence of multiple token IDs with no initial balance, this SHOULD emit the TransferBatch event from `0x0` to `0x0`, with the token creator as `_operator`, and a `_amount` of 0\n */\n event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _amounts);\n\n /**\n * @dev MUST emit when an approval is updated\n */\n event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);\n\n\n /****************************************|\n | Functions |\n |_______________________________________*/\n\n /**\n * @notice Transfers amount of an _id from the _from address to the _to address specified\n * @dev MUST emit TransferSingle event on success\n * Caller must be approved to manage the _from account\'s tokens (see isApprovedForAll)\n * MUST throw if `_to` is the zero address\n * MUST throw if balance of sender for token `_id` is lower than the `_amount` sent\n * MUST throw on any other error\n * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155Received` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes calldata _data) external;\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @dev MUST emit TransferBatch event on success\n * Caller must be approved to manage the _from account\'s tokens (see isApprovedForAll)\n * MUST throw if `_to` is the zero address\n * MUST throw if length of `_ids` is not the same as length of `_amounts`\n * MUST throw if any of the balance of sender for token `_ids` is lower than the respective `_amounts` sent\n * MUST throw on any other error\n * When transfer is complete, this function MUST check if `_to` is a smart contract (code size > 0). If so, it MUST call `onERC1155BatchReceived` on `_to` and revert if the return amount is not `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`\n * Transfers and events MUST occur in the array order they were submitted (_ids[0] before _ids[1], etc)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external;\n\n /**\n * @notice Get the balance of an account\'s Tokens\n * @param _owner The address of the token holder\n * @param _id ID of the Token\n * @return The _owner\'s balance of the Token type requested\n */\n function balanceOf(address _owner, uint256 _id) external view returns (uint256);\n\n /**\n * @notice Get the balance of multiple account/token pairs\n * @param _owners The addresses of the token holders\n * @param _ids ID of the Tokens\n * @return The _owner\'s balance of the Token types requested (i.e. balance for each (owner, id) pair)\n */\n function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);\n\n /**\n * @notice Enable or disable approval for a third party ("operator") to manage all of caller\'s tokens\n * @dev MUST emit the ApprovalForAll event on success\n * @param _operator Address to add to the set of authorized operators\n * @param _approved True if the operator is approved, false to revoke approval\n */\n function setApprovalForAll(address _operator, bool _approved) external;\n\n /**\n * @notice Queries the approval status of an operator for a given owner\n * @param _owner The owner of the Tokens\n * @param _operator Address of authorized operator\n * @return isOperator True if the operator is approved, false if not\n */\n function isApprovedForAll(address _owner, address _operator) external view returns (bool isOperator);\n}\n' + "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SaleFunctions {\n\n struct GlobalSaleDetails {\n uint256 minTokenId;\n uint256 maxTokenId;\n uint256 cost;\n uint256 remainingSupply;\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n struct SaleDetails {\n uint256 cost;\n uint256 remainingSupply;\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Get global sales details.\n * @return Sale details.\n * @notice Global sales details apply to all tokens.\n * @notice Global sales details are overriden when token sale is active.\n */\n function globalSaleDetails() external view returns (GlobalSaleDetails memory);\n\n /**\n * Get token sale details.\n * @param tokenId Token ID to get sale details for.\n * @return Sale details.\n * @notice Token sale details override global sale details.\n */\n function tokenSaleDetails(\n uint256 tokenId\n ) external view returns (SaleDetails memory);\n\n /**\n * Get sale details for multiple tokens.\n * @param tokenIds Array of token IDs to retrieve sale details for.\n * @return Array of sale details corresponding to each token ID.\n * @notice Each token's sale details override the global sale details if set.\n */\n function tokenSaleDetailsBatch(\n uint256[] calldata tokenIds\n ) external view returns (SaleDetails[] memory);\n\n /**\n * Get payment token.\n * @return Payment token address.\n * @notice address(0) indicates payment in ETH.\n */\n function paymentToken() external view returns (address);\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenIds Token IDs to mint.\n * @param amounts Amounts of tokens to mint.\n * @param data Data to pass if receiver is contract.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev tokenIds must be sorted ascending without duplicates.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256[] memory tokenIds,\n uint256[] memory amounts,\n bytes memory data,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) external payable;\n\n}\n\ninterface IERC1155SaleSignals {\n\n event GlobalSaleDetailsUpdated(\n uint256 minTokenId,\n uint256 maxTokenId,\n uint256 cost,\n uint256 remainingSupply,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n );\n event TokenSaleDetailsUpdated(\n uint256 tokenId, uint256 cost, uint256 remainingSupply, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256[] tokenIds, uint256[] amounts);\n\n /**\n * Contract already initialized.\n */\n error InvalidInitialization();\n\n /**\n * Sale details supplied are invalid.\n */\n error InvalidSaleDetails();\n\n /**\n * Sale is not active globally.\n */\n error GlobalSaleInactive();\n\n /**\n * Sale is not active.\n * @param tokenId Invalid Token ID.\n */\n error SaleInactive(uint256 tokenId);\n\n /**\n * Insufficient tokens for payment.\n * @param currency Currency address. address(0) indicates ETH.\n * @param expected Expected amount of tokens.\n * @param actual Actual amount of tokens.\n */\n error InsufficientPayment(address currency, uint256 expected, uint256 actual);\n\n /**\n * Invalid token IDs.\n */\n error InvalidTokenIds();\n\n /**\n * Insufficient supply of tokens.\n * @param remainingSupply Remaining supply.\n * @param amount Amount to mint.\n */\n error InsufficientSupply(uint256 remainingSupply, uint256 amount);\n\n}\n\ninterface IERC1155Sale is IERC1155SaleFunctions, IERC1155SaleSignals { }\n" }, 'src/proxies/openzeppelin/BeaconProxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\nimport "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\nimport "openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' }, 'src/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\n/// @notice This implementation is a copy of OpenZeppelin\'s with the following changes:\n/// - Pragma updated\n/// - Imports updated\n/// - Constructor removed\n/// - Allows admin to call implementation\n\npragma solidity ^0.8.19;\n\nimport "./ERC1967Proxy.sol";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(\n address\n ) external;\n\n function upgradeTo(\n address\n ) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * Unlike the original OpenZeppelin implementation, this contract does not prevent the admin from calling the implementation.\n * This potentially exposes the admin to a proxy selector attack. See\n * https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * When using this contract, you must ensure that the implementation function selectors do not clash with the proxy selectors.\n * The proxy selectors are:\n * - 0x3659cfe6: upgradeTo\n * - 0x4f1ef286: upgradeToAndCall\n * - 0x8f283970: changeAdmin\n * - 0xf851a440: admin\n * - 0x5c60da1b: implementation\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n // Call implementation\n return super._fallback();\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(""), false);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return "";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() internal {\n require(msg.value == 0);\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/utils/Context.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Context.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/IBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n' }, - 'lib/openzeppelin/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Address.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn\'t rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity\'s `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, "Address: insufficient balance");\n\n (bool success, ) = recipient.call{value: amount}("");\n require(success, "Address: unable to send value, recipient may have reverted");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, "Address: low-level call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, "Address: low-level call with value failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, "Address: insufficient balance for call");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, "Address: low-level static call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, "Address: low-level delegate call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), "Address: call to non-contract");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn\'t, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/tokens/ERC1155/ERC1155.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\nimport "../../interfaces/IERC1155TokenReceiver.sol";\nimport "../../interfaces/IERC1155.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/ERC165.sol";\n\n/**\n * @dev Implementation of Multi-Token Standard contract\n */\ncontract ERC1155 is IERC1155, ERC165 {\n using Address for address;\n\n /***********************************|\n | Variables and Events |\n |__________________________________*/\n\n // onReceive function signatures\n bytes4 constant internal ERC1155_RECEIVED_VALUE = 0xf23a6e61;\n bytes4 constant internal ERC1155_BATCH_RECEIVED_VALUE = 0xbc197c81;\n\n // Objects balances\n mapping (address => mapping(uint256 => uint256)) internal balances;\n\n // Operator Functions\n mapping (address => mapping(address => bool)) internal operators;\n\n\n /***********************************|\n | Public Transfer Functions |\n |__________________________________*/\n\n /**\n * @notice Transfers amount amount of an _id from the _from address to the _to address specified\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount, bytes memory _data)\n public virtual override\n {\n require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeTransferFrom: INVALID_OPERATOR");\n require(_to != address(0),"ERC1155#safeTransferFrom: INVALID_RECIPIENT");\n\n _safeTransferFrom(_from, _to, _id, _amount);\n _callonERC1155Received(_from, _to, _id, _amount, gasleft(), _data);\n }\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n * @param _data Additional data with no specified format, sent in call to `_to`\n */\n function safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, bytes memory _data)\n public virtual override\n {\n // Requirements\n require((msg.sender == _from) || isApprovedForAll(_from, msg.sender), "ERC1155#safeBatchTransferFrom: INVALID_OPERATOR");\n require(_to != address(0), "ERC1155#safeBatchTransferFrom: INVALID_RECIPIENT");\n\n _safeBatchTransferFrom(_from, _to, _ids, _amounts);\n _callonERC1155BatchReceived(_from, _to, _ids, _amounts, gasleft(), _data);\n }\n\n\n /***********************************|\n | Internal Transfer Functions |\n |__________________________________*/\n\n /**\n * @notice Transfers amount amount of an _id from the _from address to the _to address specified\n * @param _from Source address\n * @param _to Target address\n * @param _id ID of the token type\n * @param _amount Transfered amount\n */\n function _safeTransferFrom(address _from, address _to, uint256 _id, uint256 _amount)\n internal virtual\n {\n // Update balances\n balances[_from][_id] -= _amount;\n balances[_to][_id] += _amount;\n\n // Emit event\n emit TransferSingle(msg.sender, _from, _to, _id, _amount);\n }\n\n /**\n * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155Received(...)\n */\n function _callonERC1155Received(address _from, address _to, uint256 _id, uint256 _amount, uint256 _gasLimit, bytes memory _data)\n internal virtual\n {\n // Check if recipient is contract\n if (_to.isContract()) {\n bytes4 retval = IERC1155TokenReceiver(_to).onERC1155Received{gas: _gasLimit}(msg.sender, _from, _id, _amount, _data);\n require(retval == ERC1155_RECEIVED_VALUE, "ERC1155#_callonERC1155Received: INVALID_ON_RECEIVE_MESSAGE");\n }\n }\n\n /**\n * @notice Send multiple types of Tokens from the _from address to the _to address (with safety call)\n * @param _from Source addresses\n * @param _to Target addresses\n * @param _ids IDs of each token type\n * @param _amounts Transfer amounts per token type\n */\n function _safeBatchTransferFrom(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts)\n internal virtual\n {\n require(_ids.length == _amounts.length, "ERC1155#_safeBatchTransferFrom: INVALID_ARRAYS_LENGTH");\n\n // Number of transfer to execute\n uint256 nTransfer = _ids.length;\n\n // Executing all transfers\n for (uint256 i = 0; i < nTransfer; i++) {\n // Update storage balance of previous bin\n balances[_from][_ids[i]] -= _amounts[i];\n balances[_to][_ids[i]] += _amounts[i];\n }\n\n // Emit event\n emit TransferBatch(msg.sender, _from, _to, _ids, _amounts);\n }\n\n /**\n * @notice Verifies if receiver is contract and if so, calls (_to).onERC1155BatchReceived(...)\n */\n function _callonERC1155BatchReceived(address _from, address _to, uint256[] memory _ids, uint256[] memory _amounts, uint256 _gasLimit, bytes memory _data)\n internal virtual\n {\n // Pass data if recipient is contract\n if (_to.isContract()) {\n bytes4 retval = IERC1155TokenReceiver(_to).onERC1155BatchReceived{gas: _gasLimit}(msg.sender, _from, _ids, _amounts, _data);\n require(retval == ERC1155_BATCH_RECEIVED_VALUE, "ERC1155#_callonERC1155BatchReceived: INVALID_ON_RECEIVE_MESSAGE");\n }\n }\n\n\n /***********************************|\n | Operator Functions |\n |__________________________________*/\n\n /**\n * @notice Enable or disable approval for a third party ("operator") to manage all of caller\'s tokens\n * @param _operator Address to add to the set of authorized operators\n * @param _approved True if the operator is approved, false to revoke approval\n */\n function setApprovalForAll(address _operator, bool _approved)\n external virtual override\n {\n // Update operator status\n operators[msg.sender][_operator] = _approved;\n emit ApprovalForAll(msg.sender, _operator, _approved);\n }\n\n /**\n * @notice Queries the approval status of an operator for a given owner\n * @param _owner The owner of the Tokens\n * @param _operator Address of authorized operator\n * @return isOperator True if the operator is approved, false if not\n */\n function isApprovedForAll(address _owner, address _operator)\n public view virtual override returns (bool isOperator)\n {\n return operators[_owner][_operator];\n }\n\n\n /***********************************|\n | Balance Functions |\n |__________________________________*/\n\n /**\n * @notice Get the balance of an account\'s Tokens\n * @param _owner The address of the token holder\n * @param _id ID of the Token\n * @return The _owner\'s balance of the Token type requested\n */\n function balanceOf(address _owner, uint256 _id)\n public view virtual override returns (uint256)\n {\n return balances[_owner][_id];\n }\n\n /**\n * @notice Get the balance of multiple account/token pairs\n * @param _owners The addresses of the token holders\n * @param _ids ID of the Tokens\n * @return The _owner\'s balance of the Token types requested (i.e. balance for each (owner, id) pair)\n */\n function balanceOfBatch(address[] memory _owners, uint256[] memory _ids)\n public view virtual override returns (uint256[] memory)\n {\n require(_owners.length == _ids.length, "ERC1155#balanceOfBatch: INVALID_ARRAY_LENGTH");\n\n // Variables\n uint256[] memory batchBalances = new uint256[](_owners.length);\n\n // Iterate over each owner and token ID\n for (uint256 i = 0; i < _owners.length; i++) {\n batchBalances[i] = balances[_owners[i]][_ids[i]];\n }\n\n return batchBalances;\n }\n\n\n /***********************************|\n | ERC165 Functions |\n |__________________________________*/\n\n /**\n * @notice Query if a contract implements an interface\n * @param _interfaceID The interface identifier, as specified in ERC-165\n * @return `true` if the contract implements `_interfaceID` and\n */\n function supportsInterface(bytes4 _interfaceID) public view virtual override(ERC165, IERC165) returns (bool) {\n if (_interfaceID == type(IERC1155).interfaceId) {\n return true;\n }\n return super.supportsInterface(_interfaceID);\n }\n}\n' - }, 'src/tokens/common/IMerkleProofSingleUse.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IMerkleProofSingleUseFunctions {\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) external view returns (bool);\n\n}\n\ninterface IMerkleProofSingleUseSignals {\n\n /**\n * Thrown when the merkle proof is invalid or has already been used.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n */\n error MerkleProofInvalid(bytes32 root, bytes32[] proof, address addr, bytes32 salt);\n\n}\n\ninterface IMerkleProofSingleUse is IMerkleProofSingleUseFunctions, IMerkleProofSingleUseSignals { }\n' }, - 'lib/openzeppelin/contracts/utils/cryptography/MerkleProof.sol': { + 'lib/openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.2) (utils/cryptography/MerkleProof.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev These functions deal with verification of Merkle Tree proofs.\n *\n * The tree and the proofs can be generated using our\n * https://github.com/OpenZeppelin/merkle-tree[JavaScript library].\n * You will find a quickstart guide in the readme.\n *\n * WARNING: You should avoid using leaf values that are 64 bytes long prior to\n * hashing, or use a hash function other than keccak256 for hashing leaves.\n * This is because the concatenation of a sorted pair of internal nodes in\n * the merkle tree could be reinterpreted as a leaf value.\n * OpenZeppelin\'s JavaScript library generates merkle trees that are safe\n * against this attack out of the box.\n */\nlibrary MerkleProof {\n /**\n * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree\n * defined by `root`. For this, a `proof` must be provided, containing\n * sibling hashes on the branch from the leaf to the root of the tree. Each\n * pair of leaves and each pair of pre-images are assumed to be sorted.\n */\n function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProof(proof, leaf) == root;\n }\n\n /**\n * @dev Calldata version of {verify}\n *\n * _Available since v4.7._\n */\n function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {\n return processProofCalldata(proof, leaf) == root;\n }\n\n /**\n * @dev Returns the rebuilt hash obtained by traversing a Merkle tree up\n * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt\n * hash matches the root of the tree. When processing the proof, the pairs\n * of leafs & pre-images are assumed to be sorted.\n *\n * _Available since v4.4._\n */\n function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Calldata version of {processProof}\n *\n * _Available since v4.7._\n */\n function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) {\n bytes32 computedHash = leaf;\n for (uint256 i = 0; i < proof.length; i++) {\n computedHash = _hashPair(computedHash, proof[i]);\n }\n return computedHash;\n }\n\n /**\n * @dev Returns true if the `leaves` can be simultaneously proven to be a part of a merkle tree defined by\n * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerify(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProof(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Calldata version of {multiProofVerify}\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function multiProofVerifyCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32 root,\n bytes32[] memory leaves\n ) internal pure returns (bool) {\n return processMultiProofCalldata(proof, proofFlags, leaves) == root;\n }\n\n /**\n * @dev Returns the root of a tree reconstructed from `leaves` and sibling nodes in `proof`. The reconstruction\n * proceeds by incrementally reconstructing all inner nodes by combining a leaf/inner node with either another\n * leaf/inner node or a proof sibling node, depending on whether each `proofFlags` item is true or false\n * respectively.\n *\n * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree\n * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the\n * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer).\n *\n * _Available since v4.7._\n */\n function processMultiProof(\n bytes32[] memory proof,\n bool[] memory proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");\n\n // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue\'s "pop".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, "MerkleProof: invalid multiproof");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n /**\n * @dev Calldata version of {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");\n\n // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue\'s "pop".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, "MerkleProof: invalid multiproof");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n' }, - 'src/tokens/common/IWithdrawControlled.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IWithdrawControlledFunctions {\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawERC20(address token, address to, uint256 value) external;\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawETH(address to, uint256 value) external;\n\n}\n\ninterface IWithdrawControlledSignals {\n\n /**\n * Withdraw failed error.\n */\n error WithdrawFailed();\n\n}\n\ninterface IWithdrawControlled is IWithdrawControlledFunctions, IWithdrawControlledSignals { }\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControlEnumerable.sol";\nimport "./AccessControl.sol";\nimport "../utils/structs/EnumerableSet.sol";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n}\n' }, - 'lib/openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControlEnumerable.sol";\nimport "./AccessControl.sol";\nimport "../utils/structs/EnumerableSet.sol";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.13;\n\nimport { IImplicitProjectValidation } from "../registry/IImplicitProjectValidation.sol";\n\nimport { ERC165, IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol";\nimport { Attestation } from "sequence-v3/src/extensions/sessions/implicit/Attestation.sol";\nimport { ISignalsImplicitMode } from "sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol";\nimport { Payload } from "sequence-v3/src/modules/Payload.sol";\n\n/// @title SignalsImplicitMode\n/// @author Michael Standen\n/// @notice Base contract for implicit mode validation by project\nabstract contract SignalsImplicitMode is ISignalsImplicitMode, ERC165 {\n\n IImplicitProjectValidation internal _validator;\n bytes32 internal _projectId;\n\n /// @notice Initialize implicit mode validation\n /// @param validator The IImplicitProjectValidation address\n /// @param projectId The project id\n function _initializeSignalsImplicitMode(address validator, bytes32 projectId) internal {\n _validator = IImplicitProjectValidation(validator);\n _projectId = projectId;\n }\n\n /// @inheritdoc ISignalsImplicitMode\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32) {\n _validateImplicitRequest(wallet, attestation, call);\n return _validator.validateAttestation(wallet, attestation, _projectId);\n }\n\n /// @notice Validates an implicit request\n /// @dev Optional hook for additional validation of the implicit requests\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n function _validateImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) internal view virtual { }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return interfaceId == type(ISignalsImplicitMode).interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol': { + 'src/tokens/common/IWithdrawControlled.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\nimport "../extensions/IERC20Permit.sol";\nimport "../../../utils/Address.sol";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \'safeIncreaseAllowance\' and \'safeDecreaseAllowance\'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n "SafeERC20: approve from non-zero to non-zero allowance"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract\'s allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IWithdrawControlledFunctions {\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawERC20(address token, address to, uint256 value) external;\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawETH(address to, uint256 value) external;\n\n}\n\ninterface IWithdrawControlledSignals {\n\n /**\n * Withdraw failed error.\n */\n error WithdrawFailed();\n\n}\n\ninterface IWithdrawControlled is IWithdrawControlledFunctions, IWithdrawControlledSignals { }\n' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n\n/**\n * @title ERC165\n * @dev https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md\n */\ninterface IERC165 {\n\n /**\n * @notice Query if a contract implements an interface\n * @dev Interface identification is specified in ERC-165. This function\n * uses less than 30,000 gas\n * @param _interfaceId The interface identifier, as specified in ERC-165\n */\n function supportsInterface(bytes4 _interfaceId)\n external\n view\n returns (bool);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\nimport "../extensions/IERC20Permit.sol";\nimport "../../../utils/Address.sol";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \'safeIncreaseAllowance\' and \'safeDecreaseAllowance\'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n "SafeERC20: approve from non-zero to non-zero allowance"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract\'s allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport "../beacon/IBeacon.sol";\nimport "../../interfaces/IERC1967.sol";\nimport "../../interfaces/draft-IERC1822.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/StorageSlot.sol";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");\n } catch {\n revert("ERC1967Upgrade: new implementation is not UUPS");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), "ERC1967: new admin is the zero address");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256(\'eip1967.proxy.beacon\')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n "ERC1967: beacon implementation is not a contract"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" }, 'src/proxies/openzeppelin/ERC1967Proxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/interfaces/IERC1155TokenReceiver.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1155 interface for accepting safe transfers.\n */\ninterface IERC1155TokenReceiver {\n\n /**\n * @notice Handle the receipt of a single ERC1155 token type\n * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeTransferFrom` after the balance has been updated\n * This function MAY throw to revert and reject the transfer\n * Return of other amount than the magic value MUST result in the transaction being reverted\n * Note: The token contract address is always the message sender\n * @param _operator The address which called the `safeTransferFrom` function\n * @param _from The address which previously owned the token\n * @param _id The id of the token being transferred\n * @param _amount The amount of tokens being transferred\n * @param _data Additional data with no specified format\n * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`\n */\n function onERC1155Received(address _operator, address _from, uint256 _id, uint256 _amount, bytes calldata _data) external returns(bytes4);\n\n /**\n * @notice Handle the receipt of multiple ERC1155 token types\n * @dev An ERC1155-compliant smart contract MUST call this function on the token recipient contract, at the end of a `safeBatchTransferFrom` after the balances have been updated\n * This function MAY throw to revert and reject the transfer\n * Return of other amount than the magic value WILL result in the transaction being reverted\n * Note: The token contract address is always the message sender\n * @param _operator The address which called the `safeBatchTransferFrom` function\n * @param _from The address which previously owned the token\n * @param _ids An array containing ids of each token being transferred\n * @param _amounts An array containing amounts of each token being transferred\n * @param _data Additional data with no specified format\n * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`\n */\n function onERC1155BatchReceived(address _operator, address _from, uint256[] calldata _ids, uint256[] calldata _amounts, bytes calldata _data) external returns(bytes4);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.sol': { content: - 'pragma solidity ^0.8.0;\n\n/**\n * Utility library of inline functions on addresses\n */\nlibrary Address {\n\n // Default hash for EOA accounts returned by extcodehash\n bytes32 constant internal ACCOUNT_HASH = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;\n\n /**\n * Returns whether the target address is a contract\n * @dev This function will return false if invoked during the constructor of a contract.\n * @param _address address of the account to check\n * @return Whether the target address is a contract\n */\n function isContract(address _address) internal view returns (bool) {\n bytes32 codehash;\n\n // Currently there is no better way to check if there is a contract in an address\n // than to check the size of the code at that address or if it has a non-zero code hash or account hash\n assembly { codehash := extcodehash(_address) }\n return (codehash != 0x0 && codehash != ACCOUNT_HASH);\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\nimport "../utils/Context.sol";\nimport "../utils/Strings.sol";\nimport "../utils/introspection/ERC165.sol";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn\'t allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role\'s admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n "AccessControl: account ",\n Strings.toHexString(account),\n " is missing role ",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role\'s admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function\'s\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), "AccessControl: can only renounce roles for self");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn\'t perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``\'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n' }, - 'lib/0xsequence/erc-1155/src/contracts/utils/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol': { content: - 'pragma solidity ^0.8.0;\nimport "../interfaces/IERC165.sol";\n\nabstract contract ERC165 is IERC165 {\n /**\n * @notice Query if a contract implements an interface\n * @param _interfaceID The interface identifier, as specified in ERC-165\n * @return `true` if the contract implements `_interfaceID`\n */\n function supportsInterface(bytes4 _interfaceID) public view virtual override returns (bool) {\n return _interfaceID == this.supportsInterface.selector;\n }\n}\n' + "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" }, - 'lib/openzeppelin/contracts/access/IAccessControlEnumerable.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.13;\n\nimport { Attestation } from "sequence-v3/src/extensions/sessions/implicit/Attestation.sol";\n\n/// @title IImplicitProjectValidation\n/// @author Michael Standen\n/// @notice Interface for contracts supporting validation of implicit sessions for projects\ninterface IImplicitProjectValidation {\n\n /// @notice Invalid redirect url error\n error InvalidRedirectUrl();\n\n /// @notice Check if a project has a code\n /// @param wallet The wallet address\n /// @param attestation The attestation\n /// @param projectId The project id\n /// @return magic The attestation magic bytes for the wallet address\n function validateAttestation(\n address wallet,\n Attestation calldata attestation,\n bytes32 projectId\n ) external view returns (bytes32);\n\n}\n' }, - 'lib/openzeppelin/contracts/access/AccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\nimport "../utils/Context.sol";\nimport "../utils/Strings.sol";\nimport "../utils/introspection/ERC165.sol";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn\'t allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role\'s admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n "AccessControl: account ",\n Strings.toHexString(account),\n " is missing role ",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role\'s admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function\'s\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), "AccessControl: can only renounce roles for self");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn\'t perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``\'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.sol': { content: - "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../../../utils/LibBytes.sol";\nimport { ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX } from "./ISignalsImplicitMode.sol";\n\nusing LibBytes for bytes;\n\n/// @notice Attestation for a specific session\n/// @param approvedSigner Address of the approved signer\n/// @param identityType Identity type\n/// @param issuerHash Hash of the issuer\n/// @param audienceHash Hash of the audience\n/// @param applicationData Unspecified application data\n/// @param authData Auth data\nstruct Attestation {\n address approvedSigner;\n bytes4 identityType;\n bytes32 issuerHash;\n bytes32 audienceHash;\n bytes applicationData;\n AuthData authData;\n}\n\n/// @notice Auth data for an attestation\n/// @param redirectUrl Authorization redirect URL\n/// @param issuedAt Timestamp of the attestation issuance\nstruct AuthData {\n string redirectUrl;\n uint64 issuedAt;\n}\n\n/// @title LibAttestation\n/// @author Michael Standen\n/// @notice Library for attestation management\nlibrary LibAttestation {\n\n /// @notice Hashes an attestation\n function toHash(\n Attestation memory attestation\n ) internal pure returns (bytes32) {\n return keccak256(toPacked(attestation));\n }\n\n /// @notice Decodes an attestation from a packed bytes array\n /// @param encoded The packed bytes array\n /// @param pointer The pointer to the start of the attestation\n /// @return attestation The decoded attestation\n /// @return newPointer The new pointer to the end of the attestation\n function fromPacked(\n bytes calldata encoded,\n uint256 pointer\n ) internal pure returns (Attestation memory attestation, uint256 newPointer) {\n newPointer = pointer;\n (attestation.approvedSigner, newPointer) = encoded.readAddress(newPointer);\n (attestation.identityType, newPointer) = encoded.readBytes4(newPointer);\n (attestation.issuerHash, newPointer) = encoded.readBytes32(newPointer);\n (attestation.audienceHash, newPointer) = encoded.readBytes32(newPointer);\n // Application data (arbitrary bytes)\n uint256 dataSize;\n (dataSize, newPointer) = encoded.readUint24(newPointer);\n attestation.applicationData = encoded[newPointer:newPointer + dataSize];\n newPointer += dataSize;\n // Auth data\n (attestation.authData, newPointer) = fromPackedAuthData(encoded, newPointer);\n return (attestation, newPointer);\n }\n\n /// @notice Decodes the auth data from a packed bytes\n /// @param encoded The packed bytes containing the auth data\n /// @param pointer The pointer to the start of the auth data within the encoded data\n /// @return authData The decoded auth data\n /// @return newPointer The pointer to the end of the auth data within the encoded data\n function fromPackedAuthData(\n bytes calldata encoded,\n uint256 pointer\n ) internal pure returns (AuthData memory authData, uint256 newPointer) {\n uint24 redirectUrlLength;\n (redirectUrlLength, pointer) = encoded.readUint24(pointer);\n authData.redirectUrl = string(encoded[pointer:pointer + redirectUrlLength]);\n pointer += redirectUrlLength;\n (authData.issuedAt, pointer) = encoded.readUint64(pointer);\n return (authData, pointer);\n }\n\n /// @notice Encodes an attestation into a packed bytes array\n /// @param attestation The attestation to encode\n /// @return encoded The packed bytes array\n function toPacked(\n Attestation memory attestation\n ) internal pure returns (bytes memory encoded) {\n return abi.encodePacked(\n attestation.approvedSigner,\n attestation.identityType,\n attestation.issuerHash,\n attestation.audienceHash,\n uint24(attestation.applicationData.length),\n attestation.applicationData,\n toPackAuthData(attestation.authData)\n );\n }\n\n /// @notice Encodes the auth data into a packed bytes array\n /// @param authData The auth data to encode\n /// @return encoded The packed bytes array\n function toPackAuthData(\n AuthData memory authData\n ) internal pure returns (bytes memory encoded) {\n return abi.encodePacked(uint24(bytes(authData.redirectUrl).length), bytes(authData.redirectUrl), authData.issuedAt);\n }\n\n /// @notice Generates the implicit request magic return value\n /// @param attestation The attestation\n /// @param wallet The wallet\n /// @return magic The expected implicit request magic\n function generateImplicitRequestMagic(Attestation memory attestation, address wallet) internal pure returns (bytes32) {\n return keccak256(\n abi.encodePacked(ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX, wallet, attestation.audienceHash, attestation.issuerHash)\n );\n }\n\n}\n' + }, + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { Payload } from "../../../modules/Payload.sol";\nimport { Attestation } from "./Attestation.sol";\n\n/// @dev Magic prefix for the implicit request\nbytes32 constant ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX = keccak256(abi.encodePacked("acceptImplicitRequest"));\n\n/// @title ISignalsImplicitMode\n/// @author Agustin Aguilar, Michael Standen\n/// @notice Interface for the contracts that support implicit mode validation\ninterface ISignalsImplicitMode {\n\n /// @notice Determines if an implicit request is valid\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n /// @return magic The hash of the implicit request if valid\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32 magic);\n\n}\n' }, - 'lib/openzeppelin/contracts/token/ERC20/IERC20.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../utils/LibBytes.sol";\n\nusing LibBytes for bytes;\n\n/// @title Payload\n/// @author Agustin Aguilar, Michael Standen, William Hua\n/// @notice Library for encoding and decoding payloads\nlibrary Payload {\n\n /// @notice Error thrown when the kind is invalid\n error InvalidKind(uint8 kind);\n\n /// @dev keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")\n bytes32 private constant EIP712_DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n /// @dev keccak256("Sequence Wallet")\n bytes32 private constant EIP712_DOMAIN_NAME_SEQUENCE =\n 0x4aa45ca7ad825ceb1bf35643f0a58c295239df563b1b565c2485f96477c56318;\n\n /// @dev keccak256("3")\n bytes32 private constant EIP712_DOMAIN_VERSION_SEQUENCE =\n 0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de;\n\n function domainSeparator(bool _noChainId, address _wallet) internal view returns (bytes32 _domainSeparator) {\n return keccak256(\n abi.encode(\n EIP712_DOMAIN_TYPEHASH,\n EIP712_DOMAIN_NAME_SEQUENCE,\n EIP712_DOMAIN_VERSION_SEQUENCE,\n _noChainId ? uint256(0) : uint256(block.chainid),\n _wallet\n )\n );\n }\n\n /// @dev keccak256("Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALL_TYPEHASH = 0x0603985259a953da1f65a522f589c17bd1d0117ec1d3abb7c0788aef251ef437;\n\n /// @dev keccak256("Calls(Call[] calls,uint256 space,uint256 nonce,address[] wallets)Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALLS_TYPEHASH = 0x11e1e4079a79a66e4ade50033cfe2678cdd5341d2dfe5ef9513edb1a0be147a2;\n\n /// @dev keccak256("Message(bytes message,address[] wallets)")\n bytes32 private constant MESSAGE_TYPEHASH = 0xe19a3b94fc3c7ece3f890d98a99bc422615537a08dea0603fa8425867d87d466;\n\n /// @dev keccak256("ConfigUpdate(bytes32 imageHash,address[] wallets)")\n bytes32 private constant CONFIG_UPDATE_TYPEHASH = 0x11fdeb7e8373a1aa96bfac8d0ea91526b2c5d15e5cee20e0543e780258f3e8e4;\n\n /// @notice Kind of transaction\n uint8 public constant KIND_TRANSACTIONS = 0x00;\n /// @notice Kind of digest\n uint8 public constant KIND_MESSAGE = 0x01;\n /// @notice Kind of config update\n uint8 public constant KIND_CONFIG_UPDATE = 0x02;\n /// @notice Kind of message\n uint8 public constant KIND_DIGEST = 0x03;\n\n /// @notice Behavior on error: ignore error\n uint8 public constant BEHAVIOR_IGNORE_ERROR = 0x00;\n /// @notice Behavior on error: revert on error\n uint8 public constant BEHAVIOR_REVERT_ON_ERROR = 0x01;\n /// @notice Behavior on error: abort on error\n uint8 public constant BEHAVIOR_ABORT_ON_ERROR = 0x02;\n\n /// @notice Payload call information\n /// @param to Address of the target contract\n /// @param value Value to send with the call\n /// @param data Data to send with the call\n /// @param gasLimit Gas limit for the call\n /// @param delegateCall If the call is a delegate call\n /// @param onlyFallback If the call should only be executed in an error scenario\n /// @param behaviorOnError Behavior on error\n struct Call {\n address to;\n uint256 value;\n bytes data;\n uint256 gasLimit;\n bool delegateCall;\n bool onlyFallback;\n uint256 behaviorOnError;\n }\n\n /// @notice Decoded payload\n /// @param kind Kind of payload\n /// @param noChainId If the chain ID should be omitted\n /// @param calls Array of calls (transaction kind)\n /// @param space Nonce space for the calls (transaction kind)\n /// @param nonce Nonce value for the calls (transaction kind)\n /// @param message Message to validate (message kind)\n /// @param imageHash Image hash to update to (config update kind)\n /// @param digest Digest to validate (digest kind)\n /// @param parentWallets Parent wallets\n struct Decoded {\n uint8 kind;\n bool noChainId;\n // Transaction kind\n Call[] calls;\n uint256 space;\n uint256 nonce;\n // Message kind\n // TODO: Maybe native 721 ?\n bytes message;\n // Config update kind\n bytes32 imageHash;\n // Digest kind for 1271\n bytes32 digest;\n // Parent wallets\n address[] parentWallets;\n }\n\n function fromMessage(\n bytes memory message\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_MESSAGE;\n _decoded.message = message;\n }\n\n function fromConfigUpdate(\n bytes32 imageHash\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_CONFIG_UPDATE;\n _decoded.imageHash = imageHash;\n }\n\n function fromDigest(\n bytes32 digest\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_DIGEST;\n _decoded.digest = digest;\n }\n\n function fromPackedCalls(\n bytes calldata packed\n ) internal view returns (Decoded memory _decoded) {\n _decoded.kind = KIND_TRANSACTIONS;\n\n // Read the global flag\n (uint256 globalFlag, uint256 pointer) = packed.readFirstUint8();\n\n // First bit determines if space is zero or not\n if (globalFlag & 0x01 == 0x01) {\n _decoded.space = 0;\n } else {\n (_decoded.space, pointer) = packed.readUint160(pointer);\n }\n\n // Next 3 bits determine the size of the nonce\n uint256 nonceSize = (globalFlag >> 1) & 0x07;\n\n if (nonceSize > 0) {\n // Read the nonce\n (_decoded.nonce, pointer) = packed.readUintX(pointer, nonceSize);\n }\n\n uint256 numCalls;\n\n // Bit 5 determines if the batch contains a single call\n if (globalFlag & 0x10 == 0x10) {\n numCalls = 1;\n } else {\n // Bit 6 determines if the number of calls uses 1 byte or 2 bytes\n if (globalFlag & 0x20 == 0x20) {\n (numCalls, pointer) = packed.readUint16(pointer);\n } else {\n (numCalls, pointer) = packed.readUint8(pointer);\n }\n }\n\n // Read the calls\n _decoded.calls = new Call[](numCalls);\n\n for (uint256 i = 0; i < numCalls; i++) {\n uint8 flags;\n (flags, pointer) = packed.readUint8(pointer);\n\n // First bit determines if this is a call to self\n // or a call to another address\n if (flags & 0x01 == 0x01) {\n // Call to self\n _decoded.calls[i].to = address(this);\n } else {\n // Call to another address\n (_decoded.calls[i].to, pointer) = packed.readAddress(pointer);\n }\n\n // Second bit determines if the call has value or not\n if (flags & 0x02 == 0x02) {\n (_decoded.calls[i].value, pointer) = packed.readUint256(pointer);\n }\n\n // Third bit determines if the call has data or not\n if (flags & 0x04 == 0x04) {\n // 3 bytes determine the size of the calldata\n uint256 calldataSize;\n (calldataSize, pointer) = packed.readUint24(pointer);\n _decoded.calls[i].data = packed[pointer:pointer + calldataSize];\n pointer += calldataSize;\n }\n\n // Fourth bit determines if the call has a gas limit or not\n if (flags & 0x08 == 0x08) {\n (_decoded.calls[i].gasLimit, pointer) = packed.readUint256(pointer);\n }\n\n // Fifth bit determines if the call is a delegate call or not\n _decoded.calls[i].delegateCall = (flags & 0x10 == 0x10);\n\n // Sixth bit determines if the call is fallback only\n _decoded.calls[i].onlyFallback = (flags & 0x20 == 0x20);\n\n // Last 2 bits are directly mapped to the behavior on error\n _decoded.calls[i].behaviorOnError = (flags & 0xC0) >> 6;\n }\n }\n\n function hashCall(\n Call memory c\n ) internal pure returns (bytes32) {\n return keccak256(\n abi.encode(\n CALL_TYPEHASH, c.to, c.value, keccak256(c.data), c.gasLimit, c.delegateCall, c.onlyFallback, c.behaviorOnError\n )\n );\n }\n\n function hashCalls(\n Call[] memory calls\n ) internal pure returns (bytes32) {\n // In EIP712, an array is often hashed as the keccak256 of the concatenated\n // hashes of each item. So we hash each Call, pack them, and hash again.\n bytes32[] memory callHashes = new bytes32[](calls.length);\n for (uint256 i = 0; i < calls.length; i++) {\n callHashes[i] = hashCall(calls[i]);\n }\n return keccak256(abi.encodePacked(callHashes));\n }\n\n function toEIP712(\n Decoded memory _decoded\n ) internal pure returns (bytes32) {\n bytes32 walletsHash = keccak256(abi.encodePacked(_decoded.parentWallets));\n\n if (_decoded.kind == KIND_TRANSACTIONS) {\n bytes32 callsHash = hashCalls(_decoded.calls);\n // The top-level struct for Calls might be something like:\n // Calls(bytes32 callsHash,uint256 space,uint256 nonce,bytes32 walletsHash)\n return keccak256(abi.encode(CALLS_TYPEHASH, callsHash, _decoded.space, _decoded.nonce, walletsHash));\n } else if (_decoded.kind == KIND_MESSAGE) {\n // If you define your top-level as: Message(bytes32 messageHash,bytes32 walletsHash)\n return keccak256(abi.encode(MESSAGE_TYPEHASH, keccak256(_decoded.message), walletsHash));\n } else if (_decoded.kind == KIND_CONFIG_UPDATE) {\n // Top-level: ConfigUpdate(bytes32 imageHash,bytes32 walletsHash)\n return keccak256(abi.encode(CONFIG_UPDATE_TYPEHASH, _decoded.imageHash, walletsHash));\n } else if (_decoded.kind == KIND_DIGEST) {\n // Top-level: Use MESSAGE_TYPEHASH but assume the digest is already the hashed message\n return keccak256(abi.encode(MESSAGE_TYPEHASH, _decoded.digest, walletsHash));\n } else {\n // Unknown kind\n revert InvalidKind(_decoded.kind);\n }\n }\n\n function hash(\n Decoded memory _decoded\n ) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, address(this));\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n function hashFor(Decoded memory _decoded, address _wallet) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, _wallet);\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n}\n' + }, + 'lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" }, - 'lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" }, - 'lib/openzeppelin/contracts/interfaces/IERC1967.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/draft-IERC1822.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n' }, - 'lib/openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/access/IAccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" }, - 'lib/openzeppelin/contracts/utils/Strings.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport "./math/Math.sol";\nimport "./math/SignedMath.sol";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = "0123456789abcdef";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = "0";\n buffer[1] = "x";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, "Strings: hex length insufficient");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/Math.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/utils/LibBytes.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.18;\n\n/// @title Library for reading data from bytes arrays\n/// @author Agustin Aguilar (aa@horizon.io), Michael Standen (mstan@horizon.io)\n/// @notice This library contains functions for reading data from bytes arrays.\n/// @dev These functions do not check if the input index is within the bounds of the data array.\n/// @dev Reading out of bounds may return dirty values.\nlibrary LibBytes {\n\n function readFirstUint8(\n bytes calldata _data\n ) internal pure returns (uint8 a, uint256 newPointer) {\n assembly {\n let word := calldataload(_data.offset)\n a := shr(248, word)\n newPointer := 1\n }\n }\n\n function readUint8(bytes calldata _data, uint256 _index) internal pure returns (uint8 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(248, word)\n newPointer := add(_index, 1)\n }\n }\n\n function readUint16(bytes calldata _data, uint256 _index) internal pure returns (uint16 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(240, word)\n newPointer := add(_index, 2)\n }\n }\n\n function readUint24(bytes calldata _data, uint256 _index) internal pure returns (uint24 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(232, word)\n newPointer := add(_index, 3)\n }\n }\n\n function readUint64(bytes calldata _data, uint256 _index) internal pure returns (uint64 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(192, word)\n newPointer := add(_index, 8)\n }\n }\n\n function readUint160(bytes calldata _data, uint256 _index) internal pure returns (uint160 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(96, word)\n newPointer := add(_index, 20)\n }\n }\n\n function readUint256(bytes calldata _data, uint256 _index) internal pure returns (uint256 a, uint256 newPointer) {\n assembly {\n a := calldataload(add(_index, _data.offset))\n newPointer := add(_index, 32)\n }\n }\n\n function readUintX(\n bytes calldata _data,\n uint256 _index,\n uint256 _length\n ) internal pure returns (uint256 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n let shift := sub(256, mul(_length, 8))\n a := and(shr(shift, word), sub(shl(mul(8, _length), 1), 1))\n newPointer := add(_index, _length)\n }\n }\n\n function readBytes4(bytes calldata _data, uint256 _pointer) internal pure returns (bytes4 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_pointer, _data.offset))\n a := and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000)\n newPointer := add(_pointer, 4)\n }\n }\n\n function readBytes32(bytes calldata _data, uint256 _pointer) internal pure returns (bytes32 a, uint256 newPointer) {\n assembly {\n a := calldataload(add(_pointer, _data.offset))\n newPointer := add(_pointer, 32)\n }\n }\n\n function readAddress(bytes calldata _data, uint256 _index) internal pure returns (address a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := and(shr(96, word), 0xffffffffffffffffffffffffffffffffffffffff)\n newPointer := add(_index, 20)\n }\n }\n\n /// @dev ERC-2098 Compact Signature\n function readRSVCompact(\n bytes calldata _data,\n uint256 _index\n ) internal pure returns (bytes32 r, bytes32 s, uint8 v, uint256 newPointer) {\n uint256 yParityAndS;\n assembly {\n r := calldataload(add(_index, _data.offset))\n yParityAndS := calldataload(add(_index, add(_data.offset, 32)))\n newPointer := add(_index, 64)\n }\n uint256 yParity = uint256(yParityAndS >> 255);\n s = bytes32(uint256(yParityAndS) & ((1 << 255) - 1));\n v = uint8(yParity) + 27;\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/SignedMath.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/Math.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' } }, settings: { remappings: [ - '@0xsequence/contracts-library/=src/', - 'ds-test/=lib/forge-std/lib/ds-test/src/', + '@openzeppelin/contracts/=lib/murky/lib/openzeppelin-contracts/contracts/', + 'ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/', + 'erc2470-libs/=lib/erc2470-libs/', + 'erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/', 'forge-std/=lib/forge-std/src/', - 'murky/=lib/murky/src/', - '@0xsequence/erc20-meta-token/=lib/0xsequence/erc20-meta-token/src/', - '@0xsequence/erc-1155/=lib/0xsequence/erc-1155/src/', - 'erc721a/=lib/chiru-labs/erc721a/', - 'erc721a-upgradeable/=lib/chiru-labs/erc721a-upgradeable/', - '@openzeppelin/=lib/openzeppelin/', - '@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'solady/=lib/solady/src/', - '0xsequence/=lib/0xsequence/', - 'chiru-labs/=lib/chiru-labs/', - 'erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/', + 'halmos-cheatcodes/=lib/signals-implicit-mode/lib/sequence-v3/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/', + 'murky/=lib/murky/', 'openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/', - 'openzeppelin/=lib/openzeppelin/' + 'openzeppelin-contracts/=lib/openzeppelin-contracts/', + 'openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/', + 'sequence-v3/=lib/signals-implicit-mode/lib/sequence-v3/', + 'signals-implicit-mode/=lib/signals-implicit-mode/', + 'solady/=lib/solady/src/' ], optimizer: { - enabled: true, - runs: 20000 + enabled: false, + runs: 200 }, metadata: { useLiteralContent: true, diff --git a/scripts/factories/token_library/ERC1155SoulboundFactory.ts b/scripts/factories/token_library/ERC1155SoulboundFactory.ts index 4711f74..8253737 100644 --- a/scripts/factories/token_library/ERC1155SoulboundFactory.ts +++ b/scripts/factories/token_library/ERC1155SoulboundFactory.ts @@ -1,216 +1,14 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' -// https://github.com/0xsequence/contracts-library/blob/d87e7dd867c5143e833a2a1bd732a27d796ea9f2/src/tokens/ERC1155/presets/soulbound/ERC1155SoulboundFactory.sol - -const abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'factoryOwner', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - name: 'ERC1155SoulboundDeployed', - 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' - }, - { - inputs: [], - name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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' - } - ], - name: 'deploy', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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' - } - ], - name: 'determineAddress', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'upgradeBeacon', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] +// https://github.com/0xsequence/contracts-library/blob/8a229e34702984b948bd2ac82059388ed08cbe4b/src/tokens/ERC1155/presets/soulbound/ERC1155SoulboundFactory.sol export class ERC1155SoulboundFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, - '0x608034610125576001600160401b0390601f62006aa638819003918201601f191683019291908484118385101761010f57816020928492604096875283398101031261012557516001600160a01b038082168203610125576100603361012a565b8251936145d894858101958187108388111761010f57620024ce823980600096039086f0908115610105578451916105ee808401928311848410176100f1579184849260209462001ee0853916815203019085f080156100e4576100d69394501660018060a01b0319600154161760015561012a565b51611d6e9081620001728239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce4583146106cb57806338234f4d146103e657806359659e90146103935780636dbefeff1461029f578063715018a6146101ff5780638da5cb5b146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561078e565b906100ae61099f565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b5050346101fb57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fb5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b833461029c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261029c5761023661099f565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346101fb576103536055600b6102d56102b9366108cb565b908b9c969a95949c9792975197889460209e8f87019788610a84565b03936103077fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe095868101835282610815565b51902092875192610317846107f9565b835273ffffffffffffffffffffffffffffffffffffffff966103478860015416948a519586938d85019889610af7565b03908101835282610815565b5190206111eb855161036788830182610815565b81815287810191610b4e83395190209085519186830152868201523081520160ff815320915191168152f35b5050346101fb57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fb5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a6576103f6366108cb565b91879996989399959495519960208b8b8b8a849f8b8a8a8a8a8a86019661041d9588610a84565b03937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09485810182526104509082610815565b51902092815194610460866107f9565b8d865273ffffffffffffffffffffffffffffffffffffffff9486866001541694519485938401966104919388610af7565b0390810182526104a19082610815565b5190208b516111eb908f6104b783820183610815565b828252810191610b4e833980511561066e57518392918df5169b8c15610612578160015416928d3b1561060e578b92838f92938f8c956105379151988997889687957fcf7a1d7700000000000000000000000000000000000000000000000000000000875216908501526024840152606060448401526064830190610a41565b03925af18015610604579089916105f0575b5050893b156105ec5791879594939161058d938a5198899788977ff89548180000000000000000000000000000000000000000000000000000000089528801610a84565b038183885af180156105e2576105ce575b50507f212d93efc097ef6776ff65646bb06d271de24ebe85fc741b169a373801463716838251848152a151908152f35b6105d882916107b6565b61029c578061059e565b83513d84823e3d90fd5b8780fd5b6105f9906107b6565b6105ec578738610549565b8a513d8b823e3d90fd5b8b80fd5b6064888f8e51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b50506064888f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6578261070561078e565b61070d61099f565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561078a5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af19081156107815750610775575080f35b61077e906107b6565b80f35b513d84823e3d90fd5b8380fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036107b157565b600080fd5b67ffffffffffffffff81116107ca57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176107ca57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107ca57604052565b81601f820112156107b15780359067ffffffffffffffff82116107ca57604051926108a960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610815565b828452602083830101116107b157816000926020809301838601378301015290565b9060e07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8301126107b15773ffffffffffffffffffffffffffffffffffffffff9060043582811681036107b1579260243583811681036107b1579267ffffffffffffffff926044358481116107b1578361094791600401610856565b936064358181116107b1578461095f91600401610856565b936084359182116107b15761097691600401610856565b9160a43590811681036107b1579060c4356bffffffffffffffffffffffff811681036107b15790565b73ffffffffffffffffffffffffffffffffffffffff6000541633036109c057565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b838110610a315750506000910152565b8181015183820152602001610a21565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610a7d81518092818752878088019101610a1e565b0116010190565b9496959160a094610adc6bffffffffffffffffffffffff95610ace610aea9473ffffffffffffffffffffffffffffffffffffffff8097168b5260c060208c015260c08b0190610a41565b9089820360408b0152610a41565b908782036060890152610a41565b9616608085015216910152565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610b488251809360208685019101610a1e565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea264697066735822122045004168ba82273e43eeb6c01989363db864f4e92bc6bcc90fadfdb4a6c90d8564736f6c63430008130033a2646970667358221220f1e2cf3518e8976de38cf0a484b878c969f9cf85a59d0ecce5e21f8a27d385e064736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea26469706673582212201342d7da4ff651b86bceb8a63d98cff68dd07c475146281deaa480413570ea7564736f6c6343000813003360a060405234620002ec5762000014620002f1565b6200001e620002f1565b815190916001600160401b0390818311620001ed576005938454916001948584811c9416918215620002e1575b60209283861014620002cb578190601f9586811162000277575b5083908683116001146200020f5760009262000203575b5050600019600383901b1c191690861b1786555b8151938411620001ed576004958654908682811c92168015620001e2575b83831014620001cd5784821162000184575b5050809284116001146200011957509282939183926000946200010d575b50501b916000199060031b1c19161790555b336080526040516142c290816200031682396080518161034f0152f35b015192503880620000de565b919083601f1981168760005284600020946000905b888383106200016957505050106200014f575b505050811b019055620000f0565b015160001960f88460031b161c1916905538808062000141565b8587015188559096019594850194879350908101906200012e565b87600052826000209085808801821c830193858910620001c3575b01901c019086905b828110620001b65750620000c0565b60008155018690620001a7565b935082936200019f565b602288634e487b7160e01b6000525260246000fd5b91607f1691620000ae565b634e487b7160e01b600052604160045260246000fd5b0151905038806200007c565b90889350601f198316918a600052856000209260005b8782821062000260575050841162000246575b505050811b01865562000090565b015160001960f88460031b161c1916905538808062000238565b8385015186558c9790950194938401930162000225565b9091508860005283600020868085018b1c820192868610620002c1575b918a9186959493018c1c01915b828110620002b157505062000065565b600081558594508a9101620002a1565b9250819262000294565b634e487b7160e01b600052602260045260246000fd5b93607f16936200004b565b600080fd5b60405190602082016001600160401b03811183821017620001ed576040526000825256fe608080604052600436101561001357600080fd5b60003560e01c908162fdd58e14612f775750806301ffc9a714612ea457806304634d8d14612e6257806306fdde0314612dbc5780630b5ee00614612c435780630e89341c14612afb57806318160ddd14612add57806320ec271b14612997578063248a9ca3146129685780632693ebf21461293c5780632a55205a146128885780632eb2c2d6146123a65780632f2ff15d146122d057806335e60bd41461200f57806336568abe14611f495780634e1273f414611d5a5780635944c75314611c3c57806368a37ae814611c015780636c0360eb14611b5b578063731133e914611a095780637e518ec81461188f578063842f9b68146118695780639010d07c1461181657806391d14854146117bb578063938e3d7b14611641578063a217fddf14611625578063a22cb46514611592578063b390c0ab146114f4578063b48ab8b6146111e2578063ca15c873146111b6578063d547741f14611175578063e8a3d4851461108f578063e985e9c51461102b578063f242432a14610c595763f89548181461019f57600080fd5b34610c545760c0600319360112610c54576101b8612fc7565b60243567ffffffffffffffff8111610c54576101d890369060040161311f565b9060443567ffffffffffffffff8111610c54576101f990369060040161311f565b9060643567ffffffffffffffff8111610c545761021a90369060040161311f565b73ffffffffffffffffffffffffffffffffffffffff6084351660843503610c54576bffffffffffffffffffffffff60a4351660a43503610c5457600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1661010017905573ffffffffffffffffffffffffffffffffffffffff821660009081527f240abdbcdb02f5e390e80fc01f6670d9ae0d46970a0d7b933281c81f8456df9e602052604090205460ff1615610bb7575b7f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c600052600960205261033773ffffffffffffffffffffffffffffffffffffffff83167fbb47ba84ade104d32fdfa33bee5e0faef1ae541476ae15df126ba217f45027c1613c54565b5073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163314801590610bab575b610b8157835167ffffffffffffffff81116108f65761039960055461300d565b601f8111610ae2575b50602094601f8211600114610a5e57948192939495600092610a53575b50506000198260011b9260031b1c1916176005555b825167ffffffffffffffff81116108f6576103f060045461300d565b601f81116109b4575b506020601f82116001146109305781929394600092610925575b50506000198260011b9260031b1c1916176004555b80519067ffffffffffffffff82116108f657610445600a5461300d565b601f8111610891575b50602090601f83116001146107f257918061066e949273ffffffffffffffffffffffffffffffffffffffff946000926107e7575b50506000198260011b9260031b1c191617600a555b80821660009081527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c7602052604090205460ff1615610780575b6000805260096020526105068183167fec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6b613c54565b5080821660009081527fa9ced9fdc45cded6d4b7a90e36d1ee82b957a500cc22704c465e9bdf275406fd60205260409020547f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119060ff161561072a575b600052600960205261057b8282166040600020613c54565b5080821660009081527f95f185554aba264de8ed412af70e5aba6acb0e648f258c912ad29ed85d11ca1860205260409020547fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59060ff16156106d4575b60005260096020526105f08282166040600020613c54565b506105ff60a435608435613ee5565b80821660009081527f51a495916474fe1a0c0fcfb65a8a97682b84a054118858cdd1f5dfd7fc0919eb60205260409020547f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69060ff161561067e575b6000526009602052166040600020613c54565b50600b805460ff19166001179055005b80600052600860205260406000208383166000526020526040600020600160ff1982541617905533838316827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a461065b565b80600052600860205260406000208383166000526020526040600020600160ff1982541617905533838316827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a46105d8565b80600052600860205260406000208383166000526020526040600020600160ff1982541617905533838316827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4610563565b80821660008181527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c760205260408120805460ff191660011790553391907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a46104d1565b015190503880610482565b90601f19831691600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a89260005b818110610879575092600192859273ffffffffffffffffffffffffffffffffffffffff9661066e989610610860575b505050811b01600a55610497565b015160001960f88460031b161c19169055388080610852565b92936020600181928786015181550195019301610823565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f840160051c810191602085106108ec575b601f0160051c01905b8181106108e0575061044e565b600081556001016108d3565b90915081906108ca565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b015190503880610413565b601f1982169060046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b9160005b81811061099c57509583600195969710610983575b505050811b01600455610428565b015160001960f88460031b161c19169055388080610975565b9192602060018192868b015181550194019201610960565b6004600052601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b0160208310610a2c575b601f820160051c7f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b018110610a2057506103f9565b600081556001016109eb565b507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b6109eb565b0151905038806103bf565b601f1982169560056000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db09160005b888110610aca57508360019596979810610ab1575b505050811b016005556103d4565b015160001960f88460031b161c19169055388080610aa3565b91926020600181928685015181550194019201610a8e565b6005600052601f820160051c7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00160208310610b5a575b601f820160051c7f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0018110610b4e57506103a2565b60008155600101610b19565b507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0610b19565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff600b5416610379565b73ffffffffffffffffffffffffffffffffffffffff821660008181527f240abdbcdb02f5e390e80fc01f6670d9ae0d46970a0d7b933281c81f8456df9e60205260408120805460ff191660011790553391907f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a46102ce565b600080fd5b34610c545760a0600319360112610c5457610c72612fc7565b610c7a612fea565b906044356064359260843567ffffffffffffffff8111610c5457610ca290369060040161311f565b73ffffffffffffffffffffffffffffffffffffffff809416938433148015611007575b15610f83578216918215610eff5760ff600b5460081c1680610ef6575b610ecc57846000526020956000875260406000208560005287526040600020610d0c828254613281565b9055836000526000875260406000208560005287526040600020610d31828254613ac7565b90558386604051878152838a8201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4610d705a926133ac565b610d7657005b60008794610dd396604051978896879586937ff23a6e61000000000000000000000000000000000000000000000000000000009c8d865233600487015260248601526044850152606484015260a0608484015260a48301906130de565b0393f18015610ec0577fffffffff0000000000000000000000000000000000000000000000000000000091600091610e93575b501603610e0f57005b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152603a60248201527f45524331313535235f63616c6c6f6e4552433131353552656365697665643a2060448201527f494e56414c49445f4f4e5f524543454956455f4d4553534147450000000000006064820152fd5b610eb39150843d8611610eb9575b610eab8183613098565b810190613226565b84610e06565b503d610ea1565b6040513d6000823e3d90fd5b60046040517fdb89e3f4000000000000000000000000000000000000000000000000000000008152fd5b50841515610ce2565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f524543495049454e540000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f4552433131353523736166655472616e7366657246726f6d3a20494e56414c4960448201527f445f4f50455241544f52000000000000000000000000000000000000000000006064820152fd5b5084600052600160205260406000203360005260205260ff60406000205416610cc5565b34610c54576040600319360112610c5457611044612fc7565b61104c612fea565b9073ffffffffffffffffffffffffffffffffffffffff809116600052600160205260406000209116600052602052602060ff604060002054166040519015158152f35b34610c54576000600319360112610c54576040516000600a546110b18161300d565b8084529060019081811690811561114e57506001146110f3575b6110ef846110db81860382613098565b6040519182916020835260208301906130de565b0390f35b600a600090815292507fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85b8284106111365750505081016020016110db826110cb565b8054602085870181019190915290930192810161111e565b60ff191660208087019190915292151560051b850190920192506110db91508390506110cb565b34610c54576040600319360112610c54576111b4600435611194612fea565b908060005260086020526111af600160406000200154613912565b613a30565b005b34610c54576020600319360112610c545760043560005260096020526020604060002054604051908152f35b34610c5457600319608081360112610c54576111fc612fc7565b9067ffffffffffffffff602435818111610c545761121e90369060040161317e565b92604435828111610c545761123790369060040161317e565b91606435908111610c545761125090369060040161311f565b906112596137ba565b8451835181036114ca5760008073ffffffffffffffffffffffffffffffffffffffff8416925b80831061143757506112949150600254613ac7565b6002558060006040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3391806112cc8a8d83613e32565b0390a46112d95a926133ac565b6112df57005b600061134a916020956113596040519889978896879461133a7fbc197c81000000000000000000000000000000000000000000000000000000009e8f885233600489015289602489015260a0604489015260a48801906131f2565b90848783030160648801526131f2565b918483030160848501526130de565b0393f18015610ec0577fffffffff0000000000000000000000000000000000000000000000000000000091600091611419575b50160361139557005b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603f60248201527f45524331313535235f63616c6c6f6e455243313135354261746368526563656960448201527f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006064820152fd5b611431915060203d8111610eb957610eab8183613098565b8361138c565b906114bd6114c3918a60038a6114958861148e81611455818661326d565b51948d600052602095600087526040600020611471848b61326d565b5160005287526114876040600020918254613ac7565b905561326d565b519461326d565b51600052526114aa6040600020918254613ac7565b90556114b6858a61326d565b5190613ac7565b9261325e565b919061127f565b60046040517f9d89020a000000000000000000000000000000000000000000000000000000008152fd5b34610c5457611502366131dc565b9060ff600b5460081c16610ecc578161151f600093600254613281565b600255818352600360205260408320611539828254613281565b905533835282602052604083208284526020526040832061155b828254613281565b9055604051918252602082015233907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4005b34610c54576040600319360112610c54576115ab612fc7565b602435801515809103610c545733600052600160205273ffffffffffffffffffffffffffffffffffffffff604060002092169182600052602052604060002060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b34610c54576000600319360112610c5457602060405160008152f35b34610c5457602080600319360112610c545767ffffffffffffffff600435818111610c545761167490369060040161311f565b9161167d613662565b82519182116108f657611691600a5461300d565b601f8111611757575b5080601f83116001146116d6575081926000926116cb575b50506000198260011b9260031b1c191617600a55600080f35b0151905082806116b2565b90601f19831693600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8926000905b86821061173f5750508360019510611726575b505050811b01600a55005b015160001960f88460031b161c1916905582808061171b565b80600185968294968601518155019501930190611708565b600a6000527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a8601f840160051c8101918385106117b1575b601f0160051c01905b8181106117a5575061169a565b60008155600101611798565b909150819061178f565b34610c54576040600319360112610c54576117d4612fea565b600435600052600860205273ffffffffffffffffffffffffffffffffffffffff60406000209116600052602052602060ff604060002054166040519015158152f35b34610c54576040600319360112610c54576004356000526009602052602073ffffffffffffffffffffffffffffffffffffffff6118596024356040600020613c3c565b9190546040519260031b1c168152f35b34610c54576000600319360112610c5457602060ff600b5460081c166040519015158152f35b34610c5457602080600319360112610c545767ffffffffffffffff600435818111610c54576118c290369060040161311f565b916118cb613662565b82519182116108f6576118df60045461300d565b601f81116119a5575b5080601f831160011461192457508192600092611919575b50506000198260011b9260031b1c191617600455600080f35b015190508280611900565b90601f1983169360046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b926000905b86821061198d5750508360019510611974575b505050811b01600455005b015160001960f88460031b161c19169055828080611969565b80600185968294968601518155019501930190611956565b60046000527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b601f840160051c8101918385106119ff575b601f0160051c01905b8181106119f357506118e8565b600081556001016119e6565b90915081906119dd565b34610c54576080600319360112610c5457611a22612fc7565b60243560443560643567ffffffffffffffff8111610c5457611a4890369060040161311f565b92611a516137ba565b611a5d82600254613ac7565b60025582600052602093600385526040600020611a7b848254613ac7565b905573ffffffffffffffffffffffffffffffffffffffff821691826000526000865260406000208560005286526040600020611ab8858254613ac7565b905582600060405187815286898201527fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260403392a4611af85a916133ac565b611afe57005b610dd393600087946040518097819682957ff23a6e61000000000000000000000000000000000000000000000000000000009b8c85523360048601528660248601526044850152606484015260a0608484015260a48301906130de565b34610c54576000600319360112610c54576040516000600454611b7d8161300d565b8084529060019081811690811561114e5750600114611ba6576110ef846110db81860382613098565b6004600090815292507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b828410611be95750505081016020016110db826110cb565b80546020858701810191909152909301928101611bd1565b34610c54576000600319360112610c545760206040517f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c8152f35b34610c54576060600319360112610c5457611c55612fea565b6044356bffffffffffffffffffffffff8116809103610c5457611c766133e2565b611c84612710821115613e5a565b73ffffffffffffffffffffffffffffffffffffffff809216918215611cfc577fffffffffffffffffffffffff00000000000000000000000000000000000000009060405193611cd285613060565b84526020840192835260043560005260076020526040600020935116915160a01b16179055600080f35b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b34610c54576040600319360112610c545760043567ffffffffffffffff808211610c545736602383011215610c5457816004013590611d9882613166565b92611da66040519485613098565b82845260209260248486019160051b83010191368311610c5457602401905b828210611f1d57505050602435908111610c5457611de790369060040161317e565b8251815103611e9957825190601f19611e18611e0284613166565b93611e106040519586613098565b808552613166565b01368484013760005b8451811015611e86578073ffffffffffffffffffffffffffffffffffffffff611e4d611e81938861326d565b5116600052600085526040600020611e65828561326d565b516000528552604060002054611e7b828661326d565b5261325e565b611e21565b604051848152806110ef818701866131f2565b608482604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602c60248201527f455243313135352362616c616e63654f6642617463683a20494e56414c49445f60448201527f41525241595f4c454e47544800000000000000000000000000000000000000006064820152fd5b813573ffffffffffffffffffffffffffffffffffffffff81168103610c54578152908401908401611dc5565b34610c54576040600319360112610c5457611f62612fea565b3373ffffffffffffffffffffffffffffffffffffffff821603611f8b576111b490600435613a30565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b34610c5457602080600319360112610c545760043590811515809203610c54577f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c908160005260088152604060002033600052815260ff60406000205416156120a657600b80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16600885901b61ff0016179055005b6120af33613ad4565b916040516120bc8161307c565b604281528281019160603684378151156122a1576030835381516001908110156122a157607860218401536041905b8082116122215750506121c45761217693612185926048926040519687937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000088860152612141815180928a6037890191016130bb565b8401917f206973206d697373696e6720726f6c65200000000000000000000000000000006037840152518093868401906130bb565b01036028810185520183613098565b6121c06040519283927f08c379a0000000000000000000000000000000000000000000000000000000008452600484015260248301906130de565b0390fd5b606483604051907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f811660108110156122a1577f3031323334353637383961626364656600000000000000000000000000000000901a61225d848661328e565b5360041c9180156122725760001901906120eb565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b34610c54576040600319360112610c54576111b460043560096122f1612fea565b91806000526020906008825261230e600160406000200154613912565b806000526008825273ffffffffffffffffffffffffffffffffffffffff604060002094169384600052825260ff6040600020541615612356575b600052526040600020613c54565b806000526008825260406000208460005282526040600020600160ff198254161790553384827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4612348565b34610c545760a0600319360112610c54576123bf612fc7565b6123c7612fea565b9060449067ffffffffffffffff908235828111610c54576123ec90369060040161317e565b6064948535848111610c545761240690369060040161317e565b93608435908111610c545761241f90369060040161311f565b73ffffffffffffffffffffffffffffffffffffffff9081851633148015612862575b156127df578183161561275c5760ff600b5460081c1680612751575b610ecc5783518651036126ce57835160005b81811061264457505060405182841690838716907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb3391806124b28c8b83613e32565b0390a45a946124c0846133ac565b6124c657005b8291604051978896879586947fbc197c810000000000000000000000000000000000000000000000000000000086523360048701521660248501528a840160a0905260a48401612515916131f2565b838103600319018c850152612529916131f2565b82810360031901608484015261253e916130de565b039216600090602095f1908115610ec0577fbc197c8100000000000000000000000000000000000000000000000000000000917fffffffff0000000000000000000000000000000000000000000000000000000091600091612626575b5016036125a457005b7f7665643a20494e56414c49445f4f4e5f524543454956455f4d455353414745006084927f45524331313535235f63616c6c6f6e4552433131353542617463685265636569604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152603f6024860152840152820152fd5b61263e915060203d8111610eb957610eab8183613098565b8561259b565b806126526126c9928a61326d565b5185891660005260209060008252604060002061266f848b61326d565b5160005282526126856040600020918254613281565b9055612691828b61326d565b5190868816600052600081526040600020906126ad848b61326d565b51600052526126c26040600020918254613ac7565b905561325e565b61246f565b6084877f494e56414c49445f4152524159535f4c454e47544800000000000000000000008a7f45524331313535235f7361666542617463685472616e7366657246726f6d3a20604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260356024860152840152820152fd5b50818516151561245d565b6084877f4e56414c49445f524543495049454e54000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a00000000000000000000000000000000000000000000000000000000085526020600486015260306024860152840152820152fd5b6084877f4e56414c49445f4f50455241544f5200000000000000000000000000000000008a7f45524331313535237361666542617463685472616e7366657246726f6d3a2049604051937f08c379a000000000000000000000000000000000000000000000000000000000855260206004860152602f6024860152840152820152fd5b50818516600052600160205260406000203360005260205260ff60406000205416612441565b34610c5457612896366131dc565b906000526007602052604060002090604051916128b283613060565b5473ffffffffffffffffffffffffffffffffffffffff928382169182825260a01c6020820152901561291a575b6bffffffffffffffffffffffff6020820151169182810292818404149015171561227257604092612710915116918351928352046020820152f35b5060405161292781613060565b600654838116825260a01c60208201526128df565b34610c54576020600319360112610c545760043560005260036020526020604060002054604051908152f35b34610c54576020600319360112610c545760043560005260086020526020600160406000200154604051908152f35b34610c54576040600319360112610c545767ffffffffffffffff600435818111610c54576129c990369060040161317e565b90602435908111610c54576129e290369060040161317e565b60ff600b5460081c16610ecc57815191815183036114ca576000926000905b808210612a52575050612a18600093600254613281565b6002557f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb60405180612a4d3395339583613e32565b0390a4005b9093612ad1612ad791612a65878761326d565b5133600052602090600082526040600020612a808a8961326d565b516000528252612a966040600020918254613281565b90556003612aa4898961326d565b5191612ab08a8961326d565b5160005252612ac56040600020918254613281565b90556114b6878761326d565b9461325e565b90612a01565b34610c54576000600319360112610c54576020600254604051908152f35b34610c5457602080600319360112610c5457612b1860043561329f565b906040519182826000600454612b2d8161300d565b90600190818116908115612c265750600114612bc3575b50509081612b5e8560059594612baf9751948592016130bb565b017f2e6a736f6e0000000000000000000000000000000000000000000000000000008152037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe5810185520183613098565b6110ef6040519282849384528301906130de565b60046000908152949593949192507f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b5b838310612c0e57509294939250508201810183612b5e612b44565b8054838a018701528896508795909201918101612bf3565b60ff19168686015250508015150283018201905083612b5e612b44565b34610c5457602080600319360112610c545767ffffffffffffffff90600435828111610c5457612c7790369060040161311f565b91612c80613662565b82519081116108f657600591612c96835461300d565b601f8111612d5b575b5080601f8311600114612cdb5750819293600092612cd0575b50506000198260011b9260031b1c1916179055600080f35b015190508380612cb8565b90601f19831694846000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0926000905b878210612d43575050836001959610612d2a575b505050811b019055005b015160001960f88460031b161c19169055838080612d20565b80600185968294968601518155019501930190612d0c565b836000527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db0601f8401851c810191838510612db2575b601f01851c01905b818110612da65750612c9f565b60008155600101612d99565b9091508190612d91565b34610c54576000600319360112610c54576040516000600554612dde8161300d565b8084529060019081811690811561114e5750600114612e07576110ef846110db81860382613098565b6005600090815292507f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05b828410612e4a5750505081016020016110db826110cb565b80546020858701810191909152909301928101612e32565b34610c54576040600319360112610c5457612e7b612fc7565b6024356bffffffffffffffffffffffff81168103610c54576111b491612e9f6133e2565b613ee5565b34610c54576020600319360112610c54576004357fffffffff000000000000000000000000000000000000000000000000000000008116808203610c5457602091817fb1c990bc0000000000000000000000000000000000000000000000000000000014918215612f1c575b50506040519015158152f35b7fc79b8b5f000000000000000000000000000000000000000000000000000000001491508115612f66575b8115612f56575b508280612f10565b612f609150613fbd565b82612f4e565b9050612f7181613fbd565b90612f47565b34610c54576040600319360112610c545760209073ffffffffffffffffffffffffffffffffffffffff612fa8612fc7565b1660005260008252604060002060243560005282526040600020548152f35b6004359073ffffffffffffffffffffffffffffffffffffffff82168203610c5457565b6024359073ffffffffffffffffffffffffffffffffffffffff82168203610c5457565b90600182811c92168015613056575b602083101461302757565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f169161301c565b6040810190811067ffffffffffffffff8211176108f657604052565b6080810190811067ffffffffffffffff8211176108f657604052565b90601f601f19910116810190811067ffffffffffffffff8211176108f657604052565b60005b8381106130ce5750506000910152565b81810151838201526020016130be565b90601f19601f6020936130fc815180928187528780880191016130bb565b0116010190565b67ffffffffffffffff81116108f657601f01601f191660200190565b81601f82011215610c545780359061313682613103565b926131446040519485613098565b82845260208383010111610c5457816000926020809301838601378301015290565b67ffffffffffffffff81116108f65760051b60200190565b81601f82011215610c545780359161319583613166565b926131a36040519485613098565b808452602092838086019260051b820101928311610c54578301905b8282106131cd575050505090565b813581529083019083016131bf565b6003196040910112610c54576004359060243590565b90815180825260208080930193019160005b828110613212575050505090565b835185529381019392810192600101613204565b90816020910312610c5457517fffffffff0000000000000000000000000000000000000000000000000000000081168103610c545790565b60001981146122725760010190565b80518210156122a15760209160051b010190565b9190820391821161227257565b9081518110156122a1570160200190565b80156133725780816000925b61335e5750806132ba83613103565b926132c86040519485613098565b808452601f196132d782613103565b01366020860137915b6132e957505090565b60001982019182116122725781600a808304928184029184830414841517156122725761331960ff928392613281565b16603001908111612272577fff000000000000000000000000000000000000000000000000000000000000006133579160f81b1660001a918561328e565b53806132e0565b9161336a600a9161325e565b9204806132ab565b5060405161337f81613060565b600181527f3000000000000000000000000000000000000000000000000000000000000000602082015290565b3f80151590816133ba575090565b7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4709150141590565b3360009081527fa9ced9fdc45cded6d4b7a90e36d1ee82b957a500cc22704c465e9bdf275406fd602090815260408083205490927f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119160ff16156134465750505050565b61344f33613ad4565b9184519061345c8261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116135885750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b01036028810187520185613098565b519283927f08c379a0000000000000000000000000000000000000000000000000000000008452600484015260248301906130de565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a6135c5858761328e565b5360041c9280156135db5760001901919061348d565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b3360009081527f95f185554aba264de8ed412af70e5aba6acb0e648f258c912ad29ed85d11ca18602090815260408083205490927fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59160ff16156136c65750505050565b6136cf33613ad4565b918451906136dc8261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116137675750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a6137a4858761328e565b5360041c9280156135db5760001901919061370d565b3360009081527f51a495916474fe1a0c0fcfb65a8a97682b84a054118858cdd1f5dfd7fc0919eb602090815260408083205490927f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69160ff161561381e5750505050565b61382733613ad4565b918451906138348261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116138bf5750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a6138fc858761328e565b5360041c9280156135db57600019019190613865565b60009080825260209060088252604092838120338252835260ff84822054161561393c5750505050565b61394533613ad4565b918451906139528261307c565b6042825284820192606036853782511561363557603084538251906001918210156136355790607860218501536041915b8183116139dd5750505061352c5760486121c09386936134f6936134e798519889937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008a860152612141815180928c6037890191016130bb565b909192600f81166010811015613608577f3031323334353637383961626364656600000000000000000000000000000000901a613a1a858761328e565b5360041c9280156135db57600019019190613983565b906040613a7c92600090808252600860205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff8383205416613a7f575b8152600960205220613cf7565b50565b808252600860205282822084835260205282822060ff1981541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4613a6f565b9190820180921161227257565b604051906060820182811067ffffffffffffffff8211176108f657604052602a82526020820160403682378251156122a1576030905381516001908110156122a157607860218401536029905b808211613b8f575050613b315790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015613c0e577f3031323334353637383961626364656600000000000000000000000000000000901a613bcb848661328e565b5360041c918015613be0576000190190613b21565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b80548210156122a15760005260206000200190600090565b91906001830160009082825280602052604082205415600014613cf15784549468010000000000000000861015613cc45783613cb4613c9d886001604098999a01855584613c3c565b81939154906000199060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014613e2b5760001991828101818111613dfe57825490848201918211613dd157808203613d9c575b50505080548015613d6f57820191613d528383613c3c565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b613dbc613dac613c9d9386613c3c565b90549060031b1c92839286613c3c565b90558652846020526040862055388080613d3a565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b9091613e49613e57936040845260408401906131f2565b9160208184039101526131f2565b90565b15613e6157565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff831691613f18612710841115613e5a565b16918215613f5f577fffffffffffffffffffffffff0000000000000000000000000000000000000000916020604051613f5081613060565b858152015260a01b1617600655565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b613fc681614063565b908115613ffa575b8115613fe9575b8115613fdf575090565b613e579150614126565b9050613ff481614126565b90613fd5565b90506140058161400b565b90613fce565b7f0e89341c000000000000000000000000000000000000000000000000000000007fffffffff0000000000000000000000000000000000000000000000000000000082161461405d57613e5790614063565b50600190565b7fffffffff0000000000000000000000000000000000000000000000000000000081167f3e85e62f00000000000000000000000000000000000000000000000000000000149081156140b3575090565b613e5791507fffffffff00000000000000000000000000000000000000000000000000000000167fd9b67a2600000000000000000000000000000000000000000000000000000000811461405d577f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b61412f81614215565b90811561417d575b8115614152575b8115614148575090565b613e57915061418e565b7fffffffff00000000000000000000000000000000000000000000000000000000811615915061413e565b90506141888161418e565b90614137565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f5a05180f0000000000000000000000000000000000000000000000000000000082149182156141e157505090565b7f7965db0b00000000000000000000000000000000000000000000000000000000149150811561420f575090565b613e5791505b7fffffffff00000000000000000000000000000000000000000000000000000000167f2a55205a000000000000000000000000000000000000000000000000000000008114908115614265575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea2646970667358221220b36777fe9fe780fadc66eecc030c6f58436d0e96ee9680effff07e866026402664736f6c63430008130033', + FACTORY_DEFAULT_ABI, + '60806040523461002f576100196100146100fa565b610169565b610021610034565b61271a610397823961271a90f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b61011861847b8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b614f28810181811060018060401b038211176101c5576101a18291614f28612ab1843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa26179d985396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610580565b61001e60003561008d565b80631bce45831461008857806359659e901461008357806359a347bd1461007e578063715018a6146100795780638da5cb5b14610074578063cfcc59411461006f5763f2fde38b0361000e5761054d565b61050e565b6104d9565b6104a6565b610467565b6101ea565b610108565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b906020828203126100fd576100fa916000016100d4565b90565b61009e565b60000190565b346101365761012061011b3660046100e3565b61067e565b610128610093565b8061013281610102565b0390f35b610099565b600091031261014657565b61009e565b1c90565b60018060a01b031690565b61016a90600861016f930261014b565b61014f565b90565b9061017d915461015a565b90565b61018d6001600090610172565b90565b90565b6101a76101a26101ac926100a8565b610190565b6100a8565b90565b6101b890610193565b90565b6101c4906101af565b90565b6101d0906101bb565b9052565b91906101e8906000602085019401906101c7565b565b3461021a576101fa36600461013b565b610216610205610180565b61020d610093565b918291826101d4565b0390f35b610099565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061025390610229565b810190811067ffffffffffffffff82111761026d57604052565b610233565b9061028561027e610093565b9283610249565b565b67ffffffffffffffff81116102a5576102a1602091610229565b0190565b610233565b90826000939282370152565b909291926102cb6102c682610287565b610272565b938185526020850190828401116102e7576102e5926102aa565b565b610224565b9080601f8301121561030a57816020610307933591016102b6565b90565b61021f565b6bffffffffffffffffffffffff1690565b6103298161030f565b0361033057565b600080fd5b9050359061034282610320565b565b90565b61035081610344565b0361035757565b600080fd5b9050359061036982610347565b565b90916101208284031261043f5761038583600084016100d4565b9261039381602085016100d4565b92604081013567ffffffffffffffff811161043a57826103b49183016102ec565b92606082013567ffffffffffffffff811161043557836103d59184016102ec565b92608083013567ffffffffffffffff811161043057816103f69185016102ec565b926104048260a083016100d4565b9261042d6104158460c08501610335565b936104238160e086016100d4565b936101000161035c565b90565b6100a3565b6100a3565b6100a3565b61009e565b61044d906100b3565b9052565b919061046590600060208501940190610444565b565b346104a15761049d61048c61047d36600461036b565b979690969591959492946107ee565b610494610093565b91829182610451565b0390f35b610099565b346104d4576104b636600461013b565b6104be610985565b6104c6610093565b806104d081610102565b0390f35b610099565b34610509576104e936600461013b565b6105056104f46109bb565b6104fc610093565b91829182610451565b0390f35b610099565b346105485761054461053361052436600461036b565b979690969591959492946109d1565b61053b610093565b91829182610451565b0390f35b610099565b3461057b576105656105603660046100e3565b610b2a565b61056d610093565b8061057781610102565b0390f35b610099565b600080fd5b61059690610591610bb8565b6105eb565b565b60001c90565b6105aa6105af91610598565b61014f565b90565b6105bc905461059e565b90565b600080fd5b60e01b90565b60009103126105d557565b61009e565b6105e2610093565b3d6000823e3d90fd5b6105fd6105f860016105b2565b6101bb565b90633659cfe690823b15610679576106359261062a6000809461061e610093565b968795869485936105c4565b835260048301610451565b03925af1801561067457610647575b50565b6106679060003d811161066d575b61065f8183610249565b8101906105ca565b38610644565b503d610655565b6105da565b6105bf565b61068790610585565b565b600090565b5190565b60209181520190565b60005b8381106106af575050906000910152565b80602091830151818501520161069e565b6106df6106e86020936106ed936106d68161068e565b93848093610692565b9586910161069b565b610229565b0190565b6106fa9061030f565b9052565b61070790610344565b9052565b939561077461076960e0979b9a9861075b6107889761074d8a61078f9e9961073f61077e9a60006101008501940190610444565b8c60208184039101526106c0565b908a820360408c01526106c0565b9088820360608a01526106c0565b9a6080870190610444565b60a08501906106f1565b60c0830190610444565b01906106fe565b565b60200190565b5190565b906107ad6107a883610287565b610272565b918252565b6107bc600061079b565b90565b6107c76107b2565b90565b6107d390610193565b90565b6107df906107ca565b90565b6107eb906101af565b90565b61085e9098949897969397959295610804610689565b508861083c8461082d8d8a8d8d96928b908d929394610821610093565b998a9860208a0161070b565b60208201810382520382610249565b61084e61084882610797565b91610791565b20906108586107bf565b91610d5d565b9761087061086b8a6107d6565b6107e2565b94638ff83ac192969891939497863b1561092f576000986108a5968a966108b095610899610093565b9d8e9c8d9b8c9a6105c4565b8a5260048a0161070b565b03925af1801561092a576108fd575b50806108f77f212d93efc097ef6776ff65646bb06d271de24ebe85fc741b169a373801463716916108ee610093565b91829182610451565b0390a190565b61091d9060003d8111610923575b6109158183610249565b8101906105ca565b386108bf565b503d61090b565b6105da565b6105bf565b61093c610bb8565b610944610971565b565b90565b61095d61095861096292610946565b610190565b6100a8565b90565b61096e90610949565b90565b61098361097e6000610965565b610eec565b565b61098d610934565b565b60018060a01b031690565b6109a66109ab91610598565b61098f565b90565b6109b8905461099a565b90565b6109c3610689565b506109ce60006109ae565b90565b96610a089396610a1796610a399a939694966109eb610689565b5096989490919293946109fc610093565b998a9860208a0161070b565b60208201810382520382610249565b610a29610a2382610797565b91610791565b2090610a336107bf565b91610f4d565b90565b610a4d90610a48610bb8565b610af9565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610aaa6026604092610692565b610ab381610a4f565b0190565b610acd9060208101906000818303910152610a9d565b90565b15610ad757565b610adf610093565b62461bcd60e51b815280610af560048201610ab7565b0390fd5b610b2890610b2381610b1c610b16610b116000610965565b6100b3565b916100b3565b1415610ad0565b610eec565b565b610b3390610a3c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6960208092610692565b610b7281610b35565b0190565b610b8c9060208101906000818303910152610b5d565b90565b15610b9657565b610b9e610093565b62461bcd60e51b815280610bb460048201610b76565b0390fd5b610be2610bc36109bb565b610bdc610bd6610bd1610fe3565b6100b3565b916100b3565b14610b8f565b565b90565b610bf3610bf891610344565b610be4565b9052565b60601b90565b610c0b90610bfc565b90565b610c1790610c02565b90565b610c26610c2b916100b3565b610c0e565b9052565b905090565b610c59610c5092602092610c4781610797565b94858093610c2f565b9384910161069b565b0190565b60148093610c81602084610c79610c8996610c909b9a98610be7565b018092610c1a565b018092610c1a565b0190610c34565b90565b90565b610caa610ca5610caf92610946565b610190565b610c93565b90565b610cbb90610193565b90565b610cc790610cb2565b90565b610cd390610193565b90565b610cdf90610cca565b90565b610ceb906101af565b90565b60209181520190565b610d16610d1f602093610d2493610d0d81610797565b93848093610cee565b9586910161069b565b610229565b0190565b610d4d610d5a949293610d4360608401956000850190610444565b6020830190610444565b6040818403910152610cf7565b90565b610ded9093929193610d6d610689565b50610dad8591610d9e610d88610d8360016105b2565b6101bb565b8690610d92610093565b95869460208601610c5d565b60208201810382520382610249565b610dbf610db982610797565b91610791565b2061148a610dcf60208201610272565b9080825261125b6020830139610de86000929192610c96565b611187565b92610e07610e02610dfd86610cbe565b610cd6565b610ce2565b63cf7a1d779190610e20610e1b60016105b2565b6101bb565b9392813b15610e97576000610e4891610e538296610e3c610093565b988997889687956105c4565b855260048501610d28565b03925af18015610e9257610e65575b50565b610e859060003d8111610e8b575b610e7d8183610249565b8101906105ca565b38610e62565b503d610e73565b6105da565b6105bf565b60001b90565b90610eb360018060a01b0391610e9c565b9181191691161790565b610ec6906101af565b90565b90565b90610ee1610edc610ee892610ebd565b610ec9565b8254610ea2565b9055565b610ef660006109ae565b610f01826000610ecc565b90610f35610f2f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610ebd565b91610ebd565b91610f3e610093565b80610f4881610102565b0390a3565b610fe09291610f8a610f9992610f61610689565b509193610f76610f7160016105b2565b6101bb565b610f7e610093565b95869460208601610c5d565b60208201810382520382610249565b610fab610fa582610797565b91610791565b2061148a610fbb60208201610272565b9080825261125b6020830139610fd9610fd382610797565b91610791565b2090611210565b90565b610feb610689565b503390565b610ff9906101af565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b611031601d602092610692565b61103a81610ffc565b0190565b6110549060208101906000818303910152611024565b90565b1561105e57565b611066610093565b62461bcd60e51b81528061107c6004820161103e565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110b460208092610692565b6110bd81611080565b0190565b6110d790602081019060008183039101526110a8565b90565b156110e157565b6110e9610093565b62461bcd60e51b8152806110ff600482016110c1565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b6111386019602092610692565b61114181611103565b0190565b61115b906020810190600081830391015261112b565b90565b1561116557565b61116d610093565b62461bcd60e51b81528061118360048201611145565b0390fd5b919091611192610689565b506111b961119f30610ff0565b316111b26111ac84610c93565b91610c93565b1015611057565b6111df6111c583610797565b6111d86111d26000610c96565b91610c93565b14156110da565b60208251920190f59061120e826112076112016111fc6000610965565b6100b3565b916100b3565b141561115e565b565b9061122e9161121d610689565b509061122830610ff0565b91611231565b90565b90605592600b92611240610689565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a264697066735822122097530b8d31b5d354ffcc0b9e67b01ab8984a523144d8a31162adeefce0733d0d64736f6c634300081b003360a060405234602b57600e603a565b6014602f565b614ec76100618239608051816137da0152614ec790f35b6035565b60405190565b600080fd5b60406042565b565b6048604a565b565b60506052565b565b6058605a565b565b3360805256fe60806040526004361015610013575b611921565b61001e60003561027c565b8062fdd58e1461027757806301ffc9a71461027257806304634d8d1461026d57806306fdde03146102685780630b5ee006146102635780630bb310de1461025e5780630e89341c1461025957806318160ddd1461025457806320ec271b1461024f578063248a9ca31461024a5780632693ebf2146102455780632a55205a146102405780632eb2c2d61461023b5780632f2ff15d1461023657806335e60bd41461023157806336568abe1461022c5780634e1273f4146102275780635944c7531461022257806368a37ae81461021d5780636c0360eb14610218578063731133e9146102135780637e518ec81461020e578063842f9b68146102095780638ff83ac1146102045780639010d07c146101ff57806391d14854146101fa578063938e3d7b146101f55780639d043a66146101f0578063a217fddf146101eb578063a22cb465146101e6578063b390c0ab146101e1578063b48ab8b6146101dc578063ca15c873146101d7578063d547741f146101d2578063e8a3d485146101cd578063e985e9c5146101c8578063ed4c2ac7146101c35763f242432a0361000e576118e7565b611843565b61180d565b6117aa565b611766565b611731565b6116fa565b611636565b611602565b61159f565b61152c565b611464565b61142e565b6113f8565b611377565b611278565b611245565b61120e565b6110fd565b6110b8565b611055565b610fe1565b610e6d565b610e3a565b610dc3565b610d58565b610bfb565b610b67565b610ae1565b610a44565b610915565b6108a5565b610853565b610801565b6106ef565b610495565b6103f7565b61034a565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6102ab90610297565b90565b6102b7816102a2565b036102be57565b600080fd5b905035906102d0826102ae565b565b90565b6102de816102d2565b036102e557565b600080fd5b905035906102f7826102d5565b565b9190604083820312610322578061031661031f92600086016102c3565b936020016102ea565b90565b61028d565b610330906102d2565b9052565b919061034890600060208501940190610327565b565b3461037b576103776103666103603660046102f9565b9061192b565b61036e610282565b91829182610334565b0390f35b610288565b63ffffffff60e01b1690565b61039581610380565b0361039c57565b600080fd5b905035906103ae8261038c565b565b906020828203126103ca576103c7916000016103a1565b90565b61028d565b151590565b6103dd906103cf565b9052565b91906103f5906000602085019401906103d4565b565b346104275761042361041261040d3660046103b0565b611954565b61041a610282565b918291826103e1565b0390f35b610288565b6bffffffffffffffffffffffff1690565b6104468161042c565b0361044d57565b600080fd5b9050359061045f8261043d565b565b919060408382031261048a578061047e61048792600086016102c3565b93602001610452565b90565b61028d565b60000190565b346104c4576104ae6104a8366004610461565b906119e0565b6104b6610282565b806104c08161048f565b0390f35b610288565b60009103126104d457565b61028d565b634e487b7160e01b600052600060045260246000fd5b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610525575b602083101461052057565b6104ef565b91607f1691610515565b60209181520190565b600052602060002090565b906000929180549061055e61055783610505565b809461052f565b916001811690816000146105b7575060011461057a575b505050565b6105879192939450610538565b916000925b81841061059f5750500190388080610575565b6001816020929593955484860152019101929061058c565b92949550505060ff1916825215156020020190388080610575565b906105dc91610543565b90565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b90610609906105df565b810190811067ffffffffffffffff82111761062357604052565b6105e9565b9061064861064192610638610282565b938480926105d2565b03836105ff565b565b9060001061065e5761065b90610628565b90565b6104d9565b610670600860009061064a565b90565b5190565b60209181520190565b60005b838110610694575050906000910152565b806020918301518185015201610683565b6106c46106cd6020936106d2936106bb81610673565b93848093610677565b95869101610680565b6105df565b0190565b6106ec91602082019160008184039101526106a5565b90565b3461071f576106ff3660046104c9565b61071b61070a610663565b610712610282565b918291826106d6565b0390f35b610288565b600080fd5b600080fd5b9061074161073a610282565b92836105ff565b565b67ffffffffffffffff81116107615761075d6020916105df565b0190565b6105e9565b90826000939282370152565b9092919261078761078282610743565b61072e565b938185526020850190828401116107a3576107a192610766565b565b610729565b9080601f830112156107c6578160206107c393359101610772565b90565b610724565b906020828203126107fc57600082013567ffffffffffffffff81116107f7576107f492016107a8565b90565b610292565b61028d565b3461082f576108196108143660046107cb565b611c21565b610821610282565b8061082b8161048f565b0390f35b610288565b9060208282031261084e5761084b916000016102c3565b90565b61028d565b346108815761086b610866366004610834565b611cfe565b610873610282565b8061087d8161048f565b0390f35b610288565b906020828203126108a05761089d916000016102ea565b90565b61028d565b346108d5576108d16108c06108bb366004610886565b611e28565b6108c8610282565b918291826106d6565b0390f35b610288565b1c90565b90565b6108f19060086108f693026108da565b6108de565b90565b9061090491546108e1565b90565b6109126000806108f9565b90565b34610945576109253660046104c9565b610941610930610907565b610938610282565b91829182610334565b0390f35b610288565b67ffffffffffffffff81116109625760208091020190565b6105e9565b600080fd5b9092919261098161097c8261094a565b61072e565b93818552602080860192028301928184116109be57915b8383106109a55750505050565b602080916109b384866102ea565b815201920191610998565b610967565b9080601f830112156109e1578160206109de9335910161096c565b90565b610724565b919091604081840312610a3f57600081013567ffffffffffffffff8111610a3a5783610a139183016109c3565b92602082013567ffffffffffffffff8111610a3557610a3292016109c3565b90565b610292565b610292565b61028d565b34610a7357610a5d610a573660046109e6565b90611e72565b610a65610282565b80610a6f8161048f565b0390f35b610288565b90565b610a8481610a78565b03610a8b57565b600080fd5b90503590610a9d82610a7b565b565b90602082820312610ab957610ab691600001610a90565b90565b61028d565b610ac790610a78565b9052565b9190610adf90600060208501940190610abe565b565b34610b1157610b0d610afc610af7366004610a9f565b611ed4565b610b04610282565b91829182610acb565b0390f35b610288565b90565b610b2d610b28610b32926102d2565b610b16565b6102d2565b90565b90610b3f90610b19565b600052602052604060002090565b610b6490610b5f600191600092610b35565b6108f9565b90565b34610b9757610b93610b82610b7d366004610886565b610b4d565b610b8a610282565b91829182610334565b0390f35b610288565b9190604083820312610bc55780610bb9610bc292600086016102ea565b936020016102ea565b90565b61028d565b610bd3906102a2565b9052565b916020610bf9929493610bf260408201966000830190610bca565b0190610327565b565b34610c2d57610c14610c0e366004610b9c565b906120c6565b90610c29610c20610282565b92839283610bd7565b0390f35b610288565b600080fd5b909182601f83011215610c715781359167ffffffffffffffff8311610c6c576020019260208302840111610c6757565b610967565b610c32565b610724565b909182601f83011215610cb05781359167ffffffffffffffff8311610cab576020019260018302840111610ca657565b610967565b610c32565b610724565b9160a083830312610d5357610ccd82600085016102c3565b92610cdb83602083016102c3565b92604082013567ffffffffffffffff8111610d4e5781610cfc918401610c37565b929093606082013567ffffffffffffffff8111610d495783610d1f918401610c37565b929093608082013567ffffffffffffffff8111610d4457610d409201610c76565b9091565b610292565b610292565b610292565b61028d565b34610d9057610d7a610d6b366004610cb5565b969590959491949392936121a1565b610d82610282565b80610d8c8161048f565b0390f35b610288565b9190604083820312610dbe5780610db2610dbb9260008601610a90565b936020016102c3565b90565b61028d565b34610df257610ddc610dd6366004610d95565b90612448565b610de4610282565b80610dee8161048f565b0390f35b610288565b610e00816103cf565b03610e0757565b600080fd5b90503590610e1982610df7565b565b90602082820312610e3557610e3291600001610e0c565b90565b61028d565b34610e6857610e52610e4d366004610e1b565b6124c8565b610e5a610282565b80610e648161048f565b0390f35b610288565b34610e9c57610e86610e80366004610d95565b9061257d565b610e8e610282565b80610e988161048f565b0390f35b610288565b909182601f83011215610edb5781359167ffffffffffffffff8311610ed6576020019260208302840111610ed157565b610967565b610c32565b610724565b9091604082840312610f3b57600082013567ffffffffffffffff8111610f365783610f0c918401610ea1565b929093602082013567ffffffffffffffff8111610f3157610f2d9201610c37565b9091565b610292565b610292565b61028d565b5190565b60209181520190565b60200190565b610f5c906102d2565b9052565b90610f6d81602093610f53565b0190565b60200190565b90610f94610f8e610f8784610f40565b8093610f44565b92610f4d565b9060005b818110610fa55750505090565b909192610fbe610fb86001928651610f60565b94610f71565b9101919091610f98565b610fde9160208201916000818403910152610f77565b90565b3461101557611011611000610ff7366004610ee0565b929190916125b1565b611008610282565b91829182610fc8565b0390f35b610288565b90916060828403126110505761104d61103684600085016102ea565b9361104481602086016102c3565b93604001610452565b90565b61028d565b346110845761106e61106836600461101a565b9161264e565b611076610282565b806110808161048f565b0390f35b610288565b7f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c90565b6110b5611089565b90565b346110e8576110c83660046104c9565b6110e46110d36110ad565b6110db610282565b91829182610acb565b0390f35b610288565b6110fa600960009061064a565b90565b3461112d5761110d3660046104c9565b6111296111186110ed565b611120610282565b918291826106d6565b0390f35b610288565b67ffffffffffffffff81116111505761114c6020916105df565b0190565b6105e9565b9092919261116a61116582611132565b61072e565b938185526020850190828401116111865761118492610766565b565b610729565b9080601f830112156111a9578160206111a693359101611155565b90565b610724565b90608082820312611209576111c681600084016102c3565b926111d482602085016102ea565b926111e283604083016102ea565b92606082013567ffffffffffffffff811161120457611201920161118b565b90565b610292565b61028d565b346112405761122a6112213660046111ae565b929190916126ad565b611232610282565b8061123c8161048f565b0390f35b610288565b346112735761125d6112583660046107cb565b6126e3565b611265610282565b8061126f8161048f565b0390f35b610288565b346112a8576112883660046104c9565b6112a461129361271b565b61129b610282565b918291826103e1565b0390f35b610288565b919061010083820312611372576112c781600085016102c3565b92602081013567ffffffffffffffff811161136d57826112e89183016107a8565b92604082013567ffffffffffffffff811161136857836113099184016107a8565b92606083013567ffffffffffffffff8111611363578161132a9185016107a8565b9261133882608083016102c3565b926113606113498460a08501610452565b936113578160c086016102c3565b9360e001610a90565b90565b610292565b610292565b610292565b61028d565b346113af5761139961138a3660046112ad565b96959095949194939293612731565b6113a1610282565b806113ab8161048f565b0390f35b610288565b91906040838203126113dd57806113d16113da9260008601610a90565b936020016102ea565b90565b61028d565b91906113f690600060208501940190610bca565b565b346114295761142561141461140e3660046113b4565b90612784565b61141c610282565b918291826113e2565b0390f35b610288565b3461145f5761145b61144a611444366004610d95565b906127fd565b611452610282565b918291826103e1565b0390f35b610288565b346114925761147c6114773660046107cb565b612850565b611484610282565b8061148e8161048f565b0390f35b610288565b600080fd5b908160c09103126114aa5790565b611497565b908160e09103126114bd5790565b611497565b91606083830312611527576114da82600085016102c3565b92602081013567ffffffffffffffff811161152257836114fb91830161149c565b92604082013567ffffffffffffffff811161151d5761151a92016114af565b90565b610292565b610292565b61028d565b3461155d576115596115486115423660046114c2565b91612bae565b611550610282565b91829182610acb565b0390f35b610288565b90565b60001b90565b61157f61157a61158492611562565b611565565b610a78565b90565b611591600061156b565b90565b61159c611587565b90565b346115cf576115af3660046104c9565b6115cb6115ba611594565b6115c2610282565b91829182610acb565b0390f35b610288565b91906040838203126115fd57806115f16115fa92600086016102c3565b93602001610e0c565b90565b61028d565b346116315761161b6116153660046115d4565b90612c4f565b611623610282565b8061162d8161048f565b0390f35b610288565b346116655761164f611649366004610b9c565b90612c9f565b611657610282565b806116618161048f565b0390f35b610288565b906080828203126116f55761168281600084016102c3565b92602083013567ffffffffffffffff81116116f057826116a39185016109c3565b92604081013567ffffffffffffffff81116116eb57836116c49183016109c3565b92606082013567ffffffffffffffff81116116e6576116e3920161118b565b90565b610292565b610292565b610292565b61028d565b3461172c5761171661170d36600461166a565b92919091612cdc565b61171e610282565b806117288161048f565b0390f35b610288565b346117615761175d61174c611747366004610a9f565b612cea565b611754610282565b91829182610334565b0390f35b610288565b346117955761177f611779366004610d95565b90612d3a565b611787610282565b806117918161048f565b0390f35b610288565b6117a7600a60009061064a565b90565b346117da576117ba3660046104c9565b6117d66117c561179a565b6117cd610282565b918291826106d6565b0390f35b610288565b919060408382031261180857806117fc61180592600086016102c3565b936020016102c3565b90565b61028d565b3461183e5761183a6118296118233660046117df565b90612d46565b611831610282565b918291826103e1565b0390f35b610288565b346118715761185b611856366004610a9f565b612dd5565b611863610282565b8061186d8161048f565b0390f35b610288565b91909160a0818403126118e25761189083600083016102c3565b9261189e81602084016102c3565b926118ac82604085016102ea565b926118ba83606083016102ea565b92608082013567ffffffffffffffff81116118dd576118d99201610c76565b9091565b610292565b61028d565b3461191c576119066118fa366004611876565b94939093929192612de0565b61190e610282565b806119188161048f565b0390f35b610288565b600080fd5b600090565b611933611926565b50679a31110384e0b0c960205260145260005260406000205490565b600090565b61195c61194f565b50632c72642f60e21b61197761197183610380565b91610380565b14908115611984575b5090565b61198e9150612fb8565b38611980565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b906119d2916119cd6119c8611994565b61300e565b6119d4565b565b906119de91613228565b565b906119ea916119b8565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b611a2990611a24611a1f6119ec565b61300e565b611c14565b565b601f602091010490565b1b90565b91906008611a55910291611a4f60001984611a35565b92611a35565b9181191691161790565b90565b9190611a78611a73611a8093610b19565b611a5f565b908354611a39565b9055565b611a9691611a90611926565b91611a62565b565b5b818110611aa4575050565b80611ab26000600193611a84565b01611a99565b9190601f8111611ac8575b505050565b611ad4611af993610538565b906020611ae084611a2b565b83019310611b01575b611af290611a2b565b0190611a98565b388080611ac3565b9150611af281929050611ae9565b90611b2090600019906008026108da565b191690565b81611b2f91611b0f565b906002021790565b90611b4181610673565b9067ffffffffffffffff8211611c0357611b6582611b5f8554610505565b85611ab8565b602090601f8311600114611b9a57918091611b8993600092611b8e575b5050611b25565b90555b565b90915001513880611b82565b601f19831691611ba985610538565b9260005b818110611beb57509160029391856001969410611bd1575b50505002019055611b8c565b611be1910151601f841690611b0f565b9055388080611bc5565b91936020600181928787015181550195019201611bad565b6105e9565b90611c1291611b37565b565b611c1f906008611c08565b565b611c2a90611a10565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b611c6990611c64611c5f611c2c565b61300e565b611ce9565b565b611c7f611c7a611c8492610297565b610b16565b610297565b90565b611c9090611c6b565b90565b611c9c90611c87565b90565b90611cb060018060a01b0391611565565b9181191691161790565b611cc390611c87565b90565b90565b90611cde611cd9611ce592611cba565b611cc6565b8254611c9f565b9055565b611cf5611cfc91611c93565b6006611cc9565b565b611d0790611c50565b565b606090565b905090565b9060009291805490611d2e611d2783610505565b8094611d0e565b91600181169081600014611d825750600114611d4a575b505050565b611d579192939450610538565b6000905b838210611d6e5750500190388080611d45565b600181602092548486015201910190611d5b565b92949550505060ff19168252801515020190388080611d45565b611dc1611db892602092611daf81610673565b94858093611d0e565b93849101610680565b0190565b60007f2e6a736f6e000000000000000000000000000000000000000000000000000000910152565b611df960058092611d0e565b611e0281611dc5565b0190565b91611e17611e2293611e1d93611d13565b90611d9c565b611ded565b90565b90565b611e6f90611e34611d09565b50611e6a611e436009926132a2565b91611e5b611e4f610282565b93849260208401611e06565b602082018103825203826105ff565b611e25565b90565b611e7f91339190916133f0565b565b600090565b611e8f90610a78565b90565b90611e9c90611e86565b600052602052604060002090565b60001c90565b90565b611ebf611ec491611eaa565b611eb0565b90565b611ed19054611eb3565b90565b6001611eed611ef392611ee5611e81565b506004611e92565b01611ec7565b90565b600090565b90611f0590610b19565b600052602052604060002090565b60018060a01b031690565b611f2a611f2f91611eaa565b611f13565b90565b611f3c9054611f1e565b90565b90611f49906102a2565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b611f70611f7591611f4d565b611f53565b90565b611f829054611f64565b90565b90611f8f9061042c565b9052565b611f9d604061072e565b90565b90611fd7611fce6000611fb1611f93565b94611fc8611fc0838301611f32565b838801611f3f565b01611f78565b60208401611f85565b565b611fe290611fa0565b90565b611fef90516102a2565b90565b61200661200161200b92611562565b610b16565b610297565b90565b61201790611ff2565b90565b612024905161042c565b90565b61203b6120366120409261042c565b610b16565b6102d2565b90565b634e487b7160e01b600052601160045260246000fd5b61206861206e919392936102d2565b926102d2565b9161207a8382026102d2565b92818404149015171561208957565b612043565b634e487b7160e01b600052601260045260246000fd5b6120b06120b6916102d2565b916102d2565b9081156120c1570490565b61208e565b6120e96120ee919392936120d8611ef6565b506120e1611926565b506003611efb565b611fd9565b916120fb60008401611fe5565b61211661211061210b600061200e565b6102a2565b916102a2565b14612163575b600061215861214261215f9361213c6121376020890161201a565b612027565b90612059565b61215261214d6134fb565b612027565b906120a4565b9301611fe5565b9190565b915061215f600061215861214261217a6002611fd9565b95935050505061211c565b61219091369161096c565b90565b61219e913691611155565b90565b9693969590949192956121b2613512565b6123eb575b8287036123dd5760601b679a31110384e0b0c9179460601b679a31110384e0b0c91791856020528560601c958360601c9384156123cf578733036123b3575b8860051b805b61235357505050828660207f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb604051604081528b8d8160051b948286936040860152838d6060870137836060018286015260608486010190815201376080339380010190a461226961357f565b612336575b50813b61227f575b50505050505050565b602080809786946000528060c06040519b8c9a63bc197c818c5233868d015260408c015260a060608c01528a8360051b998a9586948593015260e08d01378160c00160808c015260e0828c010192835284830137818060e0010160a08a01520101838152013780010161010401601c60405101600080515af115612327575b63bc197c8160e01b9051036123195738808080808080612276565b639c05499b6000526004601cfd5b3d156122fe573d6000823e3d90fd5b61234d908690849086908a8c919287948b9661358d565b3861226e565b60209003808b01358360205281880135600052604060002080548083116123a5578290039055826020526040600020908154908101908110612397578291556121fc565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c20546121f657634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b61241a81868a896124148c61240e8b916124088c918c9894612185565b95612185565b94612193565b93613520565b6121b7565b9061243a9161243561243082611ed4565b61300e565b61243c565b565b90612446916135d7565b565b906124529161241f565b565b61246d90612468612463611089565b61300e565b6124bb565b565b60081b90565b9061248261ff009161246f565b9181191691161790565b612495906103cf565b90565b90565b906124b06124ab6124b79261248c565b612498565b8254612475565b9055565b6124c690600b61249b565b565b6124d190612454565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b61252e602f604092610677565b612537816124d3565b0190565b6125519060208101906000818303910152612521565b90565b1561255b57565b612563610282565b62461bcd60e51b8152806125796004820161253b565b0390fd5b906125aa916125a58261259f612599612594613601565b6102a2565b916102a2565b14612554565b61360e565b565b606090565b939291906125bd6125ac565b5082036126145760405193828552602085019260051b808481016040525b6125e55750505050565b602090038082013560601b679a31110384e0b0c9176020528083013560005280604060002054818601526125db565b633b800a466000526004601cfd5b9061263d9291612638612633611994565b61300e565b61263f565b565b9161264c929190916136bc565b565b906126599291612622565b565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b9061269b93929161269661269161265b565b61300e565b61269d565b565b916126ab939190919261373f565b565b906126b993929161267f565b565b6126d4906126cf6126ca6119ec565b61300e565b6126d6565b565b6126e1906009611c08565b565b6126ec906126bb565b565b60081c90565b60ff1690565b61270661270b916126ee565b6126f4565b90565b61271890546126fa565b90565b61272361194f565b5061272e600b61270e565b90565b91612767979593919694926127486001600b61249b565b61275a612753611089565b82906135d7565b96909192939495966137cb565b565b9061277390611e86565b600052602052604060002090565b90565b906127a461279f6127a993612797611ef6565b506005612769565b612781565b6138a9565b90565b6127b590611c6b565b90565b6127c1906127ac565b90565b906127ce906127b8565b600052602052604060002090565b6127e86127ed91611eaa565b6126f4565b90565b6127fa90546127dc565b90565b61282591600061281a6128209361281261194f565b506004611e92565b016127c4565b6127f0565b90565b6128419061283c6128376119ec565b61300e565b612843565b565b61284e90600a611c08565b565b61285990612828565b565b60018060a01b031690565b61287261287791611eaa565b61285b565b90565b6128849054612866565b90565b612890906127ac565b90565b60e01b90565b905051906128a682610a7b565b565b906020828203126128c2576128bf91600001612899565b90565b61028d565b506128d69060208101906102c3565b90565b6128e2906102a2565b9052565b506128f59060208101906103a1565b90565b61290190610380565b9052565b50612914906020810190610a90565b90565b61292090610a78565b9052565b600080fd5b600080fd5b600080fd5b903560016020038236030381121561297457016020813591019167ffffffffffffffff821161296f57600182023603831361296a57565b612929565b612924565b61292e565b60209181520190565b919061299c81612995816129a195612979565b8095610766565b6105df565b0190565b90356001604003823603038112156129bb570190565b61292e565b9035600160200382360303811215612a0157016020813591019167ffffffffffffffff82116129fc5760018202360383136129f757565b612929565b612924565b61292e565b9190612a2081612a1981612a259561052f565b8095610766565b6105df565b0190565b67ffffffffffffffff1690565b612a3f81612a29565b03612a4657565b600080fd5b90503590612a5882612a36565b565b50612a69906020810190612a4b565b90565b612a7590612a29565b9052565b90612ab7906020612aaf612aa560408401612a9760008801886129c0565b908683036000880152612a06565b9482810190612a5a565b910190612a6c565b90565b612b6491612b56612b4b60c08301612ae2612ad860008701876128c7565b60008601906128d9565b612afc612af260208701876128e6565b60208601906128f8565b612b16612b0c6040870187612905565b6040860190612917565b612b30612b266060870187612905565b6060860190612917565b612b3d6080860186612933565b908583036080870152612982565b9260a08101906129a5565b9060a0818403910152612a79565b90565b939290612b93604091612b9b94612b86606089019260008a0190610bca565b8782036020890152612aba565b940190610abe565b565b612ba5610282565b3d6000823e3d90fd5b9150602090612bbb611e81565b50612bce612bc9600661287a565b612887565b612bfa633808a90b949294612c05612be66007611ec7565b612bee610282565b97889687958695612893565b855260048501612b67565b03915afa908115612c4a57600091612c1c575b5090565b612c3d915060203d8111612c43575b612c3581836105ff565b8101906128a8565b38612c18565b503d612c2b565b612b9d565b901515679a31110384e0b0c96020523360145281600052806034600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b612cac91339190916138e2565b565b90612cca939291612cc5612cc061265b565b61300e565b612ccc565b565b91612cda939190919261391c565b565b90612ce8939291612cae565b565b612d09612d04612d0e92612cfc611926565b506005612769565b612781565b613a05565b90565b90612d2c91612d27612d2282611ed4565b61300e565b612d2e565b565b90612d389161360e565b565b90612d4491612d11565b565b612d4e61194f565b50679a31110384e0b0c96020526014526000526034600c205490565b612d8390612d7e612d79611c2c565b61300e565b612dc8565b565b90612d9260001991611565565b9181191691161790565b612da590611eaa565b90565b90612dbd612db8612dc492611e86565b612d9c565b8254612d85565b9055565b612dd3906007612da8565b565b612dde90612d6a565b565b94909194612dec613512565b612f8a575b60601b679a31110384e0b0c9179160601b679a31110384e0b0c917918060205260601c928260601c928315612f7c57843303612f60575b8660005260406000208054808411612f525783900390556020526040600020805490828201918210612f445755806020528284337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6260406000a4612e8a61357f565b612f1f575b823b612e9e575b505050505050565b602094829160405197889663f23a6e618852338989015260408801526060870152608086015260a0808601528160c086015260e085013760c401906000601c8401915af115612f10575b63f23a6e6160e01b905103612f0257388080808080612e96565b639c05499b6000526004601cfd5b3d15612ee8573d6000823e3d90fd5b612f2886613a25565b50612f3281613a25565b50612f3e858390612193565b50612e8f565b6301336cea6000526004601cfd5b63f4d678b86000526004601cfd5b336000526034600c2054612e2857634b6e7f186000526004601cfd5b63ea553b346000526004601cfd5b612fb38184612f9889613a25565b612fa188613a25565b91612fad8a8890612193565b93613520565b612df1565b612fc061194f565b5063c79b8b5f60e01b612fdb612fd583610380565b91610380565b148015612fff575b908115612fef575b5090565b612ff99150613a45565b38612feb565b5061300981613a45565b612fe3565b6130209061301a613601565b90613b52565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b61307d602a604092610677565b61308681613022565b0190565b6130a09060208101906000818303910152613070565b90565b156130aa57565b6130b2610282565b62461bcd60e51b8152806130c86004820161308a565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b6131016019602092610677565b61310a816130cc565b0190565b61312490602081019060008183039101526130f4565b90565b1561312e57565b613136610282565b62461bcd60e51b81528061314c6004820161310e565b0390fd5b61315a604061072e565b90565b90565b9061317561317061317c926127b8565b61315d565b8254611c9f565b9055565b60a01b90565b906131a06bffffffffffffffffffffffff60a01b91613180565b9181191691161790565b6131be6131b96131c39261042c565b610b16565b61042c565b90565b90565b906131de6131d96131e5926131aa565b6131c6565b8254613186565b9055565b906132146020600061321a9461320c828201613206848801611fe5565b90613160565b01920161201a565b906131c9565b565b90613226916131e9565b565b906132996132a0926132548361324d6132476132426134fb565b61042c565b9161042c565b11156130a3565b61327a8161327361326d613268600061200e565b6102a2565b916102a2565b1415613127565b91613290613286613150565b9360008501611f3f565b60208301611f85565b600261321c565b565b906132ab611d09565b506080604051019160208301604052600083528290600a6000198092955b01948181066030018653049384156132e85790600a91908092916132c9565b93505082602091039203918252565b61330b61330661331092611562565b610b16565b6102d2565b90565b600161331f91016102d2565b90565b634e487b7160e01b600052603260045260246000fd5b9061334282610f40565b811015613353576020809102010190565b613322565b61336290516102d2565b90565b61337161337691611eaa565b6108de565b90565b6133839054613365565b90565b61339561339b919392936102d2565b926102d2565b82039182116133a657565b612043565b906133c06133bb6133c792610b19565b611a5f565b8254612d85565b9055565b6133da6133e0919392936102d2565b926102d2565b82018092116133eb57565b612043565b6134009093929193848391613beb565b61340983610f40565b9261341460006132f7565b9261341f60006132f7565b935b8461343461342e886102d2565b916102d2565b10156134b1576134a56134ab9161348c613457613452888a90613338565b613358565b613486613477600161347161346c8d8c613338565b613358565b90610b35565b9161348183613379565b613386565b906133ab565b61349f61349a878990613338565b613358565b906133cb565b94613313565b93613421565b915093506134d592506134ce91506134c96000613379565b613386565b60006133ab565b565b600090565b90565b6134f36134ee6134f8926134dc565b610b16565b61042c565b90565b6135036134d7565b5061350f6127106134df565b90565b61351a61194f565b50600190565b935050505061352f600b61270e565b908161355a575b5061353d57565b60006336e278fd60e21b8152806135566004820161048f565b0390fd5b905061357761357161356c600061200e565b6102a2565b916102a2565b141538613536565b61358761194f565b50600090565b5050949293909361359c61357f565b6135a9575b505050505050565b6135bf6135c5936135cb97969092939596612185565b50612185565b50612193565b503880808080806135a1565b906135f96135f46135fe936135ed818590613c06565b6005612769565b612781565b613ced565b50565b613609611ef6565b503390565b9061363061362b61363593613624818590613d28565b6005612769565b612781565b613dc2565b50565b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b61366d601b602092610677565b61367681613638565b0190565b6136909060208101906000818303910152613660565b90565b1561369a57565b6136a2610282565b62461bcd60e51b8152806136b86004820161367a565b0390fd5b6137389061373161373d94936136ec856136e56136df6136da6134fb565b61042c565b9161042c565b11156130a3565b6137128161370b613705613700600061200e565b6102a2565b916102a2565b1415613693565b9361372861371e613150565b9560008701611f3f565b60208501611f85565b6003611efb565b61321c565b565b61378d91926137596137939561377e939086849192613dfd565b61377661376f8261376a6000613379565b6133cb565b60006133ab565b926001610b35565b9161378883613379565b6133cb565b906133ab565b565b906137a160ff91611565565b9181191691161790565b906137c06137bb6137c79261248c565b612498565b8254613795565b9055565b959694939294336138046137fe7f00000000000000000000000000000000000000000000000000000000000000006102a2565b916102a2565b14158015613866575b6138495761383b9761382e966138299489949091929394613f12565b613228565b61383661265b565b6135d7565b6138476001600b6137ab565b565b600063f92ee8a960e01b8152806138626004820161048f565b0390fd5b50613871600b6127f0565b61380d565b90565b61388561388a91611eaa565b610b19565b90565b6138a161389c6138a6926102d2565b610b16565b610297565b90565b6138d56138d06138df936138cb60006138da956138c4611ef6565b5001613876565b613fd6565b613879565b61388d565b6127ac565b90565b916138ed600b61270e565b6138ff576138fd92919091613ff8565b565b60006336e278fd60e21b8152806139186004820161048f565b0390fd5b9261392d919493908584919261404a565b61393683610f40565b9161394160006132f7565b9061394c60006132f7565b915b8261396161395b876102d2565b916102d2565b10156139df576139876139d99161398161397c878790613338565b613358565b906133cb565b926139d461399e613999878490613338565b613358565b6139ce6139bf60016139b96139b48d8890613338565b613358565b90610b35565b916139c983613379565b6133cb565b906133ab565b613313565b9161394e565b91509350613a0392506139fc91506139f76000613379565b6133cb565b60006133ab565b565b613a1d6000613a2292613a16611926565b5001613876565b6141a5565b90565b90613a2e6125ac565b506040519160408301604052600183526020830152565b613a4d61194f565b50613a57816141bd565b8015613a7a575b908115613a6a575b5090565b613a749150614263565b38613a66565b50613a84816141fd565b613a5e565b90565b613aa0613a9b613aa592613a89565b610b16565b6102d2565b90565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b613adc60178092611d0e565b613ae581613aa8565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b613b1d60118092611d0e565b613b2681613ae9565b0190565b613b44613b4f9392613b3e613b4993613ad0565b90611d9c565b613b11565b90611d9c565b90565b90613b67613b618383906127fd565b156103cf565b613b6f575050565b613be791613bc5613b9e613b8e613b88613bca956142df565b93613879565b613b986020613a8c565b906144f8565b91613bb6613baa610282565b93849260208401613b2a565b602082018103825203826105ff565b611e25565b613bd2610282565b91829162461bcd60e51b8352600483016106d6565b0390fd5b9091613c0492613bfb600061200e565b92909192614673565b565b613c1a613c148284906127fd565b156103cf565b613c23575b5050565b613c466001613c416000613c3960048690611e92565b0185906127c4565b6137ab565b90613c4f613601565b90613c8c613c86613c807f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95611e86565b926127b8565b926127b8565b92613c95610282565b80613c9f8161048f565b0390a43880613c1f565b613cb290611c6b565b90565b613cc9613cc4613cce92610297565b610b16565b6102d2565b90565b613ce5613ce0613cea926102d2565b611565565b610a78565b90565b90613d20613d1a613d15613d106000613d2596613d0861194f565b500194613ca9565b613cb5565b613cd1565b91613876565b614879565b90565b613d338183906127fd565b613d3c575b5050565b613d5f6000613d5a6000613d5260048690611e92565b0185906127c4565b6137ab565b90613d68613601565b90613da5613d9f613d997ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95611e86565b926127b8565b926127b8565b92613dae610282565b80613db88161048f565b0390a43880613d38565b90613df5613def613dea613de56000613dfa96613ddd61194f565b500194613ca9565b613cb5565b613cd1565b91613876565b614939565b90565b91929092613e09613512565b613ee5575b8260601b8015613ed757679a31110384e0b0c960205283601452846000526040600020805490838201918210613ec957558160205260601c6000337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604083a4613e7661357f565b613eb0575b613e8483614a43565b613e8f575b50505050565b613ea793613e9d600061200e565b9390919293614a50565b38808080613e89565b613eb984613a25565b50613ec381613a25565b50613e7b565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b613f0d613ef2600061200e565b84613efc87613a25565b613f0585613a25565b918693613520565b613e0e565b9192613f31613f769694613f2a613f38946008611c08565b6009611c08565b600a611c08565b613f4a613f43611587565b82906135d7565b613f5c613f55611994565b82906135d7565b613f6e613f676119ec565b82906135d7565b919091614ae9565b565b5490565b600052602060002090565b613f9081613f78565b821015613fab57613fa2600191613f7c565b91020190600090565b613322565b613fc0906008613fc593026108da565b611eb0565b90565b90613fd39154613fb0565b90565b613ff5916000613fef92613fe8611e81565b5001613f87565b90613fc8565b90565b6140336140489361400e61404293858391614b06565b61402b6140248261401f6000613379565b613386565b60006133ab565b926001610b35565b9161403d83613379565b613386565b906133ab565b565b91929092614056613512565b614188575b805184510361417a578260601b801561416c5780679a31110384e0b0c917602052845160051b805b61413557506000604051604081527f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb81885160051b602001604082019081818c60045afa503d60400160208301523d01865160051b60200181818960045afa503d01039360601c933392a46140f661357f565b614130575b61410483614a43565b61410f575b50505050565b6141279361411d600061200e565b9390919293614b21565b38808080614109565b6140fb565b808301519080870151600052604060002091825490810190811061415e57602092550380614083565b6301336cea6000526004601cfd5b63ea553b346000526004601cfd5b633b800a466000526004601cfd5b6141a0614195600061200e565b848684918693613520565b61405b565b60006141ba916141b3611926565b5001613f78565b90565b6141c561194f565b50633e85e62f60e01b6141e06141da83610380565b91610380565b149081156141ed575b5090565b6141f79150614bd8565b386141e9565b61420561194f565b5061420f81614bff565b8015614254575b8015614239575b908115614229575b5090565b6142339150614c3f565b38614225565b50600061424e61424883610380565b91610380565b1461421d565b5061425e81614c3f565b614216565b61426b61194f565b5061427581614c3f565b908115614281575b5090565b61428b9150614c7f565b3861427d565b90565b60ff1690565b6142ae6142a96142b392614291565b610b16565b614294565b90565b6142c0601461429a565b90565b6142d76142d26142dc92614294565b610b16565b6102d2565b90565b6142fc6142f7614312926142f1611d09565b50613ca9565b613cb5565b61430c6143076142b6565b6142c3565b906144f8565b90565b90565b61432c61432761433192614315565b610b16565b6102d2565b90565b9061434661434183611132565b61072e565b918252565b369037565b9061437561435d83614334565b9260208061436b8693611132565b920191039061434b565b565b600360fc1b90565b5190565b9061438d8261437f565b81101561439f57600160209102010190565b613322565b600f60fb1b90565b90565b6143c36143be6143c8926143ac565b610b16565b6102d2565b90565b6143d4906102d2565b600081146143e3576001900390565b612043565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b6144076143e8565b90565b90565b61442161441c6144269261440a565b610b16565b6102d2565b90565b60f81b90565b90565b61444661444161444b9261442f565b610b16565b614294565b90565b61446d9061446761446161447294614294565b916102d2565b906108da565b6102d2565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b6144a960208092610677565b6144b281614475565b0190565b6144cc906020810190600081830391015261449d565b90565b156144d657565b6144de610282565b62461bcd60e51b8152806144f4600482016144b6565b0390fd5b9190614502611d09565b5061459c61458c614538614533614523600261451e8791614318565b612059565b61452d6002614318565b906133cb565b614350565b92614541614377565b61455a8561455460009360001a936132f7565b90614383565b536145636143a4565b61457c8561457660019360001a936143af565b90614383565b536145876002614318565b612059565b61459660016143af565b906133cb565b925b836145b26145ac60016143af565b916102d2565b1115614619576145c06143ff565b816145cb600f61440d565b16916010831015614614576145e76146089261460e941a614429565b6145f78591889060001a92614383565b536146026004614432565b9061444e565b936143cb565b9261459e565b613322565b61464192935061463c9061463661463060006132f7565b916102d2565b146144cf565b611e25565b90565b9061465661465183610743565b61072e565b918252565b6146656000614644565b90565b61467061465b565b90565b9193929061467f613512565b6147ab575b815185510361479d5760601b9182679a31110384e0b0c9176020528060601b8381149015171561477b575b50835160051b805b61474557507f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb6000939460405192839160408352805160051b60200180916040850192839160045afa503d60400160208401523d019081815160051b602001809260045afa503d01039260601c923392a461473061357f565b614737575b565b61473f614668565b50614735565b808201519080860151600052604060002080549283811161476d5760209303905503806146b7565b63f4d678b86000526004601cfd5b6000526034600c20541561478f57386146af565b634b6e7f186000526004601cfd5b633b800a466000526004601cfd5b6147ca816147b9600061200e565b8785916147c4614668565b93613520565b614684565b90565b600052602060002090565b5490565b6147ea816147dd565b821015614805576147fc6001916147d2565b91020190600090565b613322565b919061482061481b61482893611e86565b612d9c565b908354611a39565b9055565b908154916801000000000000000083101561485c578261485491600161485a950181556147e1565b9061480a565b565b6105e9565b9061486b90611e86565b600052602052604060002090565b61488161194f565b50614896614890828490614cbf565b156103cf565b6000146148d9576148cf6148d4926148ba6148b3600085016147cf565b829061482c565b60016148c860008501613f78565b9301614861565b6133ab565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b61490891614902611e81565b9161480a565b565b614913816147dd565b801561493457600190039061493161492b83836147e1565b906148f6565b55565b6148e0565b61494161194f565b50614958614953600183018490614861565b613379565b908161496d61496760006132f7565b916102d2565b1415600014614a3b576149ed9260016149e89284614996600096614990856143af565b90613386565b6149b36149a4888501613f78565b6149ad866143af565b90613386565b806149c66149c0846102d2565b916102d2565b036149f2575b5050506149e26149dd8683016147cf565b61490a565b01614861565b611a84565b600190565b614a3392614a25614a11614a0b614a2e948c8901613f87565b90613fc8565b93614a1f85918c8901613f87565b9061480a565b91858501614861565b6133ab565b3880806149cc565b505050600090565b614a4b61194f565b503b90565b919360209360405195869463f23a6e618652338787015260601b60601c60408601526060850152608084015260a08084015280518091818060c0870152614ad5575b505060c401906000601c8401915af115614ac6575b63f23a6e6160e01b905103614ab857565b639c05499b6000526004601cfd5b3d15614aa7573d6000823e3d90fd5b818660e08701920160045afa508038614a92565b90614aff614b049392614afa611c2c565b6135d7565b614cf5565b565b9091614b1f92614b16600061200e565b92909192614d15565b565b919360209360405195869463bc197c818652338787015260601b60601c604086015260a06060860152805160051b8601809160c0870192839160045afa503d60a001908160808701523d019182815160051b8801809260045afa503d0160a08501523d01908181518601809260045afa50601c8301903d0103906000601c8401915af115614bc9575b63bc197c8160e01b905103614bbb57565b639c05499b6000526004601cfd5b3d15614baa573d6000823e3d90fd5b614be061194f565b5060e01c630e89341c8114906301ffc9a763d9b67a2682149114171790565b614c0761194f565b5080614c22614c1c63152a902d60e11b610380565b91610380565b14908115614c2f575b5090565b614c399150614e2b565b38614c2b565b614c4761194f565b5080614c62614c5c635a05180f60e01b610380565b91610380565b14908115614c6f575b5090565b614c799150614e51565b38614c6b565b614c8761194f565b5080614ca2614c9c634e821d3360e11b610380565b91610380565b14908115614caf575b5090565b614cb991506141fd565b38614cab565b614cdd916001614cd892614cd161194f565b5001614861565b613379565b614cf0614cea60006132f7565b916102d2565b141590565b90614d0c614d05614d1393611c93565b6006611cc9565b6007612da8565b565b90929192614d21613512565b614df7575b60601b9081679a31110384e0b0c917602052818160601b148160601b151715614dd5575b5082600052604060002090815491828411614dc757836000930390558260205260601c337fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62604084a4614d9b61357f565b614da4575b5050565b614db0614db692613a25565b50613a25565b50614dbf614668565b503880614da0565b63f4d678b86000526004601cfd5b6000526034600c205415614de95738614d4a565b634b6e7f186000526004601cfd5b614e2681614e05600061200e565b614e0e87613a25565b614e1787613a25565b91614e20614668565b93613520565b614d26565b614e3361194f565b50614e4d614e476301ffc9a760e01b610380565b91610380565b1490565b614e5961194f565b5080614e74614e6e637965db0b60e01b610380565b91610380565b14908115614e81575b5090565b614e8b9150614bff565b38614e7d56fea2646970667358221220d98fcdef81ec522fcba1acca23d497678e75a7dcd4b963ff641b6c4d127027a364736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -218,233 +16,241 @@ export class ERC1155SoulboundFactory extends ContractFactory { export const ERC1155SOULBOUNDFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC1155/presets/soulbound/ERC1155SoulboundFactory.sol:ERC1155SoulboundFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC1155/presets/soulbound/ERC1155SoulboundFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {ERC1155Soulbound} from "@0xsequence/contracts-library/tokens/ERC1155/presets/soulbound/ERC1155Soulbound.sol";\nimport {\n IERC1155SoulboundFactory,\n IERC1155SoulboundFactoryFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/presets/soulbound/IERC1155SoulboundFactory.sol";\nimport {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\n\n/**\n * Deployer of ERC-1155 Soulbound proxies.\n */\ncontract ERC1155SoulboundFactory is IERC1155SoulboundFactory, SequenceProxyFactory {\n /**\n * Creates an ERC-1155 Soulbound Factory.\n * @param factoryOwner The owner of the ERC-1155 Soulbound Factory\n */\n constructor(address factoryOwner) {\n ERC1155Soulbound impl = new ERC1155Soulbound();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155SoulboundFactoryFunctions\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 ) external returns (address proxyAddr) {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC1155Soulbound(proxyAddr).initialize(\n tokenOwner, name, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator\n );\n emit ERC1155SoulboundDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155SoulboundFactoryFunctions\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' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC1155Soulbound } from "./ERC1155Soulbound.sol";\nimport { IERC1155SoulboundFactory, IERC1155SoulboundFactoryFunctions } from "./IERC1155SoulboundFactory.sol";\nimport { SequenceProxyFactory } from "src/proxies/SequenceProxyFactory.sol";\n\n/**\n * Deployer of ERC-1155 Soulbound proxies.\n */\ncontract ERC1155SoulboundFactory is IERC1155SoulboundFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-1155 Soulbound Factory.\n * @param factoryOwner The owner of the ERC-1155 Soulbound Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC1155Soulbound impl = new ERC1155Soulbound();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC1155SoulboundFactoryFunctions\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 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 ERC1155Soulbound(proxyAddr).initialize(\n tokenOwner,\n name,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n emit ERC1155SoulboundDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC1155SoulboundFactoryFunctions\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 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/tokens/ERC1155/presets/soulbound/ERC1155Soulbound.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {ERC1155Items} from "@0xsequence/contracts-library/tokens/ERC1155/presets/items/ERC1155Items.sol";\nimport {\n IERC1155Soulbound,\n IERC1155SoulboundFunctions\n} from "@0xsequence/contracts-library/tokens/ERC1155/presets/soulbound/IERC1155Soulbound.sol";\n\n/**\n * An implementation of ERC-1155 that prevents transfers.\n */\ncontract ERC1155Soulbound is ERC1155Items, IERC1155Soulbound {\n bytes32 public constant TRANSFER_ADMIN_ROLE = keccak256("TRANSFER_ADMIN_ROLE");\n\n bool internal _transferLocked;\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 ) public virtual override {\n _transferLocked = true;\n _grantRole(TRANSFER_ADMIN_ROLE, owner);\n super.initialize(owner, tokenName, tokenBaseURI, tokenContractURI, royaltyReceiver, royaltyFeeNumerator);\n }\n\n /// @inheritdoc IERC1155SoulboundFunctions\n function setTransferLocked(bool locked) external override onlyRole(TRANSFER_ADMIN_ROLE) {\n _transferLocked = locked;\n }\n\n /// @inheritdoc IERC1155SoulboundFunctions\n function getTransferLocked() external view override returns (bool) {\n return _transferLocked;\n }\n\n // Transfer hooks\n\n function _safeTransferFrom(address from, address to, uint256 id, uint256 amount) internal virtual override {\n // Mint transactions allowed\n if (_transferLocked && from != address(0)) {\n revert TransfersLocked();\n }\n super._safeTransferFrom(from, to, id, amount);\n }\n\n function _safeBatchTransferFrom(address from, address to, uint256[] memory ids, uint256[] memory amounts)\n internal\n virtual\n override\n {\n // Mint transactions allowed\n if (_transferLocked && from != address(0)) {\n revert TransfersLocked();\n }\n super._safeBatchTransferFrom(from, to, ids, amounts);\n }\n\n function _burn(address from, uint256 id, uint256 amount) internal virtual override {\n if (_transferLocked) {\n revert TransfersLocked();\n }\n super._burn(from, id, amount);\n }\n\n function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual override {\n if (_transferLocked) {\n revert TransfersLocked();\n }\n super._batchBurn(from, ids, amounts);\n }\n\n // Views\n\n function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n return type(IERC1155SoulboundFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC1155Items } from "../items/ERC1155Items.sol";\nimport { IERC1155Soulbound, IERC1155SoulboundFunctions } from "./IERC1155Soulbound.sol";\n\nimport { ERC1155 } from "solady/tokens/ERC1155.sol";\n\n/**\n * An implementation of ERC-1155 that prevents transfers.\n */\ncontract ERC1155Soulbound is ERC1155Items, IERC1155Soulbound {\n\n bytes32 public constant TRANSFER_ADMIN_ROLE = keccak256("TRANSFER_ADMIN_ROLE");\n\n bool internal _transferLocked;\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 _transferLocked = true;\n _grantRole(TRANSFER_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 IERC1155SoulboundFunctions\n function setTransferLocked(\n bool locked\n ) external override onlyRole(TRANSFER_ADMIN_ROLE) {\n _transferLocked = locked;\n }\n\n /// @inheritdoc IERC1155SoulboundFunctions\n function getTransferLocked() external view override returns (bool) {\n return _transferLocked;\n }\n\n // Transfer hooks\n\n /// @dev Use the beforeTokenTransfer hook to block transfers\n function _useBeforeTokenTransfer() internal pure override returns (bool) {\n return true;\n }\n\n /// @inheritdoc ERC1155\n /// @dev Block transfers if the token is soulbound\n /// @dev Mint transactions allowed\n function _beforeTokenTransfer(\n address from,\n address,\n uint256[] memory,\n uint256[] memory,\n bytes memory\n ) internal virtual override {\n if (_transferLocked && from != address(0)) {\n revert TransfersLocked();\n }\n }\n\n function _burn(address from, uint256 id, uint256 amount) internal virtual override {\n if (_transferLocked) {\n revert TransfersLocked();\n }\n super._burn(from, id, amount);\n }\n\n function _batchBurn(address from, uint256[] memory ids, uint256[] memory amounts) internal virtual override {\n if (_transferLocked) {\n revert TransfersLocked();\n }\n super._batchBurn(from, ids, amounts);\n }\n\n // Views\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override returns (bool) {\n return type(IERC1155SoulboundFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC1155/presets/soulbound/IERC1155SoulboundFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SoulboundFactoryFunctions {\n /**\n * Creates an ERC-1155 Soulbound proxy.\n * @param proxyOwner The owner of the ERC-1155 Soulbound proxy\n * @param tokenOwner The owner of the ERC-1155 Soulbound implementation\n * @param name The name of the ERC-1155 Soulbound proxy\n * @param baseURI The base URI of the ERC-1155 Soulbound proxy\n * @param contractURI The contract URI of the ERC-1155 Soulbound 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 Soulbound 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 ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-1155 Soulbound proxy\n * @param tokenOwner The owner of the ERC-1155 Soulbound implementation\n * @param name The name of the ERC-1155 Soulbound proxy\n * @param baseURI The base URI of the ERC-1155 Soulbound proxy\n * @param contractURI The contract URI of the ERC-1155 Soulbound 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 Soulbound 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 IERC1155SoulboundFactorySignals {\n /**\n * Event emitted when a new ERC-1155 Soulbound proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155SoulboundDeployed(address proxyAddr);\n}\n\ninterface IERC1155SoulboundFactory is IERC1155SoulboundFactoryFunctions, IERC1155SoulboundFactorySignals {}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SoulboundFactoryFunctions {\n\n /**\n * Creates an ERC-1155 Soulbound proxy.\n * @param proxyOwner The owner of the ERC-1155 Soulbound proxy\n * @param tokenOwner The owner of the ERC-1155 Soulbound implementation\n * @param name The name of the ERC-1155 Soulbound proxy\n * @param baseURI The base URI of the ERC-1155 Soulbound proxy\n * @param contractURI The contract URI of the ERC-1155 Soulbound 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 Soulbound 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 Soulbound proxy\n * @param tokenOwner The owner of the ERC-1155 Soulbound implementation\n * @param name The name of the ERC-1155 Soulbound proxy\n * @param baseURI The base URI of the ERC-1155 Soulbound proxy\n * @param contractURI The contract URI of the ERC-1155 Soulbound 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 Soulbound 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 IERC1155SoulboundFactorySignals {\n\n /**\n * Event emitted when a new ERC-1155 Soulbound proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC1155SoulboundDeployed(address proxyAddr);\n\n}\n\ninterface IERC1155SoulboundFactory is IERC1155SoulboundFactoryFunctions, IERC1155SoulboundFactorySignals { }\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/items/ERC1155Items.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\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/presets/soulbound/IERC1155Soulbound.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SoulboundFunctions {\n /**\n * Sets the transfer lock.\n * @param locked Whether or not transfers are locked.\n */\n function setTransferLocked(bool locked) external;\n\n /**\n * Gets the transfer lock.\n * @return Whether or not transfers are locked.\n */\n function getTransferLocked() external view returns (bool);\n}\n\ninterface IERC1155SoulboundSignals {\n /**\n * Transfers locked.\n */\n error TransfersLocked();\n}\n\ninterface IERC1155Soulbound is IERC1155SoulboundFunctions, IERC1155SoulboundSignals {}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC1155SoulboundFunctions {\n\n /**\n * Sets the transfer lock.\n * @param locked Whether or not transfers are locked.\n */\n function setTransferLocked(\n bool locked\n ) external;\n\n /**\n * Gets the transfer lock.\n * @return Whether or not transfers are locked.\n */\n function getTransferLocked() external view returns (bool);\n\n}\n\ninterface IERC1155SoulboundSignals {\n\n /**\n * Transfers locked.\n */\n error TransfersLocked();\n\n}\n\ninterface IERC1155Soulbound is IERC1155SoulboundFunctions, IERC1155SoulboundSignals { }\n' }, - 'src/proxies/TransparentUpgradeableBeaconProxy.sol': { + 'lib/solady/src/tokens/ERC1155.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\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/openzeppelin/contracts/utils/Create2.sol': { + 'src/proxies/TransparentUpgradeableBeaconProxy.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 { BeaconProxy, Proxy } from "./openzeppelin/BeaconProxy.sol";\nimport { ERC1967Proxy, TransparentUpgradeableProxy } from "./openzeppelin/TransparentUpgradeableProxy.sol";\n\ninterface ITransparentUpgradeableBeaconProxy {\n\n function initialize(address admin, address beacon, bytes memory data) external;\n\n}\n\nerror InvalidInitialization();\n\n/**\n * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation,\n * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors.\n * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * The proxy selectors are:\n * - 0xcf7a1d77: initialize\n * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy)\n * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy)\n * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy)\n * - 0xf851a440: admin (from TransparentUpgradeableProxy)\n * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy)\n */\ncontract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy {\n\n /**\n * Decode the initialization data from the msg.data and call the initialize function.\n */\n function _dispatchInitialize() private returns (bytes memory) {\n _requireZeroValue();\n\n (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes));\n initialize(admin, beacon, data);\n\n return "";\n }\n\n function initialize(address admin, address beacon, bytes memory data) internal {\n if (_admin() != address(0)) {\n // Redundant call. This function can only be called when the admin is not set.\n revert InvalidInitialization();\n }\n _changeAdmin(admin);\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev If the admin is not set, the fallback function is used to initialize the proxy.\n * @dev If the admin is set, the fallback function is used to delegatecall the implementation.\n */\n function _fallback() internal override(TransparentUpgradeableProxy, Proxy) {\n if (_getAdmin() == address(0)) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) {\n ret = _dispatchInitialize();\n // solhint-disable-next-line no-inline-assembly\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n }\n // When the admin is not set, the fallback function is used to initialize the proxy.\n revert InvalidInitialization();\n }\n TransparentUpgradeableProxy._fallback();\n }\n\n /**\n * Returns the current implementation address.\n * @dev This is the implementation address set by the admin, or the beacon implementation.\n */\n function _implementation() internal view override(ERC1967Proxy, BeaconProxy) returns (address) {\n address implementation = ERC1967Proxy._implementation();\n if (implementation != address(0)) {\n return implementation;\n }\n return BeaconProxy._implementation();\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/access/Ownable.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/Context.sol";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), "Ownable: caller is not the owner");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), "Ownable: new owner is the zero address");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IBeacon.sol";\nimport "../../access/Ownable.sol";\nimport "../../utils/Address.sol";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");\n _implementation = newImplementation;\n }\n}\n' }, - 'src/tokens/ERC1155/presets/items/IERC1155Items.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.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) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as \'counterfactual interactions\'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n require(address(this).balance >= amount, "Create2: insufficient balance");\n require(bytecode.length != 0, "Create2: bytecode length is zero");\n /// @solidity memory-safe-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), "Create2: Failed on deploy");\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract\'s address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := keccak256(start, 85)\n }\n }\n}\n' }, 'src/tokens/ERC1155/ERC1155BaseToken.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\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' }, - 'src/tokens/common/ERC2981Controlled.sol': { + 'src/tokens/ERC1155/presets/items/IERC1155Items.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 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/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/common/ERC2981Controlled.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 { 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/0xsequence/erc-1155/src/contracts/tokens/ERC1155/ERC1155Metadata.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.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: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { AccessControlEnumerable } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport {\n IERC165,\n IImplicitProjectValidation,\n SignalsImplicitMode\n} from "signals-implicit-mode/src/helper/SignalsImplicitMode.sol";\n\n/**\n * An abstract contract that allows implicit session access for a given project.\n */\nabstract contract SignalsImplicitModeControlled is AccessControlEnumerable, SignalsImplicitMode {\n\n bytes32 internal constant _IMPLICIT_MODE_ADMIN_ROLE = keccak256("IMPLICIT_MODE_ADMIN_ROLE");\n\n function _initializeImplicitMode(address owner, address validator, bytes32 projectId) internal {\n _grantRole(_IMPLICIT_MODE_ADMIN_ROLE, owner);\n _initializeSignalsImplicitMode(validator, projectId);\n }\n\n /**\n * Updates the validator for implicit mode validation.\n * @param validator The validator address.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeValidator(\n address validator\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _validator = IImplicitProjectValidation(validator);\n }\n\n /**\n * Updates the settings for implicit mode validation.\n * @param projectId The project id.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeProjectId(\n bytes32 projectId\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _projectId = projectId;\n }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable, SignalsImplicitMode) returns (bool) {\n return\n AccessControlEnumerable.supportsInterface(interfaceId) || SignalsImplicitMode.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'src/tokens/common/IERC2981Controlled.sol': { + 'src/tokens/ERC1155/extensions/supply/ERC1155Supply.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: 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' }, - 'lib/openzeppelin/contracts/token/common/ERC2981.sol': { + 'lib/solady/src/utils/LibString.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\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/openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.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: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport "../beacon/IBeacon.sol";\nimport "../../interfaces/IERC1967.sol";\nimport "../../interfaces/draft-IERC1822.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/StorageSlot.sol";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");\n } catch {\n revert("ERC1967Upgrade: new implementation is not UUPS");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), "ERC1967: new admin is the zero address");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256(\'eip1967.proxy.beacon\')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n "ERC1967: beacon implementation is not a contract"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" }, - 'lib/openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { + 'src/proxies/openzeppelin/ERC1967Proxy.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: 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' }, - 'src/proxies/openzeppelin/ERC1967Proxy.sol': { + 'src/tokens/common/IERC2981Controlled.sol': { + content: + '// 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/contracts/access/AccessControlEnumerable.sol': { + content: + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControlEnumerable.sol";\nimport "./AccessControl.sol";\nimport "../utils/structs/EnumerableSet.sol";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n}\n' + }, + 'lib/openzeppelin-contracts/contracts/token/common/ERC2981.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\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/0xsequence/erc-1155/src/contracts/tokens/ERC1155/ERC1155.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.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: 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(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: 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/0xsequence/erc-1155/src/contracts/interfaces/IERC1155Metadata.sol': { + 'lib/solady/src/utils/LibBytes.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\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/0xsequence/erc-1155/src/contracts/utils/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: - 'pragma solidity ^0.8.0;\nimport "../interfaces/IERC165.sol";\n\nabstract contract ERC165 is IERC165 {\n /**\n * @notice Query if a contract implements an interface\n * @param _interfaceID The interface identifier, as specified in ERC-165\n * @return `true` if the contract implements `_interfaceID`\n */\n function supportsInterface(bytes4 _interfaceID) public view virtual override returns (bool) {\n return _interfaceID == this.supportsInterface.selector;\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/IERC2981.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.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) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.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) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/access/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: { - evmVersion: 'paris', - libraries: {}, - metadata: { - useLiteralContent: false, - bytecodeHash: 'ipfs', - appendCBOR: true - }, - optimizer: { enabled: true, runs: 20000 }, remappings: [ - '@0xsequence/contracts-library/=src/', - 'ds-test/=lib/forge-std/lib/ds-test/src/', + '@openzeppelin/contracts/=lib/murky/lib/openzeppelin-contracts/contracts/', + 'ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/', + 'erc2470-libs/=lib/erc2470-libs/', + 'erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/', 'forge-std/=lib/forge-std/src/', - 'murky/=lib/murky/src/', - '@0xsequence/erc20-meta-token/=lib/0xsequence/erc20-meta-token/src/', - '@0xsequence/erc-1155/=lib/0xsequence/erc-1155/src/', - 'erc721a/=lib/chiru-labs/erc721a/', - 'erc721a-upgradeable/=lib/chiru-labs/erc721a-upgradeable/', - '@openzeppelin/=lib/openzeppelin/', - '@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'solady/=lib/solady/src/', - '0xsequence/=lib/0xsequence/', - 'chiru-labs/=lib/chiru-labs/', + '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/' ], - 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: {} } } } diff --git a/scripts/factories/token_library/ERC20ItemsFactory.ts b/scripts/factories/token_library/ERC20ItemsFactory.ts index 42ce82a..9c7dd9f 100644 --- a/scripts/factories/token_library/ERC20ItemsFactory.ts +++ b/scripts/factories/token_library/ERC20ItemsFactory.ts @@ -1,113 +1,14 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' -// https://github.com/0xsequence/contracts-library/blob/b32f88b298fc73ec1c4be5e845185de91f41c9ff/src/tokens/ERC20/presets/items/ERC20ItemsFactory.sol - -const abi = [ - { - type: 'constructor', - inputs: [{ name: 'factoryOwner', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' - }, - { - type: 'function', - name: 'beacon', - inputs: [], - outputs: [ - { - name: '', - type: 'address', - internalType: 'contract UpgradeableBeacon' - } - ], - stateMutability: 'view' - }, - { - 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: 'decimals', type: 'uint8', internalType: 'uint8' } - ], - outputs: [{ name: 'proxyAddr', type: 'address', internalType: 'address' }], - stateMutability: 'nonpayable' - }, - { - type: 'function', - name: 'owner', - inputs: [], - outputs: [{ name: '', type: 'address', internalType: 'address' }], - stateMutability: 'view' - }, - { - 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: 'implementation', - type: 'address', - internalType: 'address' - } - ], - outputs: [], - stateMutability: 'nonpayable' - }, - { - type: 'event', - name: 'ERC20ItemsDeployed', - 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' - } - ], - anonymous: false - } -] +// https://github.com/0xsequence/contracts-library/blob/8a229e34702984b948bd2ac82059388ed08cbe4b/src/tokens/ERC20/presets/items/ERC20ItemsFactory.sol export class ERC20ItemsFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, - '0x608034610121576001600160401b0390601f614d8c38819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b825193612a4a94858101958187108388111761010b57612342823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611d54853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611be6908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c806303e29ab7146103b3578381631bce4583146102e95750806359659e9014610296578063715018a6146101f65780638da5cb5b146101a15763f2fde38b1461006557600080fd5b3461019d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261019d5761009c610770565b906100a5610891565b73ffffffffffffffffffffffffffffffffffffffff80921692831561011a575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b5050346101f257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f25773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b833461029357807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102935761022d610891565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b80fd5b5050346101f257817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f25760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b929050346103af5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126103af57610323610770565b61032b610891565b73ffffffffffffffffffffffffffffffffffffffff8060015416803b156103ab57859283602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af19081156103a257506103925750f35b61039b90610798565b6102935780f35b513d84823e3d90fd5b8580fd5b5050fd5b509190346101f25760a07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101f2576103ed610770565b916024359373ffffffffffffffffffffffffffffffffffffffff94858116810361019d5767ffffffffffffffff9160443583811161076c57610432903690830161081c565b926064358181116103ab5761044a903690840161081c565b6084359160ff831683036107685787519960209a8b81019061049f8161047388888d8d88610976565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081018352826107db565b5190208951928c84019081118482101761073c5761052460688e838f8f958f9087528952600154865196879485019889527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809360601b169085015260601b1660548301526105148851809285850190610910565b81010360488101845201826107db565b5190206111eb8c6105398c51918301826107db565b8181528d8101916109c683398051156106e157518392918bf516998a15610685578160015416928b3b1561068157906105b38a93928c5195869485947fcf7a1d77000000000000000000000000000000000000000000000000000000008652168a8501526024840152606060448401526064830190610933565b0381838d5af1801561067757610664575b50873b156103ab578593929161060591885196879586957ff6d2ee860000000000000000000000000000000000000000000000000000000087528601610976565b038183885af1801561065a57610646575b50507f2f7aebcaa1b6e607137fc80962355832b79ed6710cc89acb7987434d1e4d1b24838251848152a151908152f35b6106508291610798565b6102935780610616565b83513d84823e3d90fd5b61067090969196610798565b94386105c4565b88513d89823e3d90fd5b8980fd5b6064868d8c51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b6064888f808f51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b60248a6041897f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8680fd5b8480fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361079357565b600080fd5b67ffffffffffffffff81116107ac57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107ac57604052565b81601f820112156107935780359067ffffffffffffffff82116107ac576040519261086f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f86011601856107db565b8284526020838301011161079357816000926020809301838601378301015290565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108b257565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b8381106109235750506000910152565b8181015183820152602001610913565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60209361096f81518092818752878088019101610910565b0116010190565b926109be906109b060609473ffffffffffffffffffffffffffffffffffffffff60ff95999899168752608060208801526080870190610933565b908582036040870152610933565b941691015256fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea26469706673582212205afdfcf2db2f242d1c90fc4524ff1841da37419738805ee0571bd2744b6196ce64736f6c63430008130033a26469706673582212202d87d0486aad8a5ab0ef6bd61270f7579fa92f7d179c5ac443fdc4f9a35c38e964736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ee02a7cc9adae68564feda64934170f02f3f12a55b74647721baba4fb366157164736f6c6343000813003360c060405234620002f85762000014620002fd565b6200001e620002fd565b8151906001600160401b0390818311620001f8576003908154906001948583811c9316968715620002ed575b60209788851014620002d7578190601f9485811162000281575b5088908583116001146200021a576000926200020e575b505060001982861b1c191690861b1783555b8051938411620001f85760049586548681811c91168015620001ed575b82821014620001d8578381116200018d575b50809285116001146200011f575093839491849260009562000113575b50501b92600019911b1c19161790555b336080523360a0526040516127289081620003228239608051816101d8015260a051816101a70152f35b015193503880620000d9565b92919084601f1981168860005285600020956000905b8983831062000172575050501062000157575b50505050811b019055620000e9565b01519060f884600019921b161c191690553880808062000148565b85870151895590970196948501948893509081019062000135565b87600052816000208480880160051c820192848910620001ce575b0160051c019087905b828110620001c1575050620000bc565b60008155018790620001b1565b92508192620001a8565b602288634e487b7160e01b6000525260246000fd5b90607f1690620000aa565b634e487b7160e01b600052604160045260246000fd5b0151905038806200007b565b90889350601f19831691876000528a6000209260005b8c8282106200026a575050841162000251575b505050811b0183556200008d565b015160001983881b60f8161c1916905538808062000243565b8385015186558c9790950194938401930162000230565b90915085600052886000208580850160051c8201928b8610620002cd575b918a91869594930160051c01915b828110620002bd57505062000064565b600081558594508a9101620002ad565b925081926200029f565b634e487b7160e01b600052602260045260246000fd5b92607f16926200004a565b600080fd5b60405190602082016001600160401b03811183821017620001f8576040526000825256fe608060409080825260048036101561001657600080fd5b600091823560e01c90816301ffc9a7146118a95750806306fdde03146117ff578063095ea7b3146117d557806318160ddd146117b657806323b872dd146116c6578063248a9ca31461169a5780632f2ff15d146115b5578063313ce5671461159357806336568abe146114ce578063395093511461147257806340c10f191461124f57806342966c68146110d75780635a44621514610ae957806370a0823114610aa65780639010d07c14610a5657806391d1485414610a0257806395d89b4114610903578063a217fddf146108e8578063a457c2d714610801578063a9059cbb146107d0578063ca15c873146107a7578063d547741f14610765578063dd62ed3e1461070f5763f6d2ee861461012c57600080fd5b3461070b57608060031936011261070b576101456119b2565b67ffffffffffffffff93602435858111610707576101669036908501611a89565b926044358681116107035761017e9036908301611a89565b956064359460ff86168096036106ff5773ffffffffffffffffffffffffffffffffffffffff92837f00000000000000000000000000000000000000000000000000000000000000001633148015906106f0575b6106ba57837f00000000000000000000000000000000000000000000000000000000000000001633148015906106e1575b6106ba57815183811161068e578061021b600754612550565b93601f94858111610622575b50602090858311600114610583578b92610578575b50506000198260011b9260031b1c1916176007555b885192831161054c5750610266600854612550565b8181116104ec575b506020908211600114610447578190879861037a97989261043c575b50506000198260011b9260031b1c1916176008555b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009060099582875416178655868052600560205282872093169283875260205260ff8287205416156103f3575b858052600660205261030083838820612372565b506101007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff8654161785557f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690818752600560205282872084885260205260ff8388205416156103a9575b50855260066020528420612372565b50620100007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ffff82541617905580f35b81875260056020528287208488526020526001838820918254161790553383827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8980a43861036b565b85805260056020528186208387526020528186206001828254161790553383877f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a46102ec565b01519050388061028a565b600887527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3977fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08316885b8181106104d457509161037a979899918460019594106104bb575b505050811b0160085561029f565b015160001960f88460031b161c191690553880806104ad565b838301518b556001909a019960209384019301610492565b600888527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee38280850160051c82019260208610610543575b0160051c01905b818110610538575061026e565b88815560010161052b565b92508192610524565b8760416024927f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b01519050388061023c565b60078c527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168c5b81811061060a57509084600195949392106105f1575b505050811b01600755610251565b015160001960f88460031b161c191690553880806105e3565b929360206001819287860151815501950193016105cd565b90915060078b527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888580850160051c82019260208610610685575b9085949392910160051c01905b8181106106775750610227565b8c815584935060010161066a565b9250819261065d565b6024896041847f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b84517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff60095460081c16610202565b5060ff60095460101c166101d1565b8680fd5b8580fd5b8480fd5b5080fd5b82843461070b578060031936011261070b578060209261072d6119b2565b6107356119da565b73ffffffffffffffffffffffffffffffffffffffff91821683526001865283832091168252845220549051908152f35b5082346107a357806003193601126107a3576107a0913561079b60016107896119da565b93838752600560205286200154611afe565b611d3d565b80f35b8280fd5b508290346107a35760206003193601126107a35760209282913581526006845220549051908152f35b82843461070b578060031936011261070b576020906107fa6107f06119b2565b6024359033611e2e565b5160018152f35b5090346108e557826003193601126108e55761081b6119b2565b918360243592338152600160205281812073ffffffffffffffffffffffffffffffffffffffff86168252602052205490828210610862576020856107fa858503873361203d565b60849060208651917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152fd5b80fd5b82843461070b578160031936011261070b5751908152602090f35b82843461070b578160031936011261070b578051908260085461092581612550565b808552916001918083169081156109bc575060011461095f575b5050506109518261095b940383611a48565b5191829182611968565b0390f35b9450600885527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35b8286106109a45750505061095182602061095b958201019461093f565b80546020878701810191909152909501948101610987565b61095b9750869350602092506109519491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b8201019461093f565b508290346107a357816003193601126107a3578160209360ff92610a246119da565b903582526005865273ffffffffffffffffffffffffffffffffffffffff83832091168252855220541690519015158152f35b508290346107a357816003193601126107a357610a9760209373ffffffffffffffffffffffffffffffffffffffff923581526006855283602435912061235a565b92905490519260031b1c168152f35b82843461070b57602060031936011261070b578060209273ffffffffffffffffffffffffffffffffffffffff610ada6119b2565b16815280845220549051908152f35b50913461070b578060031936011261070b5767ffffffffffffffff9083358281116110d357610b1b9036908601611a89565b906024803584811161070357610b349036908801611a89565b9585805260209260058452808720338852845260ff818820541615610e5d57508351858111610e325780610b69600754612550565b95601f96878111610dc7575b508590878311600114610d28578992610d1d575b50506000198260011b9260031b1c1916176007555b8651948511610cf3575050610bb4600854612550565b828111610c94575b5080918311600114610bf557508293829392610bea575b50506000198260011b9260031b1c19161760085580f35b015190503880610bd3565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0831694600885527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee39285905b878210610c7c575050836001959610610c63575b505050811b0160085580f35b015160001960f88460031b161c19169055388080610c57565b80600185968294968601518155019501930190610c43565b600885527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee38380860160051c820192848710610cea575b0160051c01905b818110610cdf5750610bbc565b858155600101610cd2565b92508192610ccb565b604186917f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b015190503880610b89565b60078a527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0168a5b88828210610db1575050908460019594939210610d98575b505050811b01600755610b9e565b015160001960f88460031b161c19169055388080610d8a565b6001859682939686015181550195019301610d72565b909150600789527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6888780850160051c820192888610610e29575b9085949392910160051c01905b818110610e1b5750610b75565b8a8155849350600101610e0e565b92508192610e01565b50604186917f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b91868491610e6a336121f2565b85519183610e77846119fd565b604284528584019460603687378451156110a8576030865384519060019182101561107d5790607860218701536041915b818311610fd557505050610f7a5750610f76938693610f4893610f39604894610f049a519a857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008d978801528251928391603789019101611945565b8401917f206973206d697373696e6720726f6c6520000000000000000000000000000000603784015251809386840190611945565b01036028810187520185611a48565b519283927f08c379a00000000000000000000000000000000000000000000000000000000084528301611968565b0390fd5b925050508160649451937f08c379a00000000000000000000000000000000000000000000000000000000085528401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015611052577f3031323334353637383961626364656600000000000000000000000000000000901a61101285896121b2565b53891c92801561102757600019019190610ea8565b848260118c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b858360328d7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8060328a7f4e487b710000000000000000000000000000000000000000000000000000000087945252fd5b90506032877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8380fd5b5082346107a357602090816003193601126110d35782359233156111ce57338552848352818520549084821061114c5750917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef918486959433875286845203818620558360025403600255519283523392a380f35b608490848451917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152fd5b8260849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152fd5b508290346107a357816003193601126107a35761126a6119b2565b906024928335917f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69384875260209460058652838820338952865260ff848920541615611376575073ffffffffffffffffffffffffffffffffffffffff1694851561131c575050918185936113027fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef94600254611df2565b60025585855284835280852082815401905551908152a380f35b601f908560649451937f08c379a00000000000000000000000000000000000000000000000000000000085528401528201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152fd5b859150868891611385336121f2565b9091865192611393846119fd565b604284528584019460603687378451156110a8576030865384519060019182101561107d5790607860218701536041915b81831161142057505050610f7a5750610f76938693610f4893610f39604894610f049a519a857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008d978801528251928391603789019101611945565b909192600f81166010811015611052577f3031323334353637383961626364656600000000000000000000000000000000901a61145d85896121b2565b53891c928015611027576000190191906113c4565b82843461070b578060031936011261070b576107fa6020926114c76114956119b2565b913381526001865284812073ffffffffffffffffffffffffffffffffffffffff84168252865284602435912054611df2565b903361203d565b503461070b578260031936011261070b576114e76119da565b903373ffffffffffffffffffffffffffffffffffffffff83160361151057906107a09135611d3d565b60849060208551917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b82843461070b578160031936011261070b5760209060ff600954169051908152f35b5082346107a357806003193601126107a35761162f91359060066115d76119da565b92808652602090600582526115f160018589200154611afe565b8087526005825273ffffffffffffffffffffffffffffffffffffffff848820951694858852825260ff848820541615611633575b8652528320612372565b5080f35b80875260058252838720858852825283872060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8a80a4611625565b508290346107a35760206003193601126107a35781602093600192358152600585522001549051908152f35b503461070b57606060031936011261070b576116e06119b2565b6116e86119da565b91846044359473ffffffffffffffffffffffffffffffffffffffff8416815260016020528181203382526020522054906000198203611730575b6020866107fa878787611e2e565b848210611759575091839161174e602096956107fa9503338361203d565b919394819350611722565b60649060208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152fd5b82843461070b578160031936011261070b576020906002549051908152f35b82843461070b578060031936011261070b576020906107fa6117f56119b2565b602435903361203d565b82843461070b578160031936011261070b578051908260075461182181612550565b808552916001918083169081156109bc575060011461184c575050506109518261095b940383611a48565b9450600785527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6885b8286106118915750505061095182602061095b958201019461093f565b80546020878701810191909152909501948101611874565b919050346107a35760206003193601126107a357357fffffffff0000000000000000000000000000000000000000000000000000000081168082036110d357602093507f1a856d0c0000000000000000000000000000000000000000000000000000000014908115611934575b8115611924575b5015158152f35b61192e91506125a3565b8361191d565b905061193f816125a3565b90611916565b60005b8381106119585750506000910152565b8181015183820152602001611948565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f604093602084526119ab8151809281602088015260208888019101611945565b0116010190565b6004359073ffffffffffffffffffffffffffffffffffffffff821682036119d557565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff821682036119d557565b6080810190811067ffffffffffffffff821117611a1957604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117611a1957604052565b81601f820112156119d55780359067ffffffffffffffff8211611a195760405192611adc60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185611a48565b828452602083830101116119d557816000926020809301838601378301015290565b600081815260209060058252604092838220338352835260ff848320541615611b275750505050565b611b30336121f2565b845191611b3c836119fd565b60428352848301936060368637835115611d105760308553835190600191821015611d105790607860218601536041915b818311611c6357505050611c0757610f04938593611bd793611bc8604894610f76995198857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008b978801528251928391603789019101611945565b01036028810185520183611a48565b519182917f08c379a000000000000000000000000000000000000000000000000000000000835260048301611968565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015611ce3577f3031323334353637383961626364656600000000000000000000000000000000901a611ca085886121b2565b5360041c928015611cb657600019019190611b6d565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b906040611d8992600090808252600560205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff8383205416611d8c575b8152600660205220612415565b50565b80825260056020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4611d7c565b91908201809211611dff57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff809116918215611fb95716918215611f3557600082815280602052604081205491808310611eb157604082827fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef958760209652828652038282205586815220818154019055604051908152a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff80911691821561212f57169182156120ab5760207f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925918360005260018252604060002085600052825280604060002055604051908152a3565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152fd5b60846040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152fd5b9081518110156121c3570160200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b604051906060820182811067ffffffffffffffff821117611a1957604052602a82526020820160403682378251156121c3576030905381516001908110156121c357607860218401536029905b8082116122ad57505061224f5790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f8116601081101561232c577f3031323334353637383961626364656600000000000000000000000000000000901a6122e984866121b2565b5360041c9180156122fe57600019019061223f565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b80548210156121c35760005260206000200190600090565b9190600183016000908282528060205260408220541560001461240f57845494680100000000000000008610156123e257836123d26123bb886001604098999a0185558461235a565b81939154906000199060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014612549576000199182810181811161251c578254908482019182116124ef578082036124ba575b5050508054801561248d57820191612470838361235a565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b6124da6124ca6123bb938661235a565b90549060031b1c9283928661235a565b90558652846020526040862055388080612458565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b90600182811c92168015612599575b602083101461256a57565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f169161255f565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f36372b07000000000000000000000000000000000000000000000000000000008214918215612622575b508115612611575b8115612604575090565b61260e915061264c565b90565b905061261c8161264c565b906125fa565b7fa219a02500000000000000000000000000000000000000000000000000000000149150386125f2565b7fffffffff00000000000000000000000000000000000000000000000000000000167f5a05180f00000000000000000000000000000000000000000000000000000000811490811561269c575090565b7f7965db0b000000000000000000000000000000000000000000000000000000008114915081156126cb575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea2646970667358221220ddbcdbf43b933f6465e76fc74b27ee1555ec91b3114c4950fb16acac4b4e2fdd64736f6c63430008130033', + FACTORY_DEFAULT_ABI, + '60806040523461002f576100196100146100fa565b610169565b610021610034565b6126a261039782396126a290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b6101186170bb8038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b613be0810181811060018060401b038211176101c5576101a18291613be0612a39843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa261661985396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610537565b61001e60003561008d565b80631bce45831461008857806359659e9014610083578063715018a61461007e5780638cfd4e5e146100795780638da5cb5b14610074578063f13b273d1461006f5763f2fde38b0361000e57610504565b6104c8565b610493565b610457565b61021f565b6101ea565b610108565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b906020828203126100fd576100fa916000016100d4565b90565b61009e565b60000190565b346101365761012061011b3660046100e3565b610635565b610128610093565b8061013281610102565b0390f35b610099565b600091031261014657565b61009e565b1c90565b60018060a01b031690565b61016a90600861016f930261014b565b61014f565b90565b9061017d915461015a565b90565b61018d6001600090610172565b90565b90565b6101a76101a26101ac926100a8565b610190565b6100a8565b90565b6101b890610193565b90565b6101c4906101af565b90565b6101d0906101bb565b9052565b91906101e8906000602085019401906101c7565b565b3461021a576101fa36600461013b565b610216610205610180565b61020d610093565b918291826101d4565b0390f35b610099565b3461024d5761022f36600461013b565b610237610691565b61023f610093565b8061024981610102565b0390f35b610099565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906102869061025c565b810190811067ffffffffffffffff8211176102a057604052565b610266565b906102b86102b1610093565b928361027c565b565b67ffffffffffffffff81116102d8576102d460209161025c565b0190565b610266565b90826000939282370152565b909291926102fe6102f9826102ba565b6102a5565b9381855260208501908284011161031a57610318926102dd565b565b610257565b9080601f8301121561033d5781602061033a933591016102e9565b90565b610252565b60ff1690565b61035181610342565b0361035857565b600080fd5b9050359061036a82610348565b565b90565b6103788161036c565b0361037f57565b600080fd5b905035906103918261036f565b565b60e08183031261042f576103aa82600083016100d4565b926103b883602084016100d4565b92604083013567ffffffffffffffff811161042a57816103d991850161031f565b92606081013567ffffffffffffffff811161042557826103fa91830161031f565b9261042261040b846080850161035d565b936104198160a086016100d4565b9360c001610384565b90565b6100a3565b6100a3565b61009e565b61043d906100b3565b9052565b919061045590600060208501940190610434565b565b3461048e5761048a61047961046d366004610393565b959490949391936107bb565b610481610093565b91829182610441565b0390f35b610099565b346104c3576104a336600461013b565b6104bf6104ae61084d565b6104b6610093565b91829182610441565b0390f35b610099565b346104ff576104fb6104ea6104de366004610393565b95949094939193610887565b6104f2610093565b91829182610441565b0390f35b610099565b346105325761051c6105173660046100e3565b610ab2565b610524610093565b8061052e81610102565b0390f35b610099565b600080fd5b61054d90610548610b40565b6105a2565b565b60001c90565b6105616105669161054f565b61014f565b90565b6105739054610555565b90565b600080fd5b60e01b90565b600091031261058c57565b61009e565b610599610093565b3d6000823e3d90fd5b6105b46105af6001610569565b6101bb565b90633659cfe690823b15610630576105ec926105e1600080946105d5610093565b9687958694859361057b565b835260048301610441565b03925af1801561062b576105fe575b50565b61061e9060003d8111610624575b610616818361027c565b810190610581565b386105fb565b503d61060c565b610591565b610576565b61063e9061053c565b565b610648610b40565b61065061067d565b565b90565b61066961066461066e92610652565b610190565b6100a8565b90565b61067a90610655565b90565b61068f61068a6000610671565b610bbc565b565b610699610640565b565b600090565b5190565b60209181520190565b60005b8381106106c1575050906000910152565b8060209183015181850152016106b0565b6106f16106fa6020936106ff936106e8816106a0565b938480936106a4565b958691016106ad565b61025c565b0190565b61070c90610342565b9052565b6107199061036c565b9052565b919461076f61076460a095610756610779956107809a9c9b999c61074960c08a019260008b0190610434565b88820360208a01526106d2565b9086820360408801526106d2565b986060850190610703565b6080830190610434565b0190610710565b565b60200190565b5190565b9061079e610799836102ba565b6102a5565b918252565b6107ad600061078c565b90565b6107b86107a3565b90565b949361081e966107fc94956107ed936107d261069b565b509496929091926107e1610093565b9788966020880161071d565b6020820181038252038261027c565b61080e61080882610788565b91610782565b20906108186107b0565b91610ccc565b90565b60018060a01b031690565b61083861083d9161054f565b610821565b90565b61084a905461082c565b90565b61085561069b565b506108606000610840565b90565b61086c90610193565b90565b61087890610863565b90565b610884906101af565b90565b6108ee9096919293959661089961069b565b50836108cc86916108bd8a8a8d9089926108b1610093565b9788966020880161071d565b6020820181038252038261027c565b6108de6108d882610788565b91610782565b20906108e86107b0565b91610e2c565b956109006108fb8861086f565b61087b565b92639c14f29890949695919295843b156109bf5760009661093594889461094093610929610093565b9b8c9a8b998a9861057b565b88526004880161071d565b03925af180156109ba5761098d575b50806109877f2f7aebcaa1b6e607137fc80962355832b79ed6710cc89acb7987434d1e4d1b249161097e610093565b91829182610441565b0390a190565b6109ad9060003d81116109b3575b6109a5818361027c565b810190610581565b3861094f565b503d61099b565b610591565b610576565b6109d5906109d0610b40565b610a81565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610a3260266040926106a4565b610a3b816109d7565b0190565b610a559060208101906000818303910152610a25565b90565b15610a5f57565b610a67610093565b62461bcd60e51b815280610a7d60048201610a3f565b0390fd5b610ab090610aab81610aa4610a9e610a996000610671565b6100b3565b916100b3565b1415610a58565b610bbc565b565b610abb906109c4565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610af1602080926106a4565b610afa81610abd565b0190565b610b149060208101906000818303910152610ae5565b90565b15610b1e57565b610b26610093565b62461bcd60e51b815280610b3c60048201610afe565b0390fd5b610b6a610b4b61084d565b610b64610b5e610b59610f6b565b6100b3565b916100b3565b14610b17565b565b60001b90565b90610b8360018060a01b0391610b6c565b9181191691161790565b610b96906101af565b90565b90565b90610bb1610bac610bb892610b8d565b610b99565b8254610b72565b9055565b610bc66000610840565b610bd1826000610b9c565b90610c05610bff7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610b8d565b91610b8d565b91610c0e610093565b80610c1881610102565b0390a3565b90565b610c2c610c319161036c565b610c1d565b9052565b60601b90565b610c4490610c35565b90565b610c5090610c3b565b90565b610c5f610c64916100b3565b610c47565b9052565b905090565b610c92610c8992602092610c8081610788565b94858093610c68565b938491016106ad565b0190565b60148093610cba602084610cb2610cc296610cc99b9a98610c20565b018092610c53565b018092610c53565b0190610c6d565b90565b610d5f9291610d09610d1892610ce061069b565b509193610cf5610cf06001610569565b6101bb565b610cfd610093565b95869460208601610c96565b6020820181038252038261027c565b610d2a610d2482610788565b91610782565b2061148a610d3a602082016102a5565b908082526111e36020830139610d58610d5282610788565b91610782565b2090610f84565b90565b90565b610d79610d74610d7e92610652565b610190565b610d62565b90565b610d8a90610193565b90565b610d9690610d81565b90565b610da290610193565b90565b610dae90610d99565b90565b610dba906101af565b90565b60209181520190565b610de5610dee602093610df393610ddc81610788565b93848093610dbd565b958691016106ad565b61025c565b0190565b610e1c610e29949293610e1260608401956000850190610434565b6020830190610434565b6040818403910152610dc6565b90565b610ebc9093929193610e3c61069b565b50610e7c8591610e6d610e57610e526001610569565b6101bb565b8690610e61610093565b95869460208601610c96565b6020820181038252038261027c565b610e8e610e8882610788565b91610782565b2061148a610e9e602082016102a5565b908082526111e36020830139610eb76000929192610d65565b611130565b92610ed6610ed1610ecc86610d8d565b610da5565b610db1565b63cf7a1d779190610eef610eea6001610569565b6101bb565b9392813b15610f66576000610f1791610f228296610f0b610093565b9889978896879561057b565b855260048501610df7565b03925af18015610f6157610f34575b50565b610f549060003d8111610f5a575b610f4c818361027c565b810190610581565b38610f31565b503d610f42565b610591565b610576565b610f7361069b565b503390565b610f81906101af565b90565b90610fa291610f9161069b565b5090610f9c30610f78565b916111b9565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b610fda601d6020926106a4565b610fe381610fa5565b0190565b610ffd9060208101906000818303910152610fcd565b90565b1561100757565b61100f610093565b62461bcd60e51b81528061102560048201610fe7565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b61105d602080926106a4565b61106681611029565b0190565b6110809060208101906000818303910152611051565b90565b1561108a57565b611092610093565b62461bcd60e51b8152806110a86004820161106a565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b6110e160196020926106a4565b6110ea816110ac565b0190565b61110490602081019060008183039101526110d4565b90565b1561110e57565b611116610093565b62461bcd60e51b81528061112c600482016110ee565b0390fd5b91909161113b61069b565b5061116261114830610f78565b3161115b61115584610d62565b91610d62565b1015611000565b61118861116e83610788565b61118161117b6000610d65565b91610d62565b1415611083565b60208251920190f5906111b7826111b06111aa6111a56000610671565b6100b3565b916100b3565b1415611107565b565b90605592600b926111c861069b565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a2646970667358221220cd646062cb417292f6d2898e5ada0fe14e78d8b561e44329e18b3e3630edc17d64736f6c634300081b003360c06040523461003957610011610049565b61001961003e565b6137ba610426823960805181612a1c015260a0518161175401526137ba90f35b610044565b60405190565b600080fd5b610051610057565b3360a052565b61005f610061565b565b61006961006b565b565b610073610121565b565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061009f90610075565b810190811060018060401b038211176100b757604052565b61007f565b906100cf6100c861003e565b9283610095565b565b60018060401b0381116100ed576100e9602091610075565b0190565b61007f565b906101046100ff836100d1565b6100bc565b918252565b61011360006100f2565b90565b61011e610109565b90565b61013a61012c610116565b610134610116565b90610140565b33608052565b9061014a9161014c565b565b9061015691610158565b565b9061016291610164565b565b9061016e91610170565b565b9061017a9161017c565b565b9061018691610188565b565b9061019291610194565b565b9061019e916101a0565b565b906101aa9161040d565b565b5190565b634e487b7160e01b600052602260045260246000fd5b90600160028304921680156101e6575b60208310146101e157565b6101b0565b91607f16916101d6565b600052602060002090565b601f602091010490565b1b90565b9190600861022591029161021f60001984610205565b92610205565b9181191691161790565b90565b90565b61024961024461024e9261022f565b610232565b61022f565b90565b90565b919061026a61026561027293610235565b610251565b908354610209565b9055565b600090565b61028d91610287610276565b91610254565b565b5b81811061029b575050565b806102a9600060019361027b565b01610290565b9190601f81116102bf575b505050565b6102cb6102f0936101f0565b9060206102d7846101fb565b830193106102f8575b6102e9906101fb565b019061028f565b3880806102ba565b91506102e9819290506102e0565b1c90565b9061031b9060001990600802610306565b191690565b8161032a9161030a565b906002021790565b9061033c816101ac565b9060018060401b0382116103fc5761035e8261035885546101c6565b856102af565b602090601f83116001146103935791809161038293600092610387575b5050610320565b90555b565b9091500151388061037b565b601f198316916103a2856101f0565b9260005b8181106103e4575091600293918560019694106103ca575b50505002019055610385565b6103da910151601f84169061030a565b90553880806103be565b919360206001819287870151815501950192016103a6565b61007f565b9061040b91610332565b565b9061041c610423926003610401565b6004610401565b56fe60806040526004361015610013575b610dcf565b61001e6000356101cd565b806301ffc9a7146101c857806306fdde03146101c3578063095ea7b3146101be5780630bb310de146101b957806318160ddd146101b457806323b872dd146101af578063248a9ca3146101aa5780632f2ff15d146101a5578063313ce567146101a057806336568abe1461019b578063395093511461019657806340c10f191461019157806342966c681461018c5780635a4462151461018757806370a08231146101825780639010d07c1461017d57806391d148541461017857806395d89b41146101735780639c14f2981461016e5780639d043a6614610169578063a217fddf14610164578063a457c2d71461015f578063a9059cbb1461015a578063ca15c87314610155578063d547741f14610150578063dd62ed3e1461014b5763ed4c2ac70361000e57610d9c565b610d66565b610d04565b610ccf565b610c99565b610c63565b610c2e565b610bbb565b610aec565b6109fe565b6109c8565b610992565b61090c565b6108d8565b610761565b61070e565b6106d8565b6106a4565b61066f565b610612565b6105af565b610510565b6104a0565b61044a565b6103ef565b61032a565b61025f565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b6101fd816101e8565b0361020457565b600080fd5b90503590610216826101f4565b565b906020828203126102325761022f91600001610209565b90565b6101de565b151590565b61024590610237565b9052565b919061025d9060006020850194019061023c565b565b3461028f5761028b61027a610275366004610218565b610dd9565b6102826101d3565b91829182610249565b0390f35b6101d9565b600091031261029f57565b6101de565b5190565b60209181520190565b60005b8381106102c5575050906000910152565b8060209183015181850152016102b4565b601f801991011690565b6102ff61030860209361030d936102f6816102a4565b938480936102a8565b958691016102b1565b6102d6565b0190565b61032791602082019160008184039101526102e0565b90565b3461035a5761033a366004610294565b610356610345610f52565b61034d6101d3565b91829182610311565b0390f35b6101d9565b60018060a01b031690565b6103739061035f565b90565b61037f8161036a565b0361038657565b600080fd5b9050359061039882610376565b565b90565b6103a68161039a565b036103ad57565b600080fd5b905035906103bf8261039d565b565b91906040838203126103ea57806103de6103e7926000860161038b565b936020016103b2565b90565b6101de565b346104205761041c61040b6104053660046103c1565b90610f68565b6104136101d3565b91829182610249565b0390f35b6101d9565b9060208282031261043f5761043c9160000161038b565b90565b6101de565b60000190565b346104785761046261045d366004610425565b61105f565b61046a6101d3565b8061047481610444565b0390f35b6101d9565b6104869061039a565b9052565b919061049e9060006020850194019061047d565b565b346104d0576104b0366004610294565b6104cc6104bb611099565b6104c36101d3565b9182918261048a565b0390f35b6101d9565b909160608284031261050b576105086104f1846000850161038b565b936104ff816020860161038b565b936040016103b2565b90565b6101de565b346105415761053d61052c6105263660046104d5565b916110af565b6105346101d3565b91829182610249565b0390f35b6101d9565b90565b61055281610546565b0361055957565b600080fd5b9050359061056b82610549565b565b90602082820312610587576105849160000161055e565b90565b6101de565b61059590610546565b9052565b91906105ad9060006020850194019061058c565b565b346105df576105db6105ca6105c536600461056d565b61112b565b6105d26101d3565b91829182610599565b0390f35b6101d9565b919060408382031261060d578061060161060a926000860161055e565b9360200161038b565b90565b6101de565b346106415761062b6106253660046105e4565b90611176565b6106336101d3565b8061063d81610444565b0390f35b6101d9565b60ff1690565b61065590610646565b9052565b919061066d9060006020850194019061064c565b565b3461069f5761067f366004610294565b61069b61068a6111ae565b6106926101d3565b91829182610659565b0390f35b6101d9565b346106d3576106bd6106b73660046105e4565b9061126e565b6106c56101d3565b806106cf81610444565b0390f35b6101d9565b34610709576107056106f46106ee3660046103c1565b906112d8565b6106fc6101d3565b91829182610249565b0390f35b6101d9565b3461073d576107276107213660046103c1565b90611359565b61072f6101d3565b8061073981610444565b0390f35b6101d9565b9060208282031261075c57610759916000016103b2565b90565b6101de565b3461078f57610779610774366004610742565b611365565b6107816101d3565b8061078b81610444565b0390f35b6101d9565b600080fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b906107be906102d6565b810190811067ffffffffffffffff8211176107d857604052565b61079e565b906107f06107e96101d3565b92836107b4565b565b67ffffffffffffffff81116108105761080c6020916102d6565b0190565b61079e565b90826000939282370152565b90929192610836610831826107f2565b6107dd565b938185526020850190828401116108525761085092610815565b565b610799565b9080601f830112156108755781602061087293359101610821565b90565b610794565b9190916040818403126108d357600081013567ffffffffffffffff81116108ce57836108a7918301610857565b92602082013567ffffffffffffffff81116108c9576108c69201610857565b90565b6101e3565b6101e3565b6101de565b34610907576108f16108eb36600461087a565b906115ae565b6108f96101d3565b8061090381610444565b0390f35b6101d9565b3461093c57610938610927610922366004610425565b6115ea565b61092f6101d3565b9182918261048a565b0390f35b6101d9565b919060408382031261096a578061095e610967926000860161055e565b936020016103b2565b90565b6101de565b6109789061036a565b9052565b91906109909060006020850194019061096f565b565b346109c3576109bf6109ae6109a8366004610941565b90611629565b6109b66101d3565b9182918261097c565b0390f35b6101d9565b346109f9576109f56109e46109de3660046105e4565b90611690565b6109ec6101d3565b91829182610249565b0390f35b6101d9565b34610a2e57610a0e366004610294565b610a2a610a196116bb565b610a216101d3565b91829182610311565b0390f35b6101d9565b610a3c81610646565b03610a4357565b600080fd5b90503590610a5582610a33565b565b909160c082840312610ae757610a70836000840161038b565b92602083013567ffffffffffffffff8111610ae25781610a91918501610857565b92604081013567ffffffffffffffff8111610add5782610ab2918301610857565b92610ada610ac38460608501610a48565b93610ad1816080860161038b565b9360a00161055e565b90565b6101e3565b6101e3565b6101de565b34610b2157610b0b610aff366004610a57565b94939093929192611745565b610b136101d3565b80610b1d81610444565b0390f35b6101d9565b600080fd5b908160c0910312610b395790565b610b26565b908160e0910312610b4c5790565b610b26565b91606083830312610bb657610b69826000850161038b565b92602081013567ffffffffffffffff8111610bb15783610b8a918301610b2b565b92604082013567ffffffffffffffff8111610bac57610ba99201610b3e565b90565b6101e3565b6101e3565b6101de565b34610bec57610be8610bd7610bd1366004610b51565b91611b3a565b610bdf6101d3565b91829182610599565b0390f35b6101d9565b90565b60001b90565b610c0e610c09610c1392610bf1565b610bf4565b610546565b90565b610c206000610bfa565b90565b610c2b610c16565b90565b34610c5e57610c3e366004610294565b610c5a610c49610c23565b610c516101d3565b91829182610599565b0390f35b6101d9565b34610c9457610c90610c7f610c793660046103c1565b90611c93565b610c876101d3565b91829182610249565b0390f35b6101d9565b34610cca57610cc6610cb5610caf3660046103c1565b90611ce7565b610cbd6101d3565b91829182610249565b0390f35b6101d9565b34610cff57610cfb610cea610ce536600461056d565b611d09565b610cf26101d3565b9182918261048a565b0390f35b6101d9565b34610d3357610d1d610d173660046105e4565b90611d59565b610d256101d3565b80610d2f81610444565b0390f35b6101d9565b9190604083820312610d615780610d55610d5e926000860161038b565b9360200161038b565b90565b6101de565b34610d9757610d93610d82610d7c366004610d38565b90611d7d565b610d8a6101d3565b9182918261048a565b0390f35b6101d9565b34610dca57610db4610daf36600461056d565b611e10565b610dbc6101d3565b80610dc681610444565b0390f35b6101d9565b600080fd5b600090565b610de1610dd4565b506306a15b4360e21b610dfc610df6836101e8565b916101e8565b148015610e20575b908115610e10575b5090565b610e1a9150611e1b565b38610e0c565b50610e2a81611e1b565b610e04565b606090565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610e6a575b6020831014610e6557565b610e34565b91607f1691610e5a565b60209181520190565b600052602060002090565b9060009291805490610ea3610e9c83610e4a565b8094610e74565b91600181169081600014610efc5750600114610ebf575b505050565b610ecc9192939450610e7d565b916000925b818410610ee45750500190388080610eba565b60018160209295939554848601520191019290610ed1565b92949550505060ff1916825215156020020190388080610eba565b90610f2191610e88565b90565b90610f44610f3d92610f346101d3565b93848092610f17565b03836107b4565b565b610f4f90610f24565b90565b610f5a610e2f565b50610f656009610f46565b90565b610f8591610f74610dd4565b50610f7d611e83565b91909161202c565b600190565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b610fc790610fc2610fbd610f8a565b6120ea565b61104a565b565b90565b610fe0610fdb610fe59261035f565b610fc9565b61035f565b90565b610ff190610fcc565b90565b610ffd90610fe8565b90565b9061101160018060a01b0391610bf4565b9181191691161790565b61102490610fe8565b90565b90565b9061103f61103a6110469261101b565b611027565b8254611000565b9055565b61105661105d91610ff4565b600761102a565b565b61106890610fae565b565b600090565b60001c90565b90565b6110846110899161106f565b611075565b90565b6110969054611078565b90565b6110a161106a565b506110ac600261108c565b90565b916110d9926110bc610dd4565b506110d16110c8611e83565b82908491612182565b9190916123f6565b600190565b600090565b6110ec90610546565b90565b906110f9906110e3565b600052602052604060002090565b90565b61111661111b9161106f565b611107565b90565b611128905461110a565b90565b600161114461114a9261113c6110de565b5060056110ef565b0161111e565b90565b906111689161116361115e8261112b565b6120ea565b61116a565b565b906111749161250c565b565b906111809161114d565b565b600090565b60ff1690565b61119961119e9161106f565b611187565b90565b6111ab905461118d565b90565b6111b6611182565b506111c1600b6111a1565b90565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b61121f602f6040926102a8565b611228816111c4565b0190565b6112429060208101906000818303910152611212565b90565b1561124c57565b6112546101d3565b62461bcd60e51b81528061126a6004820161122c565b0390fd5b9061129b916112968261129061128a611285611e83565b61036a565b9161036a565b14611245565b612536565b565b634e487b7160e01b600052601160045260246000fd5b6112c26112c89193929361039a565b9261039a565b82018092116112d357565b61129d565b611308916112e4610dd4565b506113026112f0611e83565b916112fd83948094611d7d565b6112b3565b9161202c565b600190565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b9061134b9161134661134161130d565b6120ea565b61134d565b565b90611357916125e4565b565b9061136391611331565b565b61136f90336127fe565b565b9061138b91611386611381610c16565b6120ea565b611596565b565b601f602091010490565b1b90565b919060086113b79102916113b160001984611397565b92611397565b9181191691161790565b6113d56113d06113da9261039a565b610fc9565b61039a565b90565b90565b91906113f66113f16113fe936113c1565b6113dd565b90835461139b565b9055565b6114149161140e61106a565b916113e0565b565b5b818110611422575050565b806114306000600193611402565b01611417565b9190601f8111611446575b505050565b61145261147793610e7d565b90602061145e8461138d565b8301931061147f575b6114709061138d565b0190611416565b388080611441565b915061147081929050611467565b1c90565b906114a2906000199060080261148d565b191690565b816114b191611491565b906002021790565b906114c3816102a4565b9067ffffffffffffffff8211611585576114e7826114e18554610e4a565b85611436565b602090601f831160011461151c5791809161150b93600092611510575b50506114a7565b90555b565b90915001513880611504565b601f1983169161152b85610e7d565b9260005b81811061156d57509160029391856001969410611553575b5050500201905561150e565b611563910151601f841690611491565b9055388080611547565b9193602060018192878701518155019501920161152f565b61079e565b90611594916114b9565b565b906115a56115ac92600961158a565b600a61158a565b565b906115b891611371565b565b6115c390610fcc565b90565b6115cf906115ba565b90565b906115dc906115c6565b600052602052604060002090565b611601611606916115f961106a565b5060006115d2565b61108c565b90565b600090565b90611618906110e3565b600052602052604060002090565b90565b9061164961164461164e9361163c611609565b50600661160e565b611626565b61291d565b90565b9061165b906115c6565b600052602052604060002090565b60ff1690565b61167b6116809161106f565b611669565b90565b61168d905461166f565b90565b6116b89160006116ad6116b3936116a5610dd4565b5060056110ef565b01611651565b611683565b90565b6116c3610e2f565b506116ce600a610f46565b90565b60101c90565b6116e36116e8916116d1565b611669565b90565b6116f590546116d7565b90565b60101b90565b9061170c62ff0000916116f8565b9181191691161790565b61171f90610237565b90565b90565b9061173a61173561174192611716565b611722565b82546116fe565b9055565b9394909192943361177e6117787f000000000000000000000000000000000000000000000000000000000000000061036a565b9161036a565b141580156117d7575b6117ba576117ac9561179f9486949091929394612a0f565b6117a761130d565b61250c565b6117b86001600b611725565b565b600063f92ee8a960e01b8152806117d360048201610444565b0390fd5b506117e2600b6116eb565b611787565b60018060a01b031690565b6117fe6118039161106f565b6117e7565b90565b61181090546117f2565b90565b61181c906115ba565b90565b60e01b90565b9050519061183282610549565b565b9060208282031261184e5761184b91600001611825565b90565b6101de565b5061186290602081019061038b565b90565b61186e9061036a565b9052565b50611881906020810190610209565b90565b61188d906101e8565b9052565b506118a090602081019061055e565b90565b6118ac90610546565b9052565b600080fd5b600080fd5b600080fd5b903560016020038236030381121561190057016020813591019167ffffffffffffffff82116118fb5760018202360383136118f657565b6118b5565b6118b0565b6118ba565b60209181520190565b9190611928816119218161192d95611905565b8095610815565b6102d6565b0190565b9035600160400382360303811215611947570190565b6118ba565b903560016020038236030381121561198d57016020813591019167ffffffffffffffff821161198857600182023603831361198357565b6118b5565b6118b0565b6118ba565b91906119ac816119a5816119b195610e74565b8095610815565b6102d6565b0190565b67ffffffffffffffff1690565b6119cb816119b5565b036119d257565b600080fd5b905035906119e4826119c2565b565b506119f59060208101906119d7565b90565b611a01906119b5565b9052565b90611a43906020611a3b611a3160408401611a23600088018861194c565b908683036000880152611992565b94828101906119e6565b9101906119f8565b90565b611af091611ae2611ad760c08301611a6e611a646000870187611853565b6000860190611865565b611a88611a7e6020870187611872565b6020860190611884565b611aa2611a986040870187611891565b60408601906118a3565b611abc611ab26060870187611891565b60608601906118a3565b611ac960808601866118bf565b90858303608087015261190e565b9260a0810190611931565b9060a0818403910152611a05565b90565b939290611b1f604091611b2794611b12606089019260008a019061096f565b8782036020890152611a46565b94019061058c565b565b611b316101d3565b3d6000823e3d90fd5b9150602090611b476110de565b50611b5a611b556007611806565b611813565b611b86633808a90b949294611b91611b72600861111e565b611b7a6101d3565b9788968795869561181f565b855260048501611af3565b03915afa908115611bd657600091611ba8575b5090565b611bc9915060203d8111611bcf575b611bc181836107b4565b810190611834565b38611ba4565b503d611bb7565b611b29565b60207f207a65726f000000000000000000000000000000000000000000000000000000917f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201520152565b611c3660256040926102a8565b611c3f81611bdb565b0190565b611c599060208101906000818303910152611c29565b90565b15611c6357565b611c6b6101d3565b62461bcd60e51b815280611c8160048201611c43565b0390fd5b90611c90910361039a565b90565b611ce291611c9f610dd4565b50611cdc611cab611e83565b91611cb7838590611d7d565b92611cd584611cce611cc88561039a565b9161039a565b1015611c5c565b9392611c85565b9161202c565b600190565b611d0491611cf3610dd4565b50611cfc611e83565b9190916123f6565b600190565b611d28611d23611d2d92611d1b61106a565b50600661160e565b611626565b612acb565b90565b90611d4b91611d46611d418261112b565b6120ea565b611d4d565b565b90611d5791612536565b565b90611d6391611d30565b565b90611d6f906115c6565b600052602052604060002090565b611da291611d98611d9d92611d9061106a565b506001611d65565b6115d2565b61108c565b90565b611dbe90611db9611db4610f8a565b6120ea565b611e03565b565b90611dcd60001991610bf4565b9181191691161790565b611de09061106f565b90565b90611df8611df3611dff926110e3565b611dd7565b8254611dc0565b9055565b611e0e906008611de3565b565b611e1990611da5565b565b611e23610dd4565b5080611e3e611e386336372b0760e01b6101e8565b916101e8565b148015611e62575b908115611e52575b5090565b611e5c9150612aeb565b38611e4e565b5080611e7d611e7763a219a02560e01b6101e8565b916101e8565b14611e46565b611e8b611609565b503390565b611ea4611e9f611ea992610bf1565b610fc9565b61035f565b90565b611eb590611e90565b90565b60207f7265737300000000000000000000000000000000000000000000000000000000917f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201520152565b611f1360246040926102a8565b611f1c81611eb8565b0190565b611f369060208101906000818303910152611f06565b90565b15611f4057565b611f486101d3565b62461bcd60e51b815280611f5e60048201611f20565b0390fd5b60207f7373000000000000000000000000000000000000000000000000000000000000917f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201520152565b611fbd60226040926102a8565b611fc681611f62565b0190565b611fe09060208101906000818303910152611fb0565b90565b15611fea57565b611ff26101d3565b62461bcd60e51b81528061200860048201611fca565b0390fd5b9061202161201c612028926113c1565b6113dd565b8254611dc0565b9055565b9190916120558161204e6120486120436000611eac565b61036a565b9161036a565b1415611f39565b61207b8361207461206e6120696000611eac565b61036a565b9161036a565b1415611fe3565b61209a8261209561208e60018590611d65565b86906115d2565b61200c565b9190916120e56120d36120cd7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925936115c6565b936115c6565b936120dc6101d3565b9182918261048a565b0390a3565b6120fc906120f6611e83565b90612c13565b565b60007f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000910152565b612133601d6020926102a8565b61213c816120fe565b0190565b6121569060208101906000818303910152612126565b90565b1561216057565b6121686101d3565b62461bcd60e51b81528061217e60048201612140565b0390fd5b61218d818390611d7d565b90816121a361219d60001961039a565b9161039a565b036121af575b50505050565b6121e1936121db916121d4846121cd6121c78561039a565b9161039a565b1015612159565b9392611c85565b9161202c565b388080806121a9565b60207f6472657373000000000000000000000000000000000000000000000000000000917f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201520152565b61224560256040926102a8565b61224e816121ea565b0190565b6122689060208101906000818303910152612238565b90565b1561227257565b61227a6101d3565b62461bcd60e51b81528061229060048201612252565b0390fd5b60207f6573730000000000000000000000000000000000000000000000000000000000917f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201520152565b6122ef60236040926102a8565b6122f881612294565b0190565b61231290602081019060008183039101526122e2565b90565b1561231c57565b6123246101d3565b62461bcd60e51b81528061233a600482016122fc565b0390fd5b60207f616c616e63650000000000000000000000000000000000000000000000000000917f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201520152565b61239960266040926102a8565b6123a28161233e565b0190565b6123bc906020810190600081830391015261238c565b90565b156123c657565b6123ce6101d3565b62461bcd60e51b8152806123e4600482016123a6565b0390fd5b906123f3910161039a565b90565b91909161241f8161241861241261240d6000611eac565b61036a565b9161036a565b141561226b565b6124458361243e6124386124336000611eac565b61036a565b9161036a565b1415612315565b61249461248361245f61245a600085906115d2565b61108c565b61247c8161247561246f8861039a565b9161039a565b10156123bf565b8490611c85565b61248f600084906115d2565b61200c565b6124bc826124b66124a7600087906115d2565b916124b18361108c565b6123e8565b9061200c565b9190916125076124f56124ef7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef936115c6565b936115c6565b936124fe6101d3565b9182918261048a565b0390a3565b9061252e61252961253393612522818590612ccc565b600661160e565b611626565b612db3565b50565b9061255861255361255d9361254c818590612dee565b600661160e565b611626565b612e88565b50565b60007f45524332303a206d696e7420746f20746865207a65726f206164647265737300910152565b612595601f6020926102a8565b61259e81612560565b0190565b6125b89060208101906000818303910152612588565b90565b156125c257565b6125ca6101d3565b62461bcd60e51b8152806125e0600482016125a2565b0390fd5b9061260b826126046125fe6125f96000611eac565b61036a565b9161036a565b14156125bb565b6126286126218261261c600261108c565b6112b3565b600261200c565b6126508161264a61263b600086906115d2565b916126458361108c565b6123e8565b9061200c565b61265a6000611eac565b9190916126a561269361268d7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef936115c6565b936115c6565b9361269c6101d3565b9182918261048a565b0390a3565b60207f7300000000000000000000000000000000000000000000000000000000000000917f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201520152565b61270560216040926102a8565b61270e816126aa565b0190565b61272890602081019060008183039101526126f8565b90565b1561273257565b61273a6101d3565b62461bcd60e51b81528061275060048201612712565b0390fd5b60207f6365000000000000000000000000000000000000000000000000000000000000917f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201520152565b6127af60226040926102a8565b6127b881612754565b0190565b6127d290602081019060008183039101526127a2565b90565b156127dc57565b6127e46101d3565b62461bcd60e51b8152806127fa600482016127bc565b0390fd5b6128248161281d6128176128126000611eac565b61036a565b9161036a565b141561272b565b61287361286261283e612839600085906115d2565b61108c565b61285b8161285461284e8861039a565b9161039a565b10156127d5565b8490611c85565b61286e600084906115d2565b61200c565b61289061288983612884600261108c565b611c85565b600261200c565b9061289b6000611eac565b90916128e56128d36128cd7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef936115c6565b936115c6565b936128dc6101d3565b9182918261048a565b0390a3565b90565b6128f96128fe9161106f565b6113c1565b90565b61291561291061291a9261039a565b610fc9565b61035f565b90565b6129496129446129539361293f600061294e95612938611609565b50016128ea565b612f37565b6128ed565b612901565b6115ba565b90565b60081c90565b61296861296d91612956565b611669565b90565b61297a905461295c565b90565b9061298960ff91610bf4565b9181191691161790565b6129a76129a26129ac92610646565b610fc9565b610646565b90565b90565b906129c76129c26129ce92612993565b6129af565b825461297d565b9055565b60081b90565b906129e561ff00916129d2565b9181191691161790565b90612a046129ff612a0b92611716565b611722565b82546129d8565b9055565b9190949233612a46612a407f000000000000000000000000000000000000000000000000000000000000000061036a565b9161036a565b14158015612abb575b612a9e57612a6f612a7692612a68612a9098600961158a565b600a61158a565b600b6129b2565b612a88612a81610c16565b829061250c565b919091612f59565b612a9c6001600b6129ef565b565b600063f92ee8a960e01b815280612ab760048201610444565b0390fd5b50612ac6600b612970565b612a4f565b612ae36000612ae892612adc61106a565b50016128ea565b612f76565b90565b612af3610dd4565b50612afd81612f8e565b908115612b09575b5090565b612b139150612fce565b38612b05565b90565b612b30612b2b612b3592612b19565b610fc9565b61039a565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b612b7160178092612b38565b612b7a81612b3d565b0190565b612ba3612b9a92602092612b91816102a4565b94858093612b38565b938491016102b1565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b612bdb60118092612b38565b612be481612ba7565b0190565b612c02612c0d9392612bfc612c0793612b65565b90612b7e565b612bcf565b90612b7e565b90565b90565b90612c28612c22838390611690565b15610237565b612c30575050565b612ca891612c86612c5f612c4f612c49612c8b95613056565b936128ed565b612c596020612b1c565b906132e3565b91612c77612c6b6101d3565b93849260208401612be8565b602082018103825203826107b4565b612c10565b612c936101d3565b91829162461bcd60e51b835260048301610311565b0390fd5b90612cc1612cbc612cc892611716565b611722565b825461297d565b9055565b612ce0612cda828490611690565b15610237565b612ce9575b5050565b612d0c6001612d076000612cff600586906110ef565b018590611651565b612cac565b90612d15611e83565b90612d52612d4c612d467f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d956110e3565b926115c6565b926115c6565b92612d5b6101d3565b80612d6581610444565b0390a43880612ce5565b612d7890610fcc565b90565b612d8f612d8a612d949261035f565b610fc9565b61039a565b90565b612dab612da6612db09261039a565b610bf4565b610546565b90565b90612de6612de0612ddb612dd66000612deb96612dce610dd4565b500194612d6f565b612d7b565b612d97565b916128ea565b6134d9565b90565b612df9818390611690565b612e02575b5050565b612e256000612e206000612e18600586906110ef565b018590611651565b612cac565b90612e2e611e83565b90612e6b612e65612e5f7ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b956110e3565b926115c6565b926115c6565b92612e746101d3565b80612e7e81610444565b0390a43880612dfe565b90612ebb612eb5612eb0612eab6000612ec096612ea3610dd4565b500194612d6f565b612d7b565b612d97565b916128ea565b6135be565b90565b634e487b7160e01b600052603260045260246000fd5b5490565b600052602060002090565b612ef181612ed9565b821015612f0c57612f03600191612edd565b91020190600090565b612ec3565b612f21906008612f26930261148d565b611107565b90565b90612f349154612f11565b90565b612f56916000612f5092612f496110de565b5001612ee8565b90612f29565b90565b90612f6f612f749392612f6a610f8a565b61250c565b6136c8565b565b6000612f8b91612f8461106a565b5001612ed9565b90565b612f96610dd4565b5080612fb1612fab635a05180f60e01b6101e8565b916101e8565b14908115612fbe575b5090565b612fc891506136e8565b38612fba565b612fd6610dd4565b5080612ff1612feb634e821d3360e11b6101e8565b916101e8565b14908115612ffe575b5090565b6130089150612f8e565b38612ffa565b90565b61302561302061302a9261300e565b610fc9565b610646565b90565b6130376014613011565b90565b61304e61304961305392610646565b610fc9565b61039a565b90565b61307361306e61308992613068610e2f565b50612d6f565b612d7b565b61308361307e61302d565b61303a565b906132e3565b90565b90565b6130a361309e6130a89261308c565b610fc9565b61039a565b90565b6130ba6130c09193929361039a565b9261039a565b916130cc83820261039a565b9281840414901517156130db57565b61129d565b67ffffffffffffffff81116130fe576130fa6020916102d6565b0190565b61079e565b90613115613110836130e0565b6107dd565b918252565b369037565b9061314461312c83613103565b9260208061313a86936130e0565b920191039061311a565b565b600360fc1b90565b5190565b9061315c8261314e565b81101561316e57600160209102010190565b612ec3565b61318761318261318c92610bf1565b610fc9565b61039a565b90565b600f60fb1b90565b90565b6131ae6131a96131b392613197565b610fc9565b61039a565b90565b6131bf9061039a565b600081146131ce576001900390565b61129d565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b6131f26131d3565b90565b90565b61320c613207613211926131f5565b610fc9565b61039a565b90565b60f81b90565b90565b61323161322c6132369261321a565b610fc9565b610646565b90565b6132589061325261324c61325d94610646565b9161039a565b9061148d565b61039a565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b613294602080926102a8565b61329d81613260565b0190565b6132b79060208101906000818303910152613288565b90565b156132c157565b6132c96101d3565b62461bcd60e51b8152806132df600482016132a1565b0390fd5b91906132ed610e2f565b5061338761337761332361331e61330e6002613309879161308f565b6130ab565b613318600261308f565b906112b3565b61311f565b9261332c613146565b6133458561333f60009360001a93613173565b90613152565b5361334e61318f565b6133678561336160019360001a9361319a565b90613152565b53613372600261308f565b6130ab565b613381600161319a565b906112b3565b925b8361339d613397600161319a565b9161039a565b1115613404576133ab6131ea565b816133b6600f6131f8565b169160108310156133ff576133d26133f3926133f9941a613214565b6133e28591889060001a92613152565b536133ed600461321d565b90613239565b936131b6565b92613389565b612ec3565b61342c9293506134279061342161341b6000613173565b9161039a565b146132ba565b612c10565b90565b90565b600052602060002090565b5490565b61344a8161343d565b8210156134655761345c600191613432565b91020190600090565b612ec3565b919061348061347b613488936110e3565b611dd7565b90835461139b565b9055565b90815491680100000000000000008310156134bc57826134b49160016134ba95018155613441565b9061346a565b565b61079e565b906134cb906110e3565b600052602052604060002090565b6134e1610dd4565b506134f66134f0828490613728565b15610237565b6000146135395761352f6135349261351a6135136000850161342f565b829061348c565b600161352860008501612ed9565b93016134c1565b61200c565b600190565b5050600090565b61354f6135559193929361039a565b9261039a565b820391821161356057565b61129d565b634e487b7160e01b600052603160045260246000fd5b61358d916135876110de565b9161346a565b565b6135988161343d565b80156135b95760019003906135b66135b08383613441565b9061357b565b55565b613565565b6135c6610dd4565b506135dd6135d86001830184906134c1565b61108c565b90816135f26135ec6000613173565b9161039a565b14156000146136c05761367292600161366d928461361b6000966136158561319a565b90613540565b613638613629888501612ed9565b6136328661319a565b90613540565b8061364b6136458461039a565b9161039a565b03613677575b50505061366761366286830161342f565b61358f565b016134c1565b611402565b600190565b6136b8926136aa6136966136906136b3948c8901612ee8565b90612f29565b936136a485918c8901612ee8565b9061346a565b918585016134c1565b61200c565b388080613651565b505050600090565b906136df6136d86136e693610ff4565b600761102a565b6008611de3565b565b6136f0610dd4565b508061370b613705637965db0b60e01b6101e8565b916101e8565b14908115613718575b5090565b613722915061375e565b38613714565b6137469160016137419261373a610dd4565b50016134c1565b61108c565b6137596137536000613173565b9161039a565b141590565b613766610dd4565b5061378061377a6301ffc9a760e01b6101e8565b916101e8565b149056fea2646970667358221220f054ac8ddca73df07efe925c9789862ccbc82a4159f335f2a7d7ebc0d6f5098764736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -115,171 +16,209 @@ export class ERC20ItemsFactory extends ContractFactory { export const ERC20ITEMSFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC20/presets/items/ERC20ItemsFactory.sol:ERC20ItemsFactory', - 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/ERC20/presets/items/ERC20ItemsFactory.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 { ERC20Items } from "./ERC20Items.sol";\nimport { IERC20ItemsFactory, IERC20ItemsFactoryFunctions } from "./IERC20ItemsFactory.sol";\n\n/**\n * Deployer of ERC-20 Items proxies.\n */\ncontract ERC20ItemsFactory is IERC20ItemsFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-20 Items Factory.\n * @param factoryOwner The owner of the ERC-20 Items Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC20Items impl = new ERC20Items();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC20ItemsFactoryFunctions\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n uint8 decimals,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr) {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, symbol, decimals, implicitModeValidator, implicitModeProjectId));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC20Items(proxyAddr).initialize(\n tokenOwner, name, symbol, decimals, implicitModeValidator, implicitModeProjectId\n );\n emit ERC20ItemsDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC20ItemsFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n uint8 decimals,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view returns (address proxyAddr) {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, symbol, decimals, implicitModeValidator, implicitModeProjectId));\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/ERC20/presets/items/ERC20Items.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 { ERC20BaseToken } from "../../ERC20BaseToken.sol";\nimport { IERC20Items, IERC20ItemsFunctions } from "./IERC20Items.sol";\n\n/**\n * A ready made implementation of ERC-20 capable of minting when role provided.\n */\ncontract ERC20Items is ERC20BaseToken, IERC20Items {\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 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 tokenDecimals Number of decimals\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 uint8 tokenDecimals,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual override {\n if (msg.sender != _initializer || _initialized) {\n revert InvalidInitialization();\n }\n\n ERC20BaseToken.initialize(\n owner, tokenName, tokenSymbol, tokenDecimals, implicitModeValidator, implicitModeProjectId\n );\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 amount Amount of tokens to mint.\n * @notice This function can only be called by a items.\n */\n function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) {\n _mint(to, amount);\n }\n\n //\n // Admin\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(DEFAULT_ADMIN_ROLE) {\n _tokenName = tokenName;\n _tokenSymbol = tokenSymbol;\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 returns (bool) {\n return type(IERC20ItemsFunctions).interfaceId == interfaceId || ERC20BaseToken.supportsInterface(interfaceId)\n || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'node_modules/@openzeppelin/contracts/access/IAccessControlEnumerable.sol': { + 'src/tokens/ERC20/presets/items/IERC20ItemsFactory.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 IERC20ItemsFactoryFunctions {\n\n /**\n * Creates an ERC-20 Items proxy.\n * @param proxyOwner The owner of the ERC-20 Items proxy\n * @param tokenOwner The owner of the ERC-20 Items implementation\n * @param name The name of the ERC-20 Items proxy\n * @param symbol The symbol of the ERC-20 Items proxy\n * @param decimals The decimals of the ERC-20 Items proxy\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-20 Items Proxy\n */\n function deploy(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n uint8 decimals,\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-20 Items proxy\n * @param tokenOwner The owner of the ERC-20 Items implementation\n * @param name The name of the ERC-20 Items proxy\n * @param symbol The symbol of the ERC-20 Items proxy\n * @param decimals The decimals of the ERC-20 Items proxy\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-20 Items Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n string memory name,\n string memory symbol,\n uint8 decimals,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view returns (address proxyAddr);\n\n}\n\ninterface IERC20ItemsFactorySignals {\n\n /**\n * Event emitted when a new ERC-20 Items proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC20ItemsDeployed(address proxyAddr);\n\n}\n\ninterface IERC20ItemsFactory is IERC20ItemsFactoryFunctions, IERC20ItemsFactorySignals { }\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/draft-IERC1822.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.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 (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/proxy/ERC1967/ERC1967Upgrade.sol': { + 'src/tokens/ERC20/ERC20BaseToken.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 { SignalsImplicitModeControlled } from "../common/SignalsImplicitModeControlled.sol";\n\nimport { ERC20 } from "openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";\nimport { IERC20 } from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";\nimport { IERC20Metadata } from "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol";\n\nerror InvalidInitialization();\n\n/**\n * A standard base implementation of ERC-20 for use in Sequence library contracts.\n */\nabstract contract ERC20BaseToken is ERC20, SignalsImplicitModeControlled {\n\n string internal _tokenName;\n string internal _tokenSymbol;\n uint8 private _tokenDecimals;\n\n address private immutable _initializer;\n bool private _initialized;\n\n constructor() ERC20("", "") {\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 tokenDecimals Number of decimals\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 uint8 tokenDecimals,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual {\n if (msg.sender != _initializer || _initialized) {\n revert InvalidInitialization();\n }\n\n _tokenName = tokenName;\n _tokenSymbol = tokenSymbol;\n _tokenDecimals = tokenDecimals;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n\n _initializeImplicitMode(owner, implicitModeValidator, implicitModeProjectId);\n\n _initialized = true;\n }\n\n //\n // Burn\n //\n\n /**\n * Allows the owner of the token to burn their tokens.\n * @param amount Amount of tokens to burn\n */\n function burn(\n uint256 amount\n ) public virtual {\n _burn(msg.sender, amount);\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 returns (bool) {\n return interfaceId == type(IERC20).interfaceId || interfaceId == type(IERC20Metadata).interfaceId\n || super.supportsInterface(interfaceId);\n }\n\n //\n // ERC20 Overrides\n //\n\n /**\n * Override the ERC20 name function.\n */\n function name() public view override returns (string memory) {\n return _tokenName;\n }\n\n /**\n * Override the ERC20 symbol function.\n */\n function symbol() public view override returns (string memory) {\n return _tokenSymbol;\n }\n\n /**\n * Override the ERC20 decimals function.\n */\n function decimals() public view override returns (uint8) {\n return _tokenDecimals;\n }\n\n}\n' }, - 'node_modules/@openzeppelin/contracts/proxy/Proxy.sol': { + 'src/tokens/ERC20/presets/items/IERC20Items.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\ninterface IERC20ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n */\n function mint(address to, uint256 amount) external;\n\n /**\n * Set name and symbol of token.\n * @param tokenName Name of token.\n * @param tokenSymbol Symbol of token.\n */\n function setNameAndSymbol(string memory tokenName, string memory tokenSymbol) external;\n\n}\n\ninterface IERC20ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC20Items is IERC20ItemsFunctions, IERC20ItemsSignals { }\n' }, - 'node_modules/@openzeppelin/contracts/proxy/beacon/IBeacon.sol': { + '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/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\nimport "openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' + }, + 'src/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { + content: + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\n/// @notice This implementation is a copy of OpenZeppelin\'s with the following changes:\n/// - Pragma updated\n/// - Imports updated\n/// - Constructor removed\n/// - Allows admin to call implementation\n\npragma solidity ^0.8.19;\n\nimport "./ERC1967Proxy.sol";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(\n address\n ) external;\n\n function upgradeTo(\n address\n ) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * Unlike the original OpenZeppelin implementation, this contract does not prevent the admin from calling the implementation.\n * This potentially exposes the admin to a proxy selector attack. See\n * https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * When using this contract, you must ensure that the implementation function selectors do not clash with the proxy selectors.\n * The proxy selectors are:\n * - 0x3659cfe6: upgradeTo\n * - 0x4f1ef286: upgradeToAndCall\n * - 0x8f283970: changeAdmin\n * - 0xf851a440: admin\n * - 0x5c60da1b: implementation\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n // Call implementation\n return super._fallback();\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(""), false);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return "";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() internal {\n require(msg.value == 0);\n }\n\n}\n' + }, + 'lib/openzeppelin-contracts/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/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' }, - 'node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Address.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 (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/common/SignalsImplicitModeControlled.sol': { + content: + '// 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/token/ERC20/ERC20.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC20.sol";\nimport "./extensions/IERC20Metadata.sol";\nimport "../../utils/Context.sol";\n\n/**\n * @dev Implementation of the {IERC20} interface.\n *\n * This implementation is agnostic to the way tokens are created. This means\n * that a supply mechanism has to be added in a derived contract using {_mint}.\n * For a generic mechanism see {ERC20PresetMinterPauser}.\n *\n * TIP: For a detailed writeup see our guide\n * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How\n * to implement supply mechanisms].\n *\n * The default value of {decimals} is 18. To change this, you should override\n * this function so it returns a different value.\n *\n * We have followed general OpenZeppelin Contracts guidelines: functions revert\n * instead returning `false` on failure. This behavior is nonetheless\n * conventional and does not conflict with the expectations of ERC20\n * applications.\n *\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\n * This allows applications to reconstruct the allowance for all accounts just\n * by listening to said events. Other implementations of the EIP may not emit\n * these events, as it isn\'t required by the specification.\n *\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\n * functions have been added to mitigate the well-known issues around setting\n * allowances. See {IERC20-approve}.\n */\ncontract ERC20 is Context, IERC20, IERC20Metadata {\n mapping(address => uint256) private _balances;\n\n mapping(address => mapping(address => uint256)) private _allowances;\n\n uint256 private _totalSupply;\n\n string private _name;\n string private _symbol;\n\n /**\n * @dev Sets the values for {name} and {symbol}.\n *\n * All two of these values are immutable: they can only be set once during\n * construction.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev Returns the name of the token.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the symbol of the token, usually a shorter version of the\n * name.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the number of decimals used to get its user representation.\n * For example, if `decimals` equals `2`, a balance of `505` tokens should\n * be displayed to a user as `5.05` (`505 / 10 ** 2`).\n *\n * Tokens usually opt for a value of 18, imitating the relationship between\n * Ether and Wei. This is the default value returned by this function, unless\n * it\'s overridden.\n *\n * NOTE: This information is only used for _display_ purposes: it in\n * no way affects any of the arithmetic of the contract, including\n * {IERC20-balanceOf} and {IERC20-transfer}.\n */\n function decimals() public view virtual override returns (uint8) {\n return 18;\n }\n\n /**\n * @dev See {IERC20-totalSupply}.\n */\n function totalSupply() public view virtual override returns (uint256) {\n return _totalSupply;\n }\n\n /**\n * @dev See {IERC20-balanceOf}.\n */\n function balanceOf(address account) public view virtual override returns (uint256) {\n return _balances[account];\n }\n\n /**\n * @dev See {IERC20-transfer}.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - the caller must have a balance of at least `amount`.\n */\n function transfer(address to, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _transfer(owner, to, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-allowance}.\n */\n function allowance(address owner, address spender) public view virtual override returns (uint256) {\n return _allowances[owner][spender];\n }\n\n /**\n * @dev See {IERC20-approve}.\n *\n * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on\n * `transferFrom`. This is semantically equivalent to an infinite approval.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function approve(address spender, uint256 amount) public virtual override returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, amount);\n return true;\n }\n\n /**\n * @dev See {IERC20-transferFrom}.\n *\n * Emits an {Approval} event indicating the updated allowance. This is not\n * required by the EIP. See the note at the beginning of {ERC20}.\n *\n * NOTE: Does not update the allowance if the current allowance\n * is the maximum `uint256`.\n *\n * Requirements:\n *\n * - `from` and `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n * - the caller must have allowance for ``from``\'s tokens of at least\n * `amount`.\n */\n function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {\n address spender = _msgSender();\n _spendAllowance(from, spender, amount);\n _transfer(from, to, amount);\n return true;\n }\n\n /**\n * @dev Atomically increases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n */\n function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\n address owner = _msgSender();\n _approve(owner, spender, allowance(owner, spender) + addedValue);\n return true;\n }\n\n /**\n * @dev Atomically decreases the allowance granted to `spender` by the caller.\n *\n * This is an alternative to {approve} that can be used as a mitigation for\n * problems described in {IERC20-approve}.\n *\n * Emits an {Approval} event indicating the updated allowance.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `spender` must have allowance for the caller of at least\n * `subtractedValue`.\n */\n function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\n address owner = _msgSender();\n uint256 currentAllowance = allowance(owner, spender);\n require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");\n unchecked {\n _approve(owner, spender, currentAllowance - subtractedValue);\n }\n\n return true;\n }\n\n /**\n * @dev Moves `amount` of tokens from `from` to `to`.\n *\n * This internal function is equivalent to {transfer}, and can be used to\n * e.g. implement automatic token fees, slashing mechanisms, etc.\n *\n * Emits a {Transfer} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `from` must have a balance of at least `amount`.\n */\n function _transfer(address from, address to, uint256 amount) internal virtual {\n require(from != address(0), "ERC20: transfer from the zero address");\n require(to != address(0), "ERC20: transfer to the zero address");\n\n _beforeTokenTransfer(from, to, amount);\n\n uint256 fromBalance = _balances[from];\n require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");\n unchecked {\n _balances[from] = fromBalance - amount;\n // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by\n // decrementing then incrementing.\n _balances[to] += amount;\n }\n\n emit Transfer(from, to, amount);\n\n _afterTokenTransfer(from, to, amount);\n }\n\n /** @dev Creates `amount` tokens and assigns them to `account`, increasing\n * the total supply.\n *\n * Emits a {Transfer} event with `from` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function _mint(address account, uint256 amount) internal virtual {\n require(account != address(0), "ERC20: mint to the zero address");\n\n _beforeTokenTransfer(address(0), account, amount);\n\n _totalSupply += amount;\n unchecked {\n // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.\n _balances[account] += amount;\n }\n emit Transfer(address(0), account, amount);\n\n _afterTokenTransfer(address(0), account, amount);\n }\n\n /**\n * @dev Destroys `amount` tokens from `account`, reducing the\n * total supply.\n *\n * Emits a {Transfer} event with `to` set to the zero address.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n * - `account` must have at least `amount` tokens.\n */\n function _burn(address account, uint256 amount) internal virtual {\n require(account != address(0), "ERC20: burn from the zero address");\n\n _beforeTokenTransfer(account, address(0), amount);\n\n uint256 accountBalance = _balances[account];\n require(accountBalance >= amount, "ERC20: burn amount exceeds balance");\n unchecked {\n _balances[account] = accountBalance - amount;\n // Overflow not possible: amount <= accountBalance <= totalSupply.\n _totalSupply -= amount;\n }\n\n emit Transfer(account, address(0), amount);\n\n _afterTokenTransfer(account, address(0), amount);\n }\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\n *\n * This internal function is equivalent to `approve`, and can be used to\n * e.g. set automatic allowances for certain subsystems, etc.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `owner` cannot be the zero address.\n * - `spender` cannot be the zero address.\n */\n function _approve(address owner, address spender, uint256 amount) internal virtual {\n require(owner != address(0), "ERC20: approve from the zero address");\n require(spender != address(0), "ERC20: approve to the zero address");\n\n _allowances[owner][spender] = amount;\n emit Approval(owner, spender, amount);\n }\n\n /**\n * @dev Updates `owner` s allowance for `spender` based on spent `amount`.\n *\n * Does not update the allowance amount in case of infinite allowance.\n * Revert if not enough allowance is available.\n *\n * Might emit an {Approval} event.\n */\n function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {\n uint256 currentAllowance = allowance(owner, spender);\n if (currentAllowance != type(uint256).max) {\n require(currentAllowance >= amount, "ERC20: insufficient allowance");\n unchecked {\n _approve(owner, spender, currentAllowance - amount);\n }\n }\n }\n\n /**\n * @dev Hook that is called before any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``\'s tokens\n * will be transferred to `to`.\n * - when `from` is zero, `amount` tokens will be minted for `to`.\n * - when `to` is zero, `amount` of ``from``\'s tokens will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero, `amount` of ``from``\'s tokens\n * has been transferred to `to`.\n * - when `from` is zero, `amount` tokens have been minted for `to`.\n * - when `to` is zero, `amount` of ``from``\'s tokens have been burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}\n}\n' }, - 'node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" }, - 'node_modules/@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC20 standard.\n *\n * _Available since v4.1._\n */\ninterface IERC20Metadata is IERC20 {\n /**\n * @dev Returns the name of the token.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the symbol of the token.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the decimals places of the token.\n */\n function decimals() external view returns (uint8);\n}\n' }, - 'node_modules/@openzeppelin/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.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' + '// 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/Context.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.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: 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/Create2.sol': { + 'src/proxies/openzeppelin/ERC1967Proxy.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: 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/StorageSlot.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.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\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/@openzeppelin/contracts/utils/Strings.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.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.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/@openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.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) (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' }, - 'node_modules/@openzeppelin/contracts/utils/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.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.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' }, - 'node_modules/@openzeppelin/contracts/utils/math/Math.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.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.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' }, - 'node_modules/@openzeppelin/contracts/utils/math/SignedMath.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts 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/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' }, - 'node_modules/@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" }, - 'src/proxies/SequenceProxyFactory.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 {\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: 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/proxies/TransparentUpgradeableBeaconProxy.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 {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 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/proxies/openzeppelin/BeaconProxy.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.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: 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/proxies/openzeppelin/ERC1967Proxy.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.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: 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/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.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: 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/ERC20/ERC20BaseToken.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";\r\nimport {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";\r\nimport {IERC20Metadata} from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";\r\nimport {AccessControlEnumerable} from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";\r\n\r\nerror InvalidInitialization();\r\n\r\n/**\r\n * A standard base implementation of ERC-20 for use in Sequence library contracts.\r\n */\r\nabstract contract ERC20BaseToken is ERC20, AccessControlEnumerable {\r\n string internal _tokenName;\r\n string internal _tokenSymbol;\r\n uint8 private _tokenDecimals;\r\n\r\n address private immutable _initializer;\r\n bool private _initialized;\r\n\r\n constructor() ERC20("", "") {\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 tokenDecimals Number of decimals\r\n * @dev This should be called immediately after deployment.\r\n */\r\n function initialize(address owner, string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals)\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 _tokenName = tokenName;\r\n _tokenSymbol = tokenSymbol;\r\n _tokenDecimals = tokenDecimals;\r\n\r\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\r\n\r\n _initialized = true;\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 tokens.\r\n * @param amount Amount of tokens to burn\r\n */\r\n function burn(uint256 amount) public virtual {\r\n _burn(msg.sender, 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 interfaceId == type(IERC20).interfaceId || interfaceId == type(IERC20Metadata).interfaceId\r\n || AccessControlEnumerable.supportsInterface(interfaceId) || super.supportsInterface(interfaceId);\r\n }\r\n\r\n //\r\n // ERC20 Overrides\r\n //\r\n\r\n /**\r\n * Override the ERC20 name function.\r\n */\r\n function name() public view override returns (string memory) {\r\n return _tokenName;\r\n }\r\n\r\n /**\r\n * Override the ERC20 symbol function.\r\n */\r\n function symbol() public view override returns (string memory) {\r\n return _tokenSymbol;\r\n }\r\n\r\n /**\r\n * Override the ERC20 decimals function.\r\n */\r\n function decimals() public view override returns (uint8) {\r\n return _tokenDecimals;\r\n }\r\n}\r\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" }, - 'src/tokens/ERC20/presets/items/ERC20Items.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {ERC20BaseToken} from "@0xsequence/contracts-library/tokens/ERC20/ERC20BaseToken.sol";\r\nimport {\r\n IERC20Items,\r\n IERC20ItemsFunctions\r\n} from "@0xsequence/contracts-library/tokens/ERC20/presets/items/IERC20Items.sol";\r\n\r\n/**\r\n * A ready made implementation of ERC-20 capable of minting when role provided.\r\n */\r\ncontract ERC20Items is ERC20BaseToken, IERC20Items {\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 constructor() {\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 tokenDecimals Number of decimals\r\n * @dev This should be called immediately after deployment.\r\n */\r\n function initialize(address owner, string memory tokenName, string memory tokenSymbol, uint8 tokenDecimals)\r\n public\r\n virtual\r\n override\r\n {\r\n if (msg.sender != _initializer || _initialized) {\r\n revert InvalidInitialization();\r\n }\r\n\r\n ERC20BaseToken.initialize(owner, tokenName, tokenSymbol, tokenDecimals);\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 * @notice This function can only be called by a items.\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 // Admin\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(DEFAULT_ADMIN_ROLE)\r\n {\r\n _tokenName = tokenName;\r\n _tokenSymbol = tokenSymbol;\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(IERC20ItemsFunctions).interfaceId == interfaceId || ERC20BaseToken.supportsInterface(interfaceId)\r\n || super.supportsInterface(interfaceId);\r\n }\r\n}\r\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' }, - 'src/tokens/ERC20/presets/items/ERC20ItemsFactory.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\nimport {ERC20Items} from "@0xsequence/contracts-library/tokens/ERC20/presets/items/ERC20Items.sol";\r\nimport {IERC20ItemsFactory} from\r\n "@0xsequence/contracts-library/tokens/ERC20/presets/items/IERC20ItemsFactory.sol";\r\nimport {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\r\n\r\n/**\r\n * Deployer of ERC-20 Items proxies.\r\n */\r\ncontract ERC20ItemsFactory is IERC20ItemsFactory, SequenceProxyFactory {\r\n /**\r\n * Creates an ERC-20 Items Factory.\r\n * @param factoryOwner The owner of the ERC-20 Items Factory\r\n */\r\n constructor(address factoryOwner) {\r\n ERC20Items impl = new ERC20Items();\r\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\r\n }\r\n\r\n /**\r\n * Creates an ERC-20 Items proxy.\r\n * @param proxyOwner The owner of the ERC-20 Items proxy\r\n * @param tokenOwner The owner of the ERC-20 Items implementation\r\n * @param name The name of the ERC-20 Items proxy\r\n * @param symbol The symbol of the ERC-20 Items proxy\r\n * @param decimals The decimals of the ERC-20 Items proxy\r\n * @return proxyAddr The address of the ERC-20 Items Proxy\r\n */\r\n function deploy(address proxyOwner, address tokenOwner, string memory name, string memory symbol, uint8 decimals)\r\n external\r\n returns (address proxyAddr)\r\n {\r\n bytes32 salt = keccak256(abi.encode(tokenOwner, name, symbol, decimals));\r\n proxyAddr = _createProxy(salt, proxyOwner, "");\r\n ERC20Items(proxyAddr).initialize(tokenOwner, name, symbol, decimals);\r\n emit ERC20ItemsDeployed(proxyAddr);\r\n return proxyAddr;\r\n }\r\n}\r\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' }, - 'src/tokens/ERC20/presets/items/IERC20Items.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/utils/LibBytes.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\r\npragma solidity ^0.8.19;\r\n\r\ninterface IERC20ItemsFunctions {\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;\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) external;\r\n}\r\n\r\ninterface IERC20ItemsSignals {\r\n /**\r\n * Invalid initialization error.\r\n */\r\n error InvalidInitialization();\r\n}\r\n\r\ninterface IERC20Items is IERC20ItemsFunctions, IERC20ItemsSignals {}\r\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' }, - 'src/tokens/ERC20/presets/items/IERC20ItemsFactory.sol': { + '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 IERC20ItemsFactoryFunctions {\r\n /**\r\n * Creates an ERC-20 Items proxy.\r\n * @param proxyOwner The owner of the ERC-20 Items proxy\r\n * @param tokenOwner The owner of the ERC-20 Items implementation\r\n * @param name The name of the ERC-20 Items proxy\r\n * @param symbol The symbol of the ERC-20 Items proxy\r\n * @param decimals The decimals of the ERC-20 Items proxy\r\n * @return proxyAddr The address of the ERC-20 Items Proxy\r\n */\r\n function deploy(address proxyOwner, address tokenOwner, string memory name, string memory symbol, uint8 decimals)\r\n external\r\n returns (address proxyAddr);\r\n}\r\n\r\ninterface IERC20ItemsFactorySignals {\r\n /**\r\n * Event emitted when a new ERC-20 Items proxy contract is deployed.\r\n * @param proxyAddr The address of the deployed proxy.\r\n */\r\n event ERC20ItemsDeployed(address proxyAddr);\r\n}\r\n\r\ninterface IERC20ItemsFactory is IERC20ItemsFactoryFunctions, IERC20ItemsFactorySignals {}\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: {} } } } diff --git a/scripts/factories/token_library/ERC721ItemsFactory.ts b/scripts/factories/token_library/ERC721ItemsFactory.ts index 91977bb..d2d9008 100644 --- a/scripts/factories/token_library/ERC721ItemsFactory.ts +++ b/scripts/factories/token_library/ERC721ItemsFactory.ts @@ -1,245 +1,13 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' // https://github.com/0xsequence/contracts-library/blob/73363994054ad0983ceabebb8b98ad02044a4267/src/tokens/ERC721/presets/items/ERC721ItemsFactory.sol -const abi = [ - { - 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' - }, - { - inputs: [], - name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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: 'deploy', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'upgradeBeacon', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] - export class ERC721ItemsFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, + FACTORY_DEFAULT_ABI, '60806040523461002f576100196100146100fa565b610169565b610021610034565b612762610397823961276290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b6101186177378038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b61419c810181811060018060401b038211176101c5576101a1829161419c612af9843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa2616c9585396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b6105ab565b61001e60003561008d565b80630defbce9146100885780631bce45831461008357806359659e901461007e578063715018a6146100795780638bdb5fd2146100745780638da5cb5b1461006f5763f2fde38b0361000e57610578565b610543565b610501565b6104ce565b610499565b6103b7565b610350565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b90610117906100ed565b810190811067ffffffffffffffff82111761013157604052565b6100f7565b90610149610142610093565b928361010d565b565b67ffffffffffffffff8111610169576101656020916100ed565b0190565b6100f7565b90826000939282370152565b9092919261018f61018a8261014b565b610136565b938185526020850190828401116101ab576101a99261016e565b565b6100e8565b9080601f830112156101ce578160206101cb9335910161017a565b90565b6100e3565b6bffffffffffffffffffffffff1690565b6101ed816101d3565b036101f457565b600080fd5b90503590610206826101e4565b565b90565b61021481610208565b0361021b57565b600080fd5b9050359061022d8261020b565b565b610140818303126103285761024782600083016100d4565b9261025583602084016100d4565b92604083013567ffffffffffffffff811161032357816102769185016101b0565b92606081013567ffffffffffffffff811161031e57826102979183016101b0565b92608082013567ffffffffffffffff811161031957836102b89184016101b0565b9260a083013567ffffffffffffffff811161031457816102d99185016101b0565b926102e78260c083016100d4565b926103116102f88460e085016101f9565b936103078161010086016100d4565b9361012001610220565b90565b6100a3565b6100a3565b6100a3565b6100a3565b61009e565b610336906100b3565b9052565b919061034e9060006020850194019061032d565b565b3461038d5761038961037861036636600461022f565b98979097969196959295949394610756565b610380610093565b9182918261033a565b0390f35b610099565b906020828203126103ac576103a9916000016100d4565b90565b61009e565b60000190565b346103e5576103cf6103ca366004610392565b61096f565b6103d7610093565b806103e1816103b1565b0390f35b610099565b60009103126103f557565b61009e565b1c90565b60018060a01b031690565b61041990600861041e93026103fa565b6103fe565b90565b9061042c9154610409565b90565b61043c6001600090610421565b90565b90565b61045661045161045b926100a8565b61043f565b6100a8565b90565b61046790610442565b90565b6104739061045e565b90565b61047f9061046a565b9052565b919061049790600060208501940190610476565b565b346104c9576104a93660046103ea565b6104c56104b461042f565b6104bc610093565b91829182610483565b0390f35b610099565b346104fc576104de3660046103ea565b6104e66109cb565b6104ee610093565b806104f8816103b1565b0390f35b610099565b3461053e5761053a61052961051736600461022f565b989790979691969592959493946109d5565b610531610093565b9182918261033a565b0390f35b610099565b34610573576105533660046103ea565b61056f61055e610a6e565b610566610093565b9182918261033a565b0390f35b610099565b346105a65761059061058b366004610392565b610b72565b610598610093565b806105a2816103b1565b0390f35b610099565b600080fd5b600090565b5190565b60209181520190565b60005b8381106105d6575050906000910152565b8060209183015181850152016105c5565b61060661060f602093610614936105fd816105b5565b938480936105b9565b958691016105c2565b6100ed565b0190565b610621906101d3565b9052565b61062e90610208565b9052565b946106a56106b0916106976106c4976106896101009b9f9e9c969861067a6106cb9f9a6106ba9a8e61066d610120820193600083019061032d565b60208184039101526105e7565b908c60408184039101526105e7565b908a820360608c01526105e7565b9088820360808a01526105e7565b9a60a087019061032d565b60c0850190610618565b60e083019061032d565b0190610625565b565b60200190565b5190565b906106e96106e48361014b565b610136565b918252565b6106f860006106d7565b90565b6107036106ee565b90565b61070f90610442565b90565b61071b90610706565b90565b6107279061045e565b90565b600080fd5b60e01b90565b600091031261074057565b61009e565b61074d610093565b3d6000823e3d90fd5b6107c990846107a7856107988c8e9f809c9a9f9d9b98999d6107766105b0565b508a9496928d8d8c90919293949561078c610093565b9a8b9960208b01610632565b6020820181038252038261010d565b6107b96107b3826106d3565b916106cd565b20906107c36106fb565b91610cf6565b986107db6107d68b610712565b61071e565b95634c62cd9b93979992949598919091873b1561089d57600099610813978b9761081e96610807610093565b9e8f9d8e9c8d9b61072f565b8b5260048b01610632565b03925af180156108985761086b575b50806108657fd8ad75647a93de9d8d617559d87f1c27bc23fb6237b94054baf34aafbe85ad039161085c610093565b9182918261033a565b0390a190565b61088b9060003d8111610891575b610883818361010d565b810190610735565b3861082d565b503d610879565b610745565b61072a565b6108b3906108ae610eb8565b6108dc565b565b60001c90565b6108c76108cc916108b5565b6103fe565b90565b6108d990546108bb565b90565b6108ee6108e960016108cf565b61046a565b90633659cfe690823b1561096a576109269261091b6000809461090f610093565b9687958694859361072f565b83526004830161033a565b03925af1801561096557610938575b50565b6109589060003d811161095e575b610950818361010d565b810190610735565b38610935565b503d610946565b610745565b61072a565b610978906108a2565b565b610982610eb8565b61098a6109b7565b565b90565b6109a361099e6109a89261098c565b61043f565b6100a8565b90565b6109b49061098f565b90565b6109c96109c460006109ab565b610f34565b565b6109d361097a565b565b979096610a1d96610a3f9a9396610a0e9695996109f06105b0565b50979995909192939495610a02610093565b9a8b9960208b01610632565b6020820181038252038261010d565b610a2f610a29826106d3565b916106cd565b2090610a396106fb565b91610f95565b90565b60018060a01b031690565b610a59610a5e916108b5565b610a42565b90565b610a6b9054610a4d565b90565b610a766105b0565b50610a816000610a61565b90565b610a9590610a90610eb8565b610b41565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610af260266040926105b9565b610afb81610a97565b0190565b610b159060208101906000818303910152610ae5565b90565b15610b1f57565b610b27610093565b62461bcd60e51b815280610b3d60048201610aff565b0390fd5b610b7090610b6b81610b64610b5e610b5960006109ab565b6100b3565b916100b3565b1415610b18565b610f34565b565b610b7b90610a84565b565b90565b610b8c610b9191610208565b610b7d565b9052565b60601b90565b610ba490610b95565b90565b610bb090610b9b565b90565b610bbf610bc4916100b3565b610ba7565b9052565b905090565b610bf2610be992602092610be0816106d3565b94858093610bc8565b938491016105c2565b0190565b60148093610c1a602084610c12610c2296610c299b9a98610b80565b018092610bb3565b018092610bb3565b0190610bcd565b90565b90565b610c43610c3e610c489261098c565b61043f565b610c2c565b90565b610c5490610442565b90565b610c6090610c4b565b90565b610c6c90610442565b90565b610c7890610c63565b90565b610c849061045e565b90565b60209181520190565b610caf610cb8602093610cbd93610ca6816106d3565b93848093610c87565b958691016105c2565b6100ed565b0190565b610ce6610cf3949293610cdc6060840195600085019061032d565b602083019061032d565b6040818403910152610c90565b90565b610d869093929193610d066105b0565b50610d468591610d37610d21610d1c60016108cf565b61046a565b8690610d2b610093565b95869460208601610bf6565b6020820181038252038261010d565b610d58610d52826106d3565b916106cd565b2061148a610d6860208201610136565b908082526112a36020830139610d816000929192610c2f565b6111c2565b92610da0610d9b610d9686610c57565b610c6f565b610c7b565b63cf7a1d779190610db9610db460016108cf565b61046a565b9392813b15610e30576000610de191610dec8296610dd5610093565b9889978896879561072f565b855260048501610cc1565b03925af18015610e2b57610dfe575b50565b610e1e9060003d8111610e24575b610e16818361010d565b810190610735565b38610dfb565b503d610e0c565b610745565b61072a565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610e69602080926105b9565b610e7281610e35565b0190565b610e8c9060208101906000818303910152610e5d565b90565b15610e9657565b610e9e610093565b62461bcd60e51b815280610eb460048201610e76565b0390fd5b610ee2610ec3610a6e565b610edc610ed6610ed161124b565b6100b3565b916100b3565b14610e8f565b565b60001b90565b90610efb60018060a01b0391610ee4565b9181191691161790565b610f0e9061045e565b90565b90565b90610f29610f24610f3092610f05565b610f11565b8254610eea565b9055565b610f3e6000610a61565b610f49826000610f14565b90610f7d610f777f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610f05565b91610f05565b91610f86610093565b80610f90816103b1565b0390a3565b6110289291610fd2610fe192610fa96105b0565b509193610fbe610fb960016108cf565b61046a565b610fc6610093565b95869460208601610bf6565b6020820181038252038261010d565b610ff3610fed826106d3565b916106cd565b2061148a61100360208201610136565b908082526112a3602083013961102161101b826106d3565b916106cd565b2090611258565b90565b6110349061045e565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b61106c601d6020926105b9565b61107581611037565b0190565b61108f906020810190600081830391015261105f565b90565b1561109957565b6110a1610093565b62461bcd60e51b8152806110b760048201611079565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110ef602080926105b9565b6110f8816110bb565b0190565b61111290602081019060008183039101526110e3565b90565b1561111c57565b611124610093565b62461bcd60e51b81528061113a600482016110fc565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61117360196020926105b9565b61117c8161113e565b0190565b6111969060208101906000818303910152611166565b90565b156111a057565b6111a8610093565b62461bcd60e51b8152806111be60048201611180565b0390fd5b9190916111cd6105b0565b506111f46111da3061102b565b316111ed6111e784610c2c565b91610c2c565b1015611092565b61121a611200836106d3565b61121361120d6000610c2f565b91610c2c565b1415611115565b60208251920190f5906112498261124261123c61123760006109ab565b6100b3565b916100b3565b1415611199565b565b6112536105b0565b503390565b90611276916112656105b0565b50906112703061102b565b91611279565b90565b90605592600b926112886105b0565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a26469706673582212203b72369d1d46611771220d986b45a922fa914be16aa4d3dbc40e20507531653264736f6c634300081b003360a060405234602b57600e603a565b6014602f565b61415b610041823960805181611ef7015261415b90f35b6035565b60405190565b600080fd5b3360805256fe60806040526004361015610013575b61134c565b61001e60003561026d565b806301ffc9a71461026857806304634d8d1461026357806306fdde031461025e578063081812fc14610259578063095ea7b3146102545780630bb310de1461024f57806318160ddd1461024a57806323b872dd14610245578063248a9ca3146102405780632a55205a1461023b5780632e73e0fd146102365780632f2ff15d1461023157806336568abe1461022c57806340c10f191461022757806342842e0e1461022257806342966c681461021d5780634c62cd9b146102185780635944c753146102135780635a4462151461020e5780636352211e1461020957806370a08231146102045780637e518ec8146101ff5780639010d07c146101fa57806391d14854146101f5578063938e3d7b146101f057806395d89b41146101eb5780639d043a66146101e6578063a217fddf146101e1578063a22cb465146101dc578063b88d4fde146101d7578063c87b56dd146101d2578063ca15c873146101cd578063d547741f146101c8578063dc8e92ea146101c3578063e8a3d485146101be578063e985e9c5146101b95763ed4c2ac70361000e57611319565b6112e3565b611280565b61124d565b61114c565b611117565b6110e2565b6110b5565b610fd7565b610f50565b610edd565b610e13565b610de0565b610daa565b610d74565b610d13565b610ca8565b610c73565b610c3f565b610bad565b610b35565b61092b565b610901565b6108cd565b610899565b610865565b610803565b6107cc565b610745565b6106b2565b610642565b6105ec565b6105a3565b610540565b6104a2565b6103d8565b6102ff565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b61029d81610288565b036102a457565b600080fd5b905035906102b682610294565b565b906020828203126102d2576102cf916000016102a9565b90565b61027e565b151590565b6102e5906102d7565b9052565b91906102fd906000602085019401906102dc565b565b3461032f5761032b61031a6103153660046102b8565b611356565b610322610273565b918291826102e9565b0390f35b610279565b60018060a01b031690565b61034890610334565b90565b6103548161033f565b0361035b57565b600080fd5b9050359061036d8261034b565b565b6bffffffffffffffffffffffff1690565b6103898161036f565b0361039057565b600080fd5b905035906103a282610380565b565b91906040838203126103cd57806103c16103ca9260008601610360565b93602001610395565b90565b61027e565b60000190565b34610407576103f16103eb3660046103a4565b906113e2565b6103f9610273565b80610403816103d2565b0390f35b610279565b600091031261041757565b61027e565b5190565b60209181520190565b60005b83811061043d575050906000910152565b80602091830151818501520161042c565b601f801991011690565b6104776104806020936104859361046e8161041c565b93848093610420565b95869101610429565b61044e565b0190565b61049f9160208201916000818403910152610458565b90565b346104d2576104b236600461040c565b6104ce6104bd611511565b6104c5610273565b91829182610489565b0390f35b610279565b90565b6104e3816104d7565b036104ea57565b600080fd5b905035906104fc826104da565b565b9060208282031261051857610515916000016104ef565b90565b61027e565b6105269061033f565b9052565b919061053e9060006020850194019061051d565b565b346105705761056c61055b6105563660046104fe565b61152c565b610563610273565b9182918261052a565b0390f35b610279565b919060408382031261059e578061059261059b9260008601610360565b936020016104ef565b90565b61027e565b6105b76105b1366004610575565b9061156f565b6105bf610273565b806105c9816103d2565b0390f35b906020828203126105e7576105e491600001610360565b90565b61027e565b3461061a576106046105ff3660046105cd565b611653565b61060c610273565b80610616816103d2565b0390f35b610279565b610628906104d7565b9052565b91906106409060006020850194019061061f565b565b346106725761065236600461040c565b61066e61065d61168d565b610665610273565b9182918261062c565b0390f35b610279565b90916060828403126106ad576106aa6106938460008501610360565b936106a18160208601610360565b936040016104ef565b90565b61027e565b6106c66106c0366004610677565b916116a3565b6106ce610273565b806106d8816103d2565b0390f35b90565b6106e8816106dc565b036106ef57565b600080fd5b90503590610701826106df565b565b9060208282031261071d5761071a916000016106f4565b90565b61027e565b61072b906106dc565b9052565b919061074390600060208501940190610722565b565b346107755761077161076061075b366004610703565b6117ed565b610768610273565b9182918261072f565b0390f35b610279565b91906040838203126107a357806107976107a092600086016104ef565b936020016104ef565b90565b61027e565b9160206107ca9294936107c36040820196600083019061051d565b019061061f565b565b346107fe576107e56107df36600461077a565b906119f6565b906107fa6107f1610273565b928392836107a8565b0390f35b610279565b346108325761081c610816366004610575565b90611c60565b610824610273565b8061082e816103d2565b0390f35b610279565b9190604083820312610860578061085461085d92600086016106f4565b93602001610360565b90565b61027e565b346108945761087e610878366004610837565b90611c95565b610886610273565b80610890816103d2565b0390f35b610279565b346108c8576108b26108ac366004610837565b90611d4b565b6108ba610273565b806108c4816103d2565b0390f35b610279565b346108fc576108e66108e0366004610575565b90611df7565b6108ee610273565b806108f8816103d2565b0390f35b610279565b61091561090f366004610677565b91611e32565b61091d610273565b80610927816103d2565b0390f35b346109595761094361093e3660046104fe565b611e6d565b61094b610273565b80610955816103d2565b0390f35b610279565b600080fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b906109889061044e565b810190811067ffffffffffffffff8211176109a257604052565b610968565b906109ba6109b3610273565b928361097e565b565b67ffffffffffffffff81116109da576109d660209161044e565b0190565b610968565b90826000939282370152565b90929192610a006109fb826109bc565b6109a7565b93818552602085019082840111610a1c57610a1a926109df565b565b610963565b9080601f83011215610a3f57816020610a3c933591016109eb565b90565b61095e565b909161012082840312610b3057610a5e8360008401610360565b92602083013567ffffffffffffffff8111610b2b5781610a7f918501610a21565b92604081013567ffffffffffffffff8111610b265782610aa0918301610a21565b92606082013567ffffffffffffffff8111610b215783610ac1918401610a21565b92608083013567ffffffffffffffff8111610b1c5781610ae2918501610a21565b92610af08260a08301610360565b92610b19610b018460c08501610395565b93610b0f8160e08601610360565b93610100016106f4565b90565b610283565b610283565b610283565b610283565b61027e565b34610b6d57610b57610b48366004610a44565b97969096959195949294611ee5565b610b5f610273565b80610b69816103d2565b0390f35b610279565b9091606082840312610ba857610ba5610b8e84600085016104ef565b93610b9c8160208601610360565b93604001610395565b90565b61027e565b34610bdc57610bc6610bc0366004610b72565b91611fc0565b610bce610273565b80610bd8816103d2565b0390f35b610279565b919091604081840312610c3a57600081013567ffffffffffffffff8111610c355783610c0e918301610a21565b92602082013567ffffffffffffffff8111610c3057610c2d9201610a21565b90565b610283565b610283565b61027e565b34610c6e57610c58610c52366004610be1565b9061220f565b610c60610273565b80610c6a816103d2565b0390f35b610279565b34610ca357610c9f610c8e610c893660046104fe565b61221b565b610c96610273565b9182918261052a565b0390f35b610279565b34610cd857610cd4610cc3610cbe3660046105cd565b612244565b610ccb610273565b9182918261062c565b0390f35b610279565b90602082820312610d0e57600082013567ffffffffffffffff8111610d0957610d069201610a21565b90565b610283565b61027e565b34610d4157610d2b610d26366004610cdd565b6122aa565b610d33610273565b80610d3d816103d2565b0390f35b610279565b9190604083820312610d6f5780610d63610d6c92600086016106f4565b936020016104ef565b90565b61027e565b34610da557610da1610d90610d8a366004610d46565b906122d0565b610d98610273565b9182918261052a565b0390f35b610279565b34610ddb57610dd7610dc6610dc0366004610837565b90612328565b610dce610273565b918291826102e9565b0390f35b610279565b34610e0e57610df8610df3366004610cdd565b61237b565b610e00610273565b80610e0a816103d2565b0390f35b610279565b34610e4357610e2336600461040c565b610e3f610e2e612386565b610e36610273565b91829182610489565b0390f35b610279565b600080fd5b908160c0910312610e5b5790565b610e48565b908160e0910312610e6e5790565b610e48565b91606083830312610ed857610e8b8260008501610360565b92602081013567ffffffffffffffff8111610ed35783610eac918301610e4d565b92604082013567ffffffffffffffff8111610ece57610ecb9201610e60565b90565b610283565b610283565b61027e565b34610f0e57610f0a610ef9610ef3366004610e73565b916126ef565b610f01610273565b9182918261072f565b0390f35b610279565b90565b60001b90565b610f30610f2b610f3592610f13565b610f16565b6106dc565b90565b610f426000610f1c565b90565b610f4d610f38565b90565b34610f8057610f6036600461040c565b610f7c610f6b610f45565b610f73610273565b9182918261072f565b0390f35b610279565b610f8e816102d7565b03610f9557565b600080fd5b90503590610fa782610f85565b565b9190604083820312610fd25780610fc6610fcf9260008601610360565b93602001610f9a565b90565b61027e565b3461100657610ff0610fea366004610fa9565b90612790565b610ff8610273565b80611002816103d2565b0390f35b610279565b600080fd5b600080fd5b909182601f8301121561104f5781359167ffffffffffffffff831161104a57602001926001830284011161104557565b611010565b61100b565b61095e565b906080828203126110b05761106c8160008401610360565b9261107a8260208501610360565b9261108883604083016104ef565b92606082013567ffffffffffffffff81116110ab576110a79201611015565b9091565b610283565b61027e565b6110cc6110c3366004611054565b93929092612847565b6110d4610273565b806110de816103d2565b0390f35b346111125761110e6110fd6110f83660046104fe565b6128a7565b611105610273565b91829182610489565b0390f35b610279565b346111475761114361113261112d366004610703565b612940565b61113a610273565b9182918261062c565b0390f35b610279565b3461117b5761116561115f366004610837565b90612990565b61116d610273565b80611177816103d2565b0390f35b610279565b67ffffffffffffffff81116111985760208091020190565b610968565b909291926111b26111ad82611180565b6109a7565b93818552602080860192028301928184116111ef57915b8383106111d65750505050565b602080916111e484866104ef565b8152019201916111c9565b611010565b9080601f830112156112125781602061120f9335910161119d565b90565b61095e565b9060208282031261124857600082013567ffffffffffffffff81116112435761124092016111f4565b90565b610283565b61027e565b3461127b57611265611260366004611217565b6129e3565b61126d610273565b80611277816103d2565b0390f35b610279565b346112b05761129036600461040c565b6112ac61129b612a43565b6112a3610273565b91829182610489565b0390f35b610279565b91906040838203126112de57806112d26112db9260008601610360565b93602001610360565b90565b61027e565b34611314576113106112ff6112f93660046112b5565b90612a59565b611307610273565b918291826102e9565b0390f35b610279565b346113475761133161132c366004610703565b612ad2565b611339610273565b80611343816103d2565b0390f35b610279565b600080fd5b600090565b61135e611351565b506376a4e23960e01b61137961137383610288565b91610288565b14908115611386575b5090565b6113909150612add565b38611382565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b906113d4916113cf6113ca611396565b612b21565b6113d6565b565b906113e091612d3b565b565b906113ec916113ba565b565b606090565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015611429575b602083101461142457565b6113f3565b91607f1691611419565b60209181520190565b600052602060002090565b906000929180549061146261145b83611409565b8094611433565b916001811690816000146114bb575060011461147e575b505050565b61148b919293945061143c565b916000925b8184106114a35750500190388080611479565b60018160209295939554848601520191019290611490565b92949550505060ff1916825215156020020190388080611479565b906114e091611447565b90565b906115036114fc926114f3610273565b938480926114d6565b038361097e565b565b61150e906114e3565b90565b6115196113ee565b506115246007611505565b90565b600090565b611534611527565b5080600052673ec412a9852d173d60c11b601c526020600020810101805460601b15611561576001015490565b63ceea21b66000526004601cfd5b61157c9133919091612db5565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b6115bb906115b66115b161157e565b612b21565b61163e565b565b90565b6115d46115cf6115d992610334565b6115bd565b610334565b90565b6115e5906115c0565b90565b6115f1906115dc565b90565b9061160560018060a01b0391610f16565b9181191691161790565b611618906115dc565b90565b90565b9061163361162e61163a9261160f565b61161b565b82546115f4565b9055565b61164a611651916115e8565b600461161e565b565b61165c906115a2565b565b600090565b60001c90565b90565b61167861167d91611663565b611669565b90565b61168a905461166c565b90565b61169561165e565b506116a0600c611680565b90565b9060001960601c918216908216918360005233673ec412a9852d173d60c11b17601c5260206000208401840190815480911683811481021561178b57508260005281600101548033148433141715611773575b611767575b838318189055601c600c206001815403905581600052601c600c2060018154019063ffffffff821684021561175257557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a4565b67ea553b3401336cea841560021b526004601cfd5b600082600101556116fb565b6030600c20546116f657634b6e7f186000526004601cfd5b67ceea21b6a1148100901560021b526004601cfd5b600090565b6117ae906106dc565b90565b906117bb906117a5565b600052602052604060002090565b90565b6117d86117dd91611663565b6117c9565b90565b6117ea90546117cc565b90565b600161180661180c926117fe6117a0565b5060026117b1565b016117e0565b90565b61182361181e611828926104d7565b6115bd565b6104d7565b90565b906118359061180f565b600052602052604060002090565b60018060a01b031690565b61185a61185f91611663565b611843565b90565b61186c905461184e565b90565b906118799061033f565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b6118a06118a59161187d565b611883565b90565b6118b29054611894565b90565b906118bf9061036f565b9052565b6118cd60406109a7565b90565b906119076118fe60006118e16118c3565b946118f86118f0838301611862565b83880161186f565b016118a8565b602084016118b5565b565b611912906118d0565b90565b61191f905161033f565b90565b61193661193161193b92610f13565b6115bd565b610334565b90565b61194790611922565b90565b611954905161036f565b90565b61196b6119666119709261036f565b6115bd565b6104d7565b90565b634e487b7160e01b600052601160045260246000fd5b61199861199e919392936104d7565b926104d7565b916119aa8382026104d7565b9281840414901517156119b957565b611973565b634e487b7160e01b600052601260045260246000fd5b6119e06119e6916104d7565b916104d7565b9081156119f1570490565b6119be565b611a19611a1e91939293611a08611527565b50611a1161165e565b50600161182b565b611909565b91611a2b60008401611915565b611a46611a40611a3b600061193e565b61033f565b9161033f565b14611a93575b6000611a88611a72611a8f93611a6c611a676020890161194a565b611957565b90611989565b611a82611a7d612e7c565b611957565b906119d4565b9301611915565b9190565b9150611a8f6000611a88611a72611aa983611909565b959350505050611a4c565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b90611af291611aed611ae8611ab4565b612b21565b611b9b565b565b611b08611b03611b0d92610f13565b6115bd565b6104d7565b90565b6001611b1c91016104d7565b90565b611b28906104d7565b6000198114611b375760010190565b611973565b90611b4960001991610f16565b9181191691161790565b90565b90611b6b611b66611b729261180f565b611b53565b8254611b3c565b9055565b611b85611b8b919392936104d7565b926104d7565b8201809211611b9657565b611973565b9190611ba76000611af4565b915b82611bbc611bb6846104d7565b916104d7565b1015611c3d575b611bd5611bd0600b611680565b612e93565b15611bfb57611bf6611bef611bea600b611680565b611b1f565b600b611b56565b611bc3565b9091611c3690611c1585611c0f600b611680565b90612ec0565b611c31611c2a611c25600b611680565b611b1f565b600b611b56565b611b10565b9190611ba9565b9250611c5e9150611c5790611c52600c611680565b611b76565b600c611b56565b565b90611c6a91611ad8565b565b90611c8791611c82611c7d826117ed565b612b21565b611c89565b565b90611c9391612f59565b565b90611c9f91611c6c565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b611cfc602f604092610420565b611d0581611ca1565b0190565b611d1f9060208101906000818303910152611cef565b90565b15611d2957565b611d31610273565b62461bcd60e51b815280611d4760048201611d09565b0390fd5b90611d7891611d7382611d6d611d67611d62612f83565b61033f565b9161033f565b14611d22565b612f90565b565b90611d9491611d8f611d8a611ab4565b612b21565b611d96565b565b90611da091612ec0565b611dbc611db5611db0600c611680565b611b1f565b600c611b56565b5b611dcf611dca600b611680565b612e93565b15611df557611df0611de9611de4600b611680565b611b1f565b600b611b56565b611dbd565b565b90611e0191611d7a565b565b90611e15611e10836109bc565b6109a7565b918252565b611e246000611e03565b90565b611e2f611e1a565b90565b91611e3f838383916116a3565b611e4882612fba565b611e52575b505050565b611e659291611e5f611e27565b92612fc7565b388080611e4d565b611e779033613058565b565b60ff1690565b611e8b611e9091611663565b611e79565b90565b611e9d9054611e7f565b90565b90611eac60ff91610f16565b9181191691161790565b611ebf906102d7565b90565b90565b90611eda611ed5611ee192611eb6565b611ec2565b8254611ea0565b9055565b96979091929594939733611f21611f1b7f000000000000000000000000000000000000000000000000000000000000000061033f565b9161033f565b14158015611f84575b611f6757611f5998611f4c97611f47958a95909192939495613122565b612d3b565b611f54611ab4565b612f59565b611f656001600a611ec5565b565b600063f92ee8a960e01b815280611f80600482016103d2565b0390fd5b50611f8f600a611e93565b611f2a565b90611faf9291611faa611fa5611396565b612b21565b611fb1565b565b91611fbe92919091613217565b565b90611fcb9291611f94565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b9061200b91612006612001611fcd565b612b21565b6121f7565b565b601f602091010490565b1b90565b9190600861203791029161203160001984612017565b92612017565b9181191691161790565b919061205761205261205f9361180f565b611b53565b90835461201b565b9055565b6120759161206f61165e565b91612041565b565b5b818110612083575050565b806120916000600193612063565b01612078565b9190601f81116120a7575b505050565b6120b36120d89361143c565b9060206120bf8461200d565b830193106120e0575b6120d19061200d565b0190612077565b3880806120a2565b91506120d1819290506120c8565b1c90565b9061210390600019906008026120ee565b191690565b81612112916120f2565b906002021790565b906121248161041c565b9067ffffffffffffffff82116121e657612148826121428554611409565b85612097565b602090601f831160011461217d5791809161216c93600092612171575b5050612108565b90555b565b90915001513880612165565b601f1983169161218c8561143c565b9260005b8181106121ce575091600293918560019694106121b4575b5050500201905561216f565b6121c4910151601f8416906120f2565b90553880806121a8565b91936020600181928787015181550195019201612190565b610968565b906121f59161211a565b565b9061220661220d9260076121eb565b60086121eb565b565b9061221991611ff1565b565b61222d90612227611527565b5061329a565b90811561223657565b63ceea21b66000526004601cfd5b61224c61165e565b50801561227457673ec412a9852d173d60c11b601c5260005263ffffffff601c600c20541690565b638f4eb6046000526004601cfd5b61229b90612296612291611fcd565b612b21565b61229d565b565b6122a89060066121eb565b565b6122b390612282565b565b906122bf906117a5565b600052602052604060002090565b90565b906122f06122eb6122f5936122e3611527565b5060036122b5565b6122cd565b6132fb565b90565b612301906115c0565b90565b61230d906122f8565b90565b9061231a90612304565b600052602052604060002090565b61235091600061234561234b9361233d611351565b5060026117b1565b01612310565b611e93565b90565b61236c90612367612362611fcd565b612b21565b61236e565b565b6123799060096121eb565b565b61238490612353565b565b61238e6113ee565b506123996008611505565b90565b60018060a01b031690565b6123b36123b891611663565b61239c565b90565b6123c590546123a7565b90565b6123d1906122f8565b90565b60e01b90565b905051906123e7826106df565b565b9060208282031261240357612400916000016123da565b90565b61027e565b50612417906020810190610360565b90565b6124239061033f565b9052565b506124369060208101906102a9565b90565b61244290610288565b9052565b506124559060208101906106f4565b90565b612461906106dc565b9052565b600080fd5b600080fd5b600080fd5b90356001602003823603038112156124b557016020813591019167ffffffffffffffff82116124b05760018202360383136124ab57565b61246a565b612465565b61246f565b60209181520190565b91906124dd816124d6816124e2956124ba565b80956109df565b61044e565b0190565b90356001604003823603038112156124fc570190565b61246f565b903560016020038236030381121561254257016020813591019167ffffffffffffffff821161253d57600182023603831361253857565b61246a565b612465565b61246f565b91906125618161255a8161256695611433565b80956109df565b61044e565b0190565b67ffffffffffffffff1690565b6125808161256a565b0361258757565b600080fd5b9050359061259982612577565b565b506125aa90602081019061258c565b90565b6125b69061256a565b9052565b906125f89060206125f06125e6604084016125d86000880188612501565b908683036000880152612547565b948281019061259b565b9101906125ad565b90565b6126a59161269761268c60c083016126236126196000870187612408565b600086019061241a565b61263d6126336020870187612427565b6020860190612439565b61265761264d6040870187612446565b6040860190612458565b6126716126676060870187612446565b6060860190612458565b61267e6080860186612474565b9085830360808701526124c3565b9260a08101906124e6565b9060a08184039101526125ba565b90565b9392906126d46040916126dc946126c7606089019260008a019061051d565b87820360208901526125fb565b940190610722565b565b6126e6610273565b3d6000823e3d90fd5b91506020906126fc6117a0565b5061270f61270a60046123bb565b6123c8565b61273b633808a90b94929461274661272760056117e0565b61272f610273565b978896879586956123d4565b8552600485016126a8565b03915afa90811561278b5760009161275d575b5090565b61277e915060203d8111612784575b612776818361097e565b8101906123e9565b38612759565b503d61276c565b6126de565b90151581601c52670a5a2e7a0000000060085233600052806030600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b67ffffffffffffffff81116127fe576127fa60209161044e565b0190565b610968565b90929192612818612813826127e0565b6109a7565b9381855260208501908284011161283457612832926109df565b565b610963565b612844913691612803565b90565b92919092612857818584916116a3565b61286084612fba565b61286c575b5050505050565b6128829461287c91949293612839565b92612fc7565b3880808080612865565b90565b6128999054611409565b90565b6128a4611e1a565b90565b6128af6113ee565b506128c26128bc82612e93565b156102d7565b612923576128d86128d3600661288c565b61288f565b6128eb6128e56000611af4565b916104d7565b1415600014612915576129119061290c612906600692613334565b91611505565b61338f565b5b90565b5061291e61289c565b612912565b600063677510db60e11b81528061293c600482016103d2565b0390fd5b61295f61295a6129649261295261165e565b5060036122b5565b6122cd565b6133bf565b90565b906129829161297d612978826117ed565b612b21565b612984565b565b9061298e91612f90565b565b9061299a91612967565b565b5190565b634e487b7160e01b600052603260045260246000fd5b906129c08261299c565b8110156129d1576020809102010190565b6129a0565b6129e090516104d7565b90565b906129ed8261299c565b906129f86000611af4565b5b80612a0c612a06856104d7565b916104d7565b1015612a3d57612a3890612a3333612a2d612a288885906129b6565b6129d6565b90613058565b611b10565b6129f9565b50915050565b612a4b6113ee565b50612a566009611505565b90565b90612a62611351565b50601c52670a5a2e7a000000006008526000526030600c205490565b612a9790612a92612a8d61157e565b612b21565b612ac5565b565b612aa290611663565b90565b90612aba612ab5612ac1926117a5565b612a99565b8254611b3c565b9055565b612ad0906005612aa5565b565b612adb90612a7e565b565b612ae5611351565b50612aef816133df565b8015612b12575b908115612b02575b5090565b612b0c915061346c565b38612afe565b50612b1c81613406565b612af6565b612b3390612b2d612f83565b90613591565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b612b90602a604092610420565b612b9981612b35565b0190565b612bb39060208101906000818303910152612b83565b90565b15612bbd57565b612bc5610273565b62461bcd60e51b815280612bdb60048201612b9d565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b612c146019602092610420565b612c1d81612bdf565b0190565b612c379060208101906000818303910152612c07565b90565b15612c4157565b612c49610273565b62461bcd60e51b815280612c5f60048201612c21565b0390fd5b612c6d60406109a7565b90565b90565b90612c88612c83612c8f92612304565b612c70565b82546115f4565b9055565b60a01b90565b90612cb36bffffffffffffffffffffffff60a01b91612c93565b9181191691161790565b612cd1612ccc612cd69261036f565b6115bd565b61036f565b90565b90565b90612cf1612cec612cf892612cbd565b612cd9565b8254612c99565b9055565b90612d2760206000612d2d94612d1f828201612d19848801611915565b90612c73565b01920161194a565b90612cdc565b565b90612d3991612cfc565b565b90612dac612db392612d6783612d60612d5a612d55612e7c565b61036f565b9161036f565b1115612bb6565b612d8d81612d86612d80612d7b600061193e565b61033f565b9161033f565b1415612c3a565b91612da3612d99612c63565b936000850161186f565b602083016118b5565b6000612d2f565b565b9060001960601c9081169181168360005280673ec412a9852d173d60c11b17601c5260206000208401840191825416918215612e4a57818385931490151715612e24575b600101557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a4565b9050816000526030600c205415612e3c578290612df9565b634b6e7f186000526004601cfd5b63ceea21b66000526004601cfd5b600090565b90565b612e74612e6f612e7992612e5d565b6115bd565b61036f565b90565b612e84612e58565b50612e90612710612e60565b90565b612e9b611351565b5080600052673ec412a9852d173d60c11b601c5260206000208101015460601b151590565b60601b60601c81600052673ec412a9852d173d60c11b601c5260206000208201820180548060601b612f4b578217905580600052601c600c2060018154019063ffffffff8216830215612f36575560007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8138a4565b67ea553b3401336cea831560021b526004601cfd5b63c991cbb16000526004601cfd5b90612f7b612f76612f8093612f6f81859061362a565b60036122b5565b6122cd565b613711565b50565b612f8b611527565b503390565b90612fb2612fad612fb793612fa681859061374c565b60036122b5565b6122cd565b6137e6565b50565b612fc2611351565b503b90565b9160209160a460405195869363150b7a0296878652338787015260601b60601c6040860152606085015260808085015280518091818060a0880152613044575b505001906000601c8401915af115613034575b60e01b90510361302657565b63d1a57ed66000526004601cfd5b3d1561301a57503d6000823e3d90fd5b818760c08801920160045afa508038613007565b6130618261221b565b5060601b60601c8160005280673ec412a9852d173d60c11b17601c52602060002082018201908154918260601b60601c918215613114578260005281600101549081811484821417901517156130fc575b60009383916130f1575b189055601c600c20600181540390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8238a4565b8483600101556130bc565b6030600c20546130b257634b6e7f186000526004601cfd5b63ceea21b66000526004601cfd5b9261314c906131456131539461313e6131919a989560076121eb565b60086121eb565b60066121eb565b60096121eb565b61316561315e610f38565b8290612f59565b613177613170611fcd565b8290612f59565b613189613182611396565b8290612f59565b919091613821565b565b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b6131c8601b602092610420565b6131d181613193565b0190565b6131eb90602081019060008183039101526131bb565b90565b156131f557565b6131fd610273565b62461bcd60e51b815280613213600482016131d5565b0390fd5b6132939061328c61329894936132478561324061323a613235612e7c565b61036f565b9161036f565b1115612bb6565b61326d8161326661326061325b600061193e565b61033f565b9161033f565b14156131ee565b93613283613279612c63565b956000870161186f565b602085016118b5565b600161182b565b612d2f565b565b6132a2611527565b5080600052673ec412a9852d173d60c11b601c5260206000208101015460601b60601c90565b90565b6132d76132dc91611663565b61180f565b90565b6132f36132ee6132f8926104d7565b6115bd565b610334565b90565b6133276133226133319361331d600061332c95613316611527565b50016132c8565b61389c565b6132cb565b6132df565b6122f8565b90565b9061333d6113ee565b506080604051019160208301604052600083528290600a6000198092955b019481810660300186530493841561337a5790600a919080929161335b565b93505082602091039203918252565b90565b90565b6133bc916133b16133ab6133b7936133a56113ee565b50613389565b91613389565b906138c3565b61338c565b90565b6133d760006133dc926133d061165e565b50016132c8565b613945565b90565b6133e7611351565b5060e01c635b5e139f8114906301ffc9a76380ac58cd82149114171790565b61340e611351565b506134188161395d565b801561345d575b8015613442575b908115613432575b5090565b61343c915061399d565b3861342e565b50600061345761345183610288565b91610288565b14613426565b506134678161399d565b61341f565b613474611351565b5061347e8161399d565b90811561348a575b5090565b61349491506139dd565b38613486565b90565b6134b16134ac6134b69261349a565b6115bd565b6104d7565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b6134f2601780926134b9565b6134fb816134be565b0190565b61352461351b926020926135128161041c565b948580936134b9565b93849101610429565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b61355c601180926134b9565b61356581613528565b0190565b61358361358e939261357d613588936134e6565b906134ff565b613550565b906134ff565b90565b906135a66135a0838390612328565b156102d7565b6135ae575050565b613626916136046135dd6135cd6135c761360995613a6b565b936132cb565b6135d7602061349d565b90613c84565b916135f56135e9610273565b93849260208401613569565b6020820181038252038261097e565b61338c565b613611610273565b91829162461bcd60e51b835260048301610489565b0390fd5b61363e613638828490612328565b156102d7565b613647575b5050565b61366a6001613665600061365d600286906117b1565b018590612310565b611ec5565b90613673612f83565b906136b06136aa6136a47f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d956117a5565b92612304565b92612304565b926136b9610273565b806136c3816103d2565b0390a43880613643565b6136d6906115c0565b90565b6136ed6136e86136f292610334565b6115bd565b6104d7565b90565b61370961370461370e926104d7565b610f16565b6106dc565b90565b9061374461373e61373961373460006137499661372c611351565b5001946136cd565b6136d9565b6136f5565b916132c8565b613e7a565b90565b613757818390612328565b613760575b5050565b613783600061377e6000613776600286906117b1565b018590612310565b611ec5565b9061378c612f83565b906137c96137c36137bd7ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b956117a5565b92612304565b92612304565b926137d2610273565b806137dc816103d2565b0390a4388061375c565b9061381961381361380e613809600061381e96613801611351565b5001946136cd565b6136d9565b6136f5565b916132c8565b613f5f565b90565b9061383761383c939261383261157e565b612f59565b614069565b565b5490565b600052602060002090565b6138568161383e565b82101561387157613868600191613842565b91020190600090565b6129a0565b61388690600861388b93026120ee565b6117c9565b90565b906138999154613876565b90565b6138bb9160006138b5926138ae6117a0565b500161384d565b9061388e565b90565b606090565b9190916138ce6138be565b5060405192601f1980835193818060208701165b80830151818a0152019081156138fd578190915082906138e2565b505050815191838601828060208601165b80840151818401520191821561392b57828091935050839061390e565b505050506020910180828501019060008252845201604052565b600061395a9161395361165e565b500161383e565b90565b613965611351565b508061398061397a63152a902d60e11b610288565b91610288565b1490811561398d575b5090565b6139979150614089565b38613989565b6139a5611351565b50806139c06139ba635a05180f60e01b610288565b91610288565b149081156139cd575b5090565b6139d791506140af565b386139c9565b6139e5611351565b5080613a006139fa634e821d3360e11b610288565b91610288565b14908115613a0d575b5090565b613a179150613406565b38613a09565b90565b60ff1690565b613a3a613a35613a3f92613a1d565b6115bd565b613a20565b90565b613a4c6014613a26565b90565b613a63613a5e613a6892613a20565b6115bd565b6104d7565b90565b613a88613a83613a9e92613a7d6113ee565b506136cd565b6136d9565b613a98613a93613a42565b613a4f565b90613c84565b90565b90565b613ab8613ab3613abd92613aa1565b6115bd565b6104d7565b90565b90613ad2613acd836127e0565b6109a7565b918252565b369037565b90613b01613ae983613ac0565b92602080613af786936127e0565b9201910390613ad7565b565b600360fc1b90565b5190565b90613b1982613b0b565b811015613b2b57600160209102010190565b6129a0565b600f60fb1b90565b90565b613b4f613b4a613b5492613b38565b6115bd565b6104d7565b90565b613b60906104d7565b60008114613b6f576001900390565b611973565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b613b93613b74565b90565b90565b613bad613ba8613bb292613b96565b6115bd565b6104d7565b90565b60f81b90565b90565b613bd2613bcd613bd792613bbb565b6115bd565b613a20565b90565b613bf990613bf3613bed613bfe94613a20565b916104d7565b906120ee565b6104d7565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b613c3560208092610420565b613c3e81613c01565b0190565b613c589060208101906000818303910152613c29565b90565b15613c6257565b613c6a610273565b62461bcd60e51b815280613c8060048201613c42565b0390fd5b9190613c8e6113ee565b50613d28613d18613cc4613cbf613caf6002613caa8791613aa4565b611989565b613cb96002613aa4565b90611b76565b613adc565b92613ccd613b03565b613ce685613ce060009360001a93611af4565b90613b0f565b53613cef613b30565b613d0885613d0260019360001a93613b3b565b90613b0f565b53613d136002613aa4565b611989565b613d226001613b3b565b90611b76565b925b83613d3e613d386001613b3b565b916104d7565b1115613da557613d4c613b8b565b81613d57600f613b99565b16916010831015613da057613d73613d9492613d9a941a613bb5565b613d838591889060001a92613b0f565b53613d8e6004613bbe565b90613bda565b93613b57565b92613d2a565b6129a0565b613dcd929350613dc890613dc2613dbc6000611af4565b916104d7565b14613c5b565b61338c565b90565b90565b600052602060002090565b5490565b613deb81613dde565b821015613e0657613dfd600191613dd3565b91020190600090565b6129a0565b9190613e21613e1c613e29936117a5565b612a99565b90835461201b565b9055565b9081549168010000000000000000831015613e5d5782613e55916001613e5b95018155613de2565b90613e0b565b565b610968565b90613e6c906117a5565b600052602052604060002090565b613e82611351565b50613e97613e918284906140ef565b156102d7565b600014613eda57613ed0613ed592613ebb613eb460008501613dd0565b8290613e2d565b6001613ec96000850161383e565b9301613e62565b611b56565b600190565b5050600090565b613ef0613ef6919392936104d7565b926104d7565b8203918211613f0157565b611973565b634e487b7160e01b600052603160045260246000fd5b613f2e91613f286117a0565b91613e0b565b565b613f3981613dde565b8015613f5a576001900390613f57613f518383613de2565b90613f1c565b55565b613f06565b613f67611351565b50613f7e613f79600183018490613e62565b611680565b9081613f93613f8d6000611af4565b916104d7565b14156000146140615761401392600161400e9284613fbc600096613fb685613b3b565b90613ee1565b613fd9613fca88850161383e565b613fd386613b3b565b90613ee1565b80613fec613fe6846104d7565b916104d7565b03614018575b505050614008614003868301613dd0565b613f30565b01613e62565b612063565b600190565b6140599261404b614037614031614054948c890161384d565b9061388e565b9361404585918c890161384d565b90613e0b565b91858501613e62565b611b56565b388080613ff2565b505050600090565b90614080614079614087936115e8565b600461161e565b6005612aa5565b565b614091611351565b506140ab6140a56301ffc9a760e01b610288565b91610288565b1490565b6140b7611351565b50806140d26140cc637965db0b60e01b610288565b91610288565b149081156140df575b5090565b6140e9915061395d565b386140db565b61410d91600161410892614101611351565b5001613e62565b611680565b61412061411a6000611af4565b916104d7565b14159056fea264697066735822122029a6d041f14c226b015d09bed1f38d00ed477c06417cdefc834389f375cb9b8964736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) diff --git a/scripts/factories/token_library/ERC721SaleFactory.ts b/scripts/factories/token_library/ERC721SaleFactory.ts index 2e416c4..ee919b1 100644 --- a/scripts/factories/token_library/ERC721SaleFactory.ts +++ b/scripts/factories/token_library/ERC721SaleFactory.ts @@ -1,176 +1,14 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' -// https://github.com/0xsequence/contracts-library/blob/ead1baf34270c76260d01cfc130bb7cc9d57518e/src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol - -const abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'factoryOwner', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - name: 'ERC721SaleDeployed', - 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' - }, - { - inputs: [], - name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'items', - type: 'address' - } - ], - name: 'deploy', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'items', - type: 'address' - } - ], - name: 'determineAddress', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'upgradeBeacon', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] +// https://github.com/0xsequence/contracts-library/blob/2d624ed35c2ad097b0e2a3efbc62baf6455b3e49/src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol export class ERC721SaleFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, - '608034610121576001600160401b0390601f6148a438819003918201601f191683019291908484118385101761010b57816020928492604096875283398101031261012157516001600160a01b0380821682036101215761005f33610126565b8251936124d294858101958187108388111761010b576123d2823980600096039086f0908115610101578451916105ee808401928311848410176100ed5791848492602094611de4853916815203019085f080156100e0576100d39394501660018060a01b03196001541617600155610126565b51611c76908161016e8239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6040608081526004908136101561001557600080fd5b600091823560e01c80631bce45831461079057806359659e901461073d578063715018a6146106a05780638da5cb5b1461064b578063d9181cd3146102ee578063e657f693146101aa5763f2fde38b1461006e57600080fd5b346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a6576100a561084f565b906100ae6108bd565b73ffffffffffffffffffffffffffffffffffffffff809216928315610123575050600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b90602060849251917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b8284346102eb5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb57506101e461084f565b906101ed610877565b916055600b6101fa61089a565b845173ffffffffffffffffffffffffffffffffffffffff968716602080830191825292909716604080830191909152815290957fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09161025a60608261099b565b519020906102ab86519161026d8361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff9661029f8860015416948a519586938d850198896109ff565b0390810183528261099b565b5190206111eb85516102bf8883018261099b565b81815287810191610a5683395190209085519186830152868201523081520160ff815320915191168152f35b80fd5b5090346101a65760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a65761032761084f565b92610330610877565b61033861089a565b908351946020968787018761037586868490602090939293604083019473ffffffffffffffffffffffffffffffffffffffff809216845216910152565b03976103a77fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0998a810183528261099b565b5190208651916103b68361097f565b6000835273ffffffffffffffffffffffffffffffffffffffff91816103f98c6103ed878d88600154169051958694850197886109ff565b038c810183528261099b565b5190206111eb895161040d8d83018261099b565b8181528c810191610a5683398051156105f057518492918af516988915610594578260015416938a3b156105905791608491601f8a95946104988f8e51998a9889977fcf7a1d77000000000000000000000000000000000000000000000000000000008952168c880152602487015260606044870152825192839182606489015288880191016109dc565b01168101030181838b5af1801561058657908591610572575b5050853b1561056e5784517f485cc95500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff928316918101918252929091166020820152829082908190604001038183885af1801561056457610550575b50507fe3fc4d8c7984f762222579e0c4564a72a74f96cde3f6bae2751d01108c6ec240838251848152a151908152f35b61055a829161093c565b6102eb5780610520565b83513d84823e3d90fd5b8380fd5b61057b9061093c565b61056e5783386104b1565b86513d87823e3d90fd5b8880fd5b6064858c8b51917f08c379a0000000000000000000000000000000000000000000000000000000008352820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b6064878e808e51927f08c379a000000000000000000000000000000000000000000000000000000000845283015260248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5080fd5b83346102eb57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126102eb576106d76108bd565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50503461069c57817ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069c5760209073ffffffffffffffffffffffffffffffffffffffff600154169051908152f35b5090346101a65760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a657826107ca61084f565b6107d26108bd565b73ffffffffffffffffffffffffffffffffffffffff90816001541690813b1561056e5783602492865197889586947f3659cfe600000000000000000000000000000000000000000000000000000000865216908401525af1908115610846575061083a575080f35b6108439061093c565b80f35b513d84823e3d90fd5b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b600080fd5b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361087257565b73ffffffffffffffffffffffffffffffffffffffff6000541633036108de57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b67ffffffffffffffff811161095057604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff82111761095057604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff82111761095057604052565b60005b8381106109ef5750506000910152565b81810151838201526020016109df565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610a5082518093602086850191016109dc565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea2646970667358221220a592f27f25373407ca73911ddc0bbaa6ea0e0d6dfcce18bb6b5765f70d2e1a1764736f6c63430008130033a2646970667358221220f7464573d2144d649988f0f60625c5f6ed3b279c89ac9793209a1b06152866e664736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea2646970667358221220ff9f63e676c96c753988d58c9eed378dc3ae25dde2df2114b6217eba7bb9455964736f6c6343000813003360808060405234610016576124b6908161001c8239f35b600080fdfe608060408181526004908136101561001657600080fd5b600092833560e01c90816301ffc9a7146116de575080630668d0bb14610f3b578063248a9ca314610f115780632f2ff15d14610e915780633474a4a614610dc057806336568abe14610cf957806344004cc114610c255780634782f77914610bc2578063485cc955146108bf5780638c17030f146104475780639010d07c146103f857806391d14854146103a5578063a217fddf1461038a578063a971e8421461034e578063bad4366114610146578063ca15c8731461011e5763d547741f146100df57600080fd5b3461011a578060031936011261011a5761011791356101126001610101611829565b938387528660205286200154611b16565b611d81565b80f35b8280fd5b50903461011a57602060031936011261011a5760209282913581526001845220549051908152f35b503461011a57608060031936011261011a578135602490813567ffffffffffffffff9586821161034b575061017e903690860161184c565b9490610188611806565b9573ffffffffffffffffffffffffffffffffffffffff8716600052602097600289528660002085600052895260ff8760002054161597886101cf575b898989519015158152f35b9091929497508695989396517fffffffffffffffffffffffffffffffffffffffff0000000000000000000000008582019260601b16825260643560348201526034815261021b81611cbe565b51902090821161031e5760059382851b86519361023a86830186611cf6565b845284840190820191368311610319578590915b8383106103095750505050926000935b82518510156102f25784821b830184015190866000838310156102e55750506000528352846000205b937fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146102b8576001019361025e565b886011887f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b9190928252855220610287565b9496955050509450501490388080808080806101c4565b823581529181019186910161024e565b600080fd5b876041877f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b80fd5b83823461038657816003193601126103865760209073ffffffffffffffffffffffffffffffffffffffff60035460081c169051908152f35b5080fd5b83823461038657816003193601126103865751908152602090f35b50903461011a578160031936011261011a5773ffffffffffffffffffffffffffffffffffffffff826020946103d8611829565b93358152808652209116600052825260ff81600020541690519015158152f35b50903461011a578160031936011261011a5761043860209373ffffffffffffffffffffffffffffffffffffffff9235815260018552836024359120611fe9565b92905490519260031b1c168152f35b50903461011a5760c060031936011261011a5780359160249081359061046b611806565b906064359267ffffffffffffffff9485851694858103610319576084359687168097036103195760a435977f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280600052602093600085528660002033600052855260ff87600020541615610628575050868810801561061e575b6105f7579189979593917fabec13ca1773eed55d54d2f64593c33fa520ee45cac73a162f13928a2ebee2339a86948b60a073ffffffffffffffffffffffffffffffffffffffff60c09e9c9a519961053b8b611c73565b858b5288888c0152169889898201528a60608201528b608082015201525582600555847fffffffff000000000000000000000000000000000000000000000000000000007bffffffffffffffff00000000000000000000000000000000000000006006549360a01b1692161717600655857fffffffffffffffffffffffffffffffffffffffffffffffff000000000000000060075416176007558660085582519788528701528501526060840152608083015260a0820152a180f35b84517f85d4a748000000000000000000000000000000000000000000000000000000008152fd5b50428811156104e5565b919450915061063633611e74565b85519161064283611cda565b604283528483019360603686378351156108925760308553835160019081101561086557607860218601536041905b80821161079d575050610742575061073e938693610710936107016048946106cc9a519a857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008d978801528251928391603789019101611c50565b8401917f206973206d697373696e6720726f6c6520000000000000000000000000000000603784015251809386840190611c50565b01036028810187520185611cf6565b519283927f08c379a00000000000000000000000000000000000000000000000000000000084528301611d37565b0390fd5b925050508160649451937f08c379a00000000000000000000000000000000000000000000000000000000085528401528201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015610838577f3031323334353637383961626364656600000000000000000000000000000000901a6107d98488611e34565b53881c91801561080b577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190610671565b8360118a7f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b8460328b7f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b826032897f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b506032867f4e487b7100000000000000000000000000000000000000000000000000000000600052526000fd5b50903461011a578160031936011261011a576108d96117e3565b906108e2611829565b6003549160ff8316610b9b5750907fffffffffffffffffffffff0000000000000000000000000000000000000000ff74ffffffffffffffffffffffffffffffffffffffff00610a2c949360081b16911617600355600080526020926000845273ffffffffffffffffffffffffffffffffffffffff8160002092169182600052845260ff81600020541615610b2f575b60008052600184818096526109898484600020612001565b507f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c280600052600082528360002085600052825260ff84600020541615610ac4575b6000528181526109de8484600020612001565b507f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec80600052600082528360002085600052825260ff84600020541615610a59575b60005252600020612001565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00600354161760035580f35b80600052600082528360002085600052825283600020837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4610a20565b80600052600082528360002085600052825283600020837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff008254161790553385827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a46109cb565b6000805260008452806000208260005284528060002060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055338260007f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4610971565b84517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b503461011a578060031936011261011a5782808080610bdf6117e3565b610be761187d565b602435905af1610bf561235e565b5015610bff578280f35b517f750b219c000000000000000000000000000000000000000000000000000000008152fd5b83823461038657606060031936011261038657610cc773ffffffffffffffffffffffffffffffffffffffff61011792610cf3610c5f6117e3565b91610c68611829565b90610c7161187d565b517fa9059cbb00000000000000000000000000000000000000000000000000000000602082015273ffffffffffffffffffffffffffffffffffffffff909116602482015260448035908201529384906064820190565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101855284611cf6565b1661221b565b50919034610386578260031936011261038657610d14611829565b903373ffffffffffffffffffffffffffffffffffffffff831603610d3d57906101179135611d81565b60849060208551917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b50903461011a578260031936011261011a5760c09260a08351610de281611c73565b82815282602082015282858201528260608201528260808201520152815190610e0a82611c73565b5491828252600554602083019081526006548284019273ffffffffffffffffffffffffffffffffffffffff908183168552606086019167ffffffffffffffff9586809560a01c1684528460075416956080890196875260a060085499019889528351998a525160208a015251169087015251166060850152511660808301525160a0820152f35b503461011a578060031936011261011a57610f0d9135906001610eb2611829565b92808652602090868252610eca838589200154611b16565b806000526000825273ffffffffffffffffffffffffffffffffffffffff8460002095169485600052825260ff84600020541615610a595760005252600020612001565b5080f35b50903461011a57602060031936011261011a57816020936001923581528085522001549051908152f35b509060a060031936011261011a57610f516117e3565b602491823592610f5f611806565b67ffffffffffffffff929060843584811161123257610f81903690840161184c565b8560065460a01c16866007541680159182156116d4575b5081156116c9575b506116a157600854918261143d575b505050600554868102908082048814901517156114125773ffffffffffffffffffffffffffffffffffffffff918260065416838216908082036113d8575060643583811061137d5750806112a457508134036112485750505b60035460081c169286517f18160ddd0000000000000000000000000000000000000000000000000000000081526020818481885afa90811561123e578991611209575b50825490811515806111cc575b611192575050833b1561118e5787875180957f40c10f190000000000000000000000000000000000000000000000000000000082528183816110c08c8c8a84016020909392919373ffffffffffffffffffffffffffffffffffffffff60408201951681520152565b03925af1801561118457611125575b5050935173ffffffffffffffffffffffffffffffffffffffff90921682525060208101919091527ff32d98590495ee51bacb93809409a188e7ab8268b70b4c969d9da3a883c539f7915080604081015b0390a180f35b831161115a575050835261111f7ff32d98590495ee51bacb93809409a188e7ab8268b70b4c969d9da3a883c539f738806110cf565b604187917f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b87513d8a823e3d90fd5b8780fd5b606491888686938c51947fa92278300000000000000000000000000000000000000000000000000000000086528501528301526044820152fd5b508781018082116111de578210611058565b858b6011877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b90506020813d8211611236575b8161122360209383611cf6565b8101031261123257513861104b565b8880fd5b3d9150611216565b88513d8b823e3d90fd5b61073e848a519384937f1eabcfbe0000000000000000000000000000000000000000000000000000000085523492850160409194939273ffffffffffffffffffffffffffffffffffffffff606083019616825260208201520152565b939894979496949593905034156112ef576064898b8a818b51937f1eabcfbe000000000000000000000000000000000000000000000000000000008552840152820152346044820152fd5b8698939597949651917f23b872dd000000000000000000000000000000000000000000000000000000006020840152338684015230604484015260648301526064825260a082018281108782111761135257895261134d919061221b565b611008565b858b6041877f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8a517f1eabcfbe00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84168188019081526020810186905260408101929092529081906060010390fd5b858c85896064948f51947f1eabcfbe0000000000000000000000000000000000000000000000000000000086528501528301526044820152fd5b83896011857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b338b52602091600283528a8c20848d52835260ff8b8d2054161580611528575b156114a6575050338a5260028152888a20918a525286882060017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00825416179055388080610faf565b908b8692608089878f51967f265c66a80000000000000000000000000000000000000000000000000000000088528701528501528060848501527f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81116103865791839160a49360051b80928585013733604484015260648301528101030190fd5b50999690959a989293879892959851868101907fffffffffffffffffffffffffffffffffffffffff0000000000000000000000003360601b1682528b60348201526034815261157681611cbe565b51902094828c116116765788519560059594939291908d871b8e61159c8b83018b611cf6565b89528a01898901368211611672578a8c915b8383106116625750505050988c995b88518b1015611649578a881b89018a0151908e8282101561163b575289528a8d205b997fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461161057600101996115bd565b8f8e60118f7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b9190915289528a8d206115df565b919650939a97949b9d9850859196509b91989b1461145d565b82358152918101918c91016115ae565b8e80fd5b8c8b60418c7f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b8389517f3f886774000000000000000000000000000000000000000000000000000000008152fd5b905042101538610fa0565b4210915038610f98565b8490843461011a57602060031936011261011a57357fffffffff00000000000000000000000000000000000000000000000000000000811680910361011a57602092507fbe0b7712000000000000000000000000000000000000000000000000000000008114908115611753575b5015158152f35b7f5a05180f00000000000000000000000000000000000000000000000000000000811491508115611786575b508361174c565b7f7965db0b000000000000000000000000000000000000000000000000000000008114915081156117b9575b508361177f565b7f01ffc9a700000000000000000000000000000000000000000000000000000000915014836117b2565b6004359073ffffffffffffffffffffffffffffffffffffffff8216820361031957565b6044359073ffffffffffffffffffffffffffffffffffffffff8216820361031957565b6024359073ffffffffffffffffffffffffffffffffffffffff8216820361031957565b9181601f840112156103195782359167ffffffffffffffff8311610319576020808501948460051b01011161031957565b3360009081527f20be27040b8e00df40bca0df34743417f3574a156386188f7d7f14369e5ee82b60209081526040808320549092907f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec9060ff16156118e25750505050565b6118eb33611e74565b8451916118f783611cda565b60428352848301936060368637835115611ae95760308553835190600191821015611ae95790607860218601536041915b818311611a1e575050506119c2576106cc9385936119929361198360489461073e995198857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008b978801528251928391603789019101611c50565b01036028810185520183611cf6565b519182917f08c379a000000000000000000000000000000000000000000000000000000000835260048301611d37565b6064848651907f08c379a000000000000000000000000000000000000000000000000000000000825280600483015260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b909192600f81166010811015611abc577f3031323334353637383961626364656600000000000000000000000000000000901a611a5b8588611e34565b5360041c928015611a8f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190611928565b6024827f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526032600452fd5b6000818152602090808252604092838220338352835260ff848320541615611b3e5750505050565b611b4733611e74565b845191611b5383611cda565b60428352848301936060368637835115611ae95760308553835190600191821015611ae95790607860218601536041915b818311611bdf575050506119c2576106cc9385936119929361198360489461073e995198857f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008b978801528251928391603789019101611c50565b909192600f81166010811015611abc577f3031323334353637383961626364656600000000000000000000000000000000901a611c1c8588611e34565b5360041c928015611a8f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019190611b84565b60005b838110611c635750506000910152565b8181015183820152602001611c53565b60c0810190811067ffffffffffffffff821117611c8f57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6060810190811067ffffffffffffffff821117611c8f57604052565b6080810190811067ffffffffffffffff821117611c8f57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117611c8f57604052565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f60409360208452611d7a8151809281602088015260208888019101611c50565b0116010190565b906040611dcc926000908082528160205273ffffffffffffffffffffffffffffffffffffffff83832094169384835260205260ff8383205416611dcf575b81526001602052206120c2565b50565b808252816020528282208483526020528282207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541690553384827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4611dbf565b908151811015611e45570160200190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60405190611e8182611cbe565b602a8252602082016040368237825115611e4557603090538151600190811015611e4557607860218401536029905b808211611f1e575050611ec05790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b9091600f81166010811015611fbb577f3031323334353637383961626364656600000000000000000000000000000000901a611f5a8486611e34565b5360041c918015611f8d577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190611eb0565b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b602460007f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b8054821015611e455760005260206000200190600090565b919060018301600090828252806020526040822054156000146120bc578454946801000000000000000086101561208f578361207f61204a886001604098999a01855584611fe9565b81939154907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9060031b92831b921b19161790565b9055549382526020522055600190565b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526041600452fd5b50925050565b90600182019060009281845282602052604084205490811515600014612214577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff918281018181116121e7578254908482019182116121ba57808203612185575b505050805480156121585782019161213b8383611fe9565b909182549160031b1b191690555582526020526040812055600190565b6024867f4e487b710000000000000000000000000000000000000000000000000000000081526031600452fd5b6121a561219561204a9386611fe9565b90549060031b1c92839286611fe9565b90558652846020526040862055388080612123565b6024887f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b6024877f4e487b710000000000000000000000000000000000000000000000000000000081526011600452fd5b5050505090565b73ffffffffffffffffffffffffffffffffffffffff1690604051604081019080821067ffffffffffffffff831117611c8f5761229b916040526020938482527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564858301526000808587829751910182855af161229561235e565b916123bc565b80519182159184831561233a575b5050509050156122b65750565b608490604051907f08c379a00000000000000000000000000000000000000000000000000000000082526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152fd5b9193818094500103126103865782015190811515820361034b5750803880846122a9565b3d156123b7573d9067ffffffffffffffff8211611c8f57604051916123ab60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160184611cf6565b82523d6000602084013e565b606090565b9192901561243757508151156123d0575090565b3b156123d95790565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b82519091501561244a5750805190602001fd5b61073e906040519182917f08c379a000000000000000000000000000000000000000000000000000000000835260048301611d3756fea26469706673582212209f37eab5b9ee7f4712182c88f56ac6041c6dd2dc3e533abce5b326ab2343314564736f6c63430008130033', + FACTORY_DEFAULT_ABI, + '60806040523461002f576100196100146100fa565b610169565b610021610034565b6125d461039782396125d490f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118616f378038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b613b2a810181811060018060401b038211176101c5576101a18291613b2a61296b843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa261649585396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b610403565b61001e60003561008d565b80631a4b671d146100885780631bce45831461008357806359659e901461007e57806369b3934d14610079578063715018a6146100745780638da5cb5b1461006f5763f2fde38b0361000e576103d0565b61039b565b610368565b61032c565b6102f7565b610215565b6101b4565b60e01c90565b60405190565b600080fd5b600080fd5b90565b6100af816100a3565b036100b657565b600080fd5b905035906100c8826100a6565b565b60018060a01b031690565b6100de906100ca565b90565b6100ea816100d5565b036100f157565b600080fd5b90503590610103826100e1565b565b90565b61011181610105565b0361011857565b600080fd5b9050359061012a82610108565b565b909160c08284031261018c5761014583600084016100bb565b9261015381602085016100f6565b9261016182604083016100f6565b9261018961017284606085016100f6565b9361018081608086016100f6565b9360a00161011d565b90565b61009e565b61019a906100d5565b9052565b91906101b290600060208501940190610191565b565b346101eb576101e76101d66101ca36600461012c565b9493909392919261052f565b6101de610093565b9182918261019e565b0390f35b610099565b9060208282031261020a57610207916000016100f6565b90565b61009e565b60000190565b346102435761022d6102283660046101f0565b61068c565b610235610093565b8061023f8161020f565b0390f35b610099565b600091031261025357565b61009e565b1c90565b60018060a01b031690565b61027790600861027c9302610258565b61025c565b90565b9061028a9154610267565b90565b61029a600160009061027f565b90565b90565b6102b46102af6102b9926100ca565b61029d565b6100ca565b90565b6102c5906102a0565b90565b6102d1906102bc565b90565b6102dd906102c8565b9052565b91906102f5906000602085019401906102d4565b565b3461032757610307366004610248565b61032361031261028d565b61031a610093565b918291826102e1565b0390f35b610099565b346103635761035f61034e61034236600461012c565b949390939291926106fa565b610356610093565b9182918261019e565b0390f35b610099565b3461039657610378366004610248565b61038061087f565b610388610093565b806103928161020f565b0390f35b610099565b346103cb576103ab366004610248565b6103c76103b66108b5565b6103be610093565b9182918261019e565b0390f35b610099565b346103fe576103e86103e33660046101f0565b6109c2565b6103f0610093565b806103fa8161020f565b0390f35b610099565b600080fd5b600090565b610416906100a3565b9052565b61042390610105565b9052565b909594926104739461046261046c9261045860809661044e60a088019c600089019061040d565b6020870190610191565b6040850190610191565b6060830190610191565b019061041a565b565b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061049f90610475565b810190811067ffffffffffffffff8211176104b957604052565b61047f565b60200190565b5190565b906104db6104d4610093565b9283610495565b565b67ffffffffffffffff81116104fb576104f7602091610475565b0190565b61047f565b9061051261050d836104dd565b6104c8565b918252565b6105216000610500565b90565b61052c610517565b90565b61056e9291946105909661055f92610545610408565b509395919091610553610093565b96879560208701610427565b60208201810382520382610495565b61058061057a826104c4565b916104be565b209061058a610524565b91610aa1565b90565b6105a49061059f610bba565b6105f9565b565b60001c90565b6105b86105bd916105a6565b61025c565b90565b6105ca90546105ac565b90565b600080fd5b60e01b90565b60009103126105e357565b61009e565b6105f0610093565b3d6000823e3d90fd5b61060b61060660016105c0565b6102c8565b90633659cfe690823b1561068757610643926106386000809461062c610093565b968795869485936105d2565b83526004830161019e565b03925af1801561068257610655575b50565b6106759060003d811161067b575b61066d8183610495565b8101906105d8565b38610652565b503d610663565b6105e8565b6105cd565b61069590610593565b565b6106a0906102a0565b90565b6106ac90610697565b90565b6106b8906102bc565b90565b6106f16106f8946106e76060949897956106dd608086019a6000870190610191565b6020850190610191565b6040830190610191565b019061041a565b565b9061075c9193929361070a610408565b5061073a859161072b86898b9161071f610093565b96879560208701610427565b60208201810382520382610495565b61074c610746826104c4565b916104be565b2090610756610524565b91610cad565b9361076e610769866106a3565b6106af565b906363acc14d93929490823b15610829576000946107aa869261079f94610793610093565b998a98899788966105d2565b8652600486016106bb565b03925af18015610824576107f7575b50806107f17fe3fc4d8c7984f762222579e0c4564a72a74f96cde3f6bae2751d01108c6ec240916107e8610093565b9182918261019e565b0390a190565b6108179060003d811161081d575b61080f8183610495565b8101906105d8565b386107b9565b503d610805565b6105e8565b6105cd565b610836610bba565b61083e61086b565b565b90565b61085761085261085c92610840565b61029d565b6100ca565b90565b61086890610843565b90565b61087d610878600061085f565b610e3c565b565b61088761082e565b565b60018060a01b031690565b6108a06108a5916105a6565b610889565b90565b6108b29054610894565b90565b6108bd610408565b506108c860006108a8565b90565b6108dc906108d7610bba565b610991565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b61094260266040926108de565b61094b816108e7565b0190565b6109659060208101906000818303910152610935565b90565b1561096f57565b610977610093565b62461bcd60e51b81528061098d6004820161094f565b0390fd5b6109c0906109bb816109b46109ae6109a9600061085f565b6100d5565b916100d5565b1415610968565b610e3c565b565b6109cb906108cb565b565b90565b6109dc6109e191610105565b6109cd565b9052565b60601b90565b6109f4906109e5565b90565b610a00906109eb565b90565b610a0f610a14916100d5565b6109f7565b9052565b905090565b60005b838110610a31575050906000910152565b806020918301518185015201610a20565b610a67610a5e92602092610a55816104c4565b94858093610a18565b93849101610a1d565b0190565b60148093610a8f602084610a87610a9796610a9e9b9a986109d0565b018092610a03565b018092610a03565b0190610a42565b90565b610b349291610ade610aed92610ab5610408565b509193610aca610ac560016105c0565b6102c8565b610ad2610093565b95869460208601610a6b565b60208201810382520382610495565b610aff610af9826104c4565b916104be565b2061148a610b0f602082016104c8565b908082526111156020830139610b2d610b27826104c4565b916104be565b2090610ea9565b90565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610b6b602080926108de565b610b7481610b37565b0190565b610b8e9060208101906000818303910152610b5f565b90565b15610b9857565b610ba0610093565b62461bcd60e51b815280610bb660048201610b78565b0390fd5b610be4610bc56108b5565b610bde610bd8610bd3610eca565b6100d5565b916100d5565b14610b91565b565b610bfa610bf5610bff92610840565b61029d565b6100a3565b90565b610c0b906102a0565b90565b610c1790610c02565b90565b610c23906102a0565b90565b610c2f90610c1a565b90565b610c3b906102bc565b90565b60209181520190565b610c66610c6f602093610c7493610c5d816104c4565b93848093610c3e565b95869101610a1d565b610475565b0190565b610c9d610caa949293610c9360608401956000850190610191565b6020830190610191565b6040818403910152610c47565b90565b610d3d9093929193610cbd610408565b50610cfd8591610cee610cd8610cd360016105c0565b6102c8565b8690610ce2610093565b95869460208601610a6b565b60208201810382520382610495565b610d0f610d09826104c4565b916104be565b2061148a610d1f602082016104c8565b908082526111156020830139610d386000929192610be6565b611062565b92610d57610d52610d4d86610c0e565b610c26565b610c32565b63cf7a1d779190610d70610d6b60016105c0565b6102c8565b9392813b15610de7576000610d9891610da38296610d8c610093565b988997889687956105d2565b855260048501610c78565b03925af18015610de257610db5575b50565b610dd59060003d8111610ddb575b610dcd8183610495565b8101906105d8565b38610db2565b503d610dc3565b6105e8565b6105cd565b60001b90565b90610e0360018060a01b0391610dec565b9181191691161790565b610e16906102bc565b90565b90565b90610e31610e2c610e3892610e0d565b610e19565b8254610df2565b9055565b610e4660006108a8565b610e51826000610e1c565b90610e85610e7f7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610e0d565b91610e0d565b91610e8e610093565b80610e988161020f565b0390a3565b610ea6906102bc565b90565b90610ec791610eb6610408565b5090610ec130610e9d565b916110eb565b90565b610ed2610408565b503390565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b610f0c601d6020926108de565b610f1581610ed7565b0190565b610f2f9060208101906000818303910152610eff565b90565b15610f3957565b610f41610093565b62461bcd60e51b815280610f5760048201610f19565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b610f8f602080926108de565b610f9881610f5b565b0190565b610fb29060208101906000818303910152610f83565b90565b15610fbc57565b610fc4610093565b62461bcd60e51b815280610fda60048201610f9c565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61101360196020926108de565b61101c81610fde565b0190565b6110369060208101906000818303910152611006565b90565b1561104057565b611048610093565b62461bcd60e51b81528061105e60048201611020565b0390fd5b91909161106d610408565b5061109461107a30610e9d565b3161108d611087846100a3565b916100a3565b1015610f32565b6110ba6110a0836104c4565b6110b36110ad6000610be6565b916100a3565b1415610fb5565b60208251920190f5906110e9826110e26110dc6110d7600061085f565b6100d5565b916100d5565b1415611039565b565b90605592600b926110fa610408565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a26469706673582212206bc6c1471f4cc9c60143b475e599cedd261b753a87093c41a9601e41752618c964736f6c634300081b0033608060405234601c57600e6020565b613afe61002c8239613afe90f35b6026565b60405190565b600080fdfe60806040526004361015610013575b610ba7565b61001e60003561015d565b806301ffc9a7146101585780630668d0bb146101535780630bb310de1461014e578063248a9ca3146101495780632f2ff15d146101445780633474a4a61461013f57806336568abe1461013a57806344004cc1146101355780634782f7791461013057806363acc14d1461012b5780638c17030f146101265780639010d07c1461012157806391d148541461011c5780639d043a6614610117578063a217fddf14610112578063a971e8421461010d578063bad4366114610108578063ca15c87314610103578063d547741f146100fe5763ed4c2ac70361000e57610b74565b610b40565b610b0b565b610aaf565b610a17565b6109e2565b61096f565b6108a4565b61086e565b6107e3565b610723565b6106a8565b610646565b6105d7565b6105a2565b610499565b610436565b61039a565b61034b565b6101ef565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b61018d81610178565b0361019457565b600080fd5b905035906101a682610184565b565b906020828203126101c2576101bf91600001610199565b90565b61016e565b151590565b6101d5906101c7565b9052565b91906101ed906000602085019401906101cc565b565b3461021f5761021b61020a6102053660046101a8565b610bb1565b610212610163565b918291826101d9565b0390f35b610169565b60018060a01b031690565b61023890610224565b90565b6102448161022f565b0361024b57565b600080fd5b9050359061025d8261023b565b565b90565b61026b8161025f565b0361027257565b600080fd5b9050359061028482610262565b565b600080fd5b600080fd5b600080fd5b909182601f830112156102cf5781359167ffffffffffffffff83116102ca5760200192602083028401116102c557565b610290565b61028b565b610286565b91909160a081840312610340576102ee8360008301610250565b926102fc8160208401610277565b9261030a8260408501610250565b926103188360608301610277565b92608082013567ffffffffffffffff811161033b576103379201610295565b9091565b610173565b61016e565b60000190565b6103656103593660046102d4565b94939093929192610d21565b61036d610163565b8061037781610345565b0390f35b906020828203126103955761039291600001610250565b90565b61016e565b346103c8576103b26103ad36600461037b565b610f69565b6103ba610163565b806103c481610345565b0390f35b610169565b90565b6103d9816103cd565b036103e057565b600080fd5b905035906103f2826103d0565b565b9060208282031261040e5761040b916000016103e5565b90565b61016e565b61041c906103cd565b9052565b919061043490600060208501940190610413565b565b346104665761046261045161044c3660046103f4565b610fc7565b610459610163565b91829182610420565b0390f35b610169565b9190604083820312610494578061048861049192600086016103e5565b93602001610250565b90565b61016e565b346104c8576104b26104ac36600461046b565b90611012565b6104ba610163565b806104c481610345565b0390f35b610169565b60009103126104d857565b61016e565b6104e69061025f565b9052565b6104f39061022f565b9052565b67ffffffffffffffff1690565b61050d906104f7565b9052565b61051a906103cd565b9052565b9060a08061058a93610538600082015160008601906104dd565b61054a602082015160208601906104dd565b61055c604082015160408601906104ea565b61056e60608201516060860190610504565b61058060808201516080860190610504565b0151910190610511565b565b91906105a090600060c0850194019061051e565b565b346105d2576105b23660046104cd565b6105ce6105bd61122e565b6105c5610163565b9182918261058c565b0390f35b610169565b34610606576105f06105ea36600461046b565b906112f7565b6105f8610163565b8061060281610345565b0390f35b610169565b90916060828403126106415761063e6106278460008501610250565b936106358160208601610250565b93604001610277565b90565b61016e565b346106755761065f61065936600461060b565b91611396565b610667610163565b8061067181610345565b0390f35b610169565b91906040838203126106a357806106976106a09260008601610250565b93602001610277565b90565b61016e565b346106d7576106c16106bb36600461067a565b9061149c565b6106c9610163565b806106d381610345565b0390f35b610169565b60808183031261071e576106f38260008301610250565b9261071b6107048460208501610250565b936107128160408601610250565b936060016103e5565b90565b61016e565b346107555761073f6107363660046106dc565b9291909161158a565b610747610163565b8061075181610345565b0390f35b610169565b610763816104f7565b0361076a57565b600080fd5b9050359061077c8261075a565b565b909160c0828403126107de576107978360008401610277565b926107a58160208501610277565b926107b38260408301610250565b926107db6107c4846060850161076f565b936107d2816080860161076f565b9360a0016103e5565b90565b61016e565b34610818576108026107f636600461077e565b94939093929192611a34565b61080a610163565b8061081481610345565b0390f35b610169565b9190604083820312610846578061083a61084392600086016103e5565b93602001610277565b90565b61016e565b6108549061022f565b9052565b919061086c9060006020850194019061084b565b565b3461089f5761089b61088a61088436600461081d565b90611a64565b610892610163565b91829182610858565b0390f35b610169565b346108d5576108d16108c06108ba36600461046b565b90611aa4565b6108c8610163565b918291826101d9565b0390f35b610169565b600080fd5b908160c09103126108ed5790565b6108da565b908160e09103126109005790565b6108da565b9160608383031261096a5761091d8260008501610250565b92602081013567ffffffffffffffff8111610965578361093e9183016108df565b92604082013567ffffffffffffffff81116109605761095d92016108f2565b90565b610173565b610173565b61016e565b346109a05761099c61098b610985366004610905565b91611dc7565b610993610163565b91829182610420565b0390f35b610169565b90565b60001b90565b6109c26109bd6109c7926109a5565b6109a8565b6103cd565b90565b6109d460006109ae565b90565b6109df6109ca565b90565b34610a12576109f23660046104cd565b610a0e6109fd6109d7565b610a05610163565b91829182610420565b0390f35b610169565b34610a4757610a273660046104cd565b610a43610a32611e68565b610a3a610163565b91829182610858565b0390f35b610169565b91608083830312610aaa57610a6482600085016103e5565b9260208101359167ffffffffffffffff8311610aa557610a8984610aa2948401610295565b939094610a998160408601610250565b936060016103e5565b90565b610173565b61016e565b34610ae357610adf610ace610ac5366004610a4c565b93929092611fa4565b610ad6610163565b918291826101d9565b0390f35b610169565b610af19061025f565b9052565b9190610b0990600060208501940190610ae8565b565b34610b3b57610b37610b26610b213660046103f4565b61204c565b610b2e610163565b91829182610af5565b0390f35b610169565b34610b6f57610b59610b5336600461046b565b9061209c565b610b61610163565b80610b6b81610345565b0390f35b610169565b34610ba257610b8c610b873660046103f4565b6120d0565b610b94610163565b80610b9e81610345565b0390f35b610169565b600080fd5b600090565b610bb9610bac565b5080610bd4610bce635f05bb8960e11b610178565b91610178565b148015610bf8575b908115610be8575b5090565b610bf29150612115565b38610be4565b50610c02816120db565b610bdc565b60081c90565b60018060a01b031690565b610c24610c2991610c07565b610c0d565b90565b610c369054610c18565b90565b90565b610c50610c4b610c5592610224565b610c39565b610224565b90565b610c6190610c3c565b90565b610c6d90610c58565b90565b610c7990610c3c565b90565b610c8590610c70565b90565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b90610cb790610c8d565b810190811067ffffffffffffffff821117610cd157604052565b610c97565b60e01b90565b6000910312610ce757565b61016e565b916020610d0e929493610d076040820196600083019061084b565b0190610ae8565b565b610d18610163565b3d6000823e3d90fd5b93610d34939591958693909192936122b6565b610d4e610d49610d446005610c2c565b610c64565b610c7c565b632e73e0fd828492803b15610eae57610d7b60008094610d86610d6f610163565b97889687958694610cd6565b845260048401610cec565b03925af19081610e81575b5015600014610e7c576001610dde575b5b907ff32d98590495ee51bacb93809409a188e7ab8268b70b4c969d9da3a883c539f791610dd9610dd0610163565b92839283610cec565b0390a1565b610df8610df3610dee6005610c2c565b610c64565b610c7c565b6340c10f19828492803b15610e7757610e2560008094610e30610e19610163565b97889687958694610cd6565b845260048401610cec565b03925af18015610e7257610e45575b50610da1565b610e659060003d8111610e6b575b610e5d8183610cad565b810190610cdc565b38610e3f565b503d610e53565b610d10565b610c88565b610da2565b610ea19060003d8111610ea7575b610e998183610cad565b810190610cdc565b38610d91565b503d610e8f565b610c88565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b610ef090610eeb610ee6610eb3565b61251a565b610f54565b565b610efb90610c3c565b90565b610f0790610ef2565b90565b90610f1b60018060a01b03916109a8565b9181191691161790565b610f2e90610ef2565b90565b90565b90610f49610f44610f5092610f25565b610f31565b8254610f0a565b9055565b610f60610f6791610efe565b6003610f34565b565b610f7290610ed7565b565b600090565b610f82906103cd565b90565b90610f8f90610f79565b600052602052604060002090565b60001c90565b90565b610fb2610fb791610f9d565b610fa3565b90565b610fc49054610fa6565b90565b6001610fe0610fe692610fd8610f74565b506000610f85565b01610fba565b90565b9061100491610fff610ffa82610fc7565b61251a565b611006565b565b906110109161252e565b565b9061101c91610fe9565b565b9061103161102a610163565b9283610cad565b565b61103d60c061101e565b90565b600090565b600090565b600090565b600090565b61105c611033565b90602080808080808761106d611040565b815201611078611040565b815201611083611045565b81520161108e61104a565b81520161109961104a565b8152016110a461104f565b81525050565b6110b2611054565b90565b90565b6110c46110c991610f9d565b6110b5565b90565b6110d690546110b8565b90565b906110e39061025f565b9052565b6110f36110f891610f9d565b610c0d565b90565b61110590546110e7565b90565b906111129061022f565b9052565b60a01c90565b67ffffffffffffffff1690565b61113561113a91611116565b61111c565b90565b6111479054611129565b90565b90611154906104f7565b9052565b61116461116991610f9d565b61111c565b90565b6111769054611158565b90565b90611183906103cd565b9052565b906112206112176004611198611033565b946111b16111a8600083016110cc565b600088016110d9565b6111c96111c0600183016110cc565b602088016110d9565b6111e16111d8600283016110fb565b60408801611108565b6111f96111f06002830161113d565b6060880161114a565b6112116112086003830161116c565b6080880161114a565b01610fba565b60a08401611179565b565b61122b90611187565b90565b6112366110aa565b506112416006611222565b90565b60209181520190565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b6112a8602f604092611244565b6112b18161124d565b0190565b6112cb906020810190600081830391015261129b565b90565b156112d557565b6112dd610163565b62461bcd60e51b8152806112f3600482016112b5565b0390fd5b906113249161131f8261131961131361130e612558565b61022f565b9161022f565b146112ce565b612565565b565b7f5d8e12c39142ff96d79d04d15d1ba1269e4fe57bb9d26f43523628b34ba108ec90565b90611365929161136061135b611326565b61251a565b61137f565b565b61137090610c3c565b90565b61137c90611367565b90565b9161138c61139493611373565b9190916125c0565b565b906113a1929161134a565b565b906113bd916113b86113b3611326565b61251a565b61144a565b565b905090565b6113d0600080926113bf565b0190565b6113dd906113c4565b90565b67ffffffffffffffff81116113fe576113fa602091610c8d565b0190565b610c97565b90611415611410836113e0565b61101e565b918252565b606090565b3d60001461143c576114303d611403565b903d6000602084013e5b565b61144461141a565b9061143a565b60006114799281929061145b610163565b9081611466816113d4565b03925af161147261141f565b50156101c7565b61147f57565b6000631d42c86760e21b81528061149860048201610345565b0390fd5b906114a6916113a3565b565b60ff1690565b6114ba6114bf91610f9d565b6114a8565b90565b6114cc90546114ae565b90565b60081b90565b906114e8610100600160a81b03916114cf565b9181191691161790565b6114fb90610c70565b90565b90565b9061151661151161151d926114f2565b6114fe565b82546114d5565b9055565b7f4c02318d8c3aadc98ccf18aebbf3126f651e0c3f6a1de5ff8edcf6724a2ad5c290565b9061155160ff916109a8565b9181191691161790565b611564906101c7565b90565b90565b9061157f61157a6115869261155b565b611567565b8254611545565b9055565b92909261159760056114c2565b6115f5576115a96115e7946005611501565b6115bb6115b46109ca565b829061252e565b6115cd6115c6611521565b829061252e565b6115df6115d8611326565b829061252e565b91909161260b565b6115f36001600561156a565b565b600063f92ee8a960e01b81528061160e60048201610345565b0390fd5b90611630959493929161162b611626611521565b61251a565b6118fd565b565b61164661164161164b926104f7565b610c39565b61025f565b90565b61166261165d611667926109a5565b610c39565b61025f565b90565b61167460c061101e565b90565b611681905161025f565b90565b90611691600019916109a8565b9181191691161790565b6116af6116aa6116b49261025f565b610c39565b61025f565b90565b90565b906116cf6116ca6116d69261169b565b6116b7565b8254611684565b9055565b6116e4905161022f565b90565b906116fc6116f7611703926114f2565b6114fe565b8254610f0a565b9055565b61171190516104f7565b90565b60a01b90565b9061173067ffffffffffffffff60a01b91611714565b9181191691161790565b61174e611749611753926104f7565b610c39565b6104f7565b90565b90565b9061176e6117696117759261173a565b611756565b825461171a565b9055565b9061178c67ffffffffffffffff916109a8565b9181191691161790565b906117ab6117a66117b29261173a565b611756565b8254611779565b9055565b6117c090516103cd565b90565b6117cc90610f9d565b90565b906117e46117df6117eb92610f79565b6117c3565b8254611684565b9055565b9061188060a06004611886946118146000820161180e60008801611677565b906116ba565b61182d6001820161182760208801611677565b906116ba565b61184660028201611840604088016116da565b906116e7565b61185f6002820161185960608801611707565b90611759565b6118786003820161187260808801611707565b90611796565b0192016117b6565b906117cf565b565b90611892916117ef565b565b61189d906104f7565b9052565b91946118ea6118f4929897956118e060a0966118d66118fb9a6118cc60c08a019e60008b0190610ae8565b6020890190610ae8565b604087019061084b565b6060850190611894565b6080830190611894565b0190610413565b565b91939092948161191561190f886104f7565b916104f7565b108015611a19575b6119fc578261193561192f600061164e565b9161025f565b146119df57826119a16119da9461199a876119918a6119888d61197f8b936119768c9761196d61196361166a565b9b60008d016110d9565b60208b016110d9565b60408901611108565b6060870161114a565b6080850161114a565b60a08301611179565b6006611888565b9394959190917fabec13ca1773eed55d54d2f64593c33fa520ee45cac73a162f13928a2ebee233966119d1610163565b968796876118a1565b0390a1565b60006310ba94e960e31b8152806119f860048201610345565b0390fd5b60006310ba94e960e31b815280611a1560048201610345565b0390fd5b5081611a2d611a274261025f565b91611632565b111561191d565b90611a429594939291611612565b565b600090565b90611a5390610f79565b600052602052604060002090565b90565b90611a84611a7f611a8993611a77611a44565b506001611a49565b611a61565b61265b565b90565b90611a96906114f2565b600052602052604060002090565b611acb916000611ac0611ac693611ab9610bac565b5082610f85565b01611a8c565b6114c2565b90565b60018060a01b031690565b611ae5611aea91610f9d565b611ace565b90565b611af79054611ad9565b90565b611b0390610c70565b90565b90505190611b13826103d0565b565b90602082820312611b2f57611b2c91600001611b06565b90565b61016e565b50611b43906020810190610250565b90565b50611b55906020810190610199565b90565b611b6190610178565b9052565b50611b749060208101906103e5565b90565b600080fd5b600080fd5b600080fd5b9035600160200382360303811215611bc757016020813591019167ffffffffffffffff8211611bc2576001820236038313611bbd57565b611b7c565b611b77565b611b81565b60209181520190565b90826000939282370152565b9190611bfb81611bf481611c0095611bcc565b8095611bd5565b610c8d565b0190565b9035600160400382360303811215611c1a570190565b611b81565b9035600160200382360303811215611c6057016020813591019167ffffffffffffffff8211611c5b576001820236038313611c5657565b611b7c565b611b77565b611b81565b60209181520190565b9190611c8881611c8181611c8d95611c65565b8095611bd5565b610c8d565b0190565b50611ca090602081019061076f565b90565b90611ce1906020611cd9611ccf60408401611cc16000880188611c1f565b908683036000880152611c6e565b9482810190611c91565b910190610504565b90565b611d8e91611d80611d7560c08301611d0c611d026000870187611b34565b60008601906104ea565b611d26611d1c6020870187611b46565b6020860190611b58565b611d40611d366040870187611b65565b6040860190610511565b611d5a611d506060870187611b65565b6060860190610511565b611d676080860186611b86565b908583036080870152611be1565b9260a0810190611c04565b9060a0818403910152611ca3565b90565b939290611dbd604091611dc594611db0606089019260008a019061084b565b8782036020890152611ce4565b940190610413565b565b9150602090611dd4610f74565b50611de7611de26003611aed565b611afa565b611e13633808a90b949294611e1e611dff6004610fba565b611e07610163565b97889687958695610cd6565b855260048501611d91565b03915afa908115611e6357600091611e35575b5090565b611e56915060203d8111611e5c575b611e4e8183610cad565b810190611b15565b38611e31565b503d611e44565b610d10565b611e70611a44565b50611e7b6005610c2c565b90565b90611e88906114f2565b600052602052604060002090565b90611ea090610f79565b600052602052604060002090565b60601b90565b611ebd90611eae565b90565b611ec990611eb4565b90565b611ed8611edd9161022f565b611ec0565b9052565b90565b611ef0611ef5916103cd565b611ee1565b9052565b601481611f0c611f149360209695611ecc565b018092611ee4565b0190565b60200190565b5190565b67ffffffffffffffff8111611f3a5760208091020190565b610c97565b90929192611f54611f4f82611f22565b61101e565b9381855260208086019202830192818411611f9157915b838310611f785750505050565b60208091611f8684866103e5565b815201920191611f6b565b610290565b611fa1913691611f3f565b90565b9093929192611fb1610bac565b50611fd9611fd3611fce611fc760028790611e7e565b8590611e96565b6114c2565b156101c7565b9485611fe8575b505050505090565b61203d95509061201f6120389392959294612010612004610163565b93849260208401611ef9565b60208201810382520382610cad565b61203161202b82611f1e565b91611f18565b2093611f96565b612694565b3880808080611fe0565b600090565b61206b6120666120709261205e612047565b506001611a49565b611a61565b6126be565b90565b9061208e9161208961208482610fc7565b61251a565b612090565b565b9061209a91612565565b565b906120a691612073565b565b6120c1906120bc6120b7610eb3565b61251a565b6120c3565b565b6120ce9060046117cf565b565b6120d9906120a8565b565b6120e3610bac565b50806120f86120f26000610178565b91610178565b14908115612105575b5090565b61210f91506126de565b38612101565b61211d610bac565b50612127816126de565b908115612133575b5090565b61213d915061271e565b3861212f565b91602061216592949361215e60408201966000830190610ae8565b0190610ae8565b565b634e487b7160e01b600052601160045260246000fd5b61218c6121929193929361025f565b9261025f565b820391821161219d57565b612167565b600090565b6121b66121bc9193929361025f565b9261025f565b916121c883820261025f565b9281840414901517156121d757565b612167565b6121e59061164e565b9052565b60409061221361221a94969593966122096060840198600085019061084b565b6020830190610ae8565b01906121dc565b565b60409061224661224d949695939661223c6060840198600085019061084b565b6020830190610ae8565b0190610ae8565b565b61226361225e612268926109a5565b610c39565b610224565b90565b6122749061224f565b90565b61228090610c70565b90565b6040906122ad6122b494969593966122a36060840198600085019061084b565b60208301906121dc565b0190610ae8565b565b91939290926122f06122cb600260060161113d565b6122ea6122e46122de600360060161116c565b92611632565b91611632565b9061275e565b6124fd5761230160006006016110cc565b61231361230d8561025f565b9161025f565b106124d0578291612361916123426123739561233c600060060191612337836110cc565b61217d565b906116ba565b61234f6004600601610fba565b9190339161235b6121a2565b93612855565b61236e60016006016110cc565b6121a7565b918161239361238d61238860026006016110fb565b61022f565b9161022f565b036124a257806123ab6123a58561025f565b9161025f565b1061247f5750806123cd6123c76123c2600061226b565b61022f565b9161022f565b1460001461241257346123e86123e28461025f565b9161025f565b036123f25750505b565b61240e346000938493630f55e7df60e11b85526004850161221c565b0390fd5b9034612427612421600061164e565b9161025f565b1160001461245c57612439600061226b565b600090612458346000938493630f55e7df60e11b855260048501612283565b0390fd5b61246861247a92611373565b903361247330612277565b9192612928565b6123f0565b8261249e8391926000938493630f55e7df60e11b85526004850161221c565b0390fd5b826124b060026006016110fb565b6124cc600080938493630f55e7df60e11b8552600485016121e9565b0390fd5b826124de60006006016110cc565b6124f96000928392639e4c446160e01b845260048401612143565b0390fd5b6000630fe219dd60e21b81528061251660048201610345565b0390fd5b61252c90612526612558565b90612ae4565b565b9061255061254b61255593612544818590612b7d565b6001611a49565b611a61565b612c63565b50565b612560611a44565b503390565b9061258761258261258c9361257b818590612c9e565b6001611a49565b611a61565b612d37565b50565b61259890610c70565b90565b63ffffffff1690565b6125b86125b36125bd9261259b565b610cd6565b610178565b90565b916126046004926125f561260995936125dc63a9059cbb6125a4565b926125e5610163565b9687946020860190815201610cec565b60208201810382520383610cad565b612ee5565b565b90612621612626939261261c610eb3565b61252e565b612f52565b565b90565b61263761263c91610f9d565b61169b565b90565b61265361264e6126589261025f565b610c39565b610224565b90565b6126876126826126919361267d600061268c95612676611a44565b5001612628565b612fea565b61262b565b61263f565b610c70565b90565b6126ae6126ba92936126b4926126a8610bac565b5061303f565b926103cd565b916103cd565b1490565b6126d660006126db926126cf612047565b5001612628565b6130aa565b90565b6126e6610bac565b50806127016126fb635a05180f60e01b610178565b91610178565b1490811561270e575b5090565b61271891506130c2565b3861270a565b612726610bac565b508061274161273b634e821d3360e11b610178565b91610178565b1490811561274e575b5090565b61275891506120db565b3861274a565b612766610bac565b508161277b612775600061164e565b9161025f565b149081156127ae575b50908115612791575b5090565b90506127a66127a0429261025f565b9161025f565b10153861278d565b90506127c36127bd429261025f565b9161025f565b1038612784565b60209181520190565b600080fd5b9037565b9091826127e8916127ca565b9160018060fb1b03811161280b578291602061280792029384916127d8565b0190565b6127d3565b9061284161284c916128539698979560609561283460808701936000880190610413565b85830360208701526127dc565b96604083019061084b565b0190610413565b565b92938361287361286d61286860006109ae565b6103cd565b916103cd565b03612880575b5050505050565b61289861289285848689918693611fa4565b156101c7565b6128c857505050906128b96128be926128b46001936002611e7e565b611e96565b61156a565b3880808080612879565b846128f1918593949190916128db610163565b9586956304cb8cd560e31b875260048701612810565b0390fd5b60409061291f61292694969593966129156060840198600085019061084b565b602083019061084b565b0190610ae8565b565b612975939161296160049461297093946129456323b872dd6125a4565b93919091612951610163565b97889560208701908152016128f5565b60208201810382520383610cad565b612ee5565b565b90565b61298e61298961299392612977565b610c39565b61025f565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b6129cf60178092612996565b6129d88161299b565b0190565b5190565b60005b8381106129f4575050906000910152565b8060209183015181850152016129e3565b612a2a612a2192602092612a18816129dc565b94858093612996565b938491016129e0565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b612a6260118092612996565b612a6b81612a2e565b0190565b612a89612a949392612a83612a8e936129c3565b90612a05565b612a56565b90612a05565b90565b90565b612ab9612ac2602093612ac793612ab0816129dc565b93848093611244565b958691016129e0565b610c8d565b0190565b612ae19160208201916000818403910152612a9a565b90565b90612af9612af3838390611aa4565b156101c7565b612b01575050565b612b7991612b57612b30612b20612b1a612b5c95613155565b9361262b565b612b2a602061297a565b90613378565b91612b48612b3c610163565b93849260208401612a6f565b60208201810382520382610cad565b612a97565b612b64610163565b91829162461bcd60e51b835260048301612acb565b0390fd5b612b91612b8b828490611aa4565b156101c7565b612b9a575b5050565b612bbc6001612bb76000612baf818690610f85565b018590611a8c565b61156a565b90612bc5612558565b90612c02612bfc612bf67f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d95610f79565b926114f2565b926114f2565b92612c0b610163565b80612c1581610345565b0390a43880612b96565b612c2890610c3c565b90565b612c3f612c3a612c4492610224565b610c39565b61025f565b90565b612c5b612c56612c609261025f565b6109a8565b6103cd565b90565b90612c96612c90612c8b612c866000612c9b96612c7e610bac565b500194612c1f565b612c2b565b612c47565b91612628565b613598565b90565b612ca9818390611aa4565b612cb2575b5050565b612cd46000612ccf6000612cc7818690610f85565b018590611a8c565b61156a565b90612cdd612558565b90612d1a612d14612d0e7ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b95610f79565b926114f2565b926114f2565b92612d23610163565b80612d2d81610345565b0390a43880612cae565b90612d6a612d64612d5f612d5a6000612d6f96612d52610bac565b500194612c1f565b612c2b565b612c47565b91612628565b61368e565b90565b67ffffffffffffffff8111612d9057612d8c602091610c8d565b0190565b610c97565b90612da7612da283612d72565b61101e565b918252565b60007f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564910152565b612dde6020612d95565b90612deb60208301612dac565b565b612df5612dd4565b90565b612e01816101c7565b03612e0857565b600080fd5b90505190612e1a82612df8565b565b90602082820312612e3657612e3391600001612e0d565b90565b61016e565b60207f6f74207375636365656400000000000000000000000000000000000000000000917f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201520152565b612e96602a604092611244565b612e9f81612e3b565b0190565b612eb99060208101906000818303910152612e89565b90565b15612ec357565b612ecb610163565b62461bcd60e51b815280612ee160048201612ea3565b0390fd5b612f2f91612ef5612f049261258f565b90612efe612ded565b91613798565b612f0d81611f1e565b612f20612f1a600061164e565b9161025f565b14908115612f31575b50612ebc565b565b612f4c91506020612f4182611f1e565b818301019101612e1c565b38612f29565b90612f69612f62612f7093610efe565b6003610f34565b60046117cf565b565b634e487b7160e01b600052603260045260246000fd5b5490565b600052602060002090565b612fa081612f88565b821015612fbb57612fb2600191612f8c565b91020190600090565b612f72565b1c90565b612fd4906008612fd99302612fc0565b610fa3565b90565b90612fe79154612fc4565b90565b61300991600061300392612ffc610f74565b5001612f97565b90612fdc565b90565b6001613018910161025f565b90565b5190565b906130298261301b565b81101561303a576020809102010190565b612f72565b9190613049610f74565b50613054600061164e565b905b8161307161306b6130668761301b565b61025f565b9161025f565b10156130a35761309761309d9161309161308c87869061301f565b6117b6565b906137bb565b9161300c565b90613056565b9192505090565b60006130bf916130b8612047565b5001612f88565b90565b6130ca610bac565b50806130e56130df637965db0b60e01b610178565b91610178565b149081156130f2575b5090565b6130fc91506137fb565b386130ee565b606090565b90565b60ff1690565b61312461311f61312992613107565b610c39565b61310a565b90565b6131366014613110565b90565b61314d6131486131529261310a565b610c39565b61025f565b90565b61317261316d61318892613167613102565b50612c1f565b612c2b565b61318261317d61312c565b613139565b90613378565b90565b90565b6131a261319d6131a79261318b565b610c39565b61025f565b90565b6131b96131bf9193929361025f565b9261025f565b82018092116131ca57565b612167565b369037565b906131f96131e183611403565b926020806131ef86936113e0565b92019103906131cf565b565b600360fc1b90565b9061320d82611f1e565b81101561321f57600160209102010190565b612f72565b600f60fb1b90565b90565b61324361323e6132489261322c565b610c39565b61025f565b90565b6132549061025f565b60008114613263576001900390565b612167565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b613287613268565b90565b90565b6132a161329c6132a69261328a565b610c39565b61025f565b90565b60f81b90565b90565b6132c66132c16132cb926132af565b610c39565b61310a565b90565b6132ed906132e76132e16132f29461310a565b9161025f565b90612fc0565b61025f565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b61332960208092611244565b613332816132f5565b0190565b61334c906020810190600081830391015261331d565b90565b1561335657565b61335e610163565b62461bcd60e51b81528061337460048201613336565b0390fd5b9190613382613102565b5061341c61340c6133b86133b36133a3600261339e879161318e565b6121a7565b6133ad600261318e565b906131aa565b6131d4565b926133c16131fb565b6133da856133d460009360001a9361164e565b90613203565b536133e3613224565b6133fc856133f660019360001a9361322f565b90613203565b53613407600261318e565b6121a7565b613416600161322f565b906131aa565b925b8361343261342c600161322f565b9161025f565b11156134995761344061327f565b8161344b600f61328d565b16916010831015613494576134676134889261348e941a6132a9565b6134778591889060001a92613203565b5361348260046132b2565b906132ce565b9361324b565b9261341e565b612f72565b6134c19293506134bc906134b66134b0600061164e565b9161025f565b1461334f565b612a97565b90565b90565b600052602060002090565b5490565b6134df816134d2565b8210156134fa576134f16001916134c7565b91020190600090565b612f72565b1b90565b9190600861351f910291613519600019846134ff565b926134ff565b9181191691161790565b919061353f61353a61354793610f79565b6117c3565b908354613503565b9055565b908154916801000000000000000083101561357b5782613573916001613579950181556134d6565b90613529565b565b610c97565b9061358a90610f79565b600052602052604060002090565b6135a0610bac565b506135b56135af828490613821565b156101c7565b6000146135f8576135ee6135f3926135d96135d2600085016134c4565b829061354b565b60016135e760008501612f88565b9301613580565b6116ba565b600190565b5050600090565b634e487b7160e01b600052603160045260246000fd5b61362791613621610f74565b91613529565b565b613632816134d2565b801561365357600190039061365061364a83836134d6565b90613615565b55565b6135ff565b919061366e6136696136769361169b565b6116b7565b908354613503565b9055565b61368c91613686612047565b91613658565b565b613696610bac565b506136ad6136a8600183018490613580565b6110cc565b90816136c26136bc600061164e565b9161025f565b14156000146137905761374292600161373d92846136eb6000966136e58561322f565b9061217d565b6137086136f9888501612f88565b6137028661322f565b9061217d565b8061371b6137158461025f565b9161025f565b03613747575b5050506137376137328683016134c4565b613629565b01613580565b61367a565b600190565b6137889261377a613766613760613783948c8901612f97565b90612fdc565b9361377485918c8901612f97565b90613529565b91858501613580565b6116ba565b388080613721565b505050600090565b906137b892916137a661141a565b50906137b2600061164e565b9161390d565b90565b6137c3610f74565b50806137d76137d1846103cd565b916103cd565b106000146137ed57906137e991613967565b5b90565b6137f691613967565b6137ea565b613803610bac565b5061381d6138176301ffc9a760e01b610178565b91610178565b1490565b61383f91600161383a92613833610bac565b5001613580565b6110cc565b61385261384c600061164e565b9161025f565b141590565b61386090610c70565b90565b60207f722063616c6c0000000000000000000000000000000000000000000000000000917f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201520152565b6138be6026604092611244565b6138c781613863565b0190565b6138e190602081019060008183039101526138b1565b90565b156138eb57565b6138f3610163565b62461bcd60e51b815280613909600482016138cb565b0390fd5b9160008091613964959361391f61141a565b5061394661392c30613857565b3161393f6139398561025f565b9161025f565b10156138e4565b8591602082019151925af19161395a61141f565b9092909192613a02565b90565b61396f610f74565b50600052602052604060002090565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6139b3601d602092611244565b6139bc8161397e565b0190565b6139d690602081019060008183039101526139a6565b90565b156139e057565b6139e8610163565b62461bcd60e51b8152806139fe600482016139c0565b0390fd5b919290613a0d61141a565b50600014613a535750613a1f82611f1e565b613a32613a2c600061164e565b9161025f565b14613a3c575b5090565b613a48613a4d91613aa7565b6139d9565b38613a38565b8290613a5e82611f1e565b613a71613a6b600061164e565b9161025f565b11600014613a825750805190602001fd5b613aa390613a8e610163565b91829162461bcd60e51b835260048301612acb565b0390fd5b613aaf610bac565b503b613ac4613abe600061164e565b9161025f565b119056fea2646970667358221220c204633b23276edd95aa322dbea2171da8b640438f81199e08fb87ec1d64aa7f64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -178,80 +16,80 @@ export class ERC721SaleFactory extends ContractFactory { export const ERC721SALEFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol:ERC721SaleFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC721/utility/sale/ERC721SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\nimport { ERC721Sale } from "@0xsequence/contracts-library/tokens/ERC721/utility/sale/ERC721Sale.sol";\nimport {\n IERC721SaleFactory,\n IERC721SaleFactoryFunctions\n} from "@0xsequence/contracts-library/tokens/ERC721/utility/sale/IERC721SaleFactory.sol";\n\n/**\n * Deployer of ERC-721 Sale proxies.\n */\ncontract ERC721SaleFactory is IERC721SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-721 Sale Factory.\n * @param factoryOwner The owner of the ERC-721 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC721Sale impl = new ERC721Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\n function deploy(address proxyOwner, address tokenOwner, address items) external returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(tokenOwner, items));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC721Sale(proxyAddr).initialize(tokenOwner, items);\n emit ERC721SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(tokenOwner, items));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC721Sale } from "./ERC721Sale.sol";\nimport { IERC721SaleFactory, IERC721SaleFactoryFunctions } from "./IERC721SaleFactory.sol";\n\n/**\n * Deployer of ERC-721 Sale proxies.\n */\ncontract ERC721SaleFactory is IERC721SaleFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-721 Sale Factory.\n * @param factoryOwner The owner of the ERC-721 Sale Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC721Sale impl = new ERC721Sale();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\n function deploy(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(nonce, tokenOwner, items, implicitModeValidator, implicitModeProjectId));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC721Sale(proxyAddr).initialize(tokenOwner, items, implicitModeValidator, implicitModeProjectId);\n emit ERC721SaleDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721SaleFactoryFunctions\n function determineAddress(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external view returns (address proxyAddr) {\n bytes32 salt = keccak256(abi.encode(nonce, tokenOwner, items, implicitModeValidator, implicitModeProjectId));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n\n}\n' }, 'src/proxies/SequenceProxyFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ITransparentUpgradeableBeaconProxy,\n TransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";\nimport { UpgradeableBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";\nimport { Create2 } from "@openzeppelin/contracts/utils/Create2.sol";\n\n/**\n * An proxy factory that deploys upgradeable beacon proxies.\n * @dev The factory owner is able to upgrade the beacon implementation.\n * @dev Proxy deployers are able to override the beacon reference with their own.\n */\nabstract contract SequenceProxyFactory is Ownable {\n\n UpgradeableBeacon public beacon;\n\n /**\n * Initialize a Sequence Proxy Factory.\n * @param implementation The initial beacon implementation.\n * @param factoryOwner The owner of the factory.\n */\n function _initialize(address implementation, address factoryOwner) internal {\n beacon = new UpgradeableBeacon(implementation);\n Ownable._transferOwnership(factoryOwner);\n }\n\n /**\n * Deploys and initializes a new proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @param _data The initialization data.\n * @return proxyAddress The address of the deployed proxy.\n */\n function _createProxy(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal returns (address proxyAddress) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\n\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\n }\n\n /**\n * Computes the address of a proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @return proxy The expected address of the deployed proxy.\n */\n function _computeProxyAddress(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal view returns (address) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\n\n return Create2.computeAddress(saltedHash, bytecodeHash);\n }\n\n /**\n * Upgrades the beacon implementation.\n * @param implementation The new beacon implementation.\n */\n function upgradeBeacon(\n address implementation\n ) public onlyOwner {\n beacon.upgradeTo(implementation);\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ITransparentUpgradeableBeaconProxy,\n TransparentUpgradeableBeaconProxy\n} from "./TransparentUpgradeableBeaconProxy.sol";\n\nimport { Ownable } from "openzeppelin-contracts/contracts/access/Ownable.sol";\nimport { UpgradeableBeacon } from "openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol";\nimport { Create2 } from "openzeppelin-contracts/contracts/utils/Create2.sol";\n\n/**\n * An proxy factory that deploys upgradeable beacon proxies.\n * @dev The factory owner is able to upgrade the beacon implementation.\n * @dev Proxy deployers are able to override the beacon reference with their own.\n */\nabstract contract SequenceProxyFactory is Ownable {\n\n UpgradeableBeacon public beacon;\n\n /**\n * Initialize a Sequence Proxy Factory.\n * @param implementation The initial beacon implementation.\n * @param factoryOwner The owner of the factory.\n */\n function _initialize(address implementation, address factoryOwner) internal {\n beacon = new UpgradeableBeacon(implementation);\n Ownable._transferOwnership(factoryOwner);\n }\n\n /**\n * Deploys and initializes a new proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @param _data The initialization data.\n * @return proxyAddress The address of the deployed proxy.\n */\n function _createProxy(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal returns (address proxyAddress) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes memory bytecode = type(TransparentUpgradeableBeaconProxy).creationCode;\n\n proxyAddress = Create2.deploy(0, saltedHash, bytecode);\n ITransparentUpgradeableBeaconProxy(payable(proxyAddress)).initialize(_proxyOwner, address(beacon), _data);\n }\n\n /**\n * Computes the address of a proxy instance.\n * @param _salt The deployment salt.\n * @param _proxyOwner The owner of the proxy.\n * @return proxy The expected address of the deployed proxy.\n */\n function _computeProxyAddress(\n bytes32 _salt,\n address _proxyOwner,\n bytes memory _data\n ) internal view returns (address) {\n bytes32 saltedHash = keccak256(abi.encodePacked(_salt, _proxyOwner, address(beacon), _data));\n bytes32 bytecodeHash = keccak256(type(TransparentUpgradeableBeaconProxy).creationCode);\n\n return Create2.computeAddress(saltedHash, bytecodeHash);\n }\n\n /**\n * Upgrades the beacon implementation.\n * @param implementation The new beacon implementation.\n */\n function upgradeBeacon(\n address implementation\n ) public onlyOwner {\n beacon.upgradeTo(implementation);\n }\n\n}\n' }, 'src/tokens/ERC721/utility/sale/ERC721Sale.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n IERC721Sale, IERC721SaleFunctions\n} from "@0xsequence/contracts-library/tokens/ERC721/utility/sale/IERC721Sale.sol";\n\nimport { MerkleProofSingleUse } from "@0xsequence/contracts-library/tokens/common/MerkleProofSingleUse.sol";\nimport {\n AccessControlEnumerable,\n IERC20,\n SafeERC20,\n WithdrawControlled\n} from "@0xsequence/contracts-library/tokens/common/WithdrawControlled.sol";\n\nimport { IERC721ItemsFunctions } from "@0xsequence/contracts-library/tokens/ERC721/presets/items/IERC721Items.sol";\nimport { IERC721A } from "erc721a/contracts/extensions/ERC721AQueryable.sol";\n\n/**\n * An ERC-721 token contract with primary sale mechanisms.\n */\ncontract ERC721Sale is IERC721Sale, WithdrawControlled, MerkleProofSingleUse {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n SaleDetails private _saleDetails;\n\n /**\n * Initialize the contract.\n * @param owner The owner of the contract\n * @param items The ERC-721 Items contract address\n * @dev This should be called immediately after deployment.\n */\n function initialize(address owner, address items) public virtual {\n if (_initialized) {\n revert InvalidInitialization();\n }\n\n _items = items;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(MINT_ADMIN_ROLE, owner);\n _grantRole(WITHDRAW_ROLE, owner);\n\n _initialized = true;\n }\n\n /**\n * Checks if the current block.timestamp is out of the give timestamp range.\n * @param _startTime Earliest acceptable timestamp (inclusive).\n * @param _endTime Latest acceptable timestamp (exclusive).\n * @dev A zero endTime value is always considered out of bounds.\n */\n function _blockTimeOutOfBounds(uint256 _startTime, uint256 _endTime) private view returns (bool) {\n // 0 end time indicates inactive sale.\n return _endTime == 0 || block.timestamp < _startTime || block.timestamp >= _endTime; // solhint-disable-line not-rely-on-time\n }\n\n /**\n * Checks the sale is active and takes payment.\n * @param _amount Amount of tokens to mint.\n * @param _expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param _maxTotal Maximum amount of payment tokens.\n * @param _proof Merkle proof for allowlist minting.\n */\n function _payForActiveMint(\n uint256 _amount,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n // Active sale test\n if (_blockTimeOutOfBounds(_saleDetails.startTime, _saleDetails.endTime)) {\n revert SaleInactive();\n }\n requireMerkleProof(_saleDetails.merkleRoot, _proof, msg.sender, "");\n\n uint256 total = _saleDetails.cost * _amount;\n if (_expectedPaymentToken != _saleDetails.paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_saleDetails.paymentToken, total, 0);\n }\n if (_maxTotal < total) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, total, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != total) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, total, msg.value);\n }\n } else if (msg.value > 0) {\n // Paid in ERC20, but sent ETH\n revert InsufficientPayment(address(0), 0, msg.value);\n } else {\n // Paid in ERC20\n SafeERC20.safeTransferFrom(IERC20(_expectedPaymentToken), msg.sender, address(this), total);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev An empty proof is supplied when no proof is required.\n * @dev `paymentToken` must match the `paymentToken` in the sale details.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n _payForActiveMint(amount, paymentToken, maxTotal, proof);\n\n uint256 currentSupply = IERC721A(_items).totalSupply();\n uint256 supplyCap = _saleDetails.supplyCap;\n if (supplyCap > 0 && currentSupply + amount > supplyCap) {\n revert InsufficientSupply(currentSupply, amount, supplyCap);\n }\n\n IERC721ItemsFunctions(_items).mint(to, amount);\n emit ItemsMinted(to, amount);\n }\n\n /**\n * Set the sale details.\n * @param supplyCap The maximum number of tokens that can be minted. 0 indicates unlimited supply.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n */\n function setSaleDetails(\n uint256 supplyCap,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n _saleDetails = SaleDetails(supplyCap, cost, paymentToken, startTime, endTime, merkleRoot);\n emit SaleDetailsUpdated(supplyCap, cost, paymentToken, startTime, endTime, merkleRoot);\n }\n\n //\n // Views\n //\n function itemsContract() external view returns (address) {\n return address(_items);\n }\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory) {\n return _saleDetails;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable) returns (bool) {\n return interfaceId == type(IERC721SaleFunctions).interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { MerkleProofSingleUse } from "../../../common/MerkleProofSingleUse.sol";\nimport { SignalsImplicitModeControlled } from "../../../common/SignalsImplicitModeControlled.sol";\nimport { IERC20, SafeERC20, WithdrawControlled } from "../../../common/WithdrawControlled.sol";\nimport { IERC721ItemsFunctions } from "../../presets/items/IERC721Items.sol";\nimport { IERC721Sale, IERC721SaleFunctions } from "./IERC721Sale.sol";\n\n/**\n * An ERC-721 token contract with primary sale mechanisms.\n */\ncontract ERC721Sale is IERC721Sale, WithdrawControlled, MerkleProofSingleUse, SignalsImplicitModeControlled {\n\n bytes32 internal constant MINT_ADMIN_ROLE = keccak256("MINT_ADMIN_ROLE");\n\n bool private _initialized;\n address private _items;\n SaleDetails private _saleDetails;\n\n /**\n * Initialize the contract.\n * @param owner The owner of the contract\n * @param items The ERC-721 Items contract address\n * @param implicitModeValidator Implicit session validator address\n * @param implicitModeProjectId Implicit session project id\n * @dev This should be called immediately after deployment.\n */\n function initialize(\n address owner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) public virtual {\n if (_initialized) {\n revert InvalidInitialization();\n }\n\n _items = items;\n\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n _grantRole(MINT_ADMIN_ROLE, owner);\n _grantRole(WITHDRAW_ROLE, owner);\n\n _initializeImplicitMode(owner, implicitModeValidator, implicitModeProjectId);\n\n _initialized = true;\n }\n\n /**\n * Checks if the current block.timestamp is out of the give timestamp range.\n * @param _startTime Earliest acceptable timestamp (inclusive).\n * @param _endTime Latest acceptable timestamp (exclusive).\n * @dev A zero endTime value is always considered out of bounds.\n */\n function _blockTimeOutOfBounds(uint256 _startTime, uint256 _endTime) private view returns (bool) {\n // 0 end time indicates inactive sale.\n return _endTime == 0 || block.timestamp < _startTime || block.timestamp >= _endTime; // solhint-disable-line not-rely-on-time\n }\n\n /**\n * Checks the sale is active, valid and takes payment.\n * @param _amount Amount of tokens to mint.\n * @param _expectedPaymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param _maxTotal Maximum amount of payment tokens.\n * @param _proof Merkle proof for allowlist minting.\n */\n function _validateMint(\n uint256 _amount,\n address _expectedPaymentToken,\n uint256 _maxTotal,\n bytes32[] calldata _proof\n ) private {\n // Active sale test\n if (_blockTimeOutOfBounds(_saleDetails.startTime, _saleDetails.endTime)) {\n revert SaleInactive();\n }\n // Supply test\n if (_saleDetails.remainingSupply < _amount) {\n revert InsufficientSupply(_saleDetails.remainingSupply, _amount);\n }\n _saleDetails.remainingSupply -= _amount;\n // Check proof\n requireMerkleProof(_saleDetails.merkleRoot, _proof, msg.sender, "");\n\n uint256 total = _saleDetails.cost * _amount;\n if (_expectedPaymentToken != _saleDetails.paymentToken) {\n // Caller expected different payment token\n revert InsufficientPayment(_saleDetails.paymentToken, total, 0);\n }\n if (_maxTotal < total) {\n // Caller expected to pay less\n revert InsufficientPayment(_expectedPaymentToken, total, _maxTotal);\n }\n if (_expectedPaymentToken == address(0)) {\n // Paid in ETH\n if (msg.value != total) {\n // We expect exact value match\n revert InsufficientPayment(_expectedPaymentToken, total, msg.value);\n }\n } else if (msg.value > 0) {\n // Paid in ERC20, but sent ETH\n revert InsufficientPayment(address(0), 0, msg.value);\n } else {\n // Paid in ERC20\n SafeERC20.safeTransferFrom(IERC20(_expectedPaymentToken), msg.sender, address(this), total);\n }\n }\n\n //\n // Minting\n //\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev An empty proof is supplied when no proof is required.\n * @dev `paymentToken` must match the `paymentToken` in the sale details.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] calldata proof\n ) public payable {\n _validateMint(amount, paymentToken, maxTotal, proof);\n try IERC721ItemsFunctions(_items).mintSequential(to, amount) { }\n catch {\n // On failure, support old minting method.\n IERC721ItemsFunctions(_items).mint(to, amount);\n }\n emit ItemsMinted(to, amount);\n }\n\n /**\n * Set the sale details.\n * @param remainingSupply The remaining number of tokens that can be minted by the items contract. 0 indicates unlimited supply.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n * @dev A zero end time indicates an inactive sale.\n */\n function setSaleDetails(\n uint256 remainingSupply,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) public onlyRole(MINT_ADMIN_ROLE) {\n // solhint-disable-next-line not-rely-on-time\n if (endTime < startTime || endTime <= block.timestamp) {\n revert InvalidSaleDetails();\n }\n if (remainingSupply == 0) {\n revert InvalidSaleDetails();\n }\n _saleDetails = SaleDetails(remainingSupply, cost, paymentToken, startTime, endTime, merkleRoot);\n emit SaleDetailsUpdated(remainingSupply, cost, paymentToken, startTime, endTime, merkleRoot);\n }\n\n //\n // Views\n //\n function itemsContract() external view returns (address) {\n return address(_items);\n }\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory) {\n return _saleDetails;\n }\n\n /**\n * Check interface support.\n * @param interfaceId Interface id\n * @return True if supported\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(WithdrawControlled, SignalsImplicitModeControlled) returns (bool) {\n return interfaceId == type(IERC721SaleFunctions).interfaceId\n || WithdrawControlled.supportsInterface(interfaceId)\n || SignalsImplicitModeControlled.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC721/utility/sale/IERC721SaleFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFactoryFunctions {\n\n /**\n * Creates an ERC-721 Sale for given token contract\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 Items contract address\n * @return proxyAddr The address of the ERC-721 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-721 Items contract.\n */\n function deploy(address proxyOwner, address tokenOwner, address items) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 Items contract address\n * @return proxyAddr The address of the ERC-721 Sale Proxy\n */\n function determineAddress(\n address proxyOwner,\n address tokenOwner,\n address items\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC721SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-721 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC721SaleFactory is IERC721SaleFactoryFunctions, IERC721SaleFactorySignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFactoryFunctions {\n\n /**\n * Creates an ERC-721 Sale for given token contract\n * @param nonce Nonce for randomizing the deployment address.\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 Items contract address\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-721 Sale Proxy\n * @notice The deployed contract must be granted the MINTER_ROLE on the ERC-721 Items contract.\n */\n function deploy(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param nonce Nonce for randomizing the deployment address.\n * @param proxyOwner The owner of the ERC-721 Sale proxy\n * @param tokenOwner The owner of the ERC-721 Sale implementation\n * @param items The ERC-721 Items contract address\n * @param implicitModeValidator The implicit mode validator address\n * @param implicitModeProjectId The implicit mode project id\n * @return proxyAddr The address of the ERC-721 Sale Proxy\n */\n function determineAddress(\n uint256 nonce,\n address proxyOwner,\n address tokenOwner,\n address items,\n address implicitModeValidator,\n bytes32 implicitModeProjectId\n ) external returns (address proxyAddr);\n\n}\n\ninterface IERC721SaleFactorySignals {\n\n /**\n * Event emitted when a new ERC-721 Sale proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721SaleDeployed(address proxyAddr);\n\n}\n\ninterface IERC721SaleFactory is IERC721SaleFactoryFunctions, IERC721SaleFactorySignals { }\n' }, 'src/proxies/TransparentUpgradeableBeaconProxy.sol': { content: '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { BeaconProxy, Proxy } from "./openzeppelin/BeaconProxy.sol";\nimport { ERC1967Proxy, TransparentUpgradeableProxy } from "./openzeppelin/TransparentUpgradeableProxy.sol";\n\ninterface ITransparentUpgradeableBeaconProxy {\n\n function initialize(address admin, address beacon, bytes memory data) external;\n\n}\n\nerror InvalidInitialization();\n\n/**\n * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation,\n * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors.\n * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * The proxy selectors are:\n * - 0xcf7a1d77: initialize\n * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy)\n * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy)\n * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy)\n * - 0xf851a440: admin (from TransparentUpgradeableProxy)\n * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy)\n */\ncontract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy {\n\n /**\n * Decode the initialization data from the msg.data and call the initialize function.\n */\n function _dispatchInitialize() private returns (bytes memory) {\n _requireZeroValue();\n\n (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes));\n initialize(admin, beacon, data);\n\n return "";\n }\n\n function initialize(address admin, address beacon, bytes memory data) internal {\n if (_admin() != address(0)) {\n // Redundant call. This function can only be called when the admin is not set.\n revert InvalidInitialization();\n }\n _changeAdmin(admin);\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev If the admin is not set, the fallback function is used to initialize the proxy.\n * @dev If the admin is set, the fallback function is used to delegatecall the implementation.\n */\n function _fallback() internal override(TransparentUpgradeableProxy, Proxy) {\n if (_getAdmin() == address(0)) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) {\n ret = _dispatchInitialize();\n // solhint-disable-next-line no-inline-assembly\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n }\n // When the admin is not set, the fallback function is used to initialize the proxy.\n revert InvalidInitialization();\n }\n TransparentUpgradeableProxy._fallback();\n }\n\n /**\n * Returns the current implementation address.\n * @dev This is the implementation address set by the admin, or the beacon implementation.\n */\n function _implementation() internal view override(ERC1967Proxy, BeaconProxy) returns (address) {\n address implementation = ERC1967Proxy._implementation();\n if (implementation != address(0)) {\n return implementation;\n }\n return BeaconProxy._implementation();\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/access/Ownable.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/Context.sol";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), "Ownable: caller is not the owner");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), "Ownable: new owner is the zero address");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IBeacon.sol";\nimport "../../access/Ownable.sol";\nimport "../../utils/Address.sol";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");\n _implementation = newImplementation;\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/Create2.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Create2.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.\n * `CREATE2` can be used to compute in advance the address where a smart\n * contract will be deployed, which allows for interesting new mechanisms known\n * as \'counterfactual interactions\'.\n *\n * See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more\n * information.\n */\nlibrary Create2 {\n /**\n * @dev Deploys a contract using `CREATE2`. The address where the contract\n * will be deployed can be known in advance via {computeAddress}.\n *\n * The bytecode for a contract can be obtained from Solidity with\n * `type(contractName).creationCode`.\n *\n * Requirements:\n *\n * - `bytecode` must not be empty.\n * - `salt` must have not been used for `bytecode` already.\n * - the factory must have a balance of at least `amount`.\n * - if `amount` is non-zero, `bytecode` must have a `payable` constructor.\n */\n function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {\n require(address(this).balance >= amount, "Create2: insufficient balance");\n require(bytecode.length != 0, "Create2: bytecode length is zero");\n /// @solidity memory-safe-assembly\n assembly {\n addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)\n }\n require(addr != address(0), "Create2: Failed on deploy");\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the\n * `bytecodeHash` or `salt` will result in a new destination address.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {\n return computeAddress(salt, bytecodeHash, address(this));\n }\n\n /**\n * @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at\n * `deployer`. If `deployer` is this contract\'s address, returns the same value as {computeAddress}.\n */\n function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {\n /// @solidity memory-safe-assembly\n assembly {\n let ptr := mload(0x40) // Get free memory pointer\n\n // | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |\n // |-------------------|---------------------------------------------------------------------------|\n // | bytecodeHash | CCCCCCCCCCCCC...CC |\n // | salt | BBBBBBBBBBBBB...BB |\n // | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |\n // | 0xFF | FF |\n // |-------------------|---------------------------------------------------------------------------|\n // | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |\n // | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |\n\n mstore(add(ptr, 0x40), bytecodeHash)\n mstore(add(ptr, 0x20), salt)\n mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes\n let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff\n mstore8(start, 0xff)\n addr := keccak256(start, 85)\n }\n }\n}\n' }, - 'src/tokens/ERC721/utility/sale/IERC721Sale.sol': { + 'src/tokens/common/MerkleProofSingleUse.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFunctions {\n\n struct SaleDetails {\n uint256 supplyCap; // 0 supply cap indicates unlimited supply\n uint256 cost;\n address paymentToken; // ERC20 token address for payment. address(0) indicated payment in ETH.\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] memory proof\n ) external payable;\n\n /**\n * Set the sale details.\n * @param supplyCap The maximum number of tokens that can be minted. 0 indicates unlimited supply.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n */\n function setSaleDetails(\n uint256 supplyCap,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) external;\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory);\n\n}\n\ninterface IERC721SaleSignals {\n\n event SaleDetailsUpdated(\n uint256 supplyCap, uint256 cost, address paymentToken, uint64 startTime, uint64 endTime, bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256 amount);\n\n /**\n * Contract already initialized.\n */\n error InvalidInitialization();\n\n /**\n * Sale details supplied are invalid.\n */\n error InvalidSaleDetails();\n\n /**\n * Sale is not active.\n */\n error SaleInactive();\n\n /**\n * Insufficient supply.\n * @param currentSupply Current supply.\n * @param amount Amount to mint.\n * @param maxSupply Maximum supply.\n */\n error InsufficientSupply(uint256 currentSupply, uint256 amount, uint256 maxSupply);\n\n /**\n * Insufficient tokens for payment.\n * @param currency Currency address. address(0) indicates ETH.\n * @param expected Expected amount of tokens.\n * @param actual Actual amount of tokens.\n */\n error InsufficientPayment(address currency, uint256 expected, uint256 actual);\n\n}\n\ninterface IERC721Sale is IERC721SaleFunctions, IERC721SaleSignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IMerkleProofSingleUse } from "./IMerkleProofSingleUse.sol";\n\nimport { MerkleProof } from "openzeppelin-contracts/contracts/utils/cryptography/MerkleProof.sol";\n\n/**\n * Require single use merkle proofs per address.\n */\nabstract contract MerkleProofSingleUse is IMerkleProofSingleUse {\n\n // Stores proofs used by an address\n mapping(address => mapping(bytes32 => bool)) private _proofUsed;\n\n /**\n * Requires the given merkle proof to be valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @notice Fails when the proof is invalid or the proof has already been claimed by this address.\n * @dev This function reverts on failure.\n */\n function requireMerkleProof(bytes32 root, bytes32[] calldata proof, address addr, bytes32 salt) internal {\n if (root != bytes32(0)) {\n if (!checkMerkleProof(root, proof, addr, salt)) {\n revert MerkleProofInvalid(root, proof, addr, salt);\n }\n _proofUsed[addr][root] = true;\n }\n }\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) public view returns (bool) {\n return !_proofUsed[addr][root] && MerkleProof.verify(proof, root, keccak256(abi.encodePacked(addr, salt)));\n }\n\n}\n' }, - 'src/tokens/common/MerkleProofSingleUse.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IMerkleProofSingleUse } from "@0xsequence/contracts-library/tokens/common/IMerkleProofSingleUse.sol";\nimport { MerkleProof } from "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";\n\n/**\n * Require single use merkle proofs per address.\n */\nabstract contract MerkleProofSingleUse is IMerkleProofSingleUse {\n\n // Stores proofs used by an address\n mapping(address => mapping(bytes32 => bool)) private _proofUsed;\n\n /**\n * Requires the given merkle proof to be valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @notice Fails when the proof is invalid or the proof has already been claimed by this address.\n * @dev This function reverts on failure.\n */\n function requireMerkleProof(bytes32 root, bytes32[] calldata proof, address addr, bytes32 salt) internal {\n if (root != bytes32(0)) {\n if (!checkMerkleProof(root, proof, addr, salt)) {\n revert MerkleProofInvalid(root, proof, addr, salt);\n }\n _proofUsed[addr][root] = true;\n }\n }\n\n /**\n * Checks if the given merkle proof is valid.\n * @param root Merkle root.\n * @param proof Merkle proof.\n * @param addr Address to check.\n * @param salt Salt used to generate the merkle leaf.\n * @return True if the proof is valid and has not yet been used by {addr}.\n */\n function checkMerkleProof(\n bytes32 root,\n bytes32[] calldata proof,\n address addr,\n bytes32 salt\n ) public view returns (bool) {\n return !_proofUsed[addr][root] && MerkleProof.verify(proof, root, keccak256(abi.encodePacked(addr, salt)));\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { AccessControlEnumerable } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport {\n IERC165,\n IImplicitProjectValidation,\n SignalsImplicitMode\n} from "signals-implicit-mode/src/helper/SignalsImplicitMode.sol";\n\n/**\n * An abstract contract that allows implicit session access for a given project.\n */\nabstract contract SignalsImplicitModeControlled is AccessControlEnumerable, SignalsImplicitMode {\n\n bytes32 internal constant _IMPLICIT_MODE_ADMIN_ROLE = keccak256("IMPLICIT_MODE_ADMIN_ROLE");\n\n function _initializeImplicitMode(address owner, address validator, bytes32 projectId) internal {\n _grantRole(_IMPLICIT_MODE_ADMIN_ROLE, owner);\n _initializeSignalsImplicitMode(validator, projectId);\n }\n\n /**\n * Updates the validator for implicit mode validation.\n * @param validator The validator address.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeValidator(\n address validator\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _validator = IImplicitProjectValidation(validator);\n }\n\n /**\n * Updates the settings for implicit mode validation.\n * @param projectId The project id.\n * @notice Only callable by an address with the project admin role.\n */\n function setImplicitModeProjectId(\n bytes32 projectId\n ) external onlyRole(_IMPLICIT_MODE_ADMIN_ROLE) {\n _projectId = projectId;\n }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable, SignalsImplicitMode) returns (bool) {\n return\n AccessControlEnumerable.supportsInterface(interfaceId) || SignalsImplicitMode.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/common/WithdrawControlled.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IWithdrawControlled } from "@0xsequence/contracts-library/tokens/common/IWithdrawControlled.sol";\n\nimport { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol";\nimport { IERC20, SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";\n\n/**\n * An abstract contract that allows ETH and ERC20 tokens stored in the contract to be withdrawn.\n */\nabstract contract WithdrawControlled is AccessControlEnumerable, IWithdrawControlled {\n\n bytes32 internal constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");\n\n //\n // Withdraw\n //\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawERC20(address token, address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n SafeERC20.safeTransfer(IERC20(token), to, value);\n }\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawETH(address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n (bool success,) = to.call{ value: value }("");\n if (!success) {\n revert WithdrawFailed();\n }\n }\n\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { IWithdrawControlled } from "./IWithdrawControlled.sol";\n\nimport { AccessControlEnumerable, ERC165 } from "openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol";\nimport { IERC20, SafeERC20 } from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";\n\n/**\n * An abstract contract that allows ETH and ERC20 tokens stored in the contract to be withdrawn.\n */\nabstract contract WithdrawControlled is AccessControlEnumerable, IWithdrawControlled {\n\n bytes32 internal constant WITHDRAW_ROLE = keccak256("WITHDRAW_ROLE");\n\n //\n // Withdraw\n //\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawERC20(address token, address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n SafeERC20.safeTransfer(IERC20(token), to, value);\n }\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n * @notice Only callable by an address with the withdraw role.\n */\n function withdrawETH(address to, uint256 value) public onlyRole(WITHDRAW_ROLE) {\n (bool success,) = to.call{ value: value }("");\n if (!success) {\n revert WithdrawFailed();\n }\n }\n\n /// @inheritdoc ERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControlEnumerable) returns (bool) {\n return interfaceId == type(IWithdrawControlled).interfaceId\n || AccessControlEnumerable.supportsInterface(interfaceId);\n }\n\n}\n' }, 'src/tokens/ERC721/presets/items/IERC721Items.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n */\n function mint(address to, uint256 amount) external;\n\n}\n\ninterface IERC721ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC721Items is IERC721ItemsFunctions, IERC721ItemsSignals { }\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721ItemsFunctions {\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param tokenId Token id to mint.\n */\n function mint(address to, uint256 tokenId) external;\n\n /**\n * Mint a sequential token.\n * @param to Address to mint token to.\n * @param amount Amount of tokens to mint.\n */\n function mintSequential(address to, uint256 amount) external;\n\n /**\n * Get the total supply of tokens.\n * @return totalSupply The total supply of tokens.\n */\n function totalSupply() external view returns (uint256 totalSupply);\n\n}\n\ninterface IERC721ItemsSignals {\n\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n\n}\n\ninterface IERC721Items is IERC721ItemsFunctions, IERC721ItemsSignals { }\n' }, - 'lib/chiru-labs/erc721a/contracts/extensions/ERC721AQueryable.sol': { + 'src/tokens/ERC721/utility/sale/IERC721Sale.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721AQueryable.sol';\nimport '../ERC721A.sol';\n\n/**\n * @title ERC721AQueryable.\n *\n * @dev ERC721A subclass with convenience query functions.\n */\nabstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n *\n * - `addr = address(0)`\n * - `startTimestamp = 0`\n * - `burned = false`\n * - `extraData = 0`\n *\n * If the `tokenId` is burned:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = true`\n * - `extraData = `\n *\n * Otherwise:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = false`\n * - `extraData = `\n */\n function explicitOwnershipOf(uint256 tokenId)\n public\n view\n virtual\n override\n returns (TokenOwnership memory ownership)\n {\n unchecked {\n if (tokenId >= _startTokenId()) {\n if (tokenId > _sequentialUpTo()) return _ownershipAt(tokenId);\n\n if (tokenId < _nextTokenId()) {\n // If the `tokenId` is within bounds,\n // scan backwards for the initialized ownership slot.\n while (!_ownershipIsInitialized(tokenId)) --tokenId;\n return _ownershipAt(tokenId);\n }\n }\n }\n }\n\n /**\n * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\n * See {ERC721AQueryable-explicitOwnershipOf}\n */\n function explicitOwnershipsOf(uint256[] calldata tokenIds)\n external\n view\n virtual\n override\n returns (TokenOwnership[] memory)\n {\n TokenOwnership[] memory ownerships;\n uint256 i = tokenIds.length;\n assembly {\n // Grab the free memory pointer.\n ownerships := mload(0x40)\n // Store the length.\n mstore(ownerships, i)\n // Allocate one word for the length,\n // `tokenIds.length` words for the pointers.\n i := shl(5, i) // Multiply `i` by 32.\n mstore(0x40, add(add(ownerships, 0x20), i))\n }\n while (i != 0) {\n uint256 tokenId;\n assembly {\n i := sub(i, 0x20)\n tokenId := calldataload(add(tokenIds.offset, i))\n }\n TokenOwnership memory ownership = explicitOwnershipOf(tokenId);\n assembly {\n // Store the pointer of `ownership` in the `ownerships` array.\n mstore(add(add(ownerships, 0x20), i), ownership)\n }\n }\n return ownerships;\n }\n\n /**\n * @dev Returns an array of token IDs owned by `owner`,\n * in the range [`start`, `stop`)\n * (i.e. `start <= tokenId < stop`).\n *\n * This function allows for tokens to be queried if the collection\n * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\n *\n * Requirements:\n *\n * - `start < stop`\n */\n function tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) external view virtual override returns (uint256[] memory) {\n return _tokensOfOwnerIn(owner, start, stop);\n }\n\n /**\n * @dev Returns an array of token IDs owned by `owner`.\n *\n * This function scans the ownership mapping and is O(`totalSupply`) in complexity.\n * It is meant to be called off-chain.\n *\n * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\n * multiple smaller scans if the collection is large enough to cause\n * an out-of-gas error (10K collections should be fine).\n */\n function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {\n // If spot mints are enabled, full-range scan is disabled.\n if (_sequentialUpTo() != type(uint256).max) _revert(NotCompatibleWithSpotMints.selector);\n uint256 start = _startTokenId();\n uint256 stop = _nextTokenId();\n uint256[] memory tokenIds;\n if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop);\n return tokenIds;\n }\n\n /**\n * @dev Helper function for returning an array of token IDs owned by `owner`.\n *\n * Note that this function is optimized for smaller bytecode size over runtime gas,\n * since it is meant to be called off-chain.\n */\n function _tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) private view returns (uint256[] memory tokenIds) {\n unchecked {\n if (start >= stop) _revert(InvalidQueryRange.selector);\n // Set `start = max(start, _startTokenId())`.\n if (start < _startTokenId()) start = _startTokenId();\n uint256 nextTokenId = _nextTokenId();\n // If spot mints are enabled, scan all the way until the specified `stop`.\n uint256 stopLimit = _sequentialUpTo() != type(uint256).max ? stop : nextTokenId;\n // Set `stop = min(stop, stopLimit)`.\n if (stop >= stopLimit) stop = stopLimit;\n // Number of tokens to scan.\n uint256 tokenIdsMaxLength = balanceOf(owner);\n // Set `tokenIdsMaxLength` to zero if the range contains no tokens.\n if (start >= stop) tokenIdsMaxLength = 0;\n // If there are one or more tokens to scan.\n if (tokenIdsMaxLength != 0) {\n // Set `tokenIdsMaxLength = min(balanceOf(owner), tokenIdsMaxLength)`.\n if (stop - start <= tokenIdsMaxLength) tokenIdsMaxLength = stop - start;\n uint256 m; // Start of available memory.\n assembly {\n // Grab the free memory pointer.\n tokenIds := mload(0x40)\n // Allocate one word for the length, and `tokenIdsMaxLength` words\n // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.\n m := add(tokenIds, shl(5, add(tokenIdsMaxLength, 1)))\n mstore(0x40, m)\n }\n // We need to call `explicitOwnershipOf(start)`,\n // because the slot at `start` may not be initialized.\n TokenOwnership memory ownership = explicitOwnershipOf(start);\n address currOwnershipAddr;\n // If the starting slot exists (i.e. not burned),\n // initialize `currOwnershipAddr`.\n // `ownership.address` will not be zero,\n // as `start` is clamped to the valid token ID range.\n if (!ownership.burned) currOwnershipAddr = ownership.addr;\n uint256 tokenIdsIdx;\n // Use a do-while, which is slightly more efficient for this case,\n // as the array will at least contain one element.\n do {\n if (_sequentialUpTo() != type(uint256).max) {\n // Skip the remaining unused sequential slots.\n if (start == nextTokenId) start = _sequentialUpTo() + 1;\n // Reset `currOwnershipAddr`, as each spot-minted token is a batch of one.\n if (start > _sequentialUpTo()) currOwnershipAddr = address(0);\n }\n ownership = _ownershipAt(start); // This implicitly allocates memory.\n assembly {\n switch mload(add(ownership, 0x40))\n // if `ownership.burned == false`.\n case 0 {\n // if `ownership.addr != address(0)`.\n // The `addr` already has it's upper 96 bits clearned,\n // since it is written to memory with regular Solidity.\n if mload(ownership) {\n currOwnershipAddr := mload(ownership)\n }\n // if `currOwnershipAddr == owner`.\n // The `shl(96, x)` is to make the comparison agnostic to any\n // dirty upper 96 bits in `owner`.\n if iszero(shl(96, xor(currOwnershipAddr, owner))) {\n tokenIdsIdx := add(tokenIdsIdx, 1)\n mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)\n }\n }\n // Otherwise, reset `currOwnershipAddr`.\n // This handles the case of batch burned tokens\n // (burned bit of first slot set, remaining slots left uninitialized).\n default {\n currOwnershipAddr := 0\n }\n start := add(start, 1)\n // Free temporary memory implicitly allocated for ownership\n // to avoid quadratic memory expansion costs.\n mstore(0x40, m)\n }\n } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));\n // Store the length of the array.\n assembly {\n mstore(tokenIds, tokenIdsIdx)\n }\n }\n }\n }\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SaleFunctions {\n\n struct SaleDetails {\n uint256 remainingSupply;\n uint256 cost;\n address paymentToken; // ERC20 token address for payment. address(0) indicated payment in ETH.\n uint64 startTime;\n uint64 endTime; // 0 end time indicates sale inactive\n bytes32 merkleRoot; // Root of allowed addresses\n }\n\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n * @param paymentToken ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param maxTotal Maximum amount of payment tokens.\n * @param proof Merkle proof for allowlist minting.\n * @notice Sale must be active for all tokens.\n * @dev An empty proof is supplied when no proof is required.\n */\n function mint(\n address to,\n uint256 amount,\n address paymentToken,\n uint256 maxTotal,\n bytes32[] memory proof\n ) external payable;\n\n /**\n * Set the sale details.\n * @param remainingSupply The maximum number of tokens that can be minted in this sale.\n * @param cost The amount of payment tokens to accept for each token minted.\n * @param paymentToken The ERC20 token address to accept payment in. address(0) indicates ETH.\n * @param startTime The start time of the sale. Tokens cannot be minted before this time.\n * @param endTime The end time of the sale. Tokens cannot be minted after this time.\n * @param merkleRoot The merkle root for allowlist minting.\n */\n function setSaleDetails(\n uint256 remainingSupply,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n ) external;\n\n /**\n * Get sale details.\n * @return Sale details.\n */\n function saleDetails() external view returns (SaleDetails memory);\n\n}\n\ninterface IERC721SaleSignals {\n\n event SaleDetailsUpdated(\n uint256 remainingSupply,\n uint256 cost,\n address paymentToken,\n uint64 startTime,\n uint64 endTime,\n bytes32 merkleRoot\n );\n event ItemsMinted(address to, uint256 amount);\n\n /**\n * Contract already initialized.\n */\n error InvalidInitialization();\n\n /**\n * Sale details supplied are invalid.\n */\n error InvalidSaleDetails();\n\n /**\n * Sale is not active.\n */\n error SaleInactive();\n\n /**\n * Insufficient supply.\n * @param remainingSupply Remaining supply.\n * @param amount Amount to mint.\n */\n error InsufficientSupply(uint256 remainingSupply, uint256 amount);\n\n /**\n * Insufficient tokens for payment.\n * @param currency Currency address. address(0) indicates ETH.\n * @param expected Expected amount of tokens.\n * @param actual Actual amount of tokens.\n */\n error InsufficientPayment(address currency, uint256 expected, uint256 actual);\n\n}\n\ninterface IERC721Sale is IERC721SaleFunctions, IERC721SaleSignals { }\n' }, 'src/proxies/openzeppelin/BeaconProxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\nimport "@openzeppelin/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/beacon/BeaconProxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\nimport "openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol";\n\n/**\n * @dev This contract implements a proxy that gets the implementation address for each call from an {UpgradeableBeacon}.\n *\n * The beacon address is stored in storage slot `uint256(keccak256(\'eip1967.proxy.beacon\')) - 1`, so that it doesn\'t\n * conflict with the storage layout of the implementation behind the proxy.\n *\n * _Available since v3.4._\n */\ncontract BeaconProxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current beacon address.\n */\n function _beacon() internal view virtual returns (address) {\n return _getBeacon();\n }\n\n /**\n * @dev Returns the current implementation address of the associated beacon.\n */\n function _implementation() internal view virtual override returns (address) {\n return IBeacon(_getBeacon()).implementation();\n }\n\n /**\n * @dev Changes the proxy to use a new beacon. Deprecated: see {_upgradeBeaconToAndCall}.\n *\n * If `data` is nonempty, it\'s used as data in a delegate call to the implementation returned by the beacon.\n *\n * Requirements:\n *\n * - `beacon` must be a contract.\n * - The implementation returned by `beacon` must be a contract.\n */\n function _setBeacon(address beacon, bytes memory data) internal virtual {\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n}\n' }, 'src/proxies/openzeppelin/TransparentUpgradeableProxy.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/transparent/TransparentUpgradeableProxy.sol)\n\n/// @notice This implementation is a copy of OpenZeppelin\'s with the following changes:\n/// - Pragma updated\n/// - Imports updated\n/// - Constructor removed\n/// - Allows admin to call implementation\n\npragma solidity ^0.8.19;\n\nimport "./ERC1967Proxy.sol";\n\n/**\n * @dev Interface for {TransparentUpgradeableProxy}. In order to implement transparency, {TransparentUpgradeableProxy}\n * does not implement this interface directly, and some of its functions are implemented by an internal dispatch\n * mechanism. The compiler is unaware that these functions are implemented by {TransparentUpgradeableProxy} and will not\n * include them in the ABI so this interface must be used to interact with it.\n */\ninterface ITransparentUpgradeableProxy is IERC1967 {\n\n function admin() external view returns (address);\n\n function implementation() external view returns (address);\n\n function changeAdmin(\n address\n ) external;\n\n function upgradeTo(\n address\n ) external;\n\n function upgradeToAndCall(address, bytes memory) external payable;\n\n}\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * Unlike the original OpenZeppelin implementation, this contract does not prevent the admin from calling the implementation.\n * This potentially exposes the admin to a proxy selector attack. See\n * https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * When using this contract, you must ensure that the implementation function selectors do not clash with the proxy selectors.\n * The proxy selectors are:\n * - 0x3659cfe6: upgradeTo\n * - 0x4f1ef286: upgradeToAndCall\n * - 0x8f283970: changeAdmin\n * - 0xf851a440: admin\n * - 0x5c60da1b: implementation\n *\n * NOTE: The real interface of this proxy is that defined in `ITransparentUpgradeableProxy`. This contract does not\n * inherit from that interface, and instead the admin functions are implicitly implemented using a custom dispatch\n * mechanism in `_fallback`. Consequently, the compiler will not produce an ABI for this contract. This is necessary to\n * fully implement transparency without decoding reverts caused by selector clashes between the proxy and the\n * implementation.\n *\n * WARNING: It is not recommended to extend this contract to add additional external functions. If you do so, the compiler\n * will not check that there are no selector conflicts, due to the note above. A selector clash between any new function\n * and the functions declared in {ITransparentUpgradeableProxy} will be resolved in favor of the new one. This could\n * render the admin operations inaccessible, which could prevent upgradeability. Transparency may also be compromised.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n *\n * CAUTION: This modifier is deprecated, as it could cause issues if the modified function has arguments, and the\n * implementation provides a function with the same selector.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev If caller is the admin process the call internally, otherwise transparently fallback to the proxy behavior\n */\n function _fallback() internal virtual override {\n if (msg.sender == _getAdmin()) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableProxy.upgradeTo.selector) {\n ret = _dispatchUpgradeTo();\n } else if (selector == ITransparentUpgradeableProxy.upgradeToAndCall.selector) {\n ret = _dispatchUpgradeToAndCall();\n } else if (selector == ITransparentUpgradeableProxy.changeAdmin.selector) {\n ret = _dispatchChangeAdmin();\n } else if (selector == ITransparentUpgradeableProxy.admin.selector) {\n ret = _dispatchAdmin();\n } else if (selector == ITransparentUpgradeableProxy.implementation.selector) {\n ret = _dispatchImplementation();\n } else {\n // Call implementation\n return super._fallback();\n }\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n } else {\n super._fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function _dispatchAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address admin = _getAdmin();\n return abi.encode(admin);\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function _dispatchImplementation() private returns (bytes memory) {\n _requireZeroValue();\n\n address implementation = _implementation();\n return abi.encode(implementation);\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _dispatchChangeAdmin() private returns (bytes memory) {\n _requireZeroValue();\n\n address newAdmin = abi.decode(msg.data[4:], (address));\n _changeAdmin(newAdmin);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n */\n function _dispatchUpgradeTo() private returns (bytes memory) {\n _requireZeroValue();\n\n address newImplementation = abi.decode(msg.data[4:], (address));\n _upgradeToAndCall(newImplementation, bytes(""), false);\n\n return "";\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n */\n function _dispatchUpgradeToAndCall() private returns (bytes memory) {\n (address newImplementation, bytes memory data) = abi.decode(msg.data[4:], (address, bytes));\n _upgradeToAndCall(newImplementation, data, true);\n\n return "";\n }\n\n /**\n * @dev Returns the current admin.\n *\n * CAUTION: This function is deprecated. Use {ERC1967Upgrade-_getAdmin} instead.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev To keep this contract fully transparent, all `ifAdmin` functions must be payable. This helper is here to\n * emulate some proxy functions being non-payable while still allowing value to pass through.\n */\n function _requireZeroValue() internal {\n require(msg.value == 0);\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/utils/Context.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Context.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/IBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/IBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n' }, - 'lib/openzeppelin/contracts/utils/Address.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Address.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n *\n * Furthermore, `isContract` will also return true if the target contract within\n * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,\n * which only has an effect at the end of a transaction.\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn\'t rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity\'s `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, "Address: insufficient balance");\n\n (bool success, ) = recipient.call{value: amount}("");\n require(success, "Address: unable to send value, recipient may have reverted");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, "Address: low-level call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, "Address: low-level call with value failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, "Address: insufficient balance for call");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, "Address: low-level static call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, "Address: low-level delegate call failed");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), "Address: call to non-contract");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn\'t, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n' }, @@ -259,137 +97,148 @@ export const ERC721SALEFACTORY_VERIFICATION: Omit 0) {\n require(proofPos == proofLen, "MerkleProof: invalid multiproof");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n /**\n * @dev Calldata version of {processMultiProof}.\n *\n * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details.\n *\n * _Available since v4.7._\n */\n function processMultiProofCalldata(\n bytes32[] calldata proof,\n bool[] calldata proofFlags,\n bytes32[] memory leaves\n ) internal pure returns (bytes32 merkleRoot) {\n // This function rebuilds the root hash by traversing the tree up from the leaves. The root is rebuilt by\n // consuming and producing values on a queue. The queue starts with the `leaves` array, then goes onto the\n // `hashes` array. At the end of the process, the last hash in the `hashes` array should contain the root of\n // the merkle tree.\n uint256 leavesLen = leaves.length;\n uint256 proofLen = proof.length;\n uint256 totalHashes = proofFlags.length;\n\n // Check proof validity.\n require(leavesLen + proofLen - 1 == totalHashes, "MerkleProof: invalid multiproof");\n\n // The xxxPos values are "pointers" to the next value to consume in each array. All accesses are done using\n // `xxx[xxxPos++]`, which return the current value and increment the pointer, thus mimicking a queue\'s "pop".\n bytes32[] memory hashes = new bytes32[](totalHashes);\n uint256 leafPos = 0;\n uint256 hashPos = 0;\n uint256 proofPos = 0;\n // At each step, we compute the next hash using two values:\n // - a value from the "main queue". If not all leaves have been consumed, we get the next leaf, otherwise we\n // get the next hash.\n // - depending on the flag, either another value from the "main queue" (merging branches) or an element from the\n // `proof` array.\n for (uint256 i = 0; i < totalHashes; i++) {\n bytes32 a = leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++];\n bytes32 b = proofFlags[i]\n ? (leafPos < leavesLen ? leaves[leafPos++] : hashes[hashPos++])\n : proof[proofPos++];\n hashes[i] = _hashPair(a, b);\n }\n\n if (totalHashes > 0) {\n require(proofPos == proofLen, "MerkleProof: invalid multiproof");\n unchecked {\n return hashes[totalHashes - 1];\n }\n } else if (leavesLen > 0) {\n return leaves[0];\n } else {\n return proof[0];\n }\n }\n\n function _hashPair(bytes32 a, bytes32 b) private pure returns (bytes32) {\n return a < b ? _efficientHash(a, b) : _efficientHash(b, a);\n }\n\n function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) {\n /// @solidity memory-safe-assembly\n assembly {\n mstore(0x00, a)\n mstore(0x20, b)\n value := keccak256(0x00, 0x40)\n }\n }\n}\n' }, - 'src/tokens/common/IWithdrawControlled.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IWithdrawControlledFunctions {\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawERC20(address token, address to, uint256 value) external;\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawETH(address to, uint256 value) external;\n\n}\n\ninterface IWithdrawControlledSignals {\n\n /**\n * Withdraw failed error.\n */\n error WithdrawFailed();\n\n}\n\ninterface IWithdrawControlled is IWithdrawControlledFunctions, IWithdrawControlledSignals { }\n' - }, - 'lib/openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControlEnumerable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControlEnumerable.sol";\nimport "./AccessControl.sol";\nimport "../utils/structs/EnumerableSet.sol";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {\n using EnumerableSet for EnumerableSet.AddressSet;\n\n mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {\n return _roleMembers[role].at(index);\n }\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {\n return _roleMembers[role].length();\n }\n\n /**\n * @dev Overload {_grantRole} to track enumerable memberships\n */\n function _grantRole(bytes32 role, address account) internal virtual override {\n super._grantRole(role, account);\n _roleMembers[role].add(account);\n }\n\n /**\n * @dev Overload {_revokeRole} to track enumerable memberships\n */\n function _revokeRole(bytes32 role, address account) internal virtual override {\n super._revokeRole(role, account);\n _roleMembers[role].remove(account);\n }\n}\n' }, - 'lib/openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol': { + 'lib/signals-implicit-mode/src/helper/SignalsImplicitMode.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\nimport "../extensions/IERC20Permit.sol";\nimport "../../../utils/Address.sol";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \'safeIncreaseAllowance\' and \'safeDecreaseAllowance\'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n "SafeERC20: approve from non-zero to non-zero allowance"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract\'s allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.13;\n\nimport { IImplicitProjectValidation } from "../registry/IImplicitProjectValidation.sol";\n\nimport { ERC165, IERC165 } from "openzeppelin-contracts/contracts/utils/introspection/ERC165.sol";\nimport { Attestation } from "sequence-v3/src/extensions/sessions/implicit/Attestation.sol";\nimport { ISignalsImplicitMode } from "sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol";\nimport { Payload } from "sequence-v3/src/modules/Payload.sol";\n\n/// @title SignalsImplicitMode\n/// @author Michael Standen\n/// @notice Base contract for implicit mode validation by project\nabstract contract SignalsImplicitMode is ISignalsImplicitMode, ERC165 {\n\n IImplicitProjectValidation internal _validator;\n bytes32 internal _projectId;\n\n /// @notice Initialize implicit mode validation\n /// @param validator The IImplicitProjectValidation address\n /// @param projectId The project id\n function _initializeSignalsImplicitMode(address validator, bytes32 projectId) internal {\n _validator = IImplicitProjectValidation(validator);\n _projectId = projectId;\n }\n\n /// @inheritdoc ISignalsImplicitMode\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32) {\n _validateImplicitRequest(wallet, attestation, call);\n return _validator.validateAttestation(wallet, attestation, _projectId);\n }\n\n /// @notice Validates an implicit request\n /// @dev Optional hook for additional validation of the implicit requests\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n function _validateImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) internal view virtual { }\n\n /// @inheritdoc IERC165\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override returns (bool) {\n return interfaceId == type(ISignalsImplicitMode).interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'lib/chiru-labs/erc721a/contracts/extensions/IERC721AQueryable.sol': { + 'src/tokens/common/IWithdrawControlled.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport '../IERC721A.sol';\n\n/**\n * @dev Interface of ERC721AQueryable.\n */\ninterface IERC721AQueryable is IERC721A {\n /**\n * Invalid query range (`start` >= `stop`).\n */\n error InvalidQueryRange();\n\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n *\n * - `addr = address(0)`\n * - `startTimestamp = 0`\n * - `burned = false`\n * - `extraData = 0`\n *\n * If the `tokenId` is burned:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = true`\n * - `extraData = `\n *\n * Otherwise:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = false`\n * - `extraData = `\n */\n function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);\n\n /**\n * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\n * See {ERC721AQueryable-explicitOwnershipOf}\n */\n function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);\n\n /**\n * @dev Returns an array of token IDs owned by `owner`,\n * in the range [`start`, `stop`)\n * (i.e. `start <= tokenId < stop`).\n *\n * This function allows for tokens to be queried if the collection\n * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\n *\n * Requirements:\n *\n * - `start < stop`\n */\n function tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) external view returns (uint256[] memory);\n\n /**\n * @dev Returns an array of token IDs owned by `owner`.\n *\n * This function scans the ownership mapping and is O(`totalSupply`) in complexity.\n * It is meant to be called off-chain.\n *\n * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\n * multiple smaller scans if the collection is large enough to cause\n * an out-of-gas error (10K collections should be fine).\n */\n function tokensOfOwner(address owner) external view returns (uint256[] memory);\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IWithdrawControlledFunctions {\n\n /**\n * Withdraws ERC20 tokens owned by this contract.\n * @param token The ERC20 token address.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawERC20(address token, address to, uint256 value) external;\n\n /**\n * Withdraws ETH owned by this sale contract.\n * @param to Address to withdraw to.\n * @param value Amount to withdraw.\n */\n function withdrawETH(address to, uint256 value) external;\n\n}\n\ninterface IWithdrawControlledSignals {\n\n /**\n * Withdraw failed error.\n */\n error WithdrawFailed();\n\n}\n\ninterface IWithdrawControlled is IWithdrawControlledFunctions, IWithdrawControlledSignals { }\n' }, - 'lib/chiru-labs/erc721a/contracts/ERC721A.sol': { + 'lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721A.sol';\n\n/**\n * @dev Interface of ERC721 token receiver.\n */\ninterface ERC721A__IERC721Receiver {\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n\n/**\n * @title ERC721A\n *\n * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)\n * Non-Fungible Token Standard, including the Metadata extension.\n * Optimized for lower gas during batch mints.\n *\n * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)\n * starting from `_startTokenId()`.\n *\n * The `_sequentialUpTo()` function can be overriden to enable spot mints\n * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.\n *\n * Assumptions:\n *\n * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.\n * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).\n */\ncontract ERC721A is IERC721A {\n // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).\n struct TokenApprovalRef {\n address value;\n }\n\n // =============================================================\n // CONSTANTS\n // =============================================================\n\n // Mask of an entry in packed address data.\n uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n // The bit position of `numberMinted` in packed address data.\n uint256 private constant _BITPOS_NUMBER_MINTED = 64;\n\n // The bit position of `numberBurned` in packed address data.\n uint256 private constant _BITPOS_NUMBER_BURNED = 128;\n\n // The bit position of `aux` in packed address data.\n uint256 private constant _BITPOS_AUX = 192;\n\n // Mask of all 256 bits in packed address data except the 64 bits for `aux`.\n uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n // The bit position of `startTimestamp` in packed ownership.\n uint256 private constant _BITPOS_START_TIMESTAMP = 160;\n\n // The bit mask of the `burned` bit in packed ownership.\n uint256 private constant _BITMASK_BURNED = 1 << 224;\n\n // The bit position of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;\n\n // The bit mask of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n // The bit position of `extraData` in packed ownership.\n uint256 private constant _BITPOS_EXTRA_DATA = 232;\n\n // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.\n uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;\n\n // The mask of the lower 160 bits for addresses.\n uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;\n\n // The maximum `quantity` that can be minted with {_mintERC2309}.\n // This limit is to prevent overflows on the address data entries.\n // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}\n // is required to cause an overflow, which is unrealistic.\n uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;\n\n // The `Transfer` event signature is given by:\n // `keccak256(bytes(\"Transfer(address,address,uint256)\"))`.\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n // =============================================================\n // STORAGE\n // =============================================================\n\n // The next token ID to be minted.\n uint256 private _currentIndex;\n\n // The number of tokens burned.\n uint256 private _burnCounter;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to ownership details\n // An empty struct value does not necessarily mean the token is unowned.\n // See {_packedOwnershipOf} implementation for details.\n //\n // Bits Layout:\n // - [0..159] `addr`\n // - [160..223] `startTimestamp`\n // - [224] `burned`\n // - [225] `nextInitialized`\n // - [232..255] `extraData`\n mapping(uint256 => uint256) private _packedOwnerships;\n\n // Mapping owner address to address data.\n //\n // Bits Layout:\n // - [0..63] `balance`\n // - [64..127] `numberMinted`\n // - [128..191] `numberBurned`\n // - [192..255] `aux`\n mapping(address => uint256) private _packedAddressData;\n\n // Mapping from token ID to approved address.\n mapping(uint256 => TokenApprovalRef) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // The amount of tokens minted above `_sequentialUpTo()`.\n // We call these spot mints (i.e. non-sequential mints).\n uint256 private _spotMinted;\n\n // =============================================================\n // CONSTRUCTOR\n // =============================================================\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n\n if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);\n }\n\n // =============================================================\n // TOKEN COUNTING OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the starting token ID for sequential mints.\n *\n * Override this function to change the starting token ID for sequential mints.\n *\n * Note: The value returned must never change after any tokens have been minted.\n */\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev Returns the maximum token ID (inclusive) for sequential mints.\n *\n * Override this function to return a value less than 2**256 - 1,\n * but greater than `_startTokenId()`, to enable spot (non-sequential) mints.\n *\n * Note: The value returned must never change after any tokens have been minted.\n */\n function _sequentialUpTo() internal view virtual returns (uint256) {\n return type(uint256).max;\n }\n\n /**\n * @dev Returns the next token ID to be minted.\n */\n function _nextTokenId() internal view virtual returns (uint256) {\n return _currentIndex;\n }\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() public view virtual override returns (uint256 result) {\n // Counter underflow is impossible as `_burnCounter` cannot be incremented\n // more than `_currentIndex + _spotMinted - _startTokenId()` times.\n unchecked {\n // With spot minting, the intermediate `result` can be temporarily negative,\n // and the computation must be unchecked.\n result = _currentIndex - _burnCounter - _startTokenId();\n if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;\n }\n }\n\n /**\n * @dev Returns the total amount of tokens minted in the contract.\n */\n function _totalMinted() internal view virtual returns (uint256 result) {\n // Counter underflow is impossible as `_currentIndex` does not decrement,\n // and it is initialized to `_startTokenId()`.\n unchecked {\n result = _currentIndex - _startTokenId();\n if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;\n }\n }\n\n /**\n * @dev Returns the total number of tokens burned.\n */\n function _totalBurned() internal view virtual returns (uint256) {\n return _burnCounter;\n }\n\n /**\n * @dev Returns the total number of tokens that are spot-minted.\n */\n function _totalSpotMinted() internal view virtual returns (uint256) {\n return _spotMinted;\n }\n\n // =============================================================\n // ADDRESS DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);\n return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens minted by `owner`.\n */\n function _numberMinted(address owner) internal view returns (uint256) {\n return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens burned by or on behalf of `owner`.\n */\n function _numberBurned(address owner) internal view returns (uint256) {\n return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n */\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> _BITPOS_AUX);\n }\n\n /**\n * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n * If there are multiple variables, please pack them into a uint64.\n */\n function _setAux(address owner, uint64 aux) internal virtual {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n // Cast `aux` with assembly to avoid redundant masking.\n assembly {\n auxCasted := aux\n }\n packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n // The interface IDs are constants representing the first 4 bytes\n // of the XOR of all function selectors in the interface.\n // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)\n // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)\n return\n interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.\n interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.\n interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.\n }\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, it can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return '';\n }\n\n // =============================================================\n // OWNERSHIPS OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\n }\n\n /**\n * @dev Gas spent here starts off proportional to the maximum mint batch size.\n * It gradually moves to O(1) as tokens get transferred around over time.\n */\n function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct at `index`.\n */\n function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n /**\n * @dev Returns whether the ownership slot at `index` is initialized.\n * An uninitialized slot does not necessarily mean that the slot has no owner.\n */\n function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {\n return _packedOwnerships[index] != 0;\n }\n\n /**\n * @dev Initializes the ownership slot minted at `index` for efficiency purposes.\n */\n function _initializeOwnershipAt(uint256 index) internal virtual {\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n /**\n * @dev Returns the packed ownership data of `tokenId`.\n */\n function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {\n if (_startTokenId() <= tokenId) {\n packed = _packedOwnerships[tokenId];\n\n if (tokenId > _sequentialUpTo()) {\n if (_packedOwnershipExists(packed)) return packed;\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n\n // If the data at the starting slot does not exist, start the scan.\n if (packed == 0) {\n if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);\n // Invariant:\n // There will always be an initialized ownership slot\n // (i.e. `ownership.addr != address(0) && ownership.burned == false`)\n // before an unintialized ownership slot\n // (i.e. `ownership.addr == address(0) && ownership.burned == false`)\n // Hence, `tokenId` will not underflow.\n //\n // We can directly compare the packed value.\n // If the address is zero, packed will be zero.\n for (;;) {\n unchecked {\n packed = _packedOwnerships[--tokenId];\n }\n if (packed == 0) continue;\n if (packed & _BITMASK_BURNED == 0) return packed;\n // Otherwise, the token is burned, and we must revert.\n // This handles the case of batch burned tokens, where only the burned bit\n // of the starting slot is set, and remaining slots are left uninitialized.\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n }\n // Otherwise, the data exists and we can skip the scan.\n // This is possible because we have already achieved the target condition.\n // This saves 2143 gas on transfers of initialized tokens.\n // If the token is not burned, return `packed`. Otherwise, revert.\n if (packed & _BITMASK_BURNED == 0) return packed;\n }\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct from `packed`.\n */\n function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);\n ownership.burned = packed & _BITMASK_BURNED != 0;\n ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);\n }\n\n /**\n * @dev Packs ownership data into a single uint256.\n */\n function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.\n result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))\n }\n }\n\n /**\n * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.\n */\n function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {\n // For branchless setting of the `nextInitialized` flag.\n assembly {\n // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.\n result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))\n }\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n */\n function approve(address to, uint256 tokenId) public payable virtual override {\n _approve(to, tokenId, true);\n }\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);\n\n return _tokenApprovals[tokenId].value;\n }\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted. See {_mint}.\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool result) {\n if (_startTokenId() <= tokenId) {\n if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);\n\n if (tokenId < _currentIndex) {\n uint256 packed;\n while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;\n result = packed & _BITMASK_BURNED == 0;\n }\n }\n }\n\n /**\n * @dev Returns whether `packed` represents a token that exists.\n */\n function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {\n assembly {\n // The following is equivalent to `owner != address(0) && burned == false`.\n // Symbolically tested.\n result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED))\n }\n }\n\n /**\n * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.\n */\n function _isSenderApprovedOrOwner(\n address approvedAddress,\n address owner,\n address msgSender\n ) private pure returns (bool result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.\n msgSender := and(msgSender, _BITMASK_ADDRESS)\n // `msgSender == owner || msgSender == approvedAddress`.\n result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))\n }\n }\n\n /**\n * @dev Returns the storage slot and value for the approved address of `tokenId`.\n */\n function _getApprovedSlotAndAddress(uint256 tokenId)\n private\n view\n returns (uint256 approvedAddressSlot, address approvedAddress)\n {\n TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];\n // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.\n assembly {\n approvedAddressSlot := tokenApproval.slot\n approvedAddress := sload(approvedAddressSlot)\n }\n }\n\n // =============================================================\n // TRANSFER OPERATIONS\n // =============================================================\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable virtual override {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.\n from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));\n\n if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);\n\n (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);\n\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))\n if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // We can directly increment and decrement the balances.\n --_packedAddressData[from]; // Updates: `balance -= 1`.\n ++_packedAddressData[to]; // Updates: `balance += 1`.\n\n // Updates:\n // - `address` to the next owner.\n // - `startTimestamp` to the timestamp of transfering.\n // - `burned` to `false`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n from, // `from`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n if (toMasked == 0) _revert(TransferToZeroAddress.selector);\n\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable virtual override {\n safeTransferFrom(from, to, tokenId, '');\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public payable virtual override {\n transferFrom(from, to, tokenId);\n if (to.code.length != 0)\n if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n }\n\n /**\n * @dev Hook that is called before a set of serially-ordered token IDs\n * are about to be transferred. This includes minting.\n * And also called before burning one token.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after a set of serially-ordered token IDs\n * have been transferred. This includes minting.\n * And also called after one token has been burned.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been\n * transferred to `to`.\n * - When `from` is zero, `tokenId` has been minted for `to`.\n * - When `to` is zero, `tokenId` has been burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.\n *\n * `from` - Previous owner of the given token ID.\n * `to` - Target address that will receive the token.\n * `tokenId` - Token ID to be transferred.\n * `_data` - Optional data to send along with the call.\n *\n * Returns whether the call correctly returned the expected magic value.\n */\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (\n bytes4 retval\n ) {\n return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n\n // =============================================================\n // MINT OPERATIONS\n // =============================================================\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mint(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (quantity == 0) _revert(MintZeroQuantity.selector);\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are incredibly unrealistic.\n // `balance` and `numberMinted` have a maximum limit of 2**64.\n // `tokenId` has a maximum limit of 2**256.\n unchecked {\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)\n );\n\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n\n if (toMasked == 0) _revert(MintToZeroAddress.selector);\n\n uint256 end = startTokenId + quantity;\n uint256 tokenId = startTokenId;\n\n if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);\n\n do {\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n // The `!=` check ensures that large values of `quantity`\n // that overflows uint256 will make the loop run out of gas.\n } while (++tokenId != end);\n\n _currentIndex = end;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * This function is intended for efficient minting only during contract creation.\n *\n * It emits only one {ConsecutiveTransfer} as defined in\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),\n * instead of a sequence of {Transfer} event(s).\n *\n * Calling this function outside of contract creation WILL make your contract\n * non-compliant with the ERC721 standard.\n * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309\n * {ConsecutiveTransfer} event is only permissible during contract creation.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {ConsecutiveTransfer} event.\n */\n function _mintERC2309(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) _revert(MintToZeroAddress.selector);\n if (quantity == 0) _revert(MintZeroQuantity.selector);\n if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are unrealistic due to the above check for `quantity` to be below the limit.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)\n );\n\n if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);\n\n emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);\n\n _currentIndex = startTokenId + quantity;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Safely mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.\n * - `quantity` must be greater than 0.\n *\n * See {_mint}.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal virtual {\n _mint(to, quantity);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 end = _currentIndex;\n uint256 index = end - quantity;\n do {\n if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n } while (index < end);\n // This prevents reentrancy to `_safeMint`.\n // It does not prevent reentrancy to `_safeMintSpot`.\n if (_currentIndex != end) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMint(to, quantity, '')`.\n */\n function _safeMint(address to, uint256 quantity) internal virtual {\n _safeMint(to, quantity, '');\n }\n\n /**\n * @dev Mints a single token at `tokenId`.\n *\n * Note: A spot-minted `tokenId` that has been burned can be re-minted again.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` must be greater than `_sequentialUpTo()`.\n * - `tokenId` must not exist.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mintSpot(address to, uint256 tokenId) internal virtual {\n if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);\n uint256 prevOwnershipPacked = _packedOwnerships[tokenId];\n if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);\n\n _beforeTokenTransfers(address(0), to, tokenId, 1);\n\n // Overflows are incredibly unrealistic.\n // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.\n // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.\n unchecked {\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `true` (as `quantity == 1`).\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked)\n );\n\n // Updates:\n // - `balance += 1`.\n // - `numberMinted += 1`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n\n if (toMasked == 0) _revert(MintToZeroAddress.selector);\n\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n\n ++_spotMinted;\n }\n\n _afterTokenTransfers(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Safely mints a single token at `tokenId`.\n *\n * Note: A spot-minted `tokenId` that has been burned can be re-minted again.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.\n * - `tokenId` must be greater than `_sequentialUpTo()`.\n * - `tokenId` must not exist.\n *\n * See {_mintSpot}.\n *\n * Emits a {Transfer} event.\n */\n function _safeMintSpot(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mintSpot(to, tokenId);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 currentSpotMinted = _spotMinted;\n if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n // This prevents reentrancy to `_safeMintSpot`.\n // It does not prevent reentrancy to `_safeMint`.\n if (_spotMinted != currentSpotMinted) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.\n */\n function _safeMintSpot(address to, uint256 tokenId) internal virtual {\n _safeMintSpot(to, tokenId, '');\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_approve(to, tokenId, false)`.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _approve(to, tokenId, false);\n }\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function _approve(\n address to,\n uint256 tokenId,\n bool approvalCheck\n ) internal virtual {\n address owner = ownerOf(tokenId);\n\n if (approvalCheck && _msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n _revert(ApprovalCallerNotOwnerNorApproved.selector);\n }\n\n _tokenApprovals[tokenId].value = to;\n emit Approval(owner, to, tokenId);\n }\n\n // =============================================================\n // BURN OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_burn(tokenId, false)`.\n */\n function _burn(uint256 tokenId) internal virtual {\n _burn(tokenId, false);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n address from = address(uint160(prevOwnershipPacked));\n\n (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);\n\n if (approvalCheck) {\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))\n if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);\n }\n\n _beforeTokenTransfers(from, address(0), tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // Updates:\n // - `balance -= 1`.\n // - `numberBurned += 1`.\n //\n // We can directly decrement the balance, and increment the number burned.\n // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.\n _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;\n\n // Updates:\n // - `address` to the last owner.\n // - `startTimestamp` to the timestamp of burning.\n // - `burned` to `true`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n from,\n (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, address(0), tokenId);\n _afterTokenTransfers(from, address(0), tokenId, 1);\n\n // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times.\n unchecked {\n _burnCounter++;\n }\n }\n\n // =============================================================\n // EXTRA DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Directly sets the extra data for the ownership data `index`.\n */\n function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {\n uint256 packed = _packedOwnerships[index];\n if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);\n uint256 extraDataCasted;\n // Cast `extraData` with assembly to avoid redundant masking.\n assembly {\n extraDataCasted := extraData\n }\n packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);\n _packedOwnerships[index] = packed;\n }\n\n /**\n * @dev Called during each token transfer to set the 24bit `extraData` field.\n * Intended to be overridden by the cosumer contract.\n *\n * `previousExtraData` - the value of `extraData` before transfer.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _extraData(\n address from,\n address to,\n uint24 previousExtraData\n ) internal view virtual returns (uint24) {}\n\n /**\n * @dev Returns the next extra data for the packed ownership data.\n * The returned result is shifted into position.\n */\n function _nextExtraData(\n address from,\n address to,\n uint256 prevOwnershipPacked\n ) private view returns (uint256) {\n uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);\n return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;\n }\n\n // =============================================================\n // OTHER OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the message sender (defaults to `msg.sender`).\n *\n * If you are writing GSN compatible contracts, you need to override this function.\n */\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n /**\n * @dev Converts a uint256 to its ASCII string decimal representation.\n */\n function _toString(uint256 value) internal pure virtual returns (string memory str) {\n assembly {\n // The maximum value of a uint256 contains 78 digits (1 byte per digit), but\n // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.\n // We will need 1 word for the trailing zeros padding, 1 word for the length,\n // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.\n let m := add(mload(0x40), 0xa0)\n // Update the free memory pointer to allocate.\n mstore(0x40, m)\n // Assign the `str` to the end.\n str := sub(m, 0x20)\n // Zeroize the slot after the string.\n mstore(str, 0)\n\n // Cache the end of the memory to calculate the length later.\n let end := str\n\n // We write the string from rightmost digit to leftmost digit.\n // The following is essentially a do-while loop that also handles the zero case.\n // prettier-ignore\n for { let temp := value } 1 {} {\n str := sub(str, 1)\n // Write the character to the pointer.\n // The ASCII index of the '0' character is 48.\n mstore8(str, add(48, mod(temp, 10)))\n // Keep dividing `temp` until zero.\n temp := div(temp, 10)\n // prettier-ignore\n if iszero(temp) { break }\n }\n\n let length := sub(end, str)\n // Move the pointer 32 bytes leftwards to make room for the length.\n str := sub(str, 0x20)\n // Store the length.\n mstore(str, length)\n }\n }\n\n /**\n * @dev For more efficient reverts.\n */\n function _revert(bytes4 errorSelector) internal pure {\n assembly {\n mstore(0x00, errorSelector)\n revert(0x00, 0x04)\n }\n }\n}\n" + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol)\n\npragma solidity ^0.8.0;\n\nimport "../IERC20.sol";\nimport "../extensions/IERC20Permit.sol";\nimport "../../../utils/Address.sol";\n\n/**\n * @title SafeERC20\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\n * contract returns false). Tokens that return no value (and instead revert or\n * throw on failure) are also supported, non-reverting calls are assumed to be\n * successful.\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\n */\nlibrary SafeERC20 {\n using Address for address;\n\n /**\n * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\n }\n\n /**\n * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the\n * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.\n */\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\n _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\n }\n\n /**\n * @dev Deprecated. This function has issues similar to the ones found in\n * {IERC20-approve}, and its usage is discouraged.\n *\n * Whenever possible, use {safeIncreaseAllowance} and\n * {safeDecreaseAllowance} instead.\n */\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\n // safeApprove should only be called when setting an initial allowance,\n // or when resetting it to zero. To increase and decrease it, use\n // \'safeIncreaseAllowance\' and \'safeDecreaseAllowance\'\n require(\n (value == 0) || (token.allowance(address(this), spender) == 0),\n "SafeERC20: approve from non-zero to non-zero allowance"\n );\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\n }\n\n /**\n * @dev Increase the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n uint256 oldAllowance = token.allowance(address(this), spender);\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));\n }\n\n /**\n * @dev Decrease the calling contract\'s allowance toward `spender` by `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful.\n */\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\n unchecked {\n uint256 oldAllowance = token.allowance(address(this), spender);\n require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));\n }\n }\n\n /**\n * @dev Set the calling contract\'s allowance toward `spender` to `value`. If `token` returns no value,\n * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval\n * to be set to zero before setting it to a non-zero value, such as USDT.\n */\n function forceApprove(IERC20 token, address spender, uint256 value) internal {\n bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);\n\n if (!_callOptionalReturnBool(token, approvalCall)) {\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));\n _callOptionalReturn(token, approvalCall);\n }\n }\n\n /**\n * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`.\n * Revert on invalid signature.\n */\n function safePermit(\n IERC20Permit token,\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) internal {\n uint256 nonceBefore = token.nonces(owner);\n token.permit(owner, spender, value, deadline, v, r, s);\n uint256 nonceAfter = token.nonces(owner);\n require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n */\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that\n // the target address contains contract code and also asserts for success in the low-level call.\n\n bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");\n require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");\n }\n\n /**\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\n * on the return value: the return value is optional (but if data is returned, it must not be false).\n * @param token The token targeted by the call.\n * @param data The call data (encoded using abi.encode or one of its variants).\n *\n * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.\n */\n function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {\n // We need to perform a low level call here, to bypass Solidity\'s return data size checking mechanism, since\n // we\'re implementing it ourselves. We cannot use {Address-functionCall} here since this should return false\n // and not revert is the subcall reverts.\n\n (bool success, bytes memory returndata) = address(token).call(data);\n return\n success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport "../beacon/IBeacon.sol";\nimport "../../interfaces/IERC1967.sol";\nimport "../../interfaces/draft-IERC1822.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/StorageSlot.sol";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");\n } catch {\n revert("ERC1967Upgrade: new implementation is not UUPS");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), "ERC1967: new admin is the zero address");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256(\'eip1967.proxy.beacon\')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n "ERC1967: beacon implementation is not a contract"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" }, 'src/proxies/openzeppelin/ERC1967Proxy.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "@openzeppelin/contracts/proxy/Proxy.sol";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\n// Note: This implementation is an exact copy with the constructor removed, and pragma and imports updated.\n\npragma solidity ^0.8.19;\n\nimport "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol";\nimport "openzeppelin-contracts/contracts/proxy/Proxy.sol";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn\'t conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/access/IAccessControlEnumerable.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControlEnumerable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n /**\n * @dev Returns one of the accounts that have `role`. `index` must be a\n * value between 0 and {getRoleMemberCount}, non-inclusive.\n *\n * Role bearers are not sorted in any particular way, and their ordering may\n * change at any point.\n *\n * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n * you perform all queries on the same block. See the following\n * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n * for more information.\n */\n function getRoleMember(bytes32 role, uint256 index) external view returns (address);\n\n /**\n * @dev Returns the number of accounts that have `role`. Can be used\n * together with {getRoleMember} to enumerate all bearers of a role.\n */\n function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n' }, - 'lib/openzeppelin/contracts/access/AccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/access/AccessControl.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IAccessControl.sol";\nimport "../utils/Context.sol";\nimport "../utils/Strings.sol";\nimport "../utils/introspection/ERC165.sol";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn\'t allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role\'s admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n "AccessControl: account ",\n Strings.toHexString(account),\n " is missing role ",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role\'s admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``\'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function\'s\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), "AccessControl: can only renounce roles for self");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn\'t perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``\'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/structs/EnumerableSet.sol': { + 'lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```solidity\n * contract Example {\n * // Add the library methods\n * using EnumerableSet for EnumerableSet.AddressSet;\n *\n * // Declare a set state variable\n * EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n *\n * [WARNING]\n * ====\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\n * unusable.\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\n *\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\n * array of EnumerableSet.\n * ====\n */\nlibrary EnumerableSet {\n // To implement this library for multiple types with as little code\n // repetition as possible, we write it in terms of a generic Set type with\n // bytes32 values.\n // The Set implementation uses private functions, and user-facing\n // implementations (such as AddressSet) are just wrappers around the\n // underlying Set.\n // This means that we can only create new EnumerableSets for types that fit\n // in bytes32.\n\n struct Set {\n // Storage of set values\n bytes32[] _values;\n // Position of the value in the `values` array, plus 1 because index 0\n // means a value is not in the set.\n mapping(bytes32 => uint256) _indexes;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function _add(Set storage set, bytes32 value) private returns (bool) {\n if (!_contains(set, value)) {\n set._values.push(value);\n // The value is stored at length-1, but we add 1 to all indexes\n // and use 0 as a sentinel value\n set._indexes[value] = set._values.length;\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function _remove(Set storage set, bytes32 value) private returns (bool) {\n // We read and store the value's index to prevent multiple reads from the same storage slot\n uint256 valueIndex = set._indexes[value];\n\n if (valueIndex != 0) {\n // Equivalent to contains(set, value)\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n // the array, and then remove the last element (sometimes called as 'swap and pop').\n // This modifies the order of the array, as noted in {at}.\n\n uint256 toDeleteIndex = valueIndex - 1;\n uint256 lastIndex = set._values.length - 1;\n\n if (lastIndex != toDeleteIndex) {\n bytes32 lastValue = set._values[lastIndex];\n\n // Move the last value to the index where the value to delete is\n set._values[toDeleteIndex] = lastValue;\n // Update the index for the moved value\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\n }\n\n // Delete the slot where the moved value was stored\n set._values.pop();\n\n // Delete the index for the deleted slot\n delete set._indexes[value];\n\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\n return set._indexes[value] != 0;\n }\n\n /**\n * @dev Returns the number of values on the set. O(1).\n */\n function _length(Set storage set) private view returns (uint256) {\n return set._values.length;\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\n return set._values[index];\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function _values(Set storage set) private view returns (bytes32[] memory) {\n return set._values;\n }\n\n // Bytes32Set\n\n struct Bytes32Set {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _add(set._inner, value);\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n return _remove(set._inner, value);\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\n return _contains(set._inner, value);\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(Bytes32Set storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\n return _at(set._inner, index);\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\n bytes32[] memory store = _values(set._inner);\n bytes32[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // AddressSet\n\n struct AddressSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(AddressSet storage set, address value) internal returns (bool) {\n return _add(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(AddressSet storage set, address value) internal returns (bool) {\n return _remove(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(AddressSet storage set, address value) internal view returns (bool) {\n return _contains(set._inner, bytes32(uint256(uint160(value))));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(AddressSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\n return address(uint160(uint256(_at(set._inner, index))));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(AddressSet storage set) internal view returns (address[] memory) {\n bytes32[] memory store = _values(set._inner);\n address[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n\n // UintSet\n\n struct UintSet {\n Set _inner;\n }\n\n /**\n * @dev Add a value to a set. O(1).\n *\n * Returns true if the value was added to the set, that is if it was not\n * already present.\n */\n function add(UintSet storage set, uint256 value) internal returns (bool) {\n return _add(set._inner, bytes32(value));\n }\n\n /**\n * @dev Removes a value from a set. O(1).\n *\n * Returns true if the value was removed from the set, that is if it was\n * present.\n */\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\n return _remove(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns true if the value is in the set. O(1).\n */\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\n return _contains(set._inner, bytes32(value));\n }\n\n /**\n * @dev Returns the number of values in the set. O(1).\n */\n function length(UintSet storage set) internal view returns (uint256) {\n return _length(set._inner);\n }\n\n /**\n * @dev Returns the value stored at position `index` in the set. O(1).\n *\n * Note that there are no guarantees on the ordering of values inside the\n * array, and it may change when more values are added or removed.\n *\n * Requirements:\n *\n * - `index` must be strictly less than {length}.\n */\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\n return uint256(_at(set._inner, index));\n }\n\n /**\n * @dev Return the entire set in an array\n *\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n */\n function values(UintSet storage set) internal view returns (uint256[] memory) {\n bytes32[] memory store = _values(set._inner);\n uint256[] memory result;\n\n /// @solidity memory-safe-assembly\n assembly {\n result := store\n }\n\n return result;\n }\n}\n" }, - 'lib/openzeppelin/contracts/token/ERC20/IERC20.sol': { + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.sol': { content: - "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.13;\n\nimport { Attestation } from "sequence-v3/src/extensions/sessions/implicit/Attestation.sol";\n\n/// @title IImplicitProjectValidation\n/// @author Michael Standen\n/// @notice Interface for contracts supporting validation of implicit sessions for projects\ninterface IImplicitProjectValidation {\n\n /// @notice Invalid redirect url error\n error InvalidRedirectUrl();\n\n /// @notice Check if a project has a code\n /// @param wallet The wallet address\n /// @param attestation The attestation\n /// @param projectId The project id\n /// @return magic The attestation magic bytes for the wallet address\n function validateAttestation(\n address wallet,\n Attestation calldata attestation,\n bytes32 projectId\n ) external view returns (bytes32);\n\n}\n' }, - 'lib/openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol': { content: - "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' + }, + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.sol': { + content: + '// 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/chiru-labs/erc721a/contracts/IERC721A.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n/**\n * @dev Interface of ERC721A.\n */\ninterface IERC721A {\n /**\n * The caller must own the token or be an approved operator.\n */\n error ApprovalCallerNotOwnerNorApproved();\n\n /**\n * The token does not exist.\n */\n error ApprovalQueryForNonexistentToken();\n\n /**\n * Cannot query the balance for the zero address.\n */\n error BalanceQueryForZeroAddress();\n\n /**\n * Cannot mint to the zero address.\n */\n error MintToZeroAddress();\n\n /**\n * The quantity of tokens minted must be more than zero.\n */\n error MintZeroQuantity();\n\n /**\n * The token does not exist.\n */\n error OwnerQueryForNonexistentToken();\n\n /**\n * The caller must own the token or be an approved operator.\n */\n error TransferCallerNotOwnerNorApproved();\n\n /**\n * The token must be owned by `from`.\n */\n error TransferFromIncorrectOwner();\n\n /**\n * Cannot safely transfer to a contract that does not implement the\n * ERC721Receiver interface.\n */\n error TransferToNonERC721ReceiverImplementer();\n\n /**\n * Cannot transfer to the zero address.\n */\n error TransferToZeroAddress();\n\n /**\n * The token does not exist.\n */\n error URIQueryForNonexistentToken();\n\n /**\n * The `quantity` minted with ERC2309 exceeds the safety limit.\n */\n error MintERC2309QuantityExceedsLimit();\n\n /**\n * The `extraData` cannot be set on an unintialized ownership slot.\n */\n error OwnershipNotInitializedForExtraData();\n\n /**\n * `_sequentialUpTo()` must be greater than `_startTokenId()`.\n */\n error SequentialUpToTooSmall();\n\n /**\n * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.\n */\n error SequentialMintExceedsLimit();\n\n /**\n * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.\n */\n error SpotMintTokenIdTooSmall();\n\n /**\n * Cannot mint over a token that already exists.\n */\n error TokenAlreadyExists();\n\n /**\n * The feature is not compatible with spot mints.\n */\n error NotCompatibleWithSpotMints();\n\n // =============================================================\n // STRUCTS\n // =============================================================\n\n struct TokenOwnership {\n // The address of the owner.\n address addr;\n // Stores the start time of ownership with minimal overhead for tokenomics.\n uint64 startTimestamp;\n // Whether the token has been burned.\n bool burned;\n // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.\n uint24 extraData;\n }\n\n // =============================================================\n // TOKEN COUNTERS\n // =============================================================\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() external view returns (uint256);\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n\n // =============================================================\n // IERC721\n // =============================================================\n\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables\n * (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`,\n * checking first that contract recipients are aware of the ERC721 protocol\n * to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move\n * this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external payable;\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external payable;\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom}\n * whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external payable;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external payable;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n\n // =============================================================\n // IERC2309\n // =============================================================\n\n /**\n * @dev Emitted when tokens in `fromTokenId` to `toTokenId`\n * (inclusive) is transferred from `from` to `to`, as defined in the\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.\n *\n * See {_mintERC2309} for more details.\n */\n event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { Payload } from "../../../modules/Payload.sol";\nimport { Attestation } from "./Attestation.sol";\n\n/// @dev Magic prefix for the implicit request\nbytes32 constant ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX = keccak256(abi.encodePacked("acceptImplicitRequest"));\n\n/// @title ISignalsImplicitMode\n/// @author Agustin Aguilar, Michael Standen\n/// @notice Interface for the contracts that support implicit mode validation\ninterface ISignalsImplicitMode {\n\n /// @notice Determines if an implicit request is valid\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n /// @return magic The hash of the implicit request if valid\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32 magic);\n\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/IERC1967.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../utils/LibBytes.sol";\n\nusing LibBytes for bytes;\n\n/// @title Payload\n/// @author Agustin Aguilar, Michael Standen, William Hua\n/// @notice Library for encoding and decoding payloads\nlibrary Payload {\n\n /// @notice Error thrown when the kind is invalid\n error InvalidKind(uint8 kind);\n\n /// @dev keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")\n bytes32 private constant EIP712_DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n /// @dev keccak256("Sequence Wallet")\n bytes32 private constant EIP712_DOMAIN_NAME_SEQUENCE =\n 0x4aa45ca7ad825ceb1bf35643f0a58c295239df563b1b565c2485f96477c56318;\n\n /// @dev keccak256("3")\n bytes32 private constant EIP712_DOMAIN_VERSION_SEQUENCE =\n 0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de;\n\n function domainSeparator(bool _noChainId, address _wallet) internal view returns (bytes32 _domainSeparator) {\n return keccak256(\n abi.encode(\n EIP712_DOMAIN_TYPEHASH,\n EIP712_DOMAIN_NAME_SEQUENCE,\n EIP712_DOMAIN_VERSION_SEQUENCE,\n _noChainId ? uint256(0) : uint256(block.chainid),\n _wallet\n )\n );\n }\n\n /// @dev keccak256("Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALL_TYPEHASH = 0x0603985259a953da1f65a522f589c17bd1d0117ec1d3abb7c0788aef251ef437;\n\n /// @dev keccak256("Calls(Call[] calls,uint256 space,uint256 nonce,address[] wallets)Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALLS_TYPEHASH = 0x11e1e4079a79a66e4ade50033cfe2678cdd5341d2dfe5ef9513edb1a0be147a2;\n\n /// @dev keccak256("Message(bytes message,address[] wallets)")\n bytes32 private constant MESSAGE_TYPEHASH = 0xe19a3b94fc3c7ece3f890d98a99bc422615537a08dea0603fa8425867d87d466;\n\n /// @dev keccak256("ConfigUpdate(bytes32 imageHash,address[] wallets)")\n bytes32 private constant CONFIG_UPDATE_TYPEHASH = 0x11fdeb7e8373a1aa96bfac8d0ea91526b2c5d15e5cee20e0543e780258f3e8e4;\n\n /// @notice Kind of transaction\n uint8 public constant KIND_TRANSACTIONS = 0x00;\n /// @notice Kind of digest\n uint8 public constant KIND_MESSAGE = 0x01;\n /// @notice Kind of config update\n uint8 public constant KIND_CONFIG_UPDATE = 0x02;\n /// @notice Kind of message\n uint8 public constant KIND_DIGEST = 0x03;\n\n /// @notice Behavior on error: ignore error\n uint8 public constant BEHAVIOR_IGNORE_ERROR = 0x00;\n /// @notice Behavior on error: revert on error\n uint8 public constant BEHAVIOR_REVERT_ON_ERROR = 0x01;\n /// @notice Behavior on error: abort on error\n uint8 public constant BEHAVIOR_ABORT_ON_ERROR = 0x02;\n\n /// @notice Payload call information\n /// @param to Address of the target contract\n /// @param value Value to send with the call\n /// @param data Data to send with the call\n /// @param gasLimit Gas limit for the call\n /// @param delegateCall If the call is a delegate call\n /// @param onlyFallback If the call should only be executed in an error scenario\n /// @param behaviorOnError Behavior on error\n struct Call {\n address to;\n uint256 value;\n bytes data;\n uint256 gasLimit;\n bool delegateCall;\n bool onlyFallback;\n uint256 behaviorOnError;\n }\n\n /// @notice Decoded payload\n /// @param kind Kind of payload\n /// @param noChainId If the chain ID should be omitted\n /// @param calls Array of calls (transaction kind)\n /// @param space Nonce space for the calls (transaction kind)\n /// @param nonce Nonce value for the calls (transaction kind)\n /// @param message Message to validate (message kind)\n /// @param imageHash Image hash to update to (config update kind)\n /// @param digest Digest to validate (digest kind)\n /// @param parentWallets Parent wallets\n struct Decoded {\n uint8 kind;\n bool noChainId;\n // Transaction kind\n Call[] calls;\n uint256 space;\n uint256 nonce;\n // Message kind\n // TODO: Maybe native 721 ?\n bytes message;\n // Config update kind\n bytes32 imageHash;\n // Digest kind for 1271\n bytes32 digest;\n // Parent wallets\n address[] parentWallets;\n }\n\n function fromMessage(\n bytes memory message\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_MESSAGE;\n _decoded.message = message;\n }\n\n function fromConfigUpdate(\n bytes32 imageHash\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_CONFIG_UPDATE;\n _decoded.imageHash = imageHash;\n }\n\n function fromDigest(\n bytes32 digest\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_DIGEST;\n _decoded.digest = digest;\n }\n\n function fromPackedCalls(\n bytes calldata packed\n ) internal view returns (Decoded memory _decoded) {\n _decoded.kind = KIND_TRANSACTIONS;\n\n // Read the global flag\n (uint256 globalFlag, uint256 pointer) = packed.readFirstUint8();\n\n // First bit determines if space is zero or not\n if (globalFlag & 0x01 == 0x01) {\n _decoded.space = 0;\n } else {\n (_decoded.space, pointer) = packed.readUint160(pointer);\n }\n\n // Next 3 bits determine the size of the nonce\n uint256 nonceSize = (globalFlag >> 1) & 0x07;\n\n if (nonceSize > 0) {\n // Read the nonce\n (_decoded.nonce, pointer) = packed.readUintX(pointer, nonceSize);\n }\n\n uint256 numCalls;\n\n // Bit 5 determines if the batch contains a single call\n if (globalFlag & 0x10 == 0x10) {\n numCalls = 1;\n } else {\n // Bit 6 determines if the number of calls uses 1 byte or 2 bytes\n if (globalFlag & 0x20 == 0x20) {\n (numCalls, pointer) = packed.readUint16(pointer);\n } else {\n (numCalls, pointer) = packed.readUint8(pointer);\n }\n }\n\n // Read the calls\n _decoded.calls = new Call[](numCalls);\n\n for (uint256 i = 0; i < numCalls; i++) {\n uint8 flags;\n (flags, pointer) = packed.readUint8(pointer);\n\n // First bit determines if this is a call to self\n // or a call to another address\n if (flags & 0x01 == 0x01) {\n // Call to self\n _decoded.calls[i].to = address(this);\n } else {\n // Call to another address\n (_decoded.calls[i].to, pointer) = packed.readAddress(pointer);\n }\n\n // Second bit determines if the call has value or not\n if (flags & 0x02 == 0x02) {\n (_decoded.calls[i].value, pointer) = packed.readUint256(pointer);\n }\n\n // Third bit determines if the call has data or not\n if (flags & 0x04 == 0x04) {\n // 3 bytes determine the size of the calldata\n uint256 calldataSize;\n (calldataSize, pointer) = packed.readUint24(pointer);\n _decoded.calls[i].data = packed[pointer:pointer + calldataSize];\n pointer += calldataSize;\n }\n\n // Fourth bit determines if the call has a gas limit or not\n if (flags & 0x08 == 0x08) {\n (_decoded.calls[i].gasLimit, pointer) = packed.readUint256(pointer);\n }\n\n // Fifth bit determines if the call is a delegate call or not\n _decoded.calls[i].delegateCall = (flags & 0x10 == 0x10);\n\n // Sixth bit determines if the call is fallback only\n _decoded.calls[i].onlyFallback = (flags & 0x20 == 0x20);\n\n // Last 2 bits are directly mapped to the behavior on error\n _decoded.calls[i].behaviorOnError = (flags & 0xC0) >> 6;\n }\n }\n\n function hashCall(\n Call memory c\n ) internal pure returns (bytes32) {\n return keccak256(\n abi.encode(\n CALL_TYPEHASH, c.to, c.value, keccak256(c.data), c.gasLimit, c.delegateCall, c.onlyFallback, c.behaviorOnError\n )\n );\n }\n\n function hashCalls(\n Call[] memory calls\n ) internal pure returns (bytes32) {\n // In EIP712, an array is often hashed as the keccak256 of the concatenated\n // hashes of each item. So we hash each Call, pack them, and hash again.\n bytes32[] memory callHashes = new bytes32[](calls.length);\n for (uint256 i = 0; i < calls.length; i++) {\n callHashes[i] = hashCall(calls[i]);\n }\n return keccak256(abi.encodePacked(callHashes));\n }\n\n function toEIP712(\n Decoded memory _decoded\n ) internal pure returns (bytes32) {\n bytes32 walletsHash = keccak256(abi.encodePacked(_decoded.parentWallets));\n\n if (_decoded.kind == KIND_TRANSACTIONS) {\n bytes32 callsHash = hashCalls(_decoded.calls);\n // The top-level struct for Calls might be something like:\n // Calls(bytes32 callsHash,uint256 space,uint256 nonce,bytes32 walletsHash)\n return keccak256(abi.encode(CALLS_TYPEHASH, callsHash, _decoded.space, _decoded.nonce, walletsHash));\n } else if (_decoded.kind == KIND_MESSAGE) {\n // If you define your top-level as: Message(bytes32 messageHash,bytes32 walletsHash)\n return keccak256(abi.encode(MESSAGE_TYPEHASH, keccak256(_decoded.message), walletsHash));\n } else if (_decoded.kind == KIND_CONFIG_UPDATE) {\n // Top-level: ConfigUpdate(bytes32 imageHash,bytes32 walletsHash)\n return keccak256(abi.encode(CONFIG_UPDATE_TYPEHASH, _decoded.imageHash, walletsHash));\n } else if (_decoded.kind == KIND_DIGEST) {\n // Top-level: Use MESSAGE_TYPEHASH but assume the digest is already the hashed message\n return keccak256(abi.encode(MESSAGE_TYPEHASH, _decoded.digest, walletsHash));\n } else {\n // Unknown kind\n revert InvalidKind(_decoded.kind);\n }\n }\n\n function hash(\n Decoded memory _decoded\n ) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, address(this));\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n function hashFor(Decoded memory _decoded, address _wallet) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, _wallet);\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n}\n' + }, + 'lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol': { + content: + "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the amount of tokens in existence.\n */\n function totalSupply() external view returns (uint256);\n\n /**\n * @dev Returns the amount of tokens owned by `account`.\n */\n function balanceOf(address account) external view returns (uint256);\n\n /**\n * @dev Moves `amount` tokens from the caller's account to `to`.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transfer(address to, uint256 amount) external returns (bool);\n\n /**\n * @dev Returns the remaining number of tokens that `spender` will be\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\n * zero by default.\n *\n * This value changes when {approve} or {transferFrom} are called.\n */\n function allowance(address owner, address spender) external view returns (uint256);\n\n /**\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\n * that someone may use both the old and the new allowance by unfortunate\n * transaction ordering. One possible solution to mitigate this race\n * condition is to first reduce the spender's allowance to 0 and set the\n * desired value afterwards:\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n *\n * Emits an {Approval} event.\n */\n function approve(address spender, uint256 amount) external returns (bool);\n\n /**\n * @dev Moves `amount` tokens from `from` to `to` using the\n * allowance mechanism. `amount` is then deducted from the caller's\n * allowance.\n *\n * Returns a boolean value indicating whether the operation succeeded.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\n}\n" + }, + 'lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol': { + content: + "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/IERC20Permit.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\n *\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\n * need to send a transaction, and thus is not required to hold Ether at all.\n */\ninterface IERC20Permit {\n /**\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\n * given ``owner``'s signed approval.\n *\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\n * ordering also apply here.\n *\n * Emits an {Approval} event.\n *\n * Requirements:\n *\n * - `spender` cannot be the zero address.\n * - `deadline` must be a timestamp in the future.\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\n * over the EIP712-formatted function arguments.\n * - the signature must use ``owner``'s current nonce (see {nonces}).\n *\n * For more information on the signature format, see the\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\n * section].\n */\n function permit(\n address owner,\n address spender,\n uint256 value,\n uint256 deadline,\n uint8 v,\n bytes32 r,\n bytes32 s\n ) external;\n\n /**\n * @dev Returns the current nonce for `owner`. This value must be\n * included whenever a signature is generated for {permit}.\n *\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\n * prevents a signature from being used multiple times.\n */\n function nonces(address owner) external view returns (uint256);\n\n /**\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\n */\n // solhint-disable-next-line func-name-mixedcase\n function DOMAIN_SEPARATOR() external view returns (bytes32);\n}\n" + }, + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/draft-IERC1822.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n' }, - 'lib/openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/access/IAccessControl.sol': { + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" }, - 'lib/openzeppelin/contracts/utils/Strings.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport "./math/Math.sol";\nimport "./math/SignedMath.sol";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = "0123456789abcdef";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = "0";\n buffer[1] = "x";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, "Strings: hex length insufficient");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/ERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IERC165.sol";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/Math.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/utils/LibBytes.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.18;\n\n/// @title Library for reading data from bytes arrays\n/// @author Agustin Aguilar (aa@horizon.io), Michael Standen (mstan@horizon.io)\n/// @notice This library contains functions for reading data from bytes arrays.\n/// @dev These functions do not check if the input index is within the bounds of the data array.\n/// @dev Reading out of bounds may return dirty values.\nlibrary LibBytes {\n\n function readFirstUint8(\n bytes calldata _data\n ) internal pure returns (uint8 a, uint256 newPointer) {\n assembly {\n let word := calldataload(_data.offset)\n a := shr(248, word)\n newPointer := 1\n }\n }\n\n function readUint8(bytes calldata _data, uint256 _index) internal pure returns (uint8 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(248, word)\n newPointer := add(_index, 1)\n }\n }\n\n function readUint16(bytes calldata _data, uint256 _index) internal pure returns (uint16 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(240, word)\n newPointer := add(_index, 2)\n }\n }\n\n function readUint24(bytes calldata _data, uint256 _index) internal pure returns (uint24 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(232, word)\n newPointer := add(_index, 3)\n }\n }\n\n function readUint64(bytes calldata _data, uint256 _index) internal pure returns (uint64 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(192, word)\n newPointer := add(_index, 8)\n }\n }\n\n function readUint160(bytes calldata _data, uint256 _index) internal pure returns (uint160 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := shr(96, word)\n newPointer := add(_index, 20)\n }\n }\n\n function readUint256(bytes calldata _data, uint256 _index) internal pure returns (uint256 a, uint256 newPointer) {\n assembly {\n a := calldataload(add(_index, _data.offset))\n newPointer := add(_index, 32)\n }\n }\n\n function readUintX(\n bytes calldata _data,\n uint256 _index,\n uint256 _length\n ) internal pure returns (uint256 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n let shift := sub(256, mul(_length, 8))\n a := and(shr(shift, word), sub(shl(mul(8, _length), 1), 1))\n newPointer := add(_index, _length)\n }\n }\n\n function readBytes4(bytes calldata _data, uint256 _pointer) internal pure returns (bytes4 a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_pointer, _data.offset))\n a := and(word, 0xffffffff00000000000000000000000000000000000000000000000000000000)\n newPointer := add(_pointer, 4)\n }\n }\n\n function readBytes32(bytes calldata _data, uint256 _pointer) internal pure returns (bytes32 a, uint256 newPointer) {\n assembly {\n a := calldataload(add(_pointer, _data.offset))\n newPointer := add(_pointer, 32)\n }\n }\n\n function readAddress(bytes calldata _data, uint256 _index) internal pure returns (address a, uint256 newPointer) {\n assembly {\n let word := calldataload(add(_index, _data.offset))\n a := and(shr(96, word), 0xffffffffffffffffffffffffffffffffffffffff)\n newPointer := add(_index, 20)\n }\n }\n\n /// @dev ERC-2098 Compact Signature\n function readRSVCompact(\n bytes calldata _data,\n uint256 _index\n ) internal pure returns (bytes32 r, bytes32 s, uint8 v, uint256 newPointer) {\n uint256 yParityAndS;\n assembly {\n r := calldataload(add(_index, _data.offset))\n yParityAndS := calldataload(add(_index, add(_data.offset, 32)))\n newPointer := add(_index, 64)\n }\n uint256 yParity = uint256(yParityAndS >> 255);\n s = bytes32(uint256(yParityAndS) & ((1 << 255) - 1));\n v = uint8(yParity) + 27;\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/SignedMath.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/Math.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n // Solidity will revert if denominator == 0, unlike the div opcode on its own.\n // The surrounding unchecked block does not change this fact.\n // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1, "Math: mulDiv overflow");\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel\'s lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don\'t need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.\'s "Hacker\'s Delight" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton\'s method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10 ** 64) {\n value /= 10 ** 64;\n result += 64;\n }\n if (value >= 10 ** 32) {\n value /= 10 ** 32;\n result += 32;\n }\n if (value >= 10 ** 16) {\n value /= 10 ** 16;\n result += 16;\n }\n if (value >= 10 ** 8) {\n value /= 10 ** 8;\n result += 8;\n }\n if (value >= 10 ** 4) {\n value /= 10 ** 4;\n result += 4;\n }\n if (value >= 10 ** 2) {\n value /= 10 ** 2;\n result += 2;\n }\n if (value >= 10 ** 1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 256, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);\n }\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/utils/math/SignedMath.sol': { content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n' + '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book "Hacker\'s Delight"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n' } }, settings: { - evmVersion: 'paris', - libraries: {}, + remappings: [ + '@openzeppelin/contracts/=lib/murky/lib/openzeppelin-contracts/contracts/', + 'ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/', + 'erc2470-libs/=lib/erc2470-libs/', + 'erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/', + 'forge-std/=lib/forge-std/src/', + 'halmos-cheatcodes/=lib/signals-implicit-mode/lib/sequence-v3/lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/', + 'murky/=lib/murky/', + 'openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/', + 'openzeppelin-contracts/=lib/openzeppelin-contracts/', + 'openzeppelin/=lib/openzeppelin-contracts-upgradeable/contracts/', + 'sequence-v3/=lib/signals-implicit-mode/lib/sequence-v3/', + 'signals-implicit-mode/=lib/signals-implicit-mode/', + 'solady/=lib/solady/src/' + ], + optimizer: { + enabled: false, + runs: 200 + }, metadata: { useLiteralContent: true, bytecodeHash: 'ipfs', appendCBOR: true }, - optimizer: { enabled: true, runs: 20000 }, - remappings: [ - '@0xsequence/contracts-library/=src/', - 'ds-test/=lib/forge-std/lib/ds-test/src/', - 'forge-std/=lib/forge-std/src/', - 'murky/=lib/murky/src/', - '@0xsequence/erc20-meta-token/=lib/0xsequence/erc20-meta-token/src/', - '@0xsequence/erc-1155/=lib/0xsequence/erc-1155/src/', - 'erc721a/=lib/chiru-labs/erc721a/', - 'erc721a-upgradeable/=lib/chiru-labs/erc721a-upgradeable/', - '@openzeppelin/=lib/openzeppelin/', - '@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'solady/=lib/solady/src/', - '0xsequence/=lib/0xsequence/', - 'chiru-labs/=lib/chiru-labs/', - 'erc4626-tests/=lib/openzeppelin/lib/erc4626-tests/', - 'openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'openzeppelin-contracts/=lib/murky/lib/openzeppelin-contracts/', - 'openzeppelin/=lib/openzeppelin/' - ], - viaIR: true, outputSelection: { '*': { '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] } - } + }, + evmVersion: 'paris', + viaIR: true, + libraries: {} } } } diff --git a/scripts/factories/token_library/ERC721SoulboundFactory.ts b/scripts/factories/token_library/ERC721SoulboundFactory.ts index 40f444b..39bc10f 100644 --- a/scripts/factories/token_library/ERC721SoulboundFactory.ts +++ b/scripts/factories/token_library/ERC721SoulboundFactory.ts @@ -1,226 +1,14 @@ import { ContractFactory, type ethers } from 'ethers' import type { VerificationRequest } from 'scripts/types' +import { FACTORY_DEFAULT_ABI } from './constants' -// https://github.com/0xsequence/contracts-library/blob/314bd2b23fe5b105cc0cf89fbdc005c5053ef062/src/tokens/ERC721/presets/soulbound/ERC721SoulboundFactory.sol - -const abi = [ - { - inputs: [ - { - internalType: 'address', - name: 'factoryOwner', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'constructor' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - name: 'ERC721SoulboundDeployed', - 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' - }, - { - inputs: [], - name: 'beacon', - outputs: [ - { - internalType: 'contract UpgradeableBeacon', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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' - } - ], - name: 'deploy', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'proxyOwner', - type: 'address' - }, - { - internalType: 'address', - name: 'tokenOwner', - type: 'address' - }, - { - internalType: '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' - } - ], - name: 'determineAddress', - outputs: [ - { - internalType: 'address', - name: 'proxyAddr', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'owner', - outputs: [ - { - internalType: 'address', - name: '', - type: 'address' - } - ], - stateMutability: 'view', - type: 'function' - }, - { - inputs: [], - name: 'renounceOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'newOwner', - type: 'address' - } - ], - name: 'transferOwnership', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - }, - { - inputs: [ - { - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'upgradeBeacon', - outputs: [], - stateMutability: 'nonpayable', - type: 'function' - } -] +// https://github.com/0xsequence/contracts-library/blob/8a229e34702984b948bd2ac82059388ed08cbe4b/src/tokens/ERC721/presets/soulbound/ERC721SoulboundFactory.sol export class ERC721SoulboundFactory extends ContractFactory { constructor(signer?: ethers.Signer) { super( - abi, - '0x608034610125576001600160401b0390601f62006a4c38819003918201601f191683019291908484118385101761010f57816020928492604096875283398101031261012557516001600160a01b038082168203610125576100603361012a565b82519361456394858101958187108388111761010f57620024e9823980600096039086f0908115610105578451916105ee808401928311848410176100f1579184849260209462001efb853916815203019085f080156100e4576100d69394501660018060a01b0319600154161760015561012a565b51611d899081620001728239f35b50505051903d90823e3d90fd5b634e487b7160e01b88526041600452602488fd5b84513d87823e3d90fd5b634e487b7160e01b600052604160045260246000fd5b600080fd5b600080546001600160a01b039283166001600160a01b03198216811783559216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a356fe6080604052600436101561001257600080fd5b6000803560e01c80631bce4583146106bb57806325a570b8146103dd57806359659e901461038b57806364efee8814610291578063715018a6146101f45780638da5cb5b146101a35763f2fde38b1461006a57600080fd5b346101a05760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a0576100a161077e565b6100a96109a7565b73ffffffffffffffffffffffffffffffffffffffff80911690811561011c57600054827fffffffffffffffffffffffff0000000000000000000000000000000000000000821617600055167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b80fd5b50346101a057807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a05773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b50346101a057807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a05761022b6109a7565b600073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b50346101a0576103476055600b6102c76102aa366108bb565b9160409c979b96959c9893985198899560209e8f88019889610a8c565b03936102f97fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe095868101835282610805565b519020926040519261030a846107e9565b835273ffffffffffffffffffffffffffffffffffffffff9661033b8860015416946040519586938c85019889610b12565b03908101835282610805565b5190206111eb60405161035c87830182610805565b81815286810191610b69833951902090604051916040830152858201523081520160ff81532060405191168152f35b50346101a057807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a057602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b50346101a05761043e6104126103f2366108bb565b9293829986829a86858b9a9b96978a604051978896602088019a8b610a8c565b037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08101835282610805565b5190209760405161044e816107e9565b8a815273ffffffffffffffffffffffffffffffffffffffff998a600154166104858a61041285604051948593602085019788610b12565b5190206111eb9060405161049c6020840182610805565b8281526020810192610b69843980511561065d57518c928ef516998a156105ff578b988160015416908c3b156105fb578a92838e9261051d604051978896879586947fcf7a1d770000000000000000000000000000000000000000000000000000000086521660048501526024840152606060448401526064830190610a49565b03925af19081156105f05788916105dc575b5050883b156105d8576105709360405198899788977f98dd69c800000000000000000000000000000000000000000000000000000000895260048901610a8c565b038183865af180156105cd576105b5575b6020827f47e27c5ab10c568fd18ff716738c5dd5257732e878dd2ca116c5b4af900d9e3d82604051838152a1604051908152f35b6105bf83916107a6565b6105c95781610581565b5080fd5b6040513d85823e3d90fd5b8680fd5b6105e5906107a6565b6105d857863861052f565b6040513d8a823e3d90fd5b8a80fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f437265617465323a204661696c6564206f6e206465706c6f79000000000000006044820152fd5b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f437265617465323a2062797465636f6465206c656e677468206973207a65726f6044820152fd5b50346101a05760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101a0576106f361077e565b6106fb6109a7565b8173ffffffffffffffffffffffffffffffffffffffff806001541692833b1561077a576024908360405195869485937f3659cfe60000000000000000000000000000000000000000000000000000000085521660048401525af1801561076f57610763575080f35b61076c906107a6565b80f35b6040513d84823e3d90fd5b8280fd5b6004359073ffffffffffffffffffffffffffffffffffffffff821682036107a157565b600080fd5b67ffffffffffffffff81116107ba57604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176107ba57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176107ba57604052565b81601f820112156107a15780359067ffffffffffffffff82116107ba576040519261089960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8601160185610805565b828452602083830101116107a157816000926020809301838601378301015290565b6101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc8201126107a15773ffffffffffffffffffffffffffffffffffffffff9160043583811681036107a1579260243581811681036107a1579267ffffffffffffffff916044358381116107a1578261093791600401610846565b936064358481116107a1578361094f91600401610846565b936084358181116107a1578461096791600401610846565b9360a4359182116107a15761097e91600401610846565b9160c43590811681036107a1579060e4356bffffffffffffffffffffffff811681036107a15790565b73ffffffffffffffffffffffffffffffffffffffff6000541633036109c857565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b60005b838110610a395750506000910152565b8181015183820152602001610a29565b907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f602093610a8581518092818752878088019101610a26565b0116010190565b9597969294610af76bffffffffffffffffffffffff95610ae960c098610adb610b05969760e060208e73ffffffffffffffffffffffffffffffffffffffff809c168152015260e08d0190610a49565b908b820360408d0152610a49565b9089820360608b0152610a49565b908782036080890152610a49565b961660a085015216910152565b9190926048949383527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000809260601b16602084015260601b166034820152610b638251809360208685019101610a26565b01019056fe60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea264697066735822122045004168ba82273e43eeb6c01989363db864f4e92bc6bcc90fadfdb4a6c90d8564736f6c63430008130033a2646970667358221220c07a7fc95409381c3f8e890cd4a9645c01cbd77ef2525ed0f7a2056eab750e3364736f6c6343000813003360803461011a57601f6105ee38819003918201601f19168301916001600160401b0383118484101761011f5780849260209460405283398101031261011a57516001600160a01b03808216919082820361011a576000549160018060a01b0319923384821617600055604051923391167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a33b156100b2575060015416176001556040516104b890816101368239f35b62461bcd60e51b815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152608490fd5b600080fd5b634e487b7160e01b600052604160045260246000fdfe6080604052600436101561001257600080fd5b6000803560e01c80633659cfe6146102ce5780635c60da1b1461027c578063715018a6146101e05780638da5cb5b1461018f5763f2fde38b1461005457600080fd5b3461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff808216809203610188576100ad610403565b8115610104578254827fffffffffffffffffffffffff00000000000000000000000000000000000000008216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b8280fd5b80fd5b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5773ffffffffffffffffffffffffffffffffffffffff6020915416604051908152f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57610217610403565b8073ffffffffffffffffffffffffffffffffffffffff81547fffffffffffffffffffffffff000000000000000000000000000000000000000081168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b503461018c57807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c57602073ffffffffffffffffffffffffffffffffffffffff60015416604051908152f35b503461018c5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261018c5760043573ffffffffffffffffffffffffffffffffffffffff81169081810361018857610328610403565b3b1561037f57807fffffffffffffffffffffffff000000000000000000000000000000000000000060015416176001557fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8280a280f35b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60448201527f6e206973206e6f74206120636f6e7472616374000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff60005416330361042457565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fdfea26469706673582212201342d7da4ff651b86bceb8a63d98cff68dd07c475146281deaa480413570ea7564736f6c6343000813003360a06040523462000146576200001462000161565b6200001e62000161565b81516001600160401b038111620001405762000047816200004160025462000185565b620001c2565b602080601f8311600114620000af575081906200008294600092620000a3575b50508160011b916000199060031b1c19161760025562000274565b60008055336080526040516141fb908162000368823960805181613cd30152f35b01519050388062000067565b60026000529193601f1985167f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace936000905b82821062000127575050916001939186620000829794106200010d575b505050811b0160025562000274565b015160001960f88460031b161c19169055388080620000fe565b80600186978294978701518155019601940190620000e1565b6200014b565b600080fd5b634e487b7160e01b600052604160045260246000fd5b60405190602082016001600160401b03811183821017620001405760405260008252565b90600182811c92168015620001b7575b6020831014620001a157565b634e487b7160e01b600052602260045260246000fd5b91607f169162000195565b601f8111620001cf575050565b6000906002825260208220906020601f850160051c8301941062000210575b601f0160051c01915b8281106200020457505050565b818155600101620001f7565b9092508290620001ee565b601f811162000228575050565b6000906003825260208220906020601f850160051c8301941062000269575b601f0160051c01915b8281106200025d57505050565b81815560010162000250565b909250829062000247565b80519091906001600160401b0381116200014057620002a0816200029a60035462000185565b6200021b565b602080601f8311600114620002df5750819293600092620002d3575b50508160011b916000199060031b1c191617600355565b015190503880620002bc565b6003600052601f198316949091907fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b926000905b8782106200034e57505083600195961062000334575b505050811b01600355565b015160001960f88460031b161c1916905538808062000329565b806001859682949686015181550195019301906200031356fe6080604052600436101561001257600080fd5b60003560e01c806301ffc9a71461029757806304634d8d1461029257806306fdde031461028d578063081812fc14610288578063095ea7b31461028357806318160ddd1461027e57806323b872dd14610279578063248a9ca3146102745780632a55205a1461026f5780632f2ff15d1461026a57806335e60bd41461026557806336568abe1461026057806340c10f191461025b57806342842e0e1461025657806342966c68146102515780635944c7531461024c5780635a446215146102475780635bbb2177146102425780636352211e1461023d57806368a37ae81461023857806370a08231146102335780637e518ec81461022e578063842f9b68146102295780638462151c146102245780639010d07c1461021f57806391d148541461021a578063938e3d7b1461021557806395d89b411461021057806398dd69c81461020b57806399a2557a14610206578063a217fddf14610201578063a22cb465146101fc578063b88d4fde146101f7578063c23dc68f146101f2578063c87b56dd146101ed578063ca15c873146101e8578063d547741f146101e3578063dc8e92ea146101de578063e8a3d485146101d95763e985e9c5146101d457600080fd5b612057565b611fb0565b611f29565b611eea565b611ebe565b611d52565b611ce0565b611c85565b611bb6565b611b9a565b611a0a565b61196c565b6118c5565b6117c6565b611766565b611713565b611587565b611526565b611427565b6113d1565b611396565b61135a565b6112f4565b61112a565b610eb8565b610e9c565b610e79565b610d61565b610c9b565b610b40565b6109fd565b61092c565b6108fd565b6108eb565b610886565b610767565b6106ed565b6105ee565b61054e565b6102cb565b7fffffffff000000000000000000000000000000000000000000000000000000008116036102c657565b600080fd5b346102c65760206003193601126102c65761034e6004356102eb8161029c565b7fffffffff00000000000000000000000000000000000000000000000000000000811690817fb1c990bc0000000000000000000000000000000000000000000000000000000014918215610352575b505060405190151581529081906020820190565b0390f35b7f40c10f190000000000000000000000000000000000000000000000000000000081149250908215610388575b5050388061033a565b7fc21b8f280000000000000000000000000000000000000000000000000000000082149250908215610485575b82156103f4575b5081156103e3575b81156103d3575b50388061037f565b6103dd915061405f565b386103cb565b90506103ee8161405f565b906103c4565b9091507f01ffc9a700000000000000000000000000000000000000000000000000000000811490811561045b575b8115610431575b5090386103bc565b7f5b5e139f0000000000000000000000000000000000000000000000000000000091501438610429565b7f80ac58cd0000000000000000000000000000000000000000000000000000000081149150610422565b7f8446a79e00000000000000000000000000000000000000000000000000000000811492506103b5565b6004359073ffffffffffffffffffffffffffffffffffffffff821682036102c657565b6024359073ffffffffffffffffffffffffffffffffffffffff821682036102c657565b60a4359073ffffffffffffffffffffffffffffffffffffffff821682036102c657565b604435906bffffffffffffffffffffffff821682036102c657565b60c435906bffffffffffffffffffffffff821682036102c657565b346102c65760406003193601126102c6576105676104af565b6024356bffffffffffffffffffffffff811681036102c6576105909161058b612957565b613f09565b005b60005b8381106105a55750506000910152565b8181015183820152602001610595565b90601f19601f6020936105d381518092818752878088019101610592565b0116010190565b9060206105eb9281815201906105b5565b90565b346102c6576000806003193601126106ea576040519080600e546106118161359c565b808552916001918083169081156106a25750600114610647575b61034e8561063b8187038261108a565b604051918291826105da565b9250600e83527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd5b82841061068a57505050810160200161063b8261034e61062b565b8054602085870181019190915290930192810161066f565b86955061034e9693506020925061063b9491507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001682840152151560051b820101929361062b565b80fd5b346102c65760206003193601126102c65760043561070a8161228c565b1561073d576000526006602052602073ffffffffffffffffffffffffffffffffffffffff60406000205416604051908152f35b7fcf4700e40000000000000000000000000000000000000000000000000000000060005260046000fd5b60406003193601126102c65761077b6104af565b60243573ffffffffffffffffffffffffffffffffffffffff8061079d83612152565b169081330361081d575b600083815260066020526040812080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff87161790559316907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258480a480f35b81600052600760205260ff6108563360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166107a7577fcfb3b9420000000000000000000000000000000000000000000000000000000060005260046000fd5b346102c65760006003193601126102c65760206000546001549003604051908152f35b60031960609101126102c65773ffffffffffffffffffffffffffffffffffffffff9060043582811681036102c6579160243590811681036102c6579060443590565b6105906108f7366108a9565b916122ed565b346102c65760206003193601126102c657600435600052600b6020526020600160406000200154604051908152f35b346102c65760406003193601126102c657600435600052600a60205260406000206040519061095a8261104d565b549073ffffffffffffffffffffffffffffffffffffffff82169182825260a01c602082015290156109ef575b6109c66127106109aa6bffffffffffffffffffffffff602085015116602435612fd0565b04915173ffffffffffffffffffffffffffffffffffffffff1690565b6040805173ffffffffffffffffffffffffffffffffffffffff9290921682526020820192909252f35b506109f8612f9d565b610986565b346102c65760406003193601126102c657600435610aa5610a1c6104d2565b73ffffffffffffffffffffffffffffffffffffffff610a9d600094808652600b602052610a4f6001604088200154612a56565b808652600b60205260ff610a8685604089209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b541615610aa957600052600c602052604060002090565b911690613418565b5080f35b808652600b602052610ade84604088209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533838516827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8980a4600052600c602052604060002090565b346102c65760206003193601126102c6576004358015158091036102c6573360009081527f6937e6b1cde141aad05c7d03126a39eb070a9f0f221c44303558fa7a951a7435602052604090205460ff1615610bcc577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff61ff006011549260081b16911617601155600080f35b610c976048610c65610bdd336130d1565b610c57610be861316e565b6040519485937f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006020860152610c28815180926020603789019101610592565b84017f206973206d697373696e6720726f6c65200000000000000000000000000000006037820152019061213b565b03601f19810183528261108a565b6040519182917f08c379a0000000000000000000000000000000000000000000000000000000008352600483016105da565b0390fd5b346102c65760406003193601126102c657610cb46104d2565b3373ffffffffffffffffffffffffffffffffffffffff821603610cdd5761059090600435612ea9565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152fd5b346102c65760406003193601126102c657610d7a6104af565b60243590610d866129ac565b6000918254918115610e7457610d9a613fe1565b600191610e0073ffffffffffffffffffffffffffffffffffffffff83169284831460e11b4260a01b178417610dd9876000526004602052604060002090565b5573ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b68010000000000000001820281540190558115610e6f578301929180805b610e2a575b8585815580f35b15610e5e575b84818484887fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8180a4610e1e565b80920191838303610e305780610e23565b612710565b6126e6565b610590610e85366108a9565b9060405192610e938461106e565b60008452612505565b346102c65760206003193601126102c657610590600435613a64565b346102c65760606003193601126102c657610ed16104d2565b610ed9610518565b90610ee2612957565b610efe6127106bffffffffffffffffffffffff84161115613e7e565b73ffffffffffffffffffffffffffffffffffffffff811615610fc057610f5d61059092610f48610f2c6110ad565b73ffffffffffffffffffffffffffffffffffffffff9094168452565b6bffffffffffffffffffffffff166020830152565b610f73600435600052600a602052604060002090565b815160209092015160a01b7fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040810190811067ffffffffffffffff82111761106957604052565b61101e565b6020810190811067ffffffffffffffff82111761106957604052565b90601f601f19910116810190811067ffffffffffffffff82111761106957604052565b604051906110ba8261104d565b565b67ffffffffffffffff811161106957601f01601f191660200190565b9291926110e4826110bc565b916110f2604051938461108a565b8294818452818301116102c6578281602093846000960137010152565b9080601f830112156102c6578160206105eb933591016110d8565b346102c65760406003193601126102c65767ffffffffffffffff6004358181116102c65761115c90369060040161110f565b906024358181116102c65761117590369060040161110f565b9061117e612a01565b82519081116110695761119b81611196600e5461359c565b6135ef565b602080601f83116001146111dc57508190610590946000926111d1575b50506000198260011b9260031b1c191617600e556137b3565b0151905038806111b8565b600e6000529193601f1985167fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd936000905b82821061124f575050916001939186610590979410611236575b505050811b01600e556137b3565b015160001960f88460031b161c19169055388080611228565b8060018697829497870151815501960194019061120e565b6020908160408183019282815285518094520193019160005b82811061128e575050505090565b90919293826080826112e8600194895162ffffff6060809273ffffffffffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565b01950193929101611280565b346102c65760206003193601126102c65767ffffffffffffffff6004358181116102c657366023820112156102c65780600401359182116102c6573660248360051b830101116102c65761034e91602461134e9201612917565b60405191829182611267565b346102c65760206003193601126102c657602073ffffffffffffffffffffffffffffffffffffffff61138d600435612152565b16604051908152f35b346102c65760006003193601126102c65760206040517f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c8152f35b346102c65760206003193601126102c65760206113f46113ef6104af565b6120c7565b604051908152f35b60206003198201126102c6576004359067ffffffffffffffff82116102c6576105eb9160040161110f565b346102c657611435366113fc565b61143d612a01565b805167ffffffffffffffff8111611069576114628161145d600d5461359c565b613660565b602080601f831160011461149f57508192600092611494575b50506000198260011b9260031b1c191617600d55600080f35b01519050388061147b565b90601f198316936114d2600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590565b926000905b86821061150e57505083600195106114f5575b505050811b01600d55005b015160001960f88460031b161c191690553880806114ea565b806001859682949686015181550195019301906114d7565b346102c65760006003193601126102c657602060ff60115460081c166040519015158152f35b6020908160408183019282815285518094520193019160005b828110611573575050505090565b835185529381019392810192600101611565565b346102c65760206003193601126102c6576115a06104af565b60008054906060809280159283156115c1575b6040518061034e878261154c565b9491935083929091859161170e576115d8816120c7565b95866115f2575b505050505061034e9150388080806115b3565b90919293945085841115611705575b60409283519560019384890160051b88019889875261161e612842565b9084916116346116308a830151151590565b1590565b6116e6575b50849591959887805b611662575b5050505050505050505061034e9250815238808080806115df565b156116c8575b859661167384612899565b808b0151156116905750508786935b0196888d8b52979397611642565b93909351806116c0575b50848418861b156116ad575b8890611682565b998801600581901b8c018b9052996116a6565b93503861169a565b80831480156116dd575b156116685780611647565b50818a146116d2565b5173ffffffffffffffffffffffffffffffffffffffff16915038611639565b94508294611601565b6127e2565b346102c65760406003193601126102c657600435600052600c602052602073ffffffffffffffffffffffffffffffffffffffff61175660243560406000206133e2565b9190546040519260031b1c168152f35b346102c65760406003193601126102c657602060ff6117ba6117866104d2565b600435600052600b845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b54166040519015158152f35b346102c6576117d4366113fc565b6117dc612a01565b805167ffffffffffffffff811161106957611801816117fc60105461359c565b6136d1565b602080601f831160011461183e57508192600092611833575b50506000198260011b9260031b1c191617601055600080f35b01519050388061181a565b90601f1983169361187160106000527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae67290565b926000905b8682106118ad5750508360019510611894575b505050811b01601055005b015160001960f88460031b161c19169055388080611889565b80600185968294968601518155019501930190611876565b346102c6576000806003193601126106ea576040519080600f546118e88161359c565b808552916001918083169081156106a257506001146119115761034e8561063b8187038261108a565b9250600f83527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac8025b82841061195457505050810160200161063b8261034e61062b565b80546020858701810191909152909301928101611939565b346102c65760e06003193601126102c6576119856104af565b67ffffffffffffffff906024358281116102c6576119a790369060040161110f565b6044358381116102c6576119bf90369060040161110f565b6064358481116102c6576119d790369060040161110f565b6084359485116102c6576119f261059095369060040161110f565b916119fb6104f5565b93611a04610533565b95613c81565b346102c6576060806003193601126102c657611a246104af565b60243591906044358383828083101561170e5760005480911015611b92575b50611a4d846120c7565b9183871015611b89575b82611a6b575b6040518061034e888261154c565b90919293945085840383811115611b81575b50604092835195600193600591611a9d868501841b8a019a8b8952612881565b93600094611ab06116308a830151151590565b611b62575b5060009594959887805b611adf575b5050505050505050505061034e925081523880808080611a5d565b15611b44575b600096611af187612899565b808b015115611b0e5750508787965b0196888d8b52979697611abf565b9690965180611b3c575b50838718851b15611b2b575b8890611b00565b99880180861b8c018b905299611b24565b965038611b18565b8086148015611b59575b15611ae55780611ac4565b50818a14611b4e565b5173ffffffffffffffffffffffffffffffffffffffff16945038611ab5565b925038611a7d565b60009250611a57565b925038611a43565b346102c65760006003193601126102c657602060405160008152f35b346102c65760406003193601126102c657611bcf6104af565b602435908115158092036102c65773ffffffffffffffffffffffffffffffffffffffff90336000526007602052611c2a8160406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0081541660ff851617905560405192835216907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60806003193601126102c657611c996104af565b611ca16104d2565b6064359167ffffffffffffffff83116102c657366023840112156102c657611cd66105909336906024816004013591016110d8565b9160443591612505565b346102c65760206003193601126102c6576080611cfe600435612881565b611d50604051809262ffffff6060809273ffffffffffffffffffffffffffffffffffffffff815116855267ffffffffffffffff6020820151166020860152604081015115156040860152015116910152565bf35b346102c6576020806003193601126102c657600435611d708161228c565b15611e94576040519082826000600d54611d898161359c565b80845290600190818116908115611e545750600114611df5575b5050611db19250038361108a565b815115611de25761034e92610c57611dcb61063b9361269d565b611ddc60405195869485019061213b565b9061213b565b50505061034e611df0612128565b61063b565b90939150600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5936000915b818310611e3c575087945050820101611db138611da3565b85548884018501529485019487945091830191611e24565b9050611db19593507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091501682840152151560051b820101859238611da3565b7fa14c4b500000000000000000000000000000000000000000000000000000000060005260046000fd5b346102c65760206003193601126102c657600435600052600c6020526020604060002054604051908152f35b346102c65760406003193601126102c657610590600435611f096104d2565b9080600052600b602052611f24600160406000200154612a56565b612ea9565b346102c6576020806003193601126102c65767ffffffffffffffff6004358181116102c657366023820112156102c6578060040135918211611069578160051b60405192611f798583018561108a565b8352602484840191830101913683116102c657602401905b828210611fa15761059084613c43565b81358152908401908401611f91565b346102c6576000806003193601126106ea576040519080601054611fd38161359c565b808552916001918083169081156106a25750600114611ffc5761034e8561063b8187038261108a565b9250601083527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae6725b82841061203f57505050810160200161063b8261034e61062b565b80546020858701810191909152909301928101612024565b346102c65760406003193601126102c657602060ff6117ba6120776104af565b73ffffffffffffffffffffffffffffffffffffffff6120946104d2565b91166000526007845260406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b73ffffffffffffffffffffffffffffffffffffffff1680156120fe57600052600560205267ffffffffffffffff6040600020541690565b7f8f4eb6040000000000000000000000000000000000000000000000000000000060005260046000fd5b604051906121358261106e565b60008252565b9061214e60209282815194859201610592565b0190565b612166816000526004602052604060002090565b5490811561219657507c0100000000000000000000000000000000000000000000000000000000811661273a5790565b9050600090815481101561222357600019905b016121be816000526004602052604060002090565b5490811561221957507c0100000000000000000000000000000000000000000000000000000000811615612214576004827fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b905090565b60001991506121a9565b6004827fdf2d9b42000000000000000000000000000000000000000000000000000000008152fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8015612287576000190190565b61224b565b9060009160008054821061229e575050565b9192505b80825260046020526040822054806122c757506122c060409161227a565b90506122a2565b7c0100000000000000000000000000000000000000000000000000000000161592915050565b9190916122f982612152565b9073ffffffffffffffffffffffffffffffffffffffff809116938482841603612500576000848152600660205260409020805461235273ffffffffffffffffffffffffffffffffffffffff881633908114908314171590565b612496575b61236087614028565b61248c575b506123908573ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b80546000190190556123c28173ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b80546001019055169283917c0200000000000000000000000000000000000000000000000000000000804260a01b851717612407866000526004602052604060002090565b55811615612442575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600080a41561243d57565b6127b8565b6001840161245a816000526004602052604060002090565b5415612467575b50612410565b600054811461246157612484906000526004602052604060002090565b553880612461565b6000905538612365565b6124f66116306124ef336124ca8b73ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b9073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5460ff1690565b156123575761278e565b612764565b9291906125138282866122ed565b803b612520575b50505050565b612529936125a6565b15612537573880808061251a565b7fd1a57ed60000000000000000000000000000000000000000000000000000000060005260046000fd5b908160209103126102c657516105eb8161029c565b3d156125a1573d90612587826110bc565b91612595604051938461108a565b82523d6000602084013e565b606090565b91926020916126189160006040519586809581947f150b7a02000000000000000000000000000000000000000000000000000000009a8b845233600485015273ffffffffffffffffffffffffffffffffffffffff809516602485015260448401526080606484015260848301906105b5565b0393165af16000918161266d575b5061264757612633612576565b80511561264257805190602001fd5b612537565b7fffffffff00000000000000000000000000000000000000000000000000000000161490565b61268f91925060203d8111612696575b612687818361108a565b810190612561565b9038612626565b503d61267d565b9060405160a08101604052600019608082019360008552935b0192600a908181066030018553049283156126d457600019906126b6565b9250608083601f199203019201918252565b7fb562e8dd0000000000000000000000000000000000000000000000000000000060005260046000fd5b7f2e0763000000000000000000000000000000000000000000000000000000000060005260046000fd5b7fdf2d9b420000000000000000000000000000000000000000000000000000000060005260046000fd5b7fa11481000000000000000000000000000000000000000000000000000000000060005260046000fd5b7f59c896be0000000000000000000000000000000000000000000000000000000060005260046000fd5b7fea553b340000000000000000000000000000000000000000000000000000000060005260046000fd5b7f32c1995a0000000000000000000000000000000000000000000000000000000060005260046000fd5b604051906080820182811067ffffffffffffffff8211176110695760405260006060838281528260208201528260408201520152565b6000908161284e61280c565b928054612859575050565b9192505b80825260046020526040822054612877576000190161285d565b6105eb9150612899565b9061288a61280c565b91600080548210612859575050565b6128a161280c565b5060005260046020526040600020546128b861280c565b9073ffffffffffffffffffffffffffffffffffffffff8116825267ffffffffffffffff8160a01c1660208301527c010000000000000000000000000000000000000000000000000000000081161515604083015260e81c606082015290565b6040519180835260051b6020818401016040525b808180156129505761294790601f198091019385010135612881565b9084015261292b565b5050505090565b3360009081527f142ae0bd48b54fb380e908bf20fd1f4ea4f2b9a2663ca7698d91ef391575c621602052604090205460ff161561299057565b610c976048610c656129a1336130d1565b610c57610be861320b565b3360009081527ff70e363b3d7895af770c4a138460777d52eebd3cb9962ccc6b58721f6127bbc8602052604090205460ff16156129e557565b610c976048610c656129f6336130d1565b610c57610be86132a8565b3360009081527fea6919ad9e84aa527aa2dffb6ac6f0a6af0387a080d10167acddf2a249a612dd602052604090205460ff1615612a3a57565b610c976048610c65612a4b336130d1565b610c57610be8613345565b80600052600b60205260ff612a8f3360406000209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b541615612a995750565b612aa2336130d1565b612aaa612fe3565b916030612ab68461303e565b536078612ac28461304b565b5360415b60018111612ae557610c976048610c6585610c5788610be8881561306c565b90600f8116906010821015612b33577f3031323334353637383961626364656600000000000000000000000000000000612b2e921a612b24848761305b565b5360041c9161227a565b612ac6565b61300f565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527f6937e6b1cde141aad05c7d03126a39eb070a9f0f221c44303558fa7a951a74356020526040808220612bc3949392907f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c9060ff905b541615612bc6575b8152600c60205220911690613418565b50565b808252600b602052612bfa858484209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533848616827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8580a4612bb3565b73ffffffffffffffffffffffffffffffffffffffff81811660009081527fdf7de25b7f1fd6d0b5205f0e18f1f35bd7b8d84cce336588d184533ce43a6f76602052604080822054612bc39493929060ff1615612cb9575b808052600c60205220911690613418565b808052600b602052612ced848383209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0082541617905533838516827f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4612ca8565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527fea6919ad9e84aa527aa2dffb6ac6f0a6af0387a080d10167acddf2a249a612dd6020526040808220612bc3949392907fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a59060ff90612bab565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527f142ae0bd48b54fb380e908bf20fd1f4ea4f2b9a2663ca7698d91ef391575c6216020526040808220612bc3949392907f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb0119060ff90612bab565b73ffffffffffffffffffffffffffffffffffffffff80821660009081527ff70e363b3d7895af770c4a138460777d52eebd3cb9962ccc6b58721f6127bbc86020526040808220612bc3949392907f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a69060ff90612bab565b9073ffffffffffffffffffffffffffffffffffffffff6040612bc393600090808252600b60205260ff612efe868585209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b5416612f15575b8152600c602052209116906134e7565b808252600b602052612f49858484209073ffffffffffffffffffffffffffffffffffffffff16600052602052604060002090565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00815416905533848616827ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b8580a4612f05565b60405190612faa8261104d565b60095473ffffffffffffffffffffffffffffffffffffffff8116835260a01c6020830152565b8181029291811591840414171561228757565b604051906080820182811067ffffffffffffffff82111761106957604052604282526060366020840137565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b805115612b335760200190565b805160011015612b335760210190565b908151811015612b33570160200190565b1561307357565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b604051906060820182811067ffffffffffffffff82111761106957604052602a8252604036602084013760306131068361303e565b5360786131128361304b565b536029905b6001821161312a576105eb91501561306c565b600f8116906010821015612b33577f3031323334353637383961626364656600000000000000000000000000000000613168921a612b24848661305b565b90613117565b7f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c613197612fe3565b9060306131a38361303e565b5360786131af8361304b565b536041905b600182116131c7576105eb91501561306c565b600f8116906010821015612b33577f3031323334353637383961626364656600000000000000000000000000000000613205921a612b24848661305b565b906131b4565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb011613234612fe3565b9060306132408361303e565b53607861324c8361304b565b536041905b60018211613264576105eb91501561306c565b600f8116906010821015612b33577f30313233343536373839616263646566000000000000000000000000000000006132a2921a612b24848661305b565b90613251565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66132d1612fe3565b9060306132dd8361303e565b5360786132e98361304b565b536041905b60018211613301576105eb91501561306c565b600f8116906010821015612b33577f303132333435363738396162636465660000000000000000000000000000000061333f921a612b24848661305b565b906132ee565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a561336e612fe3565b90603061337a8361303e565b5360786133868361304b565b536041905b6001821161339e576105eb91501561306c565b600f8116906010821015612b33577f30313233343536373839616263646566000000000000000000000000000000006133dc921a612b24848661305b565b9061338b565b8054821015612b335760005260206000200190600090565b91613414918354906000199060031b92831b921b19161790565b9055565b6001810190826000528160205260406000205415600014613486578054680100000000000000008110156110695761347161345a8260018794018555846133e2565b81939154906000199060031b92831b921b19161790565b90555491600052602052604060002055600190565b505050600090565b80549081156134b857600019809201916134a883836133e2565b909182549160031b1b1916905555565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600181019180600052826020526040600020549283151560001461359357600019928385019085821161228757805494850194851161228757600095858361353b9461354a9803613550575b50505061348e565b90600052602052604060002090565b55600190565b61357a6135749161356461358a94876133e2565b90549060031b1c928391876133e2565b906133fa565b8590600052602052604060002090565b55388080613533565b50505050600090565b90600182811c921680156135e5575b60208310146135b657565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b91607f16916135ab565b601f81116135fb575050565b600090600e82527fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd906020601f850160051c83019410613656575b601f0160051c01915b82811061364b57505050565b81815560010161363f565b9092508290613636565b601f811161366c575050565b600090600d82527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb5906020601f850160051c830194106136c7575b601f0160051c01915b8281106136bc57505050565b8181556001016136b0565b90925082906136a7565b601f81116136dd575050565b600090601082527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae672906020601f850160051c83019410613738575b601f0160051c01915b82811061372d57505050565b818155600101613721565b9092508290613718565b601f811161374e575050565b600090600f82527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac802906020601f850160051c830194106137a9575b601f0160051c01915b82811061379e57505050565b818155600101613792565b9092508290613789565b90815167ffffffffffffffff8111611069576137d9816137d4600f5461359c565b613742565b602080601f83116001146138145750819293600092613809575b50506000198260011b9260031b1c191617600f55565b0151905038806137f3565b90601f19831694613847600f6000527f8d1108e10bcb7c27dddfc02ed9d693a074039d026cf4ea4240b40f7d581ac80290565b926000905b87821061388457505083600195961061386b575b505050811b01600f55565b015160001960f88460031b161c19169055388080613860565b8060018596829496860151815501950193019061384c565b90815167ffffffffffffffff8111611069576138bd8161145d600d5461359c565b602080601f83116001146138f857508192936000926138ed575b50506000198260011b9260031b1c191617600d55565b0151905038806138d7565b90601f1983169461392b600d6000527fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590565b926000905b87821061396857505083600195961061394f575b505050811b01600d55565b015160001960f88460031b161c19169055388080613944565b80600185968294968601518155019501930190613930565b90815167ffffffffffffffff8111611069576139a1816117fc60105461359c565b602080601f83116001146139dc57508192936000926139d1575b50506000198260011b9260031b1c191617601055565b0151905038806139bb565b90601f19831694613a0f60106000527f1b6847dc741a1b0cd08d278845f9d819d87b734759afb55fe2de5cb82a9ae67290565b926000905b878210613a4c575050836001959610613a33575b505050811b01601055565b015160001960f88460031b161c19169055388080613a28565b80600185968294968601518155019501930190613a14565b613a6d81612152565b73ffffffffffffffffffffffffffffffffffffffff8116613a9b836000526006602052604060002090815490565b9290613ac373ffffffffffffffffffffffffffffffffffffffff841633908114908614171590565b613c05575b600093613ad484614028565b613bfc575b50613b048273ffffffffffffffffffffffffffffffffffffffff166000526005602052604060002090565b6fffffffffffffffffffffffffffffffff81540190557c03000000000000000000000000000000000000000000000000000000004260a01b831717613b53856000526004602052604060002090565b557c0200000000000000000000000000000000000000000000000000000000811615613bb3575b507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8280a46110ba613bae60015460010190565b600155565b60018401613bcb816000526004602052604060002090565b5415613bd8575b50613b7a565b83548114613bd257613bf4906000526004602052604060002090565b553880613bd2565b83905538613ad9565b613c396116306124ef336124ca8773ffffffffffffffffffffffffffffffffffffffff166000526007602052604060002090565b15613ac85761278e565b80519060005b828110613c5557505050565b8151811015612b3357613c7060208260051b84010151613a64565b600019811461228757600101613c49565b9594939291906101007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff6011541617601155613cbc87612b38565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163314801590613e72575b613e485780519067ffffffffffffffff821161106957613d2282611196600e5461359c565b60209081601f8411600114613dc5575093613d6b613d759484613d959b9a9895613d7095613d909b996000926111d15750506000198260011b9260031b1c191617600e556137b3565b61389c565b613980565b613d7e84612c51565b613d8784612d44565b61058b84612dbb565b612e32565b6110ba60017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff006011541617601155565b600e6000529190601f1984167fbb7b4a454dc3493923482f07822329ed19e8244eff582cc204f8554c3620c3fd936000905b828210613e3057505094600185613d7095613d909b9995613d6b95613d959f9e9c99613d759b1061123657505050811b01600e556137b3565b80600186978294978701518155019601940190613df7565b60046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b5060ff60115416613cfd565b15613e8557565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c2065786365656460448201527f2073616c655072696365000000000000000000000000000000000000000000006064820152fd5b73ffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff831691613f3c612710841115613e7e565b16918215613f83577fffffffffffffffffffffffff0000000000000000000000000000000000000000916020604051613f748161104d565b858152015260a01b1617600955565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152fd5b60ff60115460081c1680614020575b613ff657565b60046040517fdb89e3f4000000000000000000000000000000000000000000000000000000008152fd5b506000613ff0565b60ff60115460081c16908161403f575b50613ff657565b73ffffffffffffffffffffffffffffffffffffffff915016151538614038565b6140688161414e565b9081156140b6575b811561408b575b8115614081575090565b6105eb91506140c7565b7fffffffff000000000000000000000000000000000000000000000000000000008116159150614077565b90506140c1816140c7565b90614070565b7fffffffff000000000000000000000000000000000000000000000000000000008116907f5a05180f00000000000000000000000000000000000000000000000000000000821491821561411a57505090565b7f7965db0b000000000000000000000000000000000000000000000000000000001491508115614148575090565b6105eb91505b7fffffffff00000000000000000000000000000000000000000000000000000000167f2a55205a00000000000000000000000000000000000000000000000000000000811490811561419e575090565b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150149056fea26469706673582212208cc38c1dc1c4ee2f4014fecf18b2fa82f3e8565c358f7a55501c9e6e8a901fd564736f6c63430008130033', + FACTORY_DEFAULT_ABI, + '60806040523461002f576100196100146100fa565b610169565b610021610034565b612762610397823961276290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b6101186179c78038038061010d81610086565b9283398101906100db565b90565b60000190565b610129610034565b3d6000823e3d90fd5b90565b61014961014461014e926100a0565b610132565b6100a0565b90565b61015a90610135565b90565b61016690610151565b90565b6101716101ca565b610179610034565b61442c810181811060018060401b038211176101c5576101a1829161442c612af9843961011b565b03906000f09081156101c0576101b96101be9261015d565b610265565b565b610121565b610049565b6101d26101d4565b565b6101e46101df6102c7565b610335565b565b6101ef906100ab565b9052565b9190610207906000602085019401906101e6565b565b60001b90565b9061022060018060a01b0391610209565b9181191691161790565b61023390610135565b90565b61023f9061022a565b90565b90565b9061025a61025561026192610236565b610242565b825461020f565b9055565b61026d610034565b90610aa2820182811060018060401b038211176102bd57829161029791610aa2616f2585396101f3565b03906000f09081156102b8576102b16102b6926001610245565b610335565b565b610121565b610049565b600090565b6102cf6102c2565b503390565b60001c90565b60018060a01b031690565b6102f16102f6916102d4565b6102da565b90565b61030390546102e5565b90565b61030f90610151565b90565b90565b9061032a61032561033192610306565b610312565b825461020f565b9055565b61033f60006102f9565b61034a826000610315565b9061037e6103787f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610306565b91610306565b91610387610034565b806103918161011b565b0390a356fe60806040526004361015610013575b6105ab565b61001e60003561008d565b80630defbce9146100885780631bce45831461008357806359659e901461007e578063715018a6146100795780638bdb5fd2146100745780638da5cb5b1461006f5763f2fde38b0361000e57610578565b610543565b610501565b6104ce565b610499565b6103b7565b610350565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b60018060a01b031690565b6100bc906100a8565b90565b6100c8816100b3565b036100cf57565b600080fd5b905035906100e1826100bf565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b90610117906100ed565b810190811067ffffffffffffffff82111761013157604052565b6100f7565b90610149610142610093565b928361010d565b565b67ffffffffffffffff8111610169576101656020916100ed565b0190565b6100f7565b90826000939282370152565b9092919261018f61018a8261014b565b610136565b938185526020850190828401116101ab576101a99261016e565b565b6100e8565b9080601f830112156101ce578160206101cb9335910161017a565b90565b6100e3565b6bffffffffffffffffffffffff1690565b6101ed816101d3565b036101f457565b600080fd5b90503590610206826101e4565b565b90565b61021481610208565b0361021b57565b600080fd5b9050359061022d8261020b565b565b610140818303126103285761024782600083016100d4565b9261025583602084016100d4565b92604083013567ffffffffffffffff811161032357816102769185016101b0565b92606081013567ffffffffffffffff811161031e57826102979183016101b0565b92608082013567ffffffffffffffff811161031957836102b89184016101b0565b9260a083013567ffffffffffffffff811161031457816102d99185016101b0565b926102e78260c083016100d4565b926103116102f88460e085016101f9565b936103078161010086016100d4565b9361012001610220565b90565b6100a3565b6100a3565b6100a3565b6100a3565b61009e565b610336906100b3565b9052565b919061034e9060006020850194019061032d565b565b3461038d5761038961037861036636600461022f565b98979097969196959295949394610756565b610380610093565b9182918261033a565b0390f35b610099565b906020828203126103ac576103a9916000016100d4565b90565b61009e565b60000190565b346103e5576103cf6103ca366004610392565b61096f565b6103d7610093565b806103e1816103b1565b0390f35b610099565b60009103126103f557565b61009e565b1c90565b60018060a01b031690565b61041990600861041e93026103fa565b6103fe565b90565b9061042c9154610409565b90565b61043c6001600090610421565b90565b90565b61045661045161045b926100a8565b61043f565b6100a8565b90565b61046790610442565b90565b6104739061045e565b90565b61047f9061046a565b9052565b919061049790600060208501940190610476565b565b346104c9576104a93660046103ea565b6104c56104b461042f565b6104bc610093565b91829182610483565b0390f35b610099565b346104fc576104de3660046103ea565b6104e66109cb565b6104ee610093565b806104f8816103b1565b0390f35b610099565b3461053e5761053a61052961051736600461022f565b989790979691969592959493946109d5565b610531610093565b9182918261033a565b0390f35b610099565b34610573576105533660046103ea565b61056f61055e610a6e565b610566610093565b9182918261033a565b0390f35b610099565b346105a65761059061058b366004610392565b610b72565b610598610093565b806105a2816103b1565b0390f35b610099565b600080fd5b600090565b5190565b60209181520190565b60005b8381106105d6575050906000910152565b8060209183015181850152016105c5565b61060661060f602093610614936105fd816105b5565b938480936105b9565b958691016105c2565b6100ed565b0190565b610621906101d3565b9052565b61062e90610208565b9052565b946106a56106b0916106976106c4976106896101009b9f9e9c969861067a6106cb9f9a6106ba9a8e61066d610120820193600083019061032d565b60208184039101526105e7565b908c60408184039101526105e7565b908a820360608c01526105e7565b9088820360808a01526105e7565b9a60a087019061032d565b60c0850190610618565b60e083019061032d565b0190610625565b565b60200190565b5190565b906106e96106e48361014b565b610136565b918252565b6106f860006106d7565b90565b6107036106ee565b90565b61070f90610442565b90565b61071b90610706565b90565b6107279061045e565b90565b600080fd5b60e01b90565b600091031261074057565b61009e565b61074d610093565b3d6000823e3d90fd5b6107c990846107a7856107988c8e9f809c9a9f9d9b98999d6107766105b0565b508a9496928d8d8c90919293949561078c610093565b9a8b9960208b01610632565b6020820181038252038261010d565b6107b96107b3826106d3565b916106cd565b20906107c36106fb565b91610cf6565b986107db6107d68b610712565b61071e565b95634c62cd9b93979992949598919091873b1561089d57600099610813978b9761081e96610807610093565b9e8f9d8e9c8d9b61072f565b8b5260048b01610632565b03925af180156108985761086b575b50806108657f47e27c5ab10c568fd18ff716738c5dd5257732e878dd2ca116c5b4af900d9e3d9161085c610093565b9182918261033a565b0390a190565b61088b9060003d8111610891575b610883818361010d565b810190610735565b3861082d565b503d610879565b610745565b61072a565b6108b3906108ae610eb8565b6108dc565b565b60001c90565b6108c76108cc916108b5565b6103fe565b90565b6108d990546108bb565b90565b6108ee6108e960016108cf565b61046a565b90633659cfe690823b1561096a576109269261091b6000809461090f610093565b9687958694859361072f565b83526004830161033a565b03925af1801561096557610938575b50565b6109589060003d811161095e575b610950818361010d565b810190610735565b38610935565b503d610946565b610745565b61072a565b610978906108a2565b565b610982610eb8565b61098a6109b7565b565b90565b6109a361099e6109a89261098c565b61043f565b6100a8565b90565b6109b49061098f565b90565b6109c96109c460006109ab565b610f34565b565b6109d361097a565b565b979096610a1d96610a3f9a9396610a0e9695996109f06105b0565b50979995909192939495610a02610093565b9a8b9960208b01610632565b6020820181038252038261010d565b610a2f610a29826106d3565b916106cd565b2090610a396106fb565b91610f95565b90565b60018060a01b031690565b610a59610a5e916108b5565b610a42565b90565b610a6b9054610a4d565b90565b610a766105b0565b50610a816000610a61565b90565b610a9590610a90610eb8565b610b41565b565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b610af260266040926105b9565b610afb81610a97565b0190565b610b159060208101906000818303910152610ae5565b90565b15610b1f57565b610b27610093565b62461bcd60e51b815280610b3d60048201610aff565b0390fd5b610b7090610b6b81610b64610b5e610b5960006109ab565b6100b3565b916100b3565b1415610b18565b610f34565b565b610b7b90610a84565b565b90565b610b8c610b9191610208565b610b7d565b9052565b60601b90565b610ba490610b95565b90565b610bb090610b9b565b90565b610bbf610bc4916100b3565b610ba7565b9052565b905090565b610bf2610be992602092610be0816106d3565b94858093610bc8565b938491016105c2565b0190565b60148093610c1a602084610c12610c2296610c299b9a98610b80565b018092610bb3565b018092610bb3565b0190610bcd565b90565b90565b610c43610c3e610c489261098c565b61043f565b610c2c565b90565b610c5490610442565b90565b610c6090610c4b565b90565b610c6c90610442565b90565b610c7890610c63565b90565b610c849061045e565b90565b60209181520190565b610caf610cb8602093610cbd93610ca6816106d3565b93848093610c87565b958691016105c2565b6100ed565b0190565b610ce6610cf3949293610cdc6060840195600085019061032d565b602083019061032d565b6040818403910152610c90565b90565b610d869093929193610d066105b0565b50610d468591610d37610d21610d1c60016108cf565b61046a565b8690610d2b610093565b95869460208601610bf6565b6020820181038252038261010d565b610d58610d52826106d3565b916106cd565b2061148a610d6860208201610136565b908082526112a36020830139610d816000929192610c2f565b6111c2565b92610da0610d9b610d9686610c57565b610c6f565b610c7b565b63cf7a1d779190610db9610db460016108cf565b61046a565b9392813b15610e30576000610de191610dec8296610dd5610093565b9889978896879561072f565b855260048501610cc1565b03925af18015610e2b57610dfe575b50565b610e1e9060003d8111610e24575b610e16818361010d565b810190610735565b38610dfb565b503d610e0c565b610745565b61072a565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b610e69602080926105b9565b610e7281610e35565b0190565b610e8c9060208101906000818303910152610e5d565b90565b15610e9657565b610e9e610093565b62461bcd60e51b815280610eb460048201610e76565b0390fd5b610ee2610ec3610a6e565b610edc610ed6610ed161124b565b6100b3565b916100b3565b14610e8f565b565b60001b90565b90610efb60018060a01b0391610ee4565b9181191691161790565b610f0e9061045e565b90565b90565b90610f29610f24610f3092610f05565b610f11565b8254610eea565b9055565b610f3e6000610a61565b610f49826000610f14565b90610f7d610f777f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e093610f05565b91610f05565b91610f86610093565b80610f90816103b1565b0390a3565b6110289291610fd2610fe192610fa96105b0565b509193610fbe610fb960016108cf565b61046a565b610fc6610093565b95869460208601610bf6565b6020820181038252038261010d565b610ff3610fed826106d3565b916106cd565b2061148a61100360208201610136565b908082526112a3602083013961102161101b826106d3565b916106cd565b2090611258565b90565b6110349061045e565b90565b60007f437265617465323a20696e73756666696369656e742062616c616e6365000000910152565b61106c601d6020926105b9565b61107581611037565b0190565b61108f906020810190600081830391015261105f565b90565b1561109957565b6110a1610093565b62461bcd60e51b8152806110b760048201611079565b0390fd5b60007f437265617465323a2062797465636f6465206c656e677468206973207a65726f910152565b6110ef602080926105b9565b6110f8816110bb565b0190565b61111290602081019060008183039101526110e3565b90565b1561111c57565b611124610093565b62461bcd60e51b81528061113a600482016110fc565b0390fd5b60007f437265617465323a204661696c6564206f6e206465706c6f7900000000000000910152565b61117360196020926105b9565b61117c8161113e565b0190565b6111969060208101906000818303910152611166565b90565b156111a057565b6111a8610093565b62461bcd60e51b8152806111be60048201611180565b0390fd5b9190916111cd6105b0565b506111f46111da3061102b565b316111ed6111e784610c2c565b91610c2c565b1015611092565b61121a611200836106d3565b61121361120d6000610c2f565b91610c2c565b1415611115565b60208251920190f5906112498261124261123c61123760006109ab565b6100b3565b916100b3565b1415611199565b565b6112536105b0565b503390565b90611276916112656105b0565b50906112703061102b565b91611279565b90565b90605592600b926112886105b0565b50604051926040840152602083015281520160ff8153209056fe608060405234601c57600e6020565b61145e61002c823961145e90f35b6026565b60405190565b600080fdfe6080604052361561006b5761006b565b90565b60018060a01b031690565b90565b61003461002f6100399261000f565b61001d565b610012565b90565b61004590610020565b90565b61005190610012565b90565b606090565b63ffffffff60e01b1690565b60000190565b61007361017e565b61008e610088610083600061003c565b610048565b91610048565b0361046c5761009b610054565b5063ffffffff60e01b600035166100c16100bb63cf7a1d7760e01b610059565b91610059565b146100e357600063f92ee8a960e01b8152806100df60048201610065565b0390fd5b6100eb610401565b602081519101f35b600090565b90565b90565b60001b90565b61011861011361011d926100f8565b6100fe565b6100fb565b90565b6101497fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103610104565b90565b60001c90565b60018060a01b031690565b61016961016e9161014c565b610152565b90565b61017b905461015d565b90565b6101866100f3565b506101a2600061019c610197610120565b6105a2565b01610171565b90565b90565b90565b6101bf6101ba6101c4926101a5565b61001d565b6101a8565b90565b60405190565b600080fd5b600080fd5b909392938483116101f75784116101f2576001820201920390565b6101d2565b6101cd565b91565b600080fd5b600080fd5b61021290610012565b90565b61021e81610209565b0361022557565b600080fd5b9050359061023782610215565b565b600080fd5b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b9061026d90610243565b810190811067ffffffffffffffff82111761028757604052565b61024d565b9061029f6102986101c7565b9283610263565b565b67ffffffffffffffff81116102bf576102bb602091610243565b0190565b61024d565b90826000939282370152565b909291926102e56102e0826102a1565b61028c565b93818552602085019082840111610301576102ff926102c4565b565b61023e565b9080601f8301121561032457816020610321933591016102d0565b90565b610239565b9160608383031261037657610341826000850161022a565b9261034f836020830161022a565b92604082013567ffffffffffffffff81116103715761036e9201610306565b90565b610204565b6101ff565b61038f61038a61039492610012565b61001d565b610012565b90565b6103a09061037b565b90565b6103ac90610397565b90565b67ffffffffffffffff81116103cd576103c9602091610243565b0190565b61024d565b906103e46103df836103af565b61028c565b918252565b6103f360006103d2565b90565b6103fe6103e9565b90565b610409610054565b506104126105cd565b61046161045761045161044761043f61043960003661043160046101ab565b9080926101d7565b906101fc565b810190610329565b93919290926103a3565b916103a3565b91909190916105ec565b6104696103f6565b90565b3361048661048061047b61017e565b610048565b91610048565b1460001461059d57610496610054565b5063ffffffff60e01b60003516806104bd6104b7631b2ce7f360e11b610059565b91610059565b146000146104d757506104ce610817565b5b602081519101f35b806104f16104eb63278f794360e11b610059565b91610059565b1460001461050857506105026107c1565b5b6104cf565b8061052261051c6308f2839760e41b610059565b91610059565b146000146105395750610533610723565b5b610503565b8061055361054d6303e1469160e61b610059565b91610059565b1460001461056a57506105646106bf565b5b610534565b61058361057d635c60da1b60e01b610059565b91610059565b146000146105985761059361067a565b610565565b61064a565b61064a565b90565b6105b96105b46105be9261000f565b61001d565b6101a8565b90565b156105c857565b600080fd5b6105ea346105e46105de60006105a5565b916101a8565b146105c1565b565b91906105f661087a565b61061161060b610606600061003c565b610048565b91610048565b0361062d5761062261062b936108b2565b9060009161098d565b565b600063f92ee8a960e01b81528061064660048201610065565b0390fd5b610652610aa6565b610ae7565b61066090610048565b9052565b919061067890600060208501940190610657565b565b610682610054565b5061068b6105cd565b6106ad6106bc610699610aa6565b6106a16101c7565b92839160208301610664565b60208201810382520382610263565b90565b6106c7610054565b506106d06105cd565b6106f26107016106de61017e565b6106e66101c7565b92839160208301610664565b60208201810382520382610263565b90565b9060208282031261071e5761071b9160000161022a565b90565b6101ff565b61072b610054565b506107346105cd565b61077061076b61076661075e61075860003661075060046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108b2565b6107786103f6565b90565b9190916040818403126107bc57610795836000830161022a565b92602082013567ffffffffffffffff81116107b7576107b49201610306565b90565b610204565b6101ff565b6107c9610054565b5061080c6108036107fc6107f46107ee6000366107e660046101ab565b9080926101d7565b906101fc565b81019061077b565b91906103a3565b90600191610b0a565b6108146103f6565b90565b61081f610054565b506108286105cd565b61086f61085f61085a61085261084c60003661084460046101ab565b9080926101d7565b906101fc565b810190610704565b6103a3565b6108676103f6565b600091610b0a565b6108776103f6565b90565b6108826100f3565b5061088b61017e565b90565b9160206108b09294936108a960408201966000830190610657565b0190610657565b565b6108fd906108be61017e565b817f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f916108f56108ec6101c7565b9283928361088e565b0390a1610c4d565b565b61090890610397565b90565b5190565b6109189061037b565b90565b6109249061090f565b90565b61093090610397565b90565b60e01b90565b61094281610048565b0361094957565b600080fd5b9050519061095b82610939565b565b90602082820312610977576109749160000161094e565b90565b6101ff565b6109846101c7565b3d6000823e3d90fd5b9161099783610e30565b826109c27f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e916108ff565b906109cb6101c7565b806109d581610065565b0390a26109e18261090b565b6109f46109ee60006105a5565b916101a8565b11908115610a9e575b50610a07575b5050565b6020610a1d610a18610a339461091b565b610927565b635c60da1b90610a2b6101c7565b948592610933565b82528180610a4360048201610065565b03915afa908115610a9957610a6192600092610a69575b5090610f65565b503880610a03565b610a8b91925060203d8111610a92575b610a838183610263565b81019061095d565b9038610a5a565b503d610a79565b61097c565b9050386109fd565b610aae6100f3565b50610ab7610f85565b80610ad3610acd610ac8600061003c565b610048565b91610048565b03610ae45750610ae1610f99565b90565b90565b60008091368280378136915af43d6000803e600014610b05573d6000f35b3d6000fd5b91610b148361102f565b610b1d8261090b565b610b30610b2a60006105a5565b916101a8565b11908115610b54575b50610b43575b5050565b610b4c91610f65565b503880610b3f565b905038610b39565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f455243313936373a206e65772061646d696e20697320746865207a65726f206160008201520152565b610bc06026604092610b5c565b610bc981610b65565b0190565b610be39060208101906000818303910152610bb3565b90565b15610bed57565b610bf56101c7565b62461bcd60e51b815280610c0b60048201610bcd565b0390fd5b90610c2060018060a01b03916100fe565b9181191691161790565b90565b90610c42610c3d610c49926108ff565b610c2a565b8254610c0f565b9055565b610c8f90610c7781610c70610c6a610c65600061003c565b610048565b91610048565b1415610be6565b6000610c89610c84610120565b6105a2565b01610c2d565b565b60207f7472616374000000000000000000000000000000000000000000000000000000917f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60008201520152565b610cec6025604092610b5c565b610cf581610c91565b0190565b610d0f9060208101906000818303910152610cdf565b90565b15610d1957565b610d216101c7565b62461bcd60e51b815280610d3760048201610cf9565b0390fd5b60207f73206e6f74206120636f6e747261637400000000000000000000000000000000917f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960008201520152565b610d966030604092610b5c565b610d9f81610d3b565b0190565b610db99060208101906000818303910152610d89565b90565b15610dc357565b610dcb6101c7565b62461bcd60e51b815280610de160048201610da3565b0390fd5b90565b610dfc610df7610e0192610de5565b6100fe565b6100fb565b90565b610e2d7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50610de8565b90565b610e6e90610e45610e408261107f565b610d12565b6020610e58610e538361091b565b610927565b635c60da1b90610e666101c7565b948592610933565b82528180610e7e60048201610065565b03915afa8015610eee57610ea1610ea691610ebe94600091610ec0575b5061107f565b610dbc565b6000610eb8610eb3610e04565b6105a2565b01610c2d565b565b610ee1915060203d8111610ee7575b610ed98183610263565b81019061095d565b38610e9b565b503d610ecf565b61097c565b60207f206661696c656400000000000000000000000000000000000000000000000000917f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60008201520152565b610f4b60276103d2565b90610f5860208301610ef3565b565b610f62610f41565b90565b90610f8291610f72610054565b5090610f7c610f5a565b916110e2565b90565b610f8d6100f3565b50610f96611160565b90565b610fa16100f3565b50610fd56020610fbf610fba610fb5611187565b61091b565b610927565b635c60da1b90610fcd6101c7565b938492610933565b82528180610fe560048201610065565b03915afa90811561102a57600091610ffc575b5090565b61101d915060203d8111611023575b6110158183610263565b81019061095d565b38610ff8565b503d61100b565b61097c565b61103881611258565b6110627fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b916108ff565b9061106b6101c7565b8061107581610065565b0390a2565b600090565b61108761107a565b503b61109c61109660006105a5565b916101a8565b1190565b906110b26110ad836102a1565b61028c565b918252565b3d6000146110d4576110c83d6110a0565b903d6000602084013e5b565b6110dc610054565b906110d2565b9091600080611112946110f3610054565b508490602081019051915af4916111086110b7565b909290919261130b565b90565b90565b61112c61112761113192611115565b6100fe565b6100fb565b90565b61115d7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc611118565b90565b6111686100f3565b50611184600061117e611179611134565b6105a2565b01610171565b90565b61118f6100f3565b506111ab60006111a56111a0610e04565b6105a2565b01610171565b90565b60207f6f74206120636f6e747261637400000000000000000000000000000000000000917f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60008201520152565b611209602d604092610b5c565b611212816111ae565b0190565b61122c90602081019060008183039101526111fc565b90565b1561123657565b61123e6101c7565b62461bcd60e51b81528061125460048201611216565b0390fd5b6112859061126d6112688261107f565b61122f565b600061127f61127a611134565b6105a2565b01610c2d565b565b60007f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000910152565b6112bc601d602092610b5c565b6112c581611287565b0190565b6112df90602081019060008183039101526112af565b90565b156112e957565b6112f16101c7565b62461bcd60e51b815280611307600482016112c9565b0390fd5b919290611316610054565b5060001461135c57506113288261090b565b61133b61133560006105a5565b916101a8565b14611345575b5090565b6113516113569161107f565b6112e2565b38611341565b826113d5565b5190565b60005b83811061137a575050906000910152565b806020918301518185015201611369565b6113aa6113b36020936113b8936113a181611362565b93848093610b5c565b95869101611366565b610243565b0190565b6113d2916020820191600081840391015261138b565b90565b906113df8261090b565b6113f26113ec60006105a5565b916101a8565b116000146114035750805190602001fd5b6114249061140f6101c7565b91829162461bcd60e51b8352600483016113bc565b0390fdfea2646970667358221220fb1899e61f38faa78bfbab79b8dc2fa613357c2fce2699411f9fee80b624365564736f6c634300081b0033a2646970667358221220a68cbd648ecf61d4078e499f562f25a90179b287e90824d296b0bc0484db59b264736f6c634300081b003360a060405234602b57600e603a565b6014602f565b6143cb6100618239608051816132b101526143cb90f35b6035565b60405190565b600080fd5b60406042565b565b6048604a565b565b60506052565b565b6058605a565b565b3360805256fe60806040526004361015610013575b611467565b61001e60003561029d565b806301ffc9a71461029857806304634d8d1461029357806306fdde031461028e578063081812fc14610289578063095ea7b3146102845780630bb310de1461027f57806318160ddd1461027a57806323b872dd14610275578063248a9ca3146102705780632a55205a1461026b5780632e73e0fd146102665780632f2ff15d1461026157806335e60bd41461025c57806336568abe1461025757806340c10f191461025257806342842e0e1461024d57806342966c68146102485780634c62cd9b146102435780635944c7531461023e5780635a446215146102395780636352211e1461023457806368a37ae81461022f57806370a082311461022a5780637e518ec814610225578063842f9b68146102205780639010d07c1461021b57806391d1485414610216578063938e3d7b1461021157806395d89b411461020c5780639d043a6614610207578063a217fddf14610202578063a22cb465146101fd578063b88d4fde146101f8578063c87b56dd146101f3578063ca15c873146101ee578063d547741f146101e9578063dc8e92ea146101e4578063e8a3d485146101df578063e985e9c5146101da5763ed4c2ac70361000e57611434565b6113fe565b61139b565b611368565b611267565b611232565b6111fd565b6111d0565b6110f2565b61108f565b61101c565b610f52565b610f1f565b610ee9565b610eb3565b610e50565b610e1d565b610db2565b610d7d565b610d19565b610ce5565b610c53565b610bdb565b6109d1565b6109a7565b610973565b61093f565b61090c565b610895565b610833565b6107fc565b610775565b6106e2565b610672565b61061c565b6105d3565b610570565b6104d2565b610408565b61032f565b60e01c90565b60405190565b600080fd5b600080fd5b600080fd5b63ffffffff60e01b1690565b6102cd816102b8565b036102d457565b600080fd5b905035906102e6826102c4565b565b90602082820312610302576102ff916000016102d9565b90565b6102ae565b151590565b61031590610307565b9052565b919061032d9060006020850194019061030c565b565b3461035f5761035b61034a6103453660046102e8565b611471565b6103526102a3565b91829182610319565b0390f35b6102a9565b60018060a01b031690565b61037890610364565b90565b6103848161036f565b0361038b57565b600080fd5b9050359061039d8261037b565b565b6bffffffffffffffffffffffff1690565b6103b98161039f565b036103c057565b600080fd5b905035906103d2826103b0565b565b91906040838203126103fd57806103f16103fa9260008601610390565b936020016103c5565b90565b6102ae565b60000190565b346104375761042161041b3660046103d4565b906114fd565b6104296102a3565b8061043381610402565b0390f35b6102a9565b600091031261044757565b6102ae565b5190565b60209181520190565b60005b83811061046d575050906000910152565b80602091830151818501520161045c565b601f801991011690565b6104a76104b06020936104b59361049e8161044c565b93848093610450565b95869101610459565b61047e565b0190565b6104cf9160208201916000818403910152610488565b90565b34610502576104e236600461043c565b6104fe6104ed61162c565b6104f56102a3565b918291826104b9565b0390f35b6102a9565b90565b61051381610507565b0361051a57565b600080fd5b9050359061052c8261050a565b565b90602082820312610548576105459160000161051f565b90565b6102ae565b6105569061036f565b9052565b919061056e9060006020850194019061054d565b565b346105a05761059c61058b61058636600461052e565b611647565b6105936102a3565b9182918261055a565b0390f35b6102a9565b91906040838203126105ce57806105c26105cb9260008601610390565b9360200161051f565b90565b6102ae565b6105e76105e13660046105a5565b9061168a565b6105ef6102a3565b806105f981610402565b0390f35b906020828203126106175761061491600001610390565b90565b6102ae565b3461064a5761063461062f3660046105fd565b61176e565b61063c6102a3565b8061064681610402565b0390f35b6102a9565b61065890610507565b9052565b91906106709060006020850194019061064f565b565b346106a25761068236600461043c565b61069e61068d6117a8565b6106956102a3565b9182918261065c565b0390f35b6102a9565b90916060828403126106dd576106da6106c38460008501610390565b936106d18160208601610390565b9360400161051f565b90565b6102ae565b6106f66106f03660046106a7565b916117be565b6106fe6102a3565b8061070881610402565b0390f35b90565b6107188161070c565b0361071f57565b600080fd5b905035906107318261070f565b565b9060208282031261074d5761074a91600001610724565b90565b6102ae565b61075b9061070c565b9052565b919061077390600060208501940190610752565b565b346107a5576107a161079061078b366004610733565b611914565b6107986102a3565b9182918261075f565b0390f35b6102a9565b91906040838203126107d357806107c76107d0926000860161051f565b9360200161051f565b90565b6102ae565b9160206107fa9294936107f36040820196600083019061054d565b019061064f565b565b3461082e5761081561080f3660046107aa565b90611b1d565b9061082a6108216102a3565b928392836107d8565b0390f35b6102a9565b346108625761084c6108463660046105a5565b90611d87565b6108546102a3565b8061085e81610402565b0390f35b6102a9565b9190604083820312610890578061088461088d9260008601610724565b93602001610390565b90565b6102ae565b346108c4576108ae6108a8366004610867565b90611dbc565b6108b66102a3565b806108c081610402565b0390f35b6102a9565b6108d281610307565b036108d957565b600080fd5b905035906108eb826108c9565b565b9060208282031261090757610904916000016108de565b90565b6102ae565b3461093a5761092461091f3660046108ed565b611e35565b61092c6102a3565b8061093681610402565b0390f35b6102a9565b3461096e57610958610952366004610867565b90611eea565b6109606102a3565b8061096a81610402565b0390f35b6102a9565b346109a25761098c6109863660046105a5565b90611f96565b6109946102a3565b8061099e81610402565b0390f35b6102a9565b6109bb6109b53660046106a7565b91611fd1565b6109c36102a3565b806109cd81610402565b0390f35b346109ff576109e96109e436600461052e565b61200c565b6109f16102a3565b806109fb81610402565b0390f35b6102a9565b600080fd5b600080fd5b634e487b7160e01b600052604160045260246000fd5b90610a2e9061047e565b810190811067ffffffffffffffff821117610a4857604052565b610a0e565b90610a60610a596102a3565b9283610a24565b565b67ffffffffffffffff8111610a8057610a7c60209161047e565b0190565b610a0e565b90826000939282370152565b90929192610aa6610aa182610a62565b610a4d565b93818552602085019082840111610ac257610ac092610a85565b565b610a09565b9080601f83011215610ae557816020610ae293359101610a91565b90565b610a04565b909161012082840312610bd657610b048360008401610390565b92602083013567ffffffffffffffff8111610bd15781610b25918501610ac7565b92604081013567ffffffffffffffff8111610bcc5782610b46918301610ac7565b92606082013567ffffffffffffffff8111610bc75783610b67918401610ac7565b92608083013567ffffffffffffffff8111610bc25781610b88918501610ac7565b92610b968260a08301610390565b92610bbf610ba78460c085016103c5565b93610bb58160e08601610390565b9361010001610724565b90565b6102b3565b6102b3565b6102b3565b6102b3565b6102ae565b34610c1357610bfd610bee366004610aea565b97969096959195949294612018565b610c056102a3565b80610c0f81610402565b0390f35b6102a9565b9091606082840312610c4e57610c4b610c34846000850161051f565b93610c428160208601610390565b936040016103c5565b90565b6102ae565b34610c8257610c6c610c66366004610c18565b9161207f565b610c746102a3565b80610c7e81610402565b0390f35b6102a9565b919091604081840312610ce057600081013567ffffffffffffffff8111610cdb5783610cb4918301610ac7565b92602082013567ffffffffffffffff8111610cd657610cd39201610ac7565b90565b6102b3565b6102b3565b6102ae565b34610d1457610cfe610cf8366004610c87565b906122ce565b610d066102a3565b80610d1081610402565b0390f35b6102a9565b34610d4957610d45610d34610d2f36600461052e565b6122da565b610d3c6102a3565b9182918261055a565b0390f35b6102a9565b7f915327d54f2c758ad33c35b031b5e89868657ea971cda2b8103c502dc672509c90565b610d7a610d4e565b90565b34610dad57610d8d36600461043c565b610da9610d98610d72565b610da06102a3565b9182918261075f565b0390f35b6102a9565b34610de257610dde610dcd610dc83660046105fd565b612303565b610dd56102a3565b9182918261065c565b0390f35b6102a9565b90602082820312610e1857600082013567ffffffffffffffff8111610e1357610e109201610ac7565b90565b6102b3565b6102ae565b34610e4b57610e35610e30366004610de7565b612369565b610e3d6102a3565b80610e4781610402565b0390f35b6102a9565b34610e8057610e6036600461043c565b610e7c610e6b61239b565b610e736102a3565b91829182610319565b0390f35b6102a9565b9190604083820312610eae5780610ea2610eab9260008601610724565b9360200161051f565b90565b6102ae565b34610ee457610ee0610ecf610ec9366004610e85565b906123cc565b610ed76102a3565b9182918261055a565b0390f35b6102a9565b34610f1a57610f16610f05610eff366004610867565b90612424565b610f0d6102a3565b91829182610319565b0390f35b6102a9565b34610f4d57610f37610f32366004610de7565b612477565b610f3f6102a3565b80610f4981610402565b0390f35b6102a9565b34610f8257610f6236600461043c565b610f7e610f6d612482565b610f756102a3565b918291826104b9565b0390f35b6102a9565b600080fd5b908160c0910312610f9a5790565b610f87565b908160e0910312610fad5790565b610f87565b9160608383031261101757610fca8260008501610390565b92602081013567ffffffffffffffff81116110125783610feb918301610f8c565b92604082013567ffffffffffffffff811161100d5761100a9201610f9f565b90565b6102b3565b6102b3565b6102ae565b3461104d57611049611038611032366004610fb2565b916127eb565b6110406102a3565b9182918261075f565b0390f35b6102a9565b90565b60001b90565b61106f61106a61107492611052565b611055565b61070c565b90565b611081600061105b565b90565b61108c611077565b90565b346110bf5761109f36600461043c565b6110bb6110aa611084565b6110b26102a3565b9182918261075f565b0390f35b6102a9565b91906040838203126110ed57806110e16110ea9260008601610390565b936020016108de565b90565b6102ae565b346111215761110b6111053660046110c4565b9061288c565b6111136102a3565b8061111d81610402565b0390f35b6102a9565b600080fd5b600080fd5b909182601f8301121561116a5781359167ffffffffffffffff831161116557602001926001830284011161116057565b61112b565b611126565b610a04565b906080828203126111cb576111878160008401610390565b926111958260208501610390565b926111a3836040830161051f565b92606082013567ffffffffffffffff81116111c6576111c29201611130565b9091565b6102b3565b6102ae565b6111e76111de36600461116f565b93929092612943565b6111ef6102a3565b806111f981610402565b0390f35b3461122d5761122961121861121336600461052e565b6129a3565b6112206102a3565b918291826104b9565b0390f35b6102a9565b346112625761125e61124d611248366004610733565b612a3c565b6112556102a3565b9182918261065c565b0390f35b6102a9565b346112965761128061127a366004610867565b90612a8c565b6112886102a3565b8061129281610402565b0390f35b6102a9565b67ffffffffffffffff81116112b35760208091020190565b610a0e565b909291926112cd6112c88261129b565b610a4d565b938185526020808601920283019281841161130a57915b8383106112f15750505050565b602080916112ff848661051f565b8152019201916112e4565b61112b565b9080601f8301121561132d5781602061132a933591016112b8565b90565b610a04565b9060208282031261136357600082013567ffffffffffffffff811161135e5761135b920161130f565b90565b6102b3565b6102ae565b346113965761138061137b366004611332565b612adf565b6113886102a3565b8061139281610402565b0390f35b6102a9565b346113cb576113ab36600461043c565b6113c76113b6612b3f565b6113be6102a3565b918291826104b9565b0390f35b6102a9565b91906040838203126113f957806113ed6113f69260008601610390565b93602001610390565b90565b6102ae565b3461142f5761142b61141a6114143660046113d0565b90612b55565b6114226102a3565b91829182610319565b0390f35b6102a9565b346114625761144c611447366004610733565b612bce565b6114546102a3565b8061145e81610402565b0390f35b6102a9565b600080fd5b600090565b61147961146c565b50632c72642f60e21b61149461148e836102b8565b916102b8565b149081156114a1575b5090565b6114ab9150612bd9565b3861149d565b7f6db4061a20ca83a3be756ee172bd37a029093ac5afe4ce968c6d5435b43cb01190565b906114ef916114ea6114e56114b1565b612c19565b6114f1565b565b906114fb91612e33565b565b90611507916114d5565b565b606090565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015611544575b602083101461153f57565b61150e565b91607f1691611534565b60209181520190565b600052602060002090565b906000929180549061157d61157683611524565b809461154e565b916001811690816000146115d65750600114611599575b505050565b6115a69192939450611557565b916000925b8184106115be5750500190388080611594565b600181602092959395548486015201910192906115ab565b92949550505060ff1916825215156020020190388080611594565b906115fb91611562565b90565b9061161e6116179261160e6102a3565b938480926115f1565b0383610a24565b565b611629906115fe565b90565b611634611509565b5061163f6007611620565b90565b600090565b61164f611642565b5080600052673ec412a9852d173d60c11b601c526020600020810101805460601b1561167c576001015490565b63ceea21b66000526004601cfd5b6116979133919091612ead565b565b7f70649ec320b507febad3e8ef750e5f580b9ae32f9f50d4c7b121332c8197153090565b6116d6906116d16116cc611699565b612c19565b611759565b565b90565b6116ef6116ea6116f492610364565b6116d8565b610364565b90565b611700906116db565b90565b61170c906116f7565b90565b9061172060018060a01b0391611055565b9181191691161790565b611733906116f7565b90565b90565b9061174e6117496117559261172a565b611736565b825461170f565b9055565b61176561176c91611703565b6004611739565b565b611777906116bd565b565b600090565b60001c90565b90565b6117936117989161177e565b611784565b90565b6117a59054611787565b90565b6117b0611779565b506117bb600c61179b565b90565b906117cb82828591612f50565b60001960601c918216908216918360005233673ec412a9852d173d60c11b17601c526020600020840184019081548091168381148102156118b25750826000528160010154803314843314171561189a575b61188e575b838318189055601c600c206001815403905581600052601c600c2060018154019063ffffffff821684021561187957557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600038a4565b67ea553b3401336cea841560021b526004601cfd5b60008260010155611822565b6030600c205461181d57634b6e7f186000526004601cfd5b67ceea21b6a1148100901560021b526004601cfd5b600090565b6118d59061070c565b90565b906118e2906118cc565b600052602052604060002090565b90565b6118ff6119049161177e565b6118f0565b90565b61191190546118f3565b90565b600161192d611933926119256118c7565b5060026118d8565b01611907565b90565b61194a61194561194f92610507565b6116d8565b610507565b90565b9061195c90611936565b600052602052604060002090565b60018060a01b031690565b6119816119869161177e565b61196a565b90565b6119939054611975565b90565b906119a09061036f565b9052565b60a01c90565b6bffffffffffffffffffffffff1690565b6119c76119cc916119a4565b6119aa565b90565b6119d990546119bb565b90565b906119e69061039f565b9052565b6119f46040610a4d565b90565b90611a2e611a256000611a086119ea565b94611a1f611a17838301611989565b838801611996565b016119cf565b602084016119dc565b565b611a39906119f7565b90565b611a46905161036f565b90565b611a5d611a58611a6292611052565b6116d8565b610364565b90565b611a6e90611a49565b90565b611a7b905161039f565b90565b611a92611a8d611a979261039f565b6116d8565b610507565b90565b634e487b7160e01b600052601160045260246000fd5b611abf611ac591939293610507565b92610507565b91611ad1838202610507565b928184041490151715611ae057565b611a9a565b634e487b7160e01b600052601260045260246000fd5b611b07611b0d91610507565b91610507565b908115611b18570490565b611ae5565b611b40611b4591939293611b2f611642565b50611b38611779565b506001611952565b611a30565b91611b5260008401611a3c565b611b6d611b67611b626000611a65565b61036f565b9161036f565b14611bba575b6000611baf611b99611bb693611b93611b8e60208901611a71565b611a7e565b90611ab0565b611ba9611ba4612fd1565b611a7e565b90611afb565b9301611a3c565b9190565b9150611bb66000611baf611b99611bd083611a30565b959350505050611b73565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a690565b90611c1991611c14611c0f611bdb565b612c19565b611cc2565b565b611c2f611c2a611c3492611052565b6116d8565b610507565b90565b6001611c439101610507565b90565b611c4f90610507565b6000198114611c5e5760010190565b611a9a565b90611c7060001991611055565b9181191691161790565b90565b90611c92611c8d611c9992611936565b611c7a565b8254611c63565b9055565b611cac611cb291939293610507565b92610507565b8201809211611cbd57565b611a9a565b9190611cce6000611c1b565b915b82611ce3611cdd84610507565b91610507565b1015611d64575b611cfc611cf7600b61179b565b612fe8565b15611d2257611d1d611d16611d11600b61179b565b611c46565b600b611c7d565b611cea565b9091611d5d90611d3c85611d36600b61179b565b90613015565b611d58611d51611d4c600b61179b565b611c46565b600b611c7d565b611c37565b9190611cd0565b9250611d859150611d7e90611d79600c61179b565b611c9d565b600c611c7d565b565b90611d9191611bff565b565b90611dae91611da9611da482611914565b612c19565b611db0565b565b90611dba916130c3565b565b90611dc691611d93565b565b611de190611ddc611dd7610d4e565b612c19565b611e28565b565b90611def60ff91611055565b9181191691161790565b611e0290610307565b90565b90565b90611e1d611e18611e2492611df9565b611e05565b8254611de3565b9055565b611e3390600d611e08565b565b611e3e90611dc8565b565b60207f20726f6c657320666f722073656c660000000000000000000000000000000000917f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201520152565b611e9b602f604092610450565b611ea481611e40565b0190565b611ebe9060208101906000818303910152611e8e565b90565b15611ec857565b611ed06102a3565b62461bcd60e51b815280611ee660048201611ea8565b0390fd5b90611f1791611f1282611f0c611f06611f016130ed565b61036f565b9161036f565b14611ec1565b6130fa565b565b90611f3391611f2e611f29611bdb565b612c19565b611f35565b565b90611f3f91613015565b611f5b611f54611f4f600c61179b565b611c46565b600c611c7d565b5b611f6e611f69600b61179b565b612fe8565b15611f9457611f8f611f88611f83600b61179b565b611c46565b600b611c7d565b611f5c565b565b90611fa091611f19565b565b90611fb4611faf83610a62565b610a4d565b918252565b611fc36000611fa2565b90565b611fce611fb9565b90565b91611fde838383916117be565b611fe782613124565b611ff1575b505050565b6120049291611ffe611fc6565b92613131565b388080611fec565b61201690336131c2565b565b916120519896949297959391976120316001600d611e08565b61204361203c610d4e565b82906130c3565b97909192939495969761329f565b565b9061206e92916120696120646114b1565b612c19565b612070565b565b9161207d929190916133d2565b565b9061208a9291612053565b565b7fe02a0315b383857ac496e9d2b2546a699afaeb4e5e83a1fdef64376d0b74e5a590565b906120ca916120c56120c061208c565b612c19565b6122b6565b565b601f602091010490565b1b90565b919060086120f69102916120f0600019846120d6565b926120d6565b9181191691161790565b919061211661211161211e93611936565b611c7a565b9083546120da565b9055565b6121349161212e611779565b91612100565b565b5b818110612142575050565b806121506000600193612122565b01612137565b9190601f8111612166575b505050565b61217261219793611557565b90602061217e846120cc565b8301931061219f575b612190906120cc565b0190612136565b388080612161565b915061219081929050612187565b1c90565b906121c290600019906008026121ad565b191690565b816121d1916121b1565b906002021790565b906121e38161044c565b9067ffffffffffffffff82116122a557612207826122018554611524565b85612156565b602090601f831160011461223c5791809161222b93600092612230575b50506121c7565b90555b565b90915001513880612224565b601f1983169161224b85611557565b9260005b81811061228d57509160029391856001969410612273575b5050500201905561222e565b612283910151601f8416906121b1565b9055388080612267565b9193602060018192878701518155019501920161224f565b610a0e565b906122b4916121d9565b565b906122c56122cc9260076122aa565b60086122aa565b565b906122d8916120b0565b565b6122ec906122e6611642565b50613455565b9081156122f557565b63ceea21b66000526004601cfd5b61230b611779565b50801561233357673ec412a9852d173d60c11b601c5260005263ffffffff601c600c20541690565b638f4eb6046000526004601cfd5b61235a9061235561235061208c565b612c19565b61235c565b565b6123679060066122aa565b565b61237290612341565b565b60ff1690565b61238661238b9161177e565b612374565b90565b612398905461237a565b90565b6123a361146c565b506123ae600d61238e565b90565b906123bb906118cc565b600052602052604060002090565b90565b906123ec6123e76123f1936123df611642565b5060036123b1565b6123c9565b6134b6565b90565b6123fd906116db565b90565b612409906123f4565b90565b9061241690612400565b600052602052604060002090565b61244c9160006124416124479361243961146c565b5060026118d8565b0161240c565b61238e565b90565b6124689061246361245e61208c565b612c19565b61246a565b565b6124759060096122aa565b565b6124809061244f565b565b61248a611509565b506124956008611620565b90565b60018060a01b031690565b6124af6124b49161177e565b612498565b90565b6124c190546124a3565b90565b6124cd906123f4565b90565b60e01b90565b905051906124e38261070f565b565b906020828203126124ff576124fc916000016124d6565b90565b6102ae565b50612513906020810190610390565b90565b61251f9061036f565b9052565b506125329060208101906102d9565b90565b61253e906102b8565b9052565b50612551906020810190610724565b90565b61255d9061070c565b9052565b600080fd5b600080fd5b600080fd5b90356001602003823603038112156125b157016020813591019167ffffffffffffffff82116125ac5760018202360383136125a757565b612566565b612561565b61256b565b60209181520190565b91906125d9816125d2816125de956125b6565b8095610a85565b61047e565b0190565b90356001604003823603038112156125f8570190565b61256b565b903560016020038236030381121561263e57016020813591019167ffffffffffffffff821161263957600182023603831361263457565b612566565b612561565b61256b565b919061265d81612656816126629561154e565b8095610a85565b61047e565b0190565b67ffffffffffffffff1690565b61267c81612666565b0361268357565b600080fd5b9050359061269582612673565b565b506126a6906020810190612688565b90565b6126b290612666565b9052565b906126f49060206126ec6126e2604084016126d460008801886125fd565b908683036000880152612643565b9482810190612697565b9101906126a9565b90565b6127a19161279361278860c0830161271f6127156000870187612504565b6000860190612516565b61273961272f6020870187612523565b6020860190612535565b6127536127496040870187612542565b6040860190612554565b61276d6127636060870187612542565b6060860190612554565b61277a6080860186612570565b9085830360808701526125bf565b9260a08101906125e2565b9060a08184039101526126b6565b90565b9392906127d06040916127d8946127c3606089019260008a019061054d565b87820360208901526126f7565b940190610752565b565b6127e26102a3565b3d6000823e3d90fd5b91506020906127f86118c7565b5061280b61280660046124b7565b6124c4565b612837633808a90b9492946128426128236005611907565b61282b6102a3565b978896879586956124d0565b8552600485016127a4565b03915afa90811561288757600091612859575b5090565b61287a915060203d8111612880575b6128728183610a24565b8101906124e5565b38612855565b503d612868565b6127da565b90151581601c52670a5a2e7a0000000060085233600052806030600c205560005260601b60601c337f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160206000a3565b67ffffffffffffffff81116128fa576128f660209161047e565b0190565b610a0e565b9092919261291461290f826128dc565b610a4d565b938185526020850190828401116129305761292e92610a85565b565b610a09565b6129409136916128ff565b90565b92919092612953818584916117be565b61295c84613124565b612968575b5050505050565b61297e9461297891949293612935565b92613131565b3880808080612961565b90565b6129959054611524565b90565b6129a0611fb9565b90565b6129ab611509565b506129be6129b882612fe8565b15610307565b612a1f576129d46129cf6006612988565b61298b565b6129e76129e16000611c1b565b91610507565b1415600014612a1157612a0d90612a08612a026006926134ef565b91611620565b61354a565b5b90565b50612a1a612998565b612a0e565b600063677510db60e11b815280612a3860048201610402565b0390fd5b612a5b612a56612a6092612a4e611779565b5060036123b1565b6123c9565b61357a565b90565b90612a7e91612a79612a7482611914565b612c19565b612a80565b565b90612a8a916130fa565b565b90612a9691612a63565b565b5190565b634e487b7160e01b600052603260045260246000fd5b90612abc82612a98565b811015612acd576020809102010190565b612a9c565b612adc9051610507565b90565b90612ae982612a98565b90612af46000611c1b565b5b80612b08612b0285610507565b91610507565b1015612b3957612b3490612b2f33612b29612b24888590612ab2565b612ad2565b906131c2565b611c37565b612af5565b50915050565b612b47611509565b50612b526009611620565b90565b90612b5e61146c565b50601c52670a5a2e7a000000006008526000526030600c205490565b612b9390612b8e612b89611699565b612c19565b612bc1565b565b612b9e9061177e565b90565b90612bb6612bb1612bbd926118cc565b612b95565b8254611c63565b9055565b612bcc906005612ba1565b565b612bd790612b7a565b565b612be161146c565b506376a4e23960e01b612bfc612bf6836102b8565b916102b8565b14908115612c09575b5090565b612c13915061359a565b38612c05565b612c2b90612c256130ed565b906136d5565b565b60207f2073616c65507269636500000000000000000000000000000000000000000000917f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201520152565b612c88602a604092610450565b612c9181612c2d565b0190565b612cab9060208101906000818303910152612c7b565b90565b15612cb557565b612cbd6102a3565b62461bcd60e51b815280612cd360048201612c95565b0390fd5b60007f455243323938313a20696e76616c696420726563656976657200000000000000910152565b612d0c6019602092610450565b612d1581612cd7565b0190565b612d2f9060208101906000818303910152612cff565b90565b15612d3957565b612d416102a3565b62461bcd60e51b815280612d5760048201612d19565b0390fd5b612d656040610a4d565b90565b90565b90612d80612d7b612d8792612400565b612d68565b825461170f565b9055565b60a01b90565b90612dab6bffffffffffffffffffffffff60a01b91612d8b565b9181191691161790565b612dc9612dc4612dce9261039f565b6116d8565b61039f565b90565b90565b90612de9612de4612df092612db5565b612dd1565b8254612d91565b9055565b90612e1f60206000612e2594612e17828201612e11848801611a3c565b90612d6b565b019201611a71565b90612dd4565b565b90612e3191612df4565b565b90612ea4612eab92612e5f83612e58612e52612e4d612fd1565b61039f565b9161039f565b1115612cae565b612e8581612e7e612e78612e736000611a65565b61036f565b9161036f565b1415612d32565b91612e9b612e91612d5b565b9360008501611996565b602083016119dc565b6000612e27565b565b9060001960601c9081169181168360005280673ec412a9852d173d60c11b17601c5260206000208401840191825416918215612f4257818385931490151715612f1c575b600101557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600038a4565b9050816000526030600c205415612f34578290612ef1565b634b6e7f186000526004601cfd5b63ceea21b66000526004601cfd5b915050612f5d600d61238e565b9081612f88575b50612f6b57565b60006336e278fd60e21b815280612f8460048201610402565b0390fd5b9050612fa5612f9f612f9a6000611a65565b61036f565b9161036f565b141538612f64565b600090565b90565b612fc9612fc4612fce92612fb2565b6116d8565b61039f565b90565b612fd9612fad565b50612fe5612710612fb5565b90565b612ff061146c565b5080600052673ec412a9852d173d60c11b601c5260206000208101015460601b151590565b61302a6130226000611a65565b828491612f50565b60601b60601c81600052673ec412a9852d173d60c11b601c5260206000208201820180548060601b6130b5578217905580600052601c600c2060018154019063ffffffff82168302156130a0575560007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8138a4565b67ea553b3401336cea831560021b526004601cfd5b63c991cbb16000526004601cfd5b906130e56130e06130ea936130d981859061376e565b60036123b1565b6123c9565b613855565b50565b6130f5611642565b503390565b9061311c61311761312193613110818590613890565b60036123b1565b6123c9565b61392a565b50565b61312c61146c565b503b90565b9160209160a460405195869363150b7a0296878652338787015260601b60601c6040860152606085015260808085015280518091818060a08801526131ae575b505001906000601c8401915af11561319e575b60e01b90510361319057565b63d1a57ed66000526004601cfd5b3d1561318457503d6000823e3d90fd5b818760c08801920160045afa508038613171565b6131df6131ce836122da565b6131d86000611a65565b8491612f50565b60601b60601c8160005280673ec412a9852d173d60c11b17601c52602060002082018201908154918260601b60601c91821561329157826000528160010154908181148482141790151715613279575b600093839161326e575b189055601c600c20600181540390557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8238a4565b848360010155613239565b6030600c205461322f57634b6e7f186000526004601cfd5b63ceea21b66000526004601cfd5b969790919295949397336132db6132d57f000000000000000000000000000000000000000000000000000000000000000061036f565b9161036f565b1415801561333e575b613321576133139861330697613301958a95909192939495613965565b612e33565b61330e611bdb565b6130c3565b61331f6001600a611e08565b565b600063f92ee8a960e01b81528061333a60048201610402565b0390fd5b50613349600a61238e565b6132e4565b60007f455243323938313a20496e76616c696420706172616d65746572730000000000910152565b613383601b602092610450565b61338c8161334e565b0190565b6133a69060208101906000818303910152613376565b90565b156133b057565b6133b86102a3565b62461bcd60e51b8152806133ce60048201613390565b0390fd5b61344e906134476134539493613402856133fb6133f56133f0612fd1565b61039f565b9161039f565b1115612cae565b6134288161342161341b6134166000611a65565b61036f565b9161036f565b14156133a9565b9361343e613434612d5b565b9560008701611996565b602085016119dc565b6001611952565b612e27565b565b61345d611642565b5080600052673ec412a9852d173d60c11b601c5260206000208101015460601b60601c90565b90565b6134926134979161177e565b611936565b90565b6134ae6134a96134b392610507565b6116d8565b610364565b90565b6134e26134dd6134ec936134d860006134e7956134d1611642565b5001613483565b613a34565b613486565b61349a565b6123f4565b90565b906134f8611509565b506080604051019160208301604052600083528290600a6000198092955b01948181066030018653049384156135355790600a9190809291613516565b93505082602091039203918252565b90565b90565b6135779161356c61356661357293613560611509565b50613544565b91613544565b90613a5b565b613547565b90565b61359260006135979261358b611779565b5001613483565b613add565b90565b6135a261146c565b506135ac81613af5565b80156135cf575b9081156135bf575b5090565b6135c99150613b82565b386135bb565b506135d981613b1c565b6135b3565b90565b6135f56135f06135fa926135de565b6116d8565b610507565b90565b905090565b60007f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000910152565b613636601780926135fd565b61363f81613602565b0190565b61366861365f926020926136568161044c565b948580936135fd565b93849101610459565b0190565b60007f206973206d697373696e6720726f6c6520000000000000000000000000000000910152565b6136a0601180926135fd565b6136a98161366c565b0190565b6136c76136d293926136c16136cc9361362a565b90613643565b613694565b90613643565b90565b906136ea6136e4838390612424565b15610307565b6136f2575050565b61376a9161374861372161371161370b61374d95613bfe565b93613486565b61371b60206135e1565b90613e17565b9161373961372d6102a3565b938492602084016136ad565b60208201810382520382610a24565b613547565b6137556102a3565b91829162461bcd60e51b8352600483016104b9565b0390fd5b61378261377c828490612424565b15610307565b61378b575b5050565b6137ae60016137a960006137a1600286906118d8565b01859061240c565b611e08565b906137b76130ed565b906137f46137ee6137e87f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d956118cc565b92612400565b92612400565b926137fd6102a3565b8061380781610402565b0390a43880613787565b61381a906116db565b90565b61383161382c61383692610364565b6116d8565b610507565b90565b61384d61384861385292610507565b611055565b61070c565b90565b9061388861388261387d613878600061388d9661387061146c565b500194613811565b61381d565b613839565b91613483565b61400d565b90565b61389b818390612424565b6138a4575b5050565b6138c760006138c260006138ba600286906118d8565b01859061240c565b611e08565b906138d06130ed565b9061390d6139076139017ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b956118cc565b92612400565b92612400565b926139166102a3565b8061392081610402565b0390a438806138a0565b9061395d61395761395261394d60006139629661394561146c565b500194613811565b61381d565b613839565b91613483565b6140f2565b90565b9261398f90613988613996946139816139d49a989560076122aa565b60086122aa565b60066122aa565b60096122aa565b6139a86139a1611077565b82906130c3565b6139ba6139b361208c565b82906130c3565b6139cc6139c56114b1565b82906130c3565b9190916141fc565b565b5490565b600052602060002090565b6139ee816139d6565b821015613a0957613a006001916139da565b91020190600090565b612a9c565b613a1e906008613a2393026121ad565b6118f0565b90565b90613a319154613a0e565b90565b613a53916000613a4d92613a466118c7565b50016139e5565b90613a26565b90565b606090565b919091613a66613a56565b5060405192601f1980835193818060208701165b80830151818a015201908115613a9557819091508290613a7a565b505050815191838601828060208601165b808401518184015201918215613ac3578280919350508390613aa6565b505050506020910180828501019060008252845201604052565b6000613af291613aeb611779565b50016139d6565b90565b613afd61146c565b5060e01c635b5e139f8114906301ffc9a76380ac58cd82149114171790565b613b2461146c565b50613b2e81614219565b8015613b73575b8015613b58575b908115613b48575b5090565b613b529150614259565b38613b44565b506000613b6d613b67836102b8565b916102b8565b14613b3c565b50613b7d81614259565b613b35565b613b8a61146c565b50613b9481614259565b908115613ba0575b5090565b613baa9150614299565b38613b9c565b90565b60ff1690565b613bcd613bc8613bd292613bb0565b6116d8565b613bb3565b90565b613bdf6014613bb9565b90565b613bf6613bf1613bfb92613bb3565b6116d8565b610507565b90565b613c1b613c16613c3192613c10611509565b50613811565b61381d565b613c2b613c26613bd5565b613be2565b90613e17565b90565b90565b613c4b613c46613c5092613c34565b6116d8565b610507565b90565b90613c65613c60836128dc565b610a4d565b918252565b369037565b90613c94613c7c83613c53565b92602080613c8a86936128dc565b9201910390613c6a565b565b600360fc1b90565b5190565b90613cac82613c9e565b811015613cbe57600160209102010190565b612a9c565b600f60fb1b90565b90565b613ce2613cdd613ce792613ccb565b6116d8565b610507565b90565b613cf390610507565b60008114613d02576001900390565b611a9a565b6f181899199a1a9b1b9c1cb0b131b232b360811b90565b613d26613d07565b90565b90565b613d40613d3b613d4592613d29565b6116d8565b610507565b90565b60f81b90565b90565b613d65613d60613d6a92613d4e565b6116d8565b613bb3565b90565b613d8c90613d86613d80613d9194613bb3565b91610507565b906121ad565b610507565b90565b60007f537472696e67733a20686578206c656e67746820696e73756666696369656e74910152565b613dc860208092610450565b613dd181613d94565b0190565b613deb9060208101906000818303910152613dbc565b90565b15613df557565b613dfd6102a3565b62461bcd60e51b815280613e1360048201613dd5565b0390fd5b9190613e21611509565b50613ebb613eab613e57613e52613e426002613e3d8791613c37565b611ab0565b613e4c6002613c37565b90611c9d565b613c6f565b92613e60613c96565b613e7985613e7360009360001a93611c1b565b90613ca2565b53613e82613cc3565b613e9b85613e9560019360001a93613cce565b90613ca2565b53613ea66002613c37565b611ab0565b613eb56001613cce565b90611c9d565b925b83613ed1613ecb6001613cce565b91610507565b1115613f3857613edf613d1e565b81613eea600f613d2c565b16916010831015613f3357613f06613f2792613f2d941a613d48565b613f168591889060001a92613ca2565b53613f216004613d51565b90613d6d565b93613cea565b92613ebd565b612a9c565b613f60929350613f5b90613f55613f4f6000611c1b565b91610507565b14613dee565b613547565b90565b90565b600052602060002090565b5490565b613f7e81613f71565b821015613f9957613f90600191613f66565b91020190600090565b612a9c565b9190613fb4613faf613fbc936118cc565b612b95565b9083546120da565b9055565b9081549168010000000000000000831015613ff05782613fe8916001613fee95018155613f75565b90613f9e565b565b610a0e565b90613fff906118cc565b600052602052604060002090565b61401561146c565b5061402a6140248284906142d9565b15610307565b60001461406d576140636140689261404e61404760008501613f63565b8290613fc0565b600161405c600085016139d6565b9301613ff5565b611c7d565b600190565b5050600090565b61408361408991939293610507565b92610507565b820391821161409457565b611a9a565b634e487b7160e01b600052603160045260246000fd5b6140c1916140bb6118c7565b91613f9e565b565b6140cc81613f71565b80156140ed5760019003906140ea6140e48383613f75565b906140af565b55565b614099565b6140fa61146c565b5061411161410c600183018490613ff5565b61179b565b90816141266141206000611c1b565b91610507565b14156000146141f4576141a69260016141a1928461414f60009661414985613cce565b90614074565b61416c61415d8885016139d6565b61416686613cce565b90614074565b8061417f61417984610507565b91610507565b036141ab575b50505061419b614196868301613f63565b6140c3565b01613ff5565b612122565b600190565b6141ec926141de6141ca6141c46141e7948c89016139e5565b90613a26565b936141d885918c89016139e5565b90613f9e565b91858501613ff5565b611c7d565b388080614185565b505050600090565b90614212614217939261420d611699565b6130c3565b61430f565b565b61422161146c565b508061423c61423663152a902d60e11b6102b8565b916102b8565b14908115614249575b5090565b614253915061432f565b38614245565b61426161146c565b508061427c614276635a05180f60e01b6102b8565b916102b8565b14908115614289575b5090565b6142939150614355565b38614285565b6142a161146c565b50806142bc6142b6634e821d3360e11b6102b8565b916102b8565b149081156142c9575b5090565b6142d39150613b1c565b386142c5565b6142f79160016142f2926142eb61146c565b5001613ff5565b61179b565b61430a6143046000611c1b565b91610507565b141590565b9061432661431f61432d93611703565b6004611739565b6005612ba1565b565b61433761146c565b5061435161434b6301ffc9a760e01b6102b8565b916102b8565b1490565b61435d61146c565b5080614378614372637965db0b60e01b6102b8565b916102b8565b14908115614385575b5090565b61438f9150614219565b3861438156fea26469706673582212207e7417edcfe76a3f3a18feeb5cfaca1492aa7f8073ec281d22bfb5cd9f7f952d64736f6c634300081b003360806040523461002f576100196100146100fa565b61011b565b610021610034565b610722610380823961072290f35b61003a565b60405190565b600080fd5b601f801991011690565b634e487b7160e01b600052604160045260246000fd5b906100699061003f565b810190811060018060401b0382111761008157604052565b610049565b90610099610092610034565b928361005f565b565b600080fd5b60018060a01b031690565b6100b4906100a0565b90565b6100c0816100ab565b036100c757565b600080fd5b905051906100d9826100b7565b565b906020828203126100f5576100f2916000016100cc565b90565b61009b565b610118610aa28038038061010d81610086565b9283398101906100db565b90565b61012c9061012761012e565b61026e565b565b61013e610139610291565b6102d6565b565b60209181520190565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b6101a46033604092610140565b6101ad81610149565b0190565b6101c79060208101906000818303910152610197565b90565b156101d157565b6101d9610034565b62461bcd60e51b8152806101ef600482016101b1565b0390fd5b60001b90565b9061020a60018060a01b03916101f3565b9181191691161790565b90565b61022b610226610230926100a0565b610214565b6100a0565b90565b61023c90610217565b90565b61024890610233565b90565b90565b9061026361025e61026a9261023f565b61024b565b82546101f9565b9055565b61028a9061028361027e8261035e565b6101ca565b600161024e565b565b600090565b61029961028c565b503390565b60001c90565b60018060a01b031690565b6102bb6102c09161029e565b6102a4565b90565b6102cd90546102af565b90565b60000190565b6102e060006102c3565b6102eb82600061024e565b9061031f6103197f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361023f565b9161023f565b91610328610034565b80610332816102d0565b0390a3565b600090565b90565b90565b61035661035161035b9261033f565b610214565b61033c565b90565b610366610337565b503b61037b6103756000610342565b9161033c565b119056fe60806040526004361015610013575b610219565b61001e60003561006d565b80633659cfe6146100685780635c60da1b14610063578063715018a61461005e5780638da5cb5b146100595763f2fde38b0361000e576101e6565b6101b1565b61017e565b610149565b6100e3565b60e01c90565b60405190565b600080fd5b600080fd5b60018060a01b031690565b61009790610083565b90565b6100a38161008e565b036100aa57565b600080fd5b905035906100bc8261009a565b565b906020828203126100d8576100d5916000016100af565b90565b61007e565b60000190565b34610111576100fb6100f63660046100be565b6102b3565b610103610073565b8061010d816100dd565b0390f35b610079565b600091031261012157565b61007e565b61012f9061008e565b9052565b919061014790600060208501940190610126565b565b3461017957610159366004610116565b6101756101646102f5565b61016c610073565b91829182610133565b0390f35b610079565b346101ac5761018e366004610116565b61019661035c565b61019e610073565b806101a8816100dd565b0390f35b610079565b346101e1576101c1366004610116565b6101dd6101cc610366565b6101d4610073565b91829182610133565b0390f35b610079565b34610214576101fe6101f93660046100be565b610473565b610206610073565b80610210816100dd565b0390f35b610079565b600080fd5b61022f9061022a610501565b610268565b565b90565b61024861024361024d92610083565b610231565b610083565b90565b61025990610234565b90565b61026590610250565b90565b6102718161061b565b61029b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b9161025c565b906102a4610073565b806102ae816100dd565b0390a2565b6102bc9061021e565b565b600090565b60001c90565b60018060a01b031690565b6102e06102e5916102c3565b6102c9565b90565b6102f290546102d4565b90565b6102fd6102be565b5061030860016102e8565b90565b610313610501565b61031b610348565b565b90565b61033461032f6103399261031d565b610231565b610083565b90565b61034590610320565b90565b61035a610355600061033c565b610639565b565b61036461030b565b565b61036e6102be565b5061037960006102e8565b90565b61038d90610388610501565b610442565b565b60209181520190565b60207f6464726573730000000000000000000000000000000000000000000000000000917f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201520152565b6103f3602660409261038f565b6103fc81610398565b0190565b61041690602081019060008183039101526103e6565b90565b1561042057565b610428610073565b62461bcd60e51b81528061043e60048201610400565b0390fd5b6104719061046c8161046561045f61045a600061033c565b61008e565b9161008e565b1415610419565b610639565b565b61047c9061037c565b565b60007f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572910152565b6104b26020809261038f565b6104bb8161047e565b0190565b6104d590602081019060008183039101526104a6565b90565b156104df57565b6104e7610073565b62461bcd60e51b8152806104fd600482016104bf565b0390fd5b61052b61050c610366565b61052561051f61051a61069a565b61008e565b9161008e565b146104d8565b565b60207f6e206973206e6f74206120636f6e747261637400000000000000000000000000917f5570677261646561626c65426561636f6e3a20696d706c656d656e746174696f60008201520152565b610588603360409261038f565b6105918161052d565b0190565b6105ab906020810190600081830391015261057b565b90565b156105b557565b6105bd610073565b62461bcd60e51b8152806105d360048201610595565b0390fd5b60001b90565b906105ee60018060a01b03916105d7565b9181191691161790565b90565b9061061061060b6106179261025c565b6105f8565b82546105dd565b9055565b6106379061063061062b826106cb565b6105ae565b60016105fb565b565b61064360006102e8565b61064e8260006105fb565b9061068261067c7f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09361025c565b9161025c565b9161068b610073565b80610695816100dd565b0390a3565b6106a26102be565b503390565b600090565b90565b6106c36106be6106c89261031d565b610231565b6106ac565b90565b6106d36106a7565b503b6106e86106e260006106af565b916106ac565b119056fea26469706673582212203fbf94b3aa182e7120f7ee578f52eecce106fbe2a323e7e4f1511d9f27768ead64736f6c634300081b0033', signer ) } @@ -228,209 +16,233 @@ export class ERC721SoulboundFactory extends ContractFactory { export const ERC721SOULBOUNDFACTORY_VERIFICATION: Omit = { contractToVerify: 'src/tokens/ERC721/presets/soulbound/ERC721SoulboundFactory.sol:ERC721SoulboundFactory', - version: 'v0.8.19+commit.7dd6d404', + version: 'v0.8.27+commit.40a35a09', licenceType: 'Apache-2.0', compilerInput: { language: 'Solidity', sources: { 'src/tokens/ERC721/presets/soulbound/ERC721SoulboundFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {IERC721SoulboundFactory, IERC721SoulboundFactoryFunctions} from\n "@0xsequence/contracts-library/tokens/ERC721/presets/soulbound/IERC721SoulboundFactory.sol";\nimport {ERC721Soulbound} from "@0xsequence/contracts-library/tokens/ERC721/presets/soulbound/ERC721Soulbound.sol";\nimport {SequenceProxyFactory} from "@0xsequence/contracts-library/proxies/SequenceProxyFactory.sol";\n\n/**\n * Deployer of ERC-721 Soulbound proxies.\n */\ncontract ERC721SoulboundFactory is IERC721SoulboundFactory, SequenceProxyFactory {\n /**\n * Creates an ERC-721 Soulbound Factory.\n * @param factoryOwner The owner of the ERC-721 Soulbound Factory\n */\n constructor(address factoryOwner) {\n ERC721Soulbound impl = new ERC721Soulbound();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721SoulboundFactoryFunctions\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 )\n external\n returns (address proxyAddr)\n {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, symbol, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\n proxyAddr = _createProxy(salt, proxyOwner, "");\n ERC721Soulbound(proxyAddr).initialize(tokenOwner, name, symbol, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator);\n emit ERC721SoulboundDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721SoulboundFactoryFunctions\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 ) external view returns (address proxyAddr)\n {\n bytes32 salt =\n keccak256(abi.encode(tokenOwner, name, symbol, baseURI, contractURI, royaltyReceiver, royaltyFeeNumerator));\n return _computeProxyAddress(salt, proxyOwner, "");\n }\n}\n' - }, - 'src/tokens/ERC721/presets/soulbound/IERC721SoulboundFactory.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SoulboundFactoryFunctions {\n /**\n * Creates an ERC-721 Soulbound proxy.\n * @param proxyOwner The owner of the ERC-721 Soulbound proxy\n * @param tokenOwner The owner of the ERC-721 Soulbound implementation\n * @param name The name of the ERC-721 Soulbound proxy\n * @param symbol The symbol of the ERC-721 Soulbound proxy\n * @param baseURI The base URI of the ERC-721 Soulbound proxy\n * @param contractURI The contract URI of the ERC-721 Soulbound 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-721 Soulbound 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 )\n external\n returns (address proxyAddr);\n\n /**\n * Computes the address of a proxy instance.\n * @param proxyOwner The owner of the ERC-721 Soulbound proxy\n * @param tokenOwner The owner of the ERC-721 Soulbound implementation\n * @param name The name of the ERC-721 Soulbound proxy\n * @param symbol The symbol of the ERC-721 Soulbound proxy\n * @param baseURI The base URI of the ERC-721 Soulbound proxy\n * @param contractURI The contract URI of the ERC-721 Soulbound 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-721 Soulbound 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 )\n external\n returns (address proxyAddr);\n}\n\ninterface IERC721SoulboundFactorySignals {\n /**\n * Event emitted when a new ERC-721 Soulbound proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721SoulboundDeployed(address proxyAddr);\n}\n\ninterface IERC721SoulboundFactory is IERC721SoulboundFactoryFunctions, IERC721SoulboundFactorySignals {}\n' - }, - 'src/tokens/ERC721/presets/soulbound/ERC721Soulbound.sol': { - content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {ERC721Items} from "@0xsequence/contracts-library/tokens/ERC721/presets/items/ERC721Items.sol";\nimport {\n IERC721Soulbound,\n IERC721SoulboundFunctions\n} from "@0xsequence/contracts-library/tokens/ERC721/presets/soulbound/IERC721Soulbound.sol";\n\n/**\n * An implementation of ERC-721 that prevents transfers.\n */\ncontract ERC721Soulbound is ERC721Items, IERC721Soulbound {\n bytes32 public constant TRANSFER_ADMIN_ROLE = keccak256("TRANSFER_ADMIN_ROLE");\n\n bool internal _transferLocked;\n\n constructor() ERC721Items() {}\n\n /// @inheritdoc ERC721Items\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 ) public virtual override {\n _transferLocked = true;\n _grantRole(TRANSFER_ADMIN_ROLE, owner);\n super.initialize(\n owner, tokenName, tokenSymbol, tokenBaseURI, tokenContractURI, royaltyReceiver, royaltyFeeNumerator\n );\n }\n\n /// @inheritdoc IERC721SoulboundFunctions\n function setTransferLocked(bool locked) external override onlyRole(TRANSFER_ADMIN_ROLE) {\n _transferLocked = locked;\n }\n\n /// @inheritdoc IERC721SoulboundFunctions\n function getTransferLocked() external view override returns (bool) {\n return _transferLocked;\n }\n\n function _beforeTokenTransfers(address from, address to, uint256 startTokenId, uint256 quantity)\n internal\n virtual\n override\n {\n // Mint transactions allowed\n if (_transferLocked && from != address(0)) {\n revert TransfersLocked();\n }\n super._beforeTokenTransfers(from, to, startTokenId, quantity);\n }\n\n function supportsInterface(bytes4 interfaceId) public view override returns (bool) {\n return type(IERC721SoulboundFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { SequenceProxyFactory } from "../../../../proxies/SequenceProxyFactory.sol";\nimport { ERC721Soulbound } from "./ERC721Soulbound.sol";\nimport { IERC721SoulboundFactory, IERC721SoulboundFactoryFunctions } from "./IERC721SoulboundFactory.sol";\n\n/**\n * Deployer of ERC-721 Soulbound proxies.\n */\ncontract ERC721SoulboundFactory is IERC721SoulboundFactory, SequenceProxyFactory {\n\n /**\n * Creates an ERC-721 Soulbound Factory.\n * @param factoryOwner The owner of the ERC-721 Soulbound Factory\n */\n constructor(\n address factoryOwner\n ) {\n ERC721Soulbound impl = new ERC721Soulbound();\n SequenceProxyFactory._initialize(address(impl), factoryOwner);\n }\n\n /// @inheritdoc IERC721SoulboundFactoryFunctions\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 ERC721Soulbound(proxyAddr).initialize(\n tokenOwner,\n name,\n symbol,\n baseURI,\n contractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n emit ERC721SoulboundDeployed(proxyAddr);\n return proxyAddr;\n }\n\n /// @inheritdoc IERC721SoulboundFactoryFunctions\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' }, '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/ERC721/presets/items/ERC721Items.sol': { + 'src/tokens/ERC721/presets/soulbound/ERC721Soulbound.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {ERC721BaseToken} from "@0xsequence/contracts-library/tokens/ERC721/ERC721BaseToken.sol";\nimport {\n IERC721Items,\n IERC721ItemsFunctions\n} from "@0xsequence/contracts-library/tokens/ERC721/presets/items/IERC721Items.sol";\n\n/**\n * An implementation of ERC-721 capable of minting when role provided.\n */\ncontract ERC721Items is ERC721BaseToken, IERC721Items {\n bytes32 internal constant MINTER_ROLE = keccak256("MINTER_ROLE");\n\n address private immutable _initializer;\n bool private _initialized;\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 * @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 )\n public\n virtual\n {\n if (msg.sender != _initializer || _initialized) {\n revert InvalidInitialization();\n }\n\n ERC721BaseToken._initialize(owner, tokenName, tokenSymbol, 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 amount Amount of tokens to mint.\n */\n function mint(address to, uint256 amount) external onlyRole(MINTER_ROLE) {\n _mint(to, amount);\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 returns (bool) {\n return type(IERC721ItemsFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { ERC721Items } from "../items/ERC721Items.sol";\nimport { IERC721Soulbound, IERC721SoulboundFunctions } from "./IERC721Soulbound.sol";\n\n/**\n * An implementation of ERC-721 that prevents transfers.\n */\ncontract ERC721Soulbound is ERC721Items, IERC721Soulbound {\n\n bytes32 public constant TRANSFER_ADMIN_ROLE = keccak256("TRANSFER_ADMIN_ROLE");\n\n bool internal _transferLocked;\n\n constructor() ERC721Items() { }\n\n /// @inheritdoc ERC721Items\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 override {\n _transferLocked = true;\n _grantRole(TRANSFER_ADMIN_ROLE, owner);\n super.initialize(\n owner,\n tokenName,\n tokenSymbol,\n tokenBaseURI,\n tokenContractURI,\n royaltyReceiver,\n royaltyFeeNumerator,\n implicitModeValidator,\n implicitModeProjectId\n );\n }\n\n /// @inheritdoc IERC721SoulboundFunctions\n function setTransferLocked(\n bool locked\n ) external override onlyRole(TRANSFER_ADMIN_ROLE) {\n _transferLocked = locked;\n }\n\n /// @inheritdoc IERC721SoulboundFunctions\n function getTransferLocked() external view override returns (bool) {\n return _transferLocked;\n }\n\n function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal virtual override {\n // Mint transactions allowed\n if (_transferLocked && from != address(0)) {\n revert TransfersLocked();\n }\n super._beforeTokenTransfer(from, to, tokenId);\n }\n\n function supportsInterface(\n bytes4 interfaceId\n ) public view override returns (bool) {\n return type(IERC721SoulboundFunctions).interfaceId == interfaceId || super.supportsInterface(interfaceId);\n }\n\n}\n' }, - 'src/tokens/ERC721/presets/soulbound/IERC721Soulbound.sol': { + 'src/tokens/ERC721/presets/soulbound/IERC721SoulboundFactory.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SoulboundFunctions {\n /**\n * Sets the transfer lock.\n * @param locked Whether or not transfers are locked.\n */\n function setTransferLocked(bool locked) external;\n\n /**\n * Gets the transfer lock.\n * @return Whether or not transfers are locked.\n */\n function getTransferLocked() external view returns (bool);\n}\n\ninterface IERC721SoulboundSignals {\n /**\n * Transfers locked.\n */\n error TransfersLocked();\n}\n\ninterface IERC721Soulbound is IERC721SoulboundFunctions, IERC721SoulboundSignals {}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SoulboundFactoryFunctions {\n\n /**\n * Creates an ERC-721 Soulbound proxy.\n * @param proxyOwner The owner of the ERC-721 Soulbound proxy\n * @param tokenOwner The owner of the ERC-721 Soulbound implementation\n * @param name The name of the ERC-721 Soulbound proxy\n * @param symbol The symbol of the ERC-721 Soulbound proxy\n * @param baseURI The base URI of the ERC-721 Soulbound proxy\n * @param contractURI The contract URI of the ERC-721 Soulbound 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 Soulbound 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 Soulbound proxy\n * @param tokenOwner The owner of the ERC-721 Soulbound implementation\n * @param name The name of the ERC-721 Soulbound proxy\n * @param symbol The symbol of the ERC-721 Soulbound proxy\n * @param baseURI The base URI of the ERC-721 Soulbound proxy\n * @param contractURI The contract URI of the ERC-721 Soulbound 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 Soulbound 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 IERC721SoulboundFactorySignals {\n\n /**\n * Event emitted when a new ERC-721 Soulbound proxy contract is deployed.\n * @param proxyAddr The address of the deployed proxy.\n */\n event ERC721SoulboundDeployed(address proxyAddr);\n\n}\n\ninterface IERC721SoulboundFactory is IERC721SoulboundFactoryFunctions, IERC721SoulboundFactorySignals { }\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 {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' - }, - 'lib/openzeppelin/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' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport { BeaconProxy, Proxy } from "./openzeppelin/BeaconProxy.sol";\nimport { ERC1967Proxy, TransparentUpgradeableProxy } from "./openzeppelin/TransparentUpgradeableProxy.sol";\n\ninterface ITransparentUpgradeableBeaconProxy {\n\n function initialize(address admin, address beacon, bytes memory data) external;\n\n}\n\nerror InvalidInitialization();\n\n/**\n * @dev As the underlying proxy implementation (TransparentUpgradeableProxy) allows the admin to call the implementation,\n * care must be taken to avoid proxy selector collisions. Implementation selectors must not conflict with the proxy selectors.\n * See https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing].\n * The proxy selectors are:\n * - 0xcf7a1d77: initialize\n * - 0x3659cfe6: upgradeTo (from TransparentUpgradeableProxy)\n * - 0x4f1ef286: upgradeToAndCall (from TransparentUpgradeableProxy)\n * - 0x8f283970: changeAdmin (from TransparentUpgradeableProxy)\n * - 0xf851a440: admin (from TransparentUpgradeableProxy)\n * - 0x5c60da1b: implementation (from TransparentUpgradeableProxy)\n */\ncontract TransparentUpgradeableBeaconProxy is TransparentUpgradeableProxy, BeaconProxy {\n\n /**\n * Decode the initialization data from the msg.data and call the initialize function.\n */\n function _dispatchInitialize() private returns (bytes memory) {\n _requireZeroValue();\n\n (address admin, address beacon, bytes memory data) = abi.decode(msg.data[4:], (address, address, bytes));\n initialize(admin, beacon, data);\n\n return "";\n }\n\n function initialize(address admin, address beacon, bytes memory data) internal {\n if (_admin() != address(0)) {\n // Redundant call. This function can only be called when the admin is not set.\n revert InvalidInitialization();\n }\n _changeAdmin(admin);\n _upgradeBeaconToAndCall(beacon, data, false);\n }\n\n /**\n * @dev If the admin is not set, the fallback function is used to initialize the proxy.\n * @dev If the admin is set, the fallback function is used to delegatecall the implementation.\n */\n function _fallback() internal override(TransparentUpgradeableProxy, Proxy) {\n if (_getAdmin() == address(0)) {\n bytes memory ret;\n bytes4 selector = msg.sig;\n if (selector == ITransparentUpgradeableBeaconProxy.initialize.selector) {\n ret = _dispatchInitialize();\n // solhint-disable-next-line no-inline-assembly\n assembly {\n return(add(ret, 0x20), mload(ret))\n }\n }\n // When the admin is not set, the fallback function is used to initialize the proxy.\n revert InvalidInitialization();\n }\n TransparentUpgradeableProxy._fallback();\n }\n\n /**\n * Returns the current implementation address.\n * @dev This is the implementation address set by the admin, or the beacon implementation.\n */\n function _implementation() internal view override(ERC1967Proxy, BeaconProxy) returns (address) {\n address implementation = ERC1967Proxy._implementation();\n if (implementation != address(0)) {\n return implementation;\n }\n return BeaconProxy._implementation();\n }\n\n}\n' }, - 'lib/openzeppelin/contracts/access/Ownable.sol': { + 'lib/openzeppelin-contracts/contracts/access/Ownable.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport "../utils/Context.sol";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), "Ownable: caller is not the owner");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby disabling any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), "Ownable: new owner is the zero address");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n' }, - 'lib/openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/beacon/UpgradeableBeacon.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IBeacon.sol";\nimport "../../access/Ownable.sol";\nimport "../../utils/Address.sol";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");\n _implementation = newImplementation;\n }\n}\n' }, - 'src/tokens/ERC721/ERC721BaseToken.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Create2.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\nimport {\n ERC721AQueryable, IERC721AQueryable, ERC721A, IERC721A\n} from "erc721a/contracts/extensions/ERC721AQueryable.sol";\nimport {ERC2981Controlled} from "@0xsequence/contracts-library/tokens/common/ERC2981Controlled.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 ERC721AQueryable, ERC2981Controlled {\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 * Deploy contract.\n */\n constructor() ERC721A("", "") {}\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 * @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 )\n internal\n {\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\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(string memory tokenName, string memory tokenSymbol)\n external\n onlyRole(METADATA_ADMIN_ROLE)\n {\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(string memory tokenBaseURI) 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(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 token.\n * @param tokenId Id of token to burn\n */\n function burn(uint256 tokenId) public virtual {\n _burn(tokenId, true);\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(uint256[] memory tokenIds) public virtual {\n uint256 nBurn = tokenIds.length;\n for (uint256 i = 0; i < nBurn; i++) {\n _burn(tokenIds[i], true);\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(bytes4 interfaceId)\n public\n view\n virtual\n override (ERC721A, IERC721A, ERC2981Controlled)\n returns (bool)\n {\n return interfaceId == type(IERC721A).interfaceId || interfaceId == type(IERC721AQueryable).interfaceId\n || ERC721A.supportsInterface(interfaceId) || ERC2981Controlled.supportsInterface(interfaceId)\n || super.supportsInterface(interfaceId);\n }\n\n //\n // ERC721A Overrides\n //\n\n /**\n * Override the ERC721A baseURI function.\n */\n function _baseURI() internal view override returns (string memory) {\n return _tokenBaseURI;\n }\n\n /**\n * Override the ERC721A name function.\n */\n function name() public view override (ERC721A, IERC721A) returns (string memory) {\n return _tokenName;\n }\n\n /**\n * Override the ERC721A symbol function.\n */\n function symbol() public view override (ERC721A, IERC721A) returns (string memory) {\n return _tokenSymbol;\n }\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' }, - 'src/tokens/ERC721/presets/items/IERC721Items.sol': { + 'src/tokens/ERC721/presets/items/ERC721Items.sol': { + content: + '// 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' + }, + 'src/tokens/ERC721/presets/soulbound/IERC721Soulbound.sol': { content: - '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721ItemsFunctions {\n /**\n * Mint tokens.\n * @param to Address to mint tokens to.\n * @param amount Amount of tokens to mint.\n */\n function mint(address to, uint256 amount) external;\n}\n\ninterface IERC721ItemsSignals {\n /**\n * Invalid initialization error.\n */\n error InvalidInitialization();\n}\n\ninterface IERC721Items is IERC721ItemsFunctions, IERC721ItemsSignals {}\n' + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.19;\n\ninterface IERC721SoulboundFunctions {\n\n /**\n * Sets the transfer lock.\n * @param locked Whether or not transfers are locked.\n */\n function setTransferLocked(\n bool locked\n ) external;\n\n /**\n * Gets the transfer lock.\n * @return Whether or not transfers are locked.\n */\n function getTransferLocked() external view returns (bool);\n\n}\n\ninterface IERC721SoulboundSignals {\n\n /**\n * Transfers locked.\n */\n error TransfersLocked();\n\n}\n\ninterface IERC721Soulbound is IERC721SoulboundFunctions, IERC721SoulboundSignals { }\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' }, - 'lib/chiru-labs/erc721a/contracts/extensions/ERC721AQueryable.sol': { - content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721AQueryable.sol';\nimport '../ERC721A.sol';\n\n/**\n * @title ERC721AQueryable.\n *\n * @dev ERC721A subclass with convenience query functions.\n */\nabstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n *\n * - `addr = address(0)`\n * - `startTimestamp = 0`\n * - `burned = false`\n * - `extraData = 0`\n *\n * If the `tokenId` is burned:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = true`\n * - `extraData = `\n *\n * Otherwise:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = false`\n * - `extraData = `\n */\n function explicitOwnershipOf(uint256 tokenId)\n public\n view\n virtual\n override\n returns (TokenOwnership memory ownership)\n {\n unchecked {\n if (tokenId >= _startTokenId()) {\n if (tokenId > _sequentialUpTo()) return _ownershipAt(tokenId);\n\n if (tokenId < _nextTokenId()) {\n // If the `tokenId` is within bounds,\n // scan backwards for the initialized ownership slot.\n while (!_ownershipIsInitialized(tokenId)) --tokenId;\n return _ownershipAt(tokenId);\n }\n }\n }\n }\n\n /**\n * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\n * See {ERC721AQueryable-explicitOwnershipOf}\n */\n function explicitOwnershipsOf(uint256[] calldata tokenIds)\n external\n view\n virtual\n override\n returns (TokenOwnership[] memory)\n {\n TokenOwnership[] memory ownerships;\n uint256 i = tokenIds.length;\n assembly {\n // Grab the free memory pointer.\n ownerships := mload(0x40)\n // Store the length.\n mstore(ownerships, i)\n // Allocate one word for the length,\n // `tokenIds.length` words for the pointers.\n i := shl(5, i) // Multiply `i` by 32.\n mstore(0x40, add(add(ownerships, 0x20), i))\n }\n while (i != 0) {\n uint256 tokenId;\n assembly {\n i := sub(i, 0x20)\n tokenId := calldataload(add(tokenIds.offset, i))\n }\n TokenOwnership memory ownership = explicitOwnershipOf(tokenId);\n assembly {\n // Store the pointer of `ownership` in the `ownerships` array.\n mstore(add(add(ownerships, 0x20), i), ownership)\n }\n }\n return ownerships;\n }\n\n /**\n * @dev Returns an array of token IDs owned by `owner`,\n * in the range [`start`, `stop`)\n * (i.e. `start <= tokenId < stop`).\n *\n * This function allows for tokens to be queried if the collection\n * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\n *\n * Requirements:\n *\n * - `start < stop`\n */\n function tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) external view virtual override returns (uint256[] memory) {\n return _tokensOfOwnerIn(owner, start, stop);\n }\n\n /**\n * @dev Returns an array of token IDs owned by `owner`.\n *\n * This function scans the ownership mapping and is O(`totalSupply`) in complexity.\n * It is meant to be called off-chain.\n *\n * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\n * multiple smaller scans if the collection is large enough to cause\n * an out-of-gas error (10K collections should be fine).\n */\n function tokensOfOwner(address owner) external view virtual override returns (uint256[] memory) {\n // If spot mints are enabled, full-range scan is disabled.\n if (_sequentialUpTo() != type(uint256).max) _revert(NotCompatibleWithSpotMints.selector);\n uint256 start = _startTokenId();\n uint256 stop = _nextTokenId();\n uint256[] memory tokenIds;\n if (start != stop) tokenIds = _tokensOfOwnerIn(owner, start, stop);\n return tokenIds;\n }\n\n /**\n * @dev Helper function for returning an array of token IDs owned by `owner`.\n *\n * Note that this function is optimized for smaller bytecode size over runtime gas,\n * since it is meant to be called off-chain.\n */\n function _tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) private view returns (uint256[] memory tokenIds) {\n unchecked {\n if (start >= stop) _revert(InvalidQueryRange.selector);\n // Set `start = max(start, _startTokenId())`.\n if (start < _startTokenId()) start = _startTokenId();\n uint256 nextTokenId = _nextTokenId();\n // If spot mints are enabled, scan all the way until the specified `stop`.\n uint256 stopLimit = _sequentialUpTo() != type(uint256).max ? stop : nextTokenId;\n // Set `stop = min(stop, stopLimit)`.\n if (stop >= stopLimit) stop = stopLimit;\n // Number of tokens to scan.\n uint256 tokenIdsMaxLength = balanceOf(owner);\n // Set `tokenIdsMaxLength` to zero if the range contains no tokens.\n if (start >= stop) tokenIdsMaxLength = 0;\n // If there are one or more tokens to scan.\n if (tokenIdsMaxLength != 0) {\n // Set `tokenIdsMaxLength = min(balanceOf(owner), tokenIdsMaxLength)`.\n if (stop - start <= tokenIdsMaxLength) tokenIdsMaxLength = stop - start;\n uint256 m; // Start of available memory.\n assembly {\n // Grab the free memory pointer.\n tokenIds := mload(0x40)\n // Allocate one word for the length, and `tokenIdsMaxLength` words\n // for the data. `shl(5, x)` is equivalent to `mul(32, x)`.\n m := add(tokenIds, shl(5, add(tokenIdsMaxLength, 1)))\n mstore(0x40, m)\n }\n // We need to call `explicitOwnershipOf(start)`,\n // because the slot at `start` may not be initialized.\n TokenOwnership memory ownership = explicitOwnershipOf(start);\n address currOwnershipAddr;\n // If the starting slot exists (i.e. not burned),\n // initialize `currOwnershipAddr`.\n // `ownership.address` will not be zero,\n // as `start` is clamped to the valid token ID range.\n if (!ownership.burned) currOwnershipAddr = ownership.addr;\n uint256 tokenIdsIdx;\n // Use a do-while, which is slightly more efficient for this case,\n // as the array will at least contain one element.\n do {\n if (_sequentialUpTo() != type(uint256).max) {\n // Skip the remaining unused sequential slots.\n if (start == nextTokenId) start = _sequentialUpTo() + 1;\n // Reset `currOwnershipAddr`, as each spot-minted token is a batch of one.\n if (start > _sequentialUpTo()) currOwnershipAddr = address(0);\n }\n ownership = _ownershipAt(start); // This implicitly allocates memory.\n assembly {\n switch mload(add(ownership, 0x40))\n // if `ownership.burned == false`.\n case 0 {\n // if `ownership.addr != address(0)`.\n // The `addr` already has it's upper 96 bits clearned,\n // since it is written to memory with regular Solidity.\n if mload(ownership) {\n currOwnershipAddr := mload(ownership)\n }\n // if `currOwnershipAddr == owner`.\n // The `shl(96, x)` is to make the comparison agnostic to any\n // dirty upper 96 bits in `owner`.\n if iszero(shl(96, xor(currOwnershipAddr, owner))) {\n tokenIdsIdx := add(tokenIdsIdx, 1)\n mstore(add(tokenIds, shl(5, tokenIdsIdx)), start)\n }\n }\n // Otherwise, reset `currOwnershipAddr`.\n // This handles the case of batch burned tokens\n // (burned bit of first slot set, remaining slots left uninitialized).\n default {\n currOwnershipAddr := 0\n }\n start := add(start, 1)\n // Free temporary memory implicitly allocated for ownership\n // to avoid quadratic memory expansion costs.\n mstore(0x40, m)\n }\n } while (!(start == stop || tokenIdsIdx == tokenIdsMaxLength));\n // Store the length of the array.\n assembly {\n mstore(tokenIds, tokenIdsIdx)\n }\n }\n }\n }\n}\n" - }, - 'src/tokens/common/ERC2981Controlled.sol': { + 'src/tokens/ERC721/ERC721BaseToken.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\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' }, - 'lib/openzeppelin/contracts/proxy/Proxy.sol': { + 'src/tokens/ERC721/presets/items/IERC721Items.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\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/ERC1967/ERC1967Upgrade.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport "../beacon/IBeacon.sol";\nimport "../../interfaces/IERC1967.sol";\nimport "../../interfaces/draft-IERC1822.sol";\nimport "../../utils/Address.sol";\nimport "../../utils/StorageSlot.sol";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n */\nabstract contract ERC1967Upgrade is IERC1967 {\n // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(address newImplementation, bytes memory data, bool forceCall) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(address newImplementation, bytes memory data, bool forceCall) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");\n } catch {\n revert("ERC1967Upgrade: new implementation is not UUPS");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), "ERC1967: new admin is the zero address");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256(\'eip1967.proxy.beacon\')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n "ERC1967: beacon implementation is not a contract"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(address newBeacon, bytes memory data, bool forceCall) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n' }, - 'src/proxies/openzeppelin/ERC1967Proxy.sol': { + 'lib/openzeppelin-contracts/contracts/proxy/Proxy.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\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/chiru-labs/erc721a/contracts/extensions/IERC721AQueryable.sol': { + 'src/proxies/openzeppelin/ERC1967Proxy.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport '../IERC721A.sol';\n\n/**\n * @dev Interface of ERC721AQueryable.\n */\ninterface IERC721AQueryable is IERC721A {\n /**\n * Invalid query range (`start` >= `stop`).\n */\n error InvalidQueryRange();\n\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n *\n * - `addr = address(0)`\n * - `startTimestamp = 0`\n * - `burned = false`\n * - `extraData = 0`\n *\n * If the `tokenId` is burned:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = true`\n * - `extraData = `\n *\n * Otherwise:\n *\n * - `addr =
`\n * - `startTimestamp = `\n * - `burned = false`\n * - `extraData = `\n */\n function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);\n\n /**\n * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.\n * See {ERC721AQueryable-explicitOwnershipOf}\n */\n function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);\n\n /**\n * @dev Returns an array of token IDs owned by `owner`,\n * in the range [`start`, `stop`)\n * (i.e. `start <= tokenId < stop`).\n *\n * This function allows for tokens to be queried if the collection\n * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.\n *\n * Requirements:\n *\n * - `start < stop`\n */\n function tokensOfOwnerIn(\n address owner,\n uint256 start,\n uint256 stop\n ) external view returns (uint256[] memory);\n\n /**\n * @dev Returns an array of token IDs owned by `owner`.\n *\n * This function scans the ownership mapping and is O(`totalSupply`) in complexity.\n * It is meant to be called off-chain.\n *\n * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into\n * multiple smaller scans if the collection is large enough to cause\n * an out-of-gas error (10K collections should be fine).\n */\n function tokensOfOwner(address owner) external view returns (uint256[] memory);\n}\n" + '// SPDX-License-Identifier: 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/chiru-labs/erc721a/contracts/ERC721A.sol': { + 'src/tokens/common/ERC2981Controlled.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721A.sol';\n\n/**\n * @dev Interface of ERC721 token receiver.\n */\ninterface ERC721A__IERC721Receiver {\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n\n/**\n * @title ERC721A\n *\n * @dev Implementation of the [ERC721](https://eips.ethereum.org/EIPS/eip-721)\n * Non-Fungible Token Standard, including the Metadata extension.\n * Optimized for lower gas during batch mints.\n *\n * Token IDs are minted in sequential order (e.g. 0, 1, 2, 3, ...)\n * starting from `_startTokenId()`.\n *\n * The `_sequentialUpTo()` function can be overriden to enable spot mints\n * (i.e. non-consecutive mints) for `tokenId`s greater than `_sequentialUpTo()`.\n *\n * Assumptions:\n *\n * - An owner cannot have more than 2**64 - 1 (max value of uint64) of supply.\n * - The maximum token ID cannot exceed 2**256 - 1 (max value of uint256).\n */\ncontract ERC721A is IERC721A {\n // Bypass for a `--via-ir` bug (https://github.com/chiru-labs/ERC721A/pull/364).\n struct TokenApprovalRef {\n address value;\n }\n\n // =============================================================\n // CONSTANTS\n // =============================================================\n\n // Mask of an entry in packed address data.\n uint256 private constant _BITMASK_ADDRESS_DATA_ENTRY = (1 << 64) - 1;\n\n // The bit position of `numberMinted` in packed address data.\n uint256 private constant _BITPOS_NUMBER_MINTED = 64;\n\n // The bit position of `numberBurned` in packed address data.\n uint256 private constant _BITPOS_NUMBER_BURNED = 128;\n\n // The bit position of `aux` in packed address data.\n uint256 private constant _BITPOS_AUX = 192;\n\n // Mask of all 256 bits in packed address data except the 64 bits for `aux`.\n uint256 private constant _BITMASK_AUX_COMPLEMENT = (1 << 192) - 1;\n\n // The bit position of `startTimestamp` in packed ownership.\n uint256 private constant _BITPOS_START_TIMESTAMP = 160;\n\n // The bit mask of the `burned` bit in packed ownership.\n uint256 private constant _BITMASK_BURNED = 1 << 224;\n\n // The bit position of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITPOS_NEXT_INITIALIZED = 225;\n\n // The bit mask of the `nextInitialized` bit in packed ownership.\n uint256 private constant _BITMASK_NEXT_INITIALIZED = 1 << 225;\n\n // The bit position of `extraData` in packed ownership.\n uint256 private constant _BITPOS_EXTRA_DATA = 232;\n\n // Mask of all 256 bits in a packed ownership except the 24 bits for `extraData`.\n uint256 private constant _BITMASK_EXTRA_DATA_COMPLEMENT = (1 << 232) - 1;\n\n // The mask of the lower 160 bits for addresses.\n uint256 private constant _BITMASK_ADDRESS = (1 << 160) - 1;\n\n // The maximum `quantity` that can be minted with {_mintERC2309}.\n // This limit is to prevent overflows on the address data entries.\n // For a limit of 5000, a total of 3.689e15 calls to {_mintERC2309}\n // is required to cause an overflow, which is unrealistic.\n uint256 private constant _MAX_MINT_ERC2309_QUANTITY_LIMIT = 5000;\n\n // The `Transfer` event signature is given by:\n // `keccak256(bytes(\"Transfer(address,address,uint256)\"))`.\n bytes32 private constant _TRANSFER_EVENT_SIGNATURE =\n 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef;\n\n // =============================================================\n // STORAGE\n // =============================================================\n\n // The next token ID to be minted.\n uint256 private _currentIndex;\n\n // The number of tokens burned.\n uint256 private _burnCounter;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to ownership details\n // An empty struct value does not necessarily mean the token is unowned.\n // See {_packedOwnershipOf} implementation for details.\n //\n // Bits Layout:\n // - [0..159] `addr`\n // - [160..223] `startTimestamp`\n // - [224] `burned`\n // - [225] `nextInitialized`\n // - [232..255] `extraData`\n mapping(uint256 => uint256) private _packedOwnerships;\n\n // Mapping owner address to address data.\n //\n // Bits Layout:\n // - [0..63] `balance`\n // - [64..127] `numberMinted`\n // - [128..191] `numberBurned`\n // - [192..255] `aux`\n mapping(address => uint256) private _packedAddressData;\n\n // Mapping from token ID to approved address.\n mapping(uint256 => TokenApprovalRef) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // The amount of tokens minted above `_sequentialUpTo()`.\n // We call these spot mints (i.e. non-sequential mints).\n uint256 private _spotMinted;\n\n // =============================================================\n // CONSTRUCTOR\n // =============================================================\n\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n _currentIndex = _startTokenId();\n\n if (_sequentialUpTo() < _startTokenId()) _revert(SequentialUpToTooSmall.selector);\n }\n\n // =============================================================\n // TOKEN COUNTING OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the starting token ID for sequential mints.\n *\n * Override this function to change the starting token ID for sequential mints.\n *\n * Note: The value returned must never change after any tokens have been minted.\n */\n function _startTokenId() internal view virtual returns (uint256) {\n return 0;\n }\n\n /**\n * @dev Returns the maximum token ID (inclusive) for sequential mints.\n *\n * Override this function to return a value less than 2**256 - 1,\n * but greater than `_startTokenId()`, to enable spot (non-sequential) mints.\n *\n * Note: The value returned must never change after any tokens have been minted.\n */\n function _sequentialUpTo() internal view virtual returns (uint256) {\n return type(uint256).max;\n }\n\n /**\n * @dev Returns the next token ID to be minted.\n */\n function _nextTokenId() internal view virtual returns (uint256) {\n return _currentIndex;\n }\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() public view virtual override returns (uint256 result) {\n // Counter underflow is impossible as `_burnCounter` cannot be incremented\n // more than `_currentIndex + _spotMinted - _startTokenId()` times.\n unchecked {\n // With spot minting, the intermediate `result` can be temporarily negative,\n // and the computation must be unchecked.\n result = _currentIndex - _burnCounter - _startTokenId();\n if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;\n }\n }\n\n /**\n * @dev Returns the total amount of tokens minted in the contract.\n */\n function _totalMinted() internal view virtual returns (uint256 result) {\n // Counter underflow is impossible as `_currentIndex` does not decrement,\n // and it is initialized to `_startTokenId()`.\n unchecked {\n result = _currentIndex - _startTokenId();\n if (_sequentialUpTo() != type(uint256).max) result += _spotMinted;\n }\n }\n\n /**\n * @dev Returns the total number of tokens burned.\n */\n function _totalBurned() internal view virtual returns (uint256) {\n return _burnCounter;\n }\n\n /**\n * @dev Returns the total number of tokens that are spot-minted.\n */\n function _totalSpotMinted() internal view virtual returns (uint256) {\n return _spotMinted;\n }\n\n // =============================================================\n // ADDRESS DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n if (owner == address(0)) _revert(BalanceQueryForZeroAddress.selector);\n return _packedAddressData[owner] & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens minted by `owner`.\n */\n function _numberMinted(address owner) internal view returns (uint256) {\n return (_packedAddressData[owner] >> _BITPOS_NUMBER_MINTED) & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the number of tokens burned by or on behalf of `owner`.\n */\n function _numberBurned(address owner) internal view returns (uint256) {\n return (_packedAddressData[owner] >> _BITPOS_NUMBER_BURNED) & _BITMASK_ADDRESS_DATA_ENTRY;\n }\n\n /**\n * Returns the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n */\n function _getAux(address owner) internal view returns (uint64) {\n return uint64(_packedAddressData[owner] >> _BITPOS_AUX);\n }\n\n /**\n * Sets the auxiliary data for `owner`. (e.g. number of whitelist mint slots used).\n * If there are multiple variables, please pack them into a uint64.\n */\n function _setAux(address owner, uint64 aux) internal virtual {\n uint256 packed = _packedAddressData[owner];\n uint256 auxCasted;\n // Cast `aux` with assembly to avoid redundant masking.\n assembly {\n auxCasted := aux\n }\n packed = (packed & _BITMASK_AUX_COMPLEMENT) | (auxCasted << _BITPOS_AUX);\n _packedAddressData[owner] = packed;\n }\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n // The interface IDs are constants representing the first 4 bytes\n // of the XOR of all function selectors in the interface.\n // See: [ERC165](https://eips.ethereum.org/EIPS/eip-165)\n // (e.g. `bytes4(i.functionA.selector ^ i.functionB.selector ^ ...)`)\n return\n interfaceId == 0x01ffc9a7 || // ERC165 interface ID for ERC165.\n interfaceId == 0x80ac58cd || // ERC165 interface ID for ERC721.\n interfaceId == 0x5b5e139f; // ERC165 interface ID for ERC721Metadata.\n }\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n if (!_exists(tokenId)) _revert(URIQueryForNonexistentToken.selector);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length != 0 ? string(abi.encodePacked(baseURI, _toString(tokenId))) : '';\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, it can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return '';\n }\n\n // =============================================================\n // OWNERSHIPS OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n return address(uint160(_packedOwnershipOf(tokenId)));\n }\n\n /**\n * @dev Gas spent here starts off proportional to the maximum mint batch size.\n * It gradually moves to O(1) as tokens get transferred around over time.\n */\n function _ownershipOf(uint256 tokenId) internal view virtual returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnershipOf(tokenId));\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct at `index`.\n */\n function _ownershipAt(uint256 index) internal view virtual returns (TokenOwnership memory) {\n return _unpackedOwnership(_packedOwnerships[index]);\n }\n\n /**\n * @dev Returns whether the ownership slot at `index` is initialized.\n * An uninitialized slot does not necessarily mean that the slot has no owner.\n */\n function _ownershipIsInitialized(uint256 index) internal view virtual returns (bool) {\n return _packedOwnerships[index] != 0;\n }\n\n /**\n * @dev Initializes the ownership slot minted at `index` for efficiency purposes.\n */\n function _initializeOwnershipAt(uint256 index) internal virtual {\n if (_packedOwnerships[index] == 0) {\n _packedOwnerships[index] = _packedOwnershipOf(index);\n }\n }\n\n /**\n * @dev Returns the packed ownership data of `tokenId`.\n */\n function _packedOwnershipOf(uint256 tokenId) private view returns (uint256 packed) {\n if (_startTokenId() <= tokenId) {\n packed = _packedOwnerships[tokenId];\n\n if (tokenId > _sequentialUpTo()) {\n if (_packedOwnershipExists(packed)) return packed;\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n\n // If the data at the starting slot does not exist, start the scan.\n if (packed == 0) {\n if (tokenId >= _currentIndex) _revert(OwnerQueryForNonexistentToken.selector);\n // Invariant:\n // There will always be an initialized ownership slot\n // (i.e. `ownership.addr != address(0) && ownership.burned == false`)\n // before an unintialized ownership slot\n // (i.e. `ownership.addr == address(0) && ownership.burned == false`)\n // Hence, `tokenId` will not underflow.\n //\n // We can directly compare the packed value.\n // If the address is zero, packed will be zero.\n for (;;) {\n unchecked {\n packed = _packedOwnerships[--tokenId];\n }\n if (packed == 0) continue;\n if (packed & _BITMASK_BURNED == 0) return packed;\n // Otherwise, the token is burned, and we must revert.\n // This handles the case of batch burned tokens, where only the burned bit\n // of the starting slot is set, and remaining slots are left uninitialized.\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n }\n // Otherwise, the data exists and we can skip the scan.\n // This is possible because we have already achieved the target condition.\n // This saves 2143 gas on transfers of initialized tokens.\n // If the token is not burned, return `packed`. Otherwise, revert.\n if (packed & _BITMASK_BURNED == 0) return packed;\n }\n _revert(OwnerQueryForNonexistentToken.selector);\n }\n\n /**\n * @dev Returns the unpacked `TokenOwnership` struct from `packed`.\n */\n function _unpackedOwnership(uint256 packed) private pure returns (TokenOwnership memory ownership) {\n ownership.addr = address(uint160(packed));\n ownership.startTimestamp = uint64(packed >> _BITPOS_START_TIMESTAMP);\n ownership.burned = packed & _BITMASK_BURNED != 0;\n ownership.extraData = uint24(packed >> _BITPOS_EXTRA_DATA);\n }\n\n /**\n * @dev Packs ownership data into a single uint256.\n */\n function _packOwnershipData(address owner, uint256 flags) private view returns (uint256 result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // `owner | (block.timestamp << _BITPOS_START_TIMESTAMP) | flags`.\n result := or(owner, or(shl(_BITPOS_START_TIMESTAMP, timestamp()), flags))\n }\n }\n\n /**\n * @dev Returns the `nextInitialized` flag set if `quantity` equals 1.\n */\n function _nextInitializedFlag(uint256 quantity) private pure returns (uint256 result) {\n // For branchless setting of the `nextInitialized` flag.\n assembly {\n // `(quantity == 1) << _BITPOS_NEXT_INITIALIZED`.\n result := shl(_BITPOS_NEXT_INITIALIZED, eq(quantity, 1))\n }\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account. See {ERC721A-_approve}.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n */\n function approve(address to, uint256 tokenId) public payable virtual override {\n _approve(to, tokenId, true);\n }\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n if (!_exists(tokenId)) _revert(ApprovalQueryForNonexistentToken.selector);\n\n return _tokenApprovals[tokenId].value;\n }\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _operatorApprovals[_msgSenderERC721A()][operator] = approved;\n emit ApprovalForAll(_msgSenderERC721A(), operator, approved);\n }\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted. See {_mint}.\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool result) {\n if (_startTokenId() <= tokenId) {\n if (tokenId > _sequentialUpTo()) return _packedOwnershipExists(_packedOwnerships[tokenId]);\n\n if (tokenId < _currentIndex) {\n uint256 packed;\n while ((packed = _packedOwnerships[tokenId]) == 0) --tokenId;\n result = packed & _BITMASK_BURNED == 0;\n }\n }\n }\n\n /**\n * @dev Returns whether `packed` represents a token that exists.\n */\n function _packedOwnershipExists(uint256 packed) private pure returns (bool result) {\n assembly {\n // The following is equivalent to `owner != address(0) && burned == false`.\n // Symbolically tested.\n result := gt(and(packed, _BITMASK_ADDRESS), and(packed, _BITMASK_BURNED))\n }\n }\n\n /**\n * @dev Returns whether `msgSender` is equal to `approvedAddress` or `owner`.\n */\n function _isSenderApprovedOrOwner(\n address approvedAddress,\n address owner,\n address msgSender\n ) private pure returns (bool result) {\n assembly {\n // Mask `owner` to the lower 160 bits, in case the upper bits somehow aren't clean.\n owner := and(owner, _BITMASK_ADDRESS)\n // Mask `msgSender` to the lower 160 bits, in case the upper bits somehow aren't clean.\n msgSender := and(msgSender, _BITMASK_ADDRESS)\n // `msgSender == owner || msgSender == approvedAddress`.\n result := or(eq(msgSender, owner), eq(msgSender, approvedAddress))\n }\n }\n\n /**\n * @dev Returns the storage slot and value for the approved address of `tokenId`.\n */\n function _getApprovedSlotAndAddress(uint256 tokenId)\n private\n view\n returns (uint256 approvedAddressSlot, address approvedAddress)\n {\n TokenApprovalRef storage tokenApproval = _tokenApprovals[tokenId];\n // The following is equivalent to `approvedAddress = _tokenApprovals[tokenId].value`.\n assembly {\n approvedAddressSlot := tokenApproval.slot\n approvedAddress := sload(approvedAddressSlot)\n }\n }\n\n // =============================================================\n // TRANSFER OPERATIONS\n // =============================================================\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable virtual override {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n // Mask `from` to the lower 160 bits, in case the upper bits somehow aren't clean.\n from = address(uint160(uint256(uint160(from)) & _BITMASK_ADDRESS));\n\n if (address(uint160(prevOwnershipPacked)) != from) _revert(TransferFromIncorrectOwner.selector);\n\n (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);\n\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))\n if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);\n\n _beforeTokenTransfers(from, to, tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // We can directly increment and decrement the balances.\n --_packedAddressData[from]; // Updates: `balance -= 1`.\n ++_packedAddressData[to]; // Updates: `balance += 1`.\n\n // Updates:\n // - `address` to the next owner.\n // - `startTimestamp` to the timestamp of transfering.\n // - `burned` to `false`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _BITMASK_NEXT_INITIALIZED | _nextExtraData(from, to, prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n from, // `from`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n if (toMasked == 0) _revert(TransferToZeroAddress.selector);\n\n _afterTokenTransfers(from, to, tokenId, 1);\n }\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public payable virtual override {\n safeTransferFrom(from, to, tokenId, '');\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public payable virtual override {\n transferFrom(from, to, tokenId);\n if (to.code.length != 0)\n if (!_checkContractOnERC721Received(from, to, tokenId, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n }\n\n /**\n * @dev Hook that is called before a set of serially-ordered token IDs\n * are about to be transferred. This includes minting.\n * And also called before burning one token.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _beforeTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after a set of serially-ordered token IDs\n * have been transferred. This includes minting.\n * And also called after one token has been burned.\n *\n * `startTokenId` - the first token ID to be transferred.\n * `quantity` - the amount to be transferred.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` has been\n * transferred to `to`.\n * - When `from` is zero, `tokenId` has been minted for `to`.\n * - When `to` is zero, `tokenId` has been burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _afterTokenTransfers(\n address from,\n address to,\n uint256 startTokenId,\n uint256 quantity\n ) internal virtual {}\n\n /**\n * @dev Private function to invoke {IERC721Receiver-onERC721Received} on a target contract.\n *\n * `from` - Previous owner of the given token ID.\n * `to` - Target address that will receive the token.\n * `tokenId` - Token ID to be transferred.\n * `_data` - Optional data to send along with the call.\n *\n * Returns whether the call correctly returned the expected magic value.\n */\n function _checkContractOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n try ERC721A__IERC721Receiver(to).onERC721Received(_msgSenderERC721A(), from, tokenId, _data) returns (\n bytes4 retval\n ) {\n return retval == ERC721A__IERC721Receiver(to).onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n\n // =============================================================\n // MINT OPERATIONS\n // =============================================================\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mint(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (quantity == 0) _revert(MintZeroQuantity.selector);\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are incredibly unrealistic.\n // `balance` and `numberMinted` have a maximum limit of 2**64.\n // `tokenId` has a maximum limit of 2**256.\n unchecked {\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)\n );\n\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n\n if (toMasked == 0) _revert(MintToZeroAddress.selector);\n\n uint256 end = startTokenId + quantity;\n uint256 tokenId = startTokenId;\n\n if (end - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);\n\n do {\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n // The `!=` check ensures that large values of `quantity`\n // that overflows uint256 will make the loop run out of gas.\n } while (++tokenId != end);\n\n _currentIndex = end;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Mints `quantity` tokens and transfers them to `to`.\n *\n * This function is intended for efficient minting only during contract creation.\n *\n * It emits only one {ConsecutiveTransfer} as defined in\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309),\n * instead of a sequence of {Transfer} event(s).\n *\n * Calling this function outside of contract creation WILL make your contract\n * non-compliant with the ERC721 standard.\n * For full ERC721 compliance, substituting ERC721 {Transfer} event(s) with the ERC2309\n * {ConsecutiveTransfer} event is only permissible during contract creation.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `quantity` must be greater than 0.\n *\n * Emits a {ConsecutiveTransfer} event.\n */\n function _mintERC2309(address to, uint256 quantity) internal virtual {\n uint256 startTokenId = _currentIndex;\n if (to == address(0)) _revert(MintToZeroAddress.selector);\n if (quantity == 0) _revert(MintZeroQuantity.selector);\n if (quantity > _MAX_MINT_ERC2309_QUANTITY_LIMIT) _revert(MintERC2309QuantityExceedsLimit.selector);\n\n _beforeTokenTransfers(address(0), to, startTokenId, quantity);\n\n // Overflows are unrealistic due to the above check for `quantity` to be below the limit.\n unchecked {\n // Updates:\n // - `balance += quantity`.\n // - `numberMinted += quantity`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += quantity * ((1 << _BITPOS_NUMBER_MINTED) | 1);\n\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `quantity == 1`.\n _packedOwnerships[startTokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(quantity) | _nextExtraData(address(0), to, 0)\n );\n\n if (startTokenId + quantity - 1 > _sequentialUpTo()) _revert(SequentialMintExceedsLimit.selector);\n\n emit ConsecutiveTransfer(startTokenId, startTokenId + quantity - 1, address(0), to);\n\n _currentIndex = startTokenId + quantity;\n }\n _afterTokenTransfers(address(0), to, startTokenId, quantity);\n }\n\n /**\n * @dev Safely mints `quantity` tokens and transfers them to `to`.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called for each safe transfer.\n * - `quantity` must be greater than 0.\n *\n * See {_mint}.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _safeMint(\n address to,\n uint256 quantity,\n bytes memory _data\n ) internal virtual {\n _mint(to, quantity);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 end = _currentIndex;\n uint256 index = end - quantity;\n do {\n if (!_checkContractOnERC721Received(address(0), to, index++, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n } while (index < end);\n // This prevents reentrancy to `_safeMint`.\n // It does not prevent reentrancy to `_safeMintSpot`.\n if (_currentIndex != end) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMint(to, quantity, '')`.\n */\n function _safeMint(address to, uint256 quantity) internal virtual {\n _safeMint(to, quantity, '');\n }\n\n /**\n * @dev Mints a single token at `tokenId`.\n *\n * Note: A spot-minted `tokenId` that has been burned can be re-minted again.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` must be greater than `_sequentialUpTo()`.\n * - `tokenId` must not exist.\n *\n * Emits a {Transfer} event for each mint.\n */\n function _mintSpot(address to, uint256 tokenId) internal virtual {\n if (tokenId <= _sequentialUpTo()) _revert(SpotMintTokenIdTooSmall.selector);\n uint256 prevOwnershipPacked = _packedOwnerships[tokenId];\n if (_packedOwnershipExists(prevOwnershipPacked)) _revert(TokenAlreadyExists.selector);\n\n _beforeTokenTransfers(address(0), to, tokenId, 1);\n\n // Overflows are incredibly unrealistic.\n // The `numberMinted` for `to` is incremented by 1, and has a max limit of 2**64 - 1.\n // `_spotMinted` is incremented by 1, and has a max limit of 2**256 - 1.\n unchecked {\n // Updates:\n // - `address` to the owner.\n // - `startTimestamp` to the timestamp of minting.\n // - `burned` to `false`.\n // - `nextInitialized` to `true` (as `quantity == 1`).\n _packedOwnerships[tokenId] = _packOwnershipData(\n to,\n _nextInitializedFlag(1) | _nextExtraData(address(0), to, prevOwnershipPacked)\n );\n\n // Updates:\n // - `balance += 1`.\n // - `numberMinted += 1`.\n //\n // We can directly add to the `balance` and `numberMinted`.\n _packedAddressData[to] += (1 << _BITPOS_NUMBER_MINTED) | 1;\n\n // Mask `to` to the lower 160 bits, in case the upper bits somehow aren't clean.\n uint256 toMasked = uint256(uint160(to)) & _BITMASK_ADDRESS;\n\n if (toMasked == 0) _revert(MintToZeroAddress.selector);\n\n assembly {\n // Emit the `Transfer` event.\n log4(\n 0, // Start of data (0, since no data).\n 0, // End of data (0, since no data).\n _TRANSFER_EVENT_SIGNATURE, // Signature.\n 0, // `address(0)`.\n toMasked, // `to`.\n tokenId // `tokenId`.\n )\n }\n\n ++_spotMinted;\n }\n\n _afterTokenTransfers(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Safely mints a single token at `tokenId`.\n *\n * Note: A spot-minted `tokenId` that has been burned can be re-minted again.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}.\n * - `tokenId` must be greater than `_sequentialUpTo()`.\n * - `tokenId` must not exist.\n *\n * See {_mintSpot}.\n *\n * Emits a {Transfer} event.\n */\n function _safeMintSpot(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mintSpot(to, tokenId);\n\n unchecked {\n if (to.code.length != 0) {\n uint256 currentSpotMinted = _spotMinted;\n if (!_checkContractOnERC721Received(address(0), to, tokenId, _data)) {\n _revert(TransferToNonERC721ReceiverImplementer.selector);\n }\n // This prevents reentrancy to `_safeMintSpot`.\n // It does not prevent reentrancy to `_safeMint`.\n if (_spotMinted != currentSpotMinted) revert();\n }\n }\n }\n\n /**\n * @dev Equivalent to `_safeMintSpot(to, tokenId, '')`.\n */\n function _safeMintSpot(address to, uint256 tokenId) internal virtual {\n _safeMintSpot(to, tokenId, '');\n }\n\n // =============================================================\n // APPROVAL OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_approve(to, tokenId, false)`.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _approve(to, tokenId, false);\n }\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function _approve(\n address to,\n uint256 tokenId,\n bool approvalCheck\n ) internal virtual {\n address owner = ownerOf(tokenId);\n\n if (approvalCheck && _msgSenderERC721A() != owner)\n if (!isApprovedForAll(owner, _msgSenderERC721A())) {\n _revert(ApprovalCallerNotOwnerNorApproved.selector);\n }\n\n _tokenApprovals[tokenId].value = to;\n emit Approval(owner, to, tokenId);\n }\n\n // =============================================================\n // BURN OPERATIONS\n // =============================================================\n\n /**\n * @dev Equivalent to `_burn(tokenId, false)`.\n */\n function _burn(uint256 tokenId) internal virtual {\n _burn(tokenId, false);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId, bool approvalCheck) internal virtual {\n uint256 prevOwnershipPacked = _packedOwnershipOf(tokenId);\n\n address from = address(uint160(prevOwnershipPacked));\n\n (uint256 approvedAddressSlot, address approvedAddress) = _getApprovedSlotAndAddress(tokenId);\n\n if (approvalCheck) {\n // The nested ifs save around 20+ gas over a compound boolean condition.\n if (!_isSenderApprovedOrOwner(approvedAddress, from, _msgSenderERC721A()))\n if (!isApprovedForAll(from, _msgSenderERC721A())) _revert(TransferCallerNotOwnerNorApproved.selector);\n }\n\n _beforeTokenTransfers(from, address(0), tokenId, 1);\n\n // Clear approvals from the previous owner.\n assembly {\n if approvedAddress {\n // This is equivalent to `delete _tokenApprovals[tokenId]`.\n sstore(approvedAddressSlot, 0)\n }\n }\n\n // Underflow of the sender's balance is impossible because we check for\n // ownership above and the recipient's balance can't realistically overflow.\n // Counter overflow is incredibly unrealistic as `tokenId` would have to be 2**256.\n unchecked {\n // Updates:\n // - `balance -= 1`.\n // - `numberBurned += 1`.\n //\n // We can directly decrement the balance, and increment the number burned.\n // This is equivalent to `packed -= 1; packed += 1 << _BITPOS_NUMBER_BURNED;`.\n _packedAddressData[from] += (1 << _BITPOS_NUMBER_BURNED) - 1;\n\n // Updates:\n // - `address` to the last owner.\n // - `startTimestamp` to the timestamp of burning.\n // - `burned` to `true`.\n // - `nextInitialized` to `true`.\n _packedOwnerships[tokenId] = _packOwnershipData(\n from,\n (_BITMASK_BURNED | _BITMASK_NEXT_INITIALIZED) | _nextExtraData(from, address(0), prevOwnershipPacked)\n );\n\n // If the next slot may not have been initialized (i.e. `nextInitialized == false`) .\n if (prevOwnershipPacked & _BITMASK_NEXT_INITIALIZED == 0) {\n uint256 nextTokenId = tokenId + 1;\n // If the next slot's address is zero and not burned (i.e. packed value is zero).\n if (_packedOwnerships[nextTokenId] == 0) {\n // If the next slot is within bounds.\n if (nextTokenId != _currentIndex) {\n // Initialize the next slot to maintain correctness for `ownerOf(tokenId + 1)`.\n _packedOwnerships[nextTokenId] = prevOwnershipPacked;\n }\n }\n }\n }\n\n emit Transfer(from, address(0), tokenId);\n _afterTokenTransfers(from, address(0), tokenId, 1);\n\n // Overflow not possible, as `_burnCounter` cannot be exceed `_currentIndex + _spotMinted` times.\n unchecked {\n _burnCounter++;\n }\n }\n\n // =============================================================\n // EXTRA DATA OPERATIONS\n // =============================================================\n\n /**\n * @dev Directly sets the extra data for the ownership data `index`.\n */\n function _setExtraDataAt(uint256 index, uint24 extraData) internal virtual {\n uint256 packed = _packedOwnerships[index];\n if (packed == 0) _revert(OwnershipNotInitializedForExtraData.selector);\n uint256 extraDataCasted;\n // Cast `extraData` with assembly to avoid redundant masking.\n assembly {\n extraDataCasted := extraData\n }\n packed = (packed & _BITMASK_EXTRA_DATA_COMPLEMENT) | (extraDataCasted << _BITPOS_EXTRA_DATA);\n _packedOwnerships[index] = packed;\n }\n\n /**\n * @dev Called during each token transfer to set the 24bit `extraData` field.\n * Intended to be overridden by the cosumer contract.\n *\n * `previousExtraData` - the value of `extraData` before transfer.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, `from`'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, `tokenId` will be burned by `from`.\n * - `from` and `to` are never both zero.\n */\n function _extraData(\n address from,\n address to,\n uint24 previousExtraData\n ) internal view virtual returns (uint24) {}\n\n /**\n * @dev Returns the next extra data for the packed ownership data.\n * The returned result is shifted into position.\n */\n function _nextExtraData(\n address from,\n address to,\n uint256 prevOwnershipPacked\n ) private view returns (uint256) {\n uint24 extraData = uint24(prevOwnershipPacked >> _BITPOS_EXTRA_DATA);\n return uint256(_extraData(from, to, extraData)) << _BITPOS_EXTRA_DATA;\n }\n\n // =============================================================\n // OTHER OPERATIONS\n // =============================================================\n\n /**\n * @dev Returns the message sender (defaults to `msg.sender`).\n *\n * If you are writing GSN compatible contracts, you need to override this function.\n */\n function _msgSenderERC721A() internal view virtual returns (address) {\n return msg.sender;\n }\n\n /**\n * @dev Converts a uint256 to its ASCII string decimal representation.\n */\n function _toString(uint256 value) internal pure virtual returns (string memory str) {\n assembly {\n // The maximum value of a uint256 contains 78 digits (1 byte per digit), but\n // we allocate 0xa0 bytes to keep the free memory pointer 32-byte word aligned.\n // We will need 1 word for the trailing zeros padding, 1 word for the length,\n // and 3 words for a maximum of 78 digits. Total: 5 * 0x20 = 0xa0.\n let m := add(mload(0x40), 0xa0)\n // Update the free memory pointer to allocate.\n mstore(0x40, m)\n // Assign the `str` to the end.\n str := sub(m, 0x20)\n // Zeroize the slot after the string.\n mstore(str, 0)\n\n // Cache the end of the memory to calculate the length later.\n let end := str\n\n // We write the string from rightmost digit to leftmost digit.\n // The following is essentially a do-while loop that also handles the zero case.\n // prettier-ignore\n for { let temp := value } 1 {} {\n str := sub(str, 1)\n // Write the character to the pointer.\n // The ASCII index of the '0' character is 48.\n mstore8(str, add(48, mod(temp, 10)))\n // Keep dividing `temp` until zero.\n temp := div(temp, 10)\n // prettier-ignore\n if iszero(temp) { break }\n }\n\n let length := sub(end, str)\n // Move the pointer 32 bytes leftwards to make room for the length.\n str := sub(str, 0x20)\n // Store the length.\n mstore(str, length)\n }\n }\n\n /**\n * @dev For more efficient reverts.\n */\n function _revert(bytes4 errorSelector) internal pure {\n assembly {\n mstore(0x00, errorSelector)\n revert(0x00, 0x04)\n }\n }\n}\n" + '// SPDX-License-Identifier: 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' }, - 'src/tokens/common/IERC2981Controlled.sol': { + 'src/tokens/common/SignalsImplicitModeControlled.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: 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/token/common/ERC2981.sol': { + 'lib/solady/src/tokens/ERC721.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\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' }, - 'lib/openzeppelin/contracts/access/AccessControlEnumerable.sol': { + 'lib/solady/src/utils/LibString.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: 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/openzeppelin/contracts/interfaces/IERC1967.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC1967.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC1967.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\n *\n * _Available since v4.8.3._\n */\ninterface IERC1967 {\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Emitted when the beacon is changed.\n */\n event BeaconUpgraded(address indexed beacon);\n}\n' }, - 'lib/openzeppelin/contracts/interfaces/draft-IERC1822.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/draft-IERC1822.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n' }, - 'lib/openzeppelin/contracts/utils/StorageSlot.sol': { + 'lib/openzeppelin-contracts/contracts/utils/StorageSlot.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._\n * _Available since v4.9 for `string`, `bytes`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n struct StringSlot {\n string value;\n }\n\n struct BytesSlot {\n bytes value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` with member `value` located at `slot`.\n */\n function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `StringSlot` representation of the string storage pointer `store`.\n */\n function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` with member `value` located at `slot`.\n */\n function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.\n */\n function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := store.slot\n }\n }\n}\n' }, - 'lib/chiru-labs/erc721a/contracts/IERC721A.sol': { + 'src/tokens/common/IERC2981Controlled.sol': { content: - "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v4.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\n/**\n * @dev Interface of ERC721A.\n */\ninterface IERC721A {\n /**\n * The caller must own the token or be an approved operator.\n */\n error ApprovalCallerNotOwnerNorApproved();\n\n /**\n * The token does not exist.\n */\n error ApprovalQueryForNonexistentToken();\n\n /**\n * Cannot query the balance for the zero address.\n */\n error BalanceQueryForZeroAddress();\n\n /**\n * Cannot mint to the zero address.\n */\n error MintToZeroAddress();\n\n /**\n * The quantity of tokens minted must be more than zero.\n */\n error MintZeroQuantity();\n\n /**\n * The token does not exist.\n */\n error OwnerQueryForNonexistentToken();\n\n /**\n * The caller must own the token or be an approved operator.\n */\n error TransferCallerNotOwnerNorApproved();\n\n /**\n * The token must be owned by `from`.\n */\n error TransferFromIncorrectOwner();\n\n /**\n * Cannot safely transfer to a contract that does not implement the\n * ERC721Receiver interface.\n */\n error TransferToNonERC721ReceiverImplementer();\n\n /**\n * Cannot transfer to the zero address.\n */\n error TransferToZeroAddress();\n\n /**\n * The token does not exist.\n */\n error URIQueryForNonexistentToken();\n\n /**\n * The `quantity` minted with ERC2309 exceeds the safety limit.\n */\n error MintERC2309QuantityExceedsLimit();\n\n /**\n * The `extraData` cannot be set on an unintialized ownership slot.\n */\n error OwnershipNotInitializedForExtraData();\n\n /**\n * `_sequentialUpTo()` must be greater than `_startTokenId()`.\n */\n error SequentialUpToTooSmall();\n\n /**\n * The `tokenId` of a sequential mint exceeds `_sequentialUpTo()`.\n */\n error SequentialMintExceedsLimit();\n\n /**\n * Spot minting requires a `tokenId` greater than `_sequentialUpTo()`.\n */\n error SpotMintTokenIdTooSmall();\n\n /**\n * Cannot mint over a token that already exists.\n */\n error TokenAlreadyExists();\n\n /**\n * The feature is not compatible with spot mints.\n */\n error NotCompatibleWithSpotMints();\n\n // =============================================================\n // STRUCTS\n // =============================================================\n\n struct TokenOwnership {\n // The address of the owner.\n address addr;\n // Stores the start time of ownership with minimal overhead for tokenomics.\n uint64 startTimestamp;\n // Whether the token has been burned.\n bool burned;\n // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.\n uint24 extraData;\n }\n\n // =============================================================\n // TOKEN COUNTERS\n // =============================================================\n\n /**\n * @dev Returns the total number of tokens in existence.\n * Burned tokens will reduce the count.\n * To get the total number of tokens minted, please see {_totalMinted}.\n */\n function totalSupply() external view returns (uint256);\n\n // =============================================================\n // IERC165\n // =============================================================\n\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n\n // =============================================================\n // IERC721\n // =============================================================\n\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables\n * (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in `owner`'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`,\n * checking first that contract recipients are aware of the ERC721 protocol\n * to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move\n * this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement\n * {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external payable;\n\n /**\n * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external payable;\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom}\n * whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token\n * by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external payable;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the\n * zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external payable;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom}\n * for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n // =============================================================\n // IERC721Metadata\n // =============================================================\n\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n\n // =============================================================\n // IERC2309\n // =============================================================\n\n /**\n * @dev Emitted when tokens in `fromTokenId` to `toTokenId`\n * (inclusive) is transferred from `from` to `to`, as defined in the\n * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.\n *\n * See {_mintERC2309} for more details.\n */\n event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);\n}\n" + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.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' + }, + '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/utils/introspection/IERC165.sol': { + 'lib/openzeppelin-contracts/contracts/interfaces/IERC2981.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) (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/contracts/utils/introspection/ERC165.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' + }, + 'lib/signals-implicit-mode/src/registry/IImplicitProjectValidation.sol': { + content: + '// 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/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/Attestation.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../../../utils/LibBytes.sol";\nimport { ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX } from "./ISignalsImplicitMode.sol";\n\nusing LibBytes for bytes;\n\n/// @notice Attestation for a specific session\n/// @param approvedSigner Address of the approved signer\n/// @param identityType Identity type\n/// @param issuerHash Hash of the issuer\n/// @param audienceHash Hash of the audience\n/// @param applicationData Unspecified application data\n/// @param authData Auth data\nstruct Attestation {\n address approvedSigner;\n bytes4 identityType;\n bytes32 issuerHash;\n bytes32 audienceHash;\n bytes applicationData;\n AuthData authData;\n}\n\n/// @notice Auth data for an attestation\n/// @param redirectUrl Authorization redirect URL\n/// @param issuedAt Timestamp of the attestation issuance\nstruct AuthData {\n string redirectUrl;\n uint64 issuedAt;\n}\n\n/// @title LibAttestation\n/// @author Michael Standen\n/// @notice Library for attestation management\nlibrary LibAttestation {\n\n /// @notice Hashes an attestation\n function toHash(\n Attestation memory attestation\n ) internal pure returns (bytes32) {\n return keccak256(toPacked(attestation));\n }\n\n /// @notice Decodes an attestation from a packed bytes array\n /// @param encoded The packed bytes array\n /// @param pointer The pointer to the start of the attestation\n /// @return attestation The decoded attestation\n /// @return newPointer The new pointer to the end of the attestation\n function fromPacked(\n bytes calldata encoded,\n uint256 pointer\n ) internal pure returns (Attestation memory attestation, uint256 newPointer) {\n newPointer = pointer;\n (attestation.approvedSigner, newPointer) = encoded.readAddress(newPointer);\n (attestation.identityType, newPointer) = encoded.readBytes4(newPointer);\n (attestation.issuerHash, newPointer) = encoded.readBytes32(newPointer);\n (attestation.audienceHash, newPointer) = encoded.readBytes32(newPointer);\n // Application data (arbitrary bytes)\n uint256 dataSize;\n (dataSize, newPointer) = encoded.readUint24(newPointer);\n attestation.applicationData = encoded[newPointer:newPointer + dataSize];\n newPointer += dataSize;\n // Auth data\n (attestation.authData, newPointer) = fromPackedAuthData(encoded, newPointer);\n return (attestation, newPointer);\n }\n\n /// @notice Decodes the auth data from a packed bytes\n /// @param encoded The packed bytes containing the auth data\n /// @param pointer The pointer to the start of the auth data within the encoded data\n /// @return authData The decoded auth data\n /// @return newPointer The pointer to the end of the auth data within the encoded data\n function fromPackedAuthData(\n bytes calldata encoded,\n uint256 pointer\n ) internal pure returns (AuthData memory authData, uint256 newPointer) {\n uint24 redirectUrlLength;\n (redirectUrlLength, pointer) = encoded.readUint24(pointer);\n authData.redirectUrl = string(encoded[pointer:pointer + redirectUrlLength]);\n pointer += redirectUrlLength;\n (authData.issuedAt, pointer) = encoded.readUint64(pointer);\n return (authData, pointer);\n }\n\n /// @notice Encodes an attestation into a packed bytes array\n /// @param attestation The attestation to encode\n /// @return encoded The packed bytes array\n function toPacked(\n Attestation memory attestation\n ) internal pure returns (bytes memory encoded) {\n return abi.encodePacked(\n attestation.approvedSigner,\n attestation.identityType,\n attestation.issuerHash,\n attestation.audienceHash,\n uint24(attestation.applicationData.length),\n attestation.applicationData,\n toPackAuthData(attestation.authData)\n );\n }\n\n /// @notice Encodes the auth data into a packed bytes array\n /// @param authData The auth data to encode\n /// @return encoded The packed bytes array\n function toPackAuthData(\n AuthData memory authData\n ) internal pure returns (bytes memory encoded) {\n return abi.encodePacked(uint24(bytes(authData.redirectUrl).length), bytes(authData.redirectUrl), authData.issuedAt);\n }\n\n /// @notice Generates the implicit request magic return value\n /// @param attestation The attestation\n /// @param wallet The wallet\n /// @return magic The expected implicit request magic\n function generateImplicitRequestMagic(Attestation memory attestation, address wallet) internal pure returns (bytes32) {\n return keccak256(\n abi.encodePacked(ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX, wallet, attestation.audienceHash, attestation.issuerHash)\n );\n }\n\n}\n' + }, + 'lib/signals-implicit-mode/lib/sequence-v3/src/extensions/sessions/implicit/ISignalsImplicitMode.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { Payload } from "../../../modules/Payload.sol";\nimport { Attestation } from "./Attestation.sol";\n\n/// @dev Magic prefix for the implicit request\nbytes32 constant ACCEPT_IMPLICIT_REQUEST_MAGIC_PREFIX = keccak256(abi.encodePacked("acceptImplicitRequest"));\n\n/// @title ISignalsImplicitMode\n/// @author Agustin Aguilar, Michael Standen\n/// @notice Interface for the contracts that support implicit mode validation\ninterface ISignalsImplicitMode {\n\n /// @notice Determines if an implicit request is valid\n /// @param wallet The wallet\'s address\n /// @param attestation The attestation data\n /// @param call The call to validate\n /// @return magic The hash of the implicit request if valid\n function acceptImplicitRequest(\n address wallet,\n Attestation calldata attestation,\n Payload.Call calldata call\n ) external view returns (bytes32 magic);\n\n}\n' }, - 'lib/openzeppelin/contracts/access/IAccessControl.sol': { + 'lib/signals-implicit-mode/lib/sequence-v3/src/modules/Payload.sol': { + content: + '// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\nimport { LibBytes } from "../utils/LibBytes.sol";\n\nusing LibBytes for bytes;\n\n/// @title Payload\n/// @author Agustin Aguilar, Michael Standen, William Hua\n/// @notice Library for encoding and decoding payloads\nlibrary Payload {\n\n /// @notice Error thrown when the kind is invalid\n error InvalidKind(uint8 kind);\n\n /// @dev keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")\n bytes32 private constant EIP712_DOMAIN_TYPEHASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f;\n\n /// @dev keccak256("Sequence Wallet")\n bytes32 private constant EIP712_DOMAIN_NAME_SEQUENCE =\n 0x4aa45ca7ad825ceb1bf35643f0a58c295239df563b1b565c2485f96477c56318;\n\n /// @dev keccak256("3")\n bytes32 private constant EIP712_DOMAIN_VERSION_SEQUENCE =\n 0x2a80e1ef1d7842f27f2e6be0972bb708b9a135c38860dbe73c27c3486c34f4de;\n\n function domainSeparator(bool _noChainId, address _wallet) internal view returns (bytes32 _domainSeparator) {\n return keccak256(\n abi.encode(\n EIP712_DOMAIN_TYPEHASH,\n EIP712_DOMAIN_NAME_SEQUENCE,\n EIP712_DOMAIN_VERSION_SEQUENCE,\n _noChainId ? uint256(0) : uint256(block.chainid),\n _wallet\n )\n );\n }\n\n /// @dev keccak256("Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALL_TYPEHASH = 0x0603985259a953da1f65a522f589c17bd1d0117ec1d3abb7c0788aef251ef437;\n\n /// @dev keccak256("Calls(Call[] calls,uint256 space,uint256 nonce,address[] wallets)Call(address to,uint256 value,bytes data,uint256 gasLimit,bool delegateCall,bool onlyFallback,uint256 behaviorOnError)")\n bytes32 private constant CALLS_TYPEHASH = 0x11e1e4079a79a66e4ade50033cfe2678cdd5341d2dfe5ef9513edb1a0be147a2;\n\n /// @dev keccak256("Message(bytes message,address[] wallets)")\n bytes32 private constant MESSAGE_TYPEHASH = 0xe19a3b94fc3c7ece3f890d98a99bc422615537a08dea0603fa8425867d87d466;\n\n /// @dev keccak256("ConfigUpdate(bytes32 imageHash,address[] wallets)")\n bytes32 private constant CONFIG_UPDATE_TYPEHASH = 0x11fdeb7e8373a1aa96bfac8d0ea91526b2c5d15e5cee20e0543e780258f3e8e4;\n\n /// @notice Kind of transaction\n uint8 public constant KIND_TRANSACTIONS = 0x00;\n /// @notice Kind of digest\n uint8 public constant KIND_MESSAGE = 0x01;\n /// @notice Kind of config update\n uint8 public constant KIND_CONFIG_UPDATE = 0x02;\n /// @notice Kind of message\n uint8 public constant KIND_DIGEST = 0x03;\n\n /// @notice Behavior on error: ignore error\n uint8 public constant BEHAVIOR_IGNORE_ERROR = 0x00;\n /// @notice Behavior on error: revert on error\n uint8 public constant BEHAVIOR_REVERT_ON_ERROR = 0x01;\n /// @notice Behavior on error: abort on error\n uint8 public constant BEHAVIOR_ABORT_ON_ERROR = 0x02;\n\n /// @notice Payload call information\n /// @param to Address of the target contract\n /// @param value Value to send with the call\n /// @param data Data to send with the call\n /// @param gasLimit Gas limit for the call\n /// @param delegateCall If the call is a delegate call\n /// @param onlyFallback If the call should only be executed in an error scenario\n /// @param behaviorOnError Behavior on error\n struct Call {\n address to;\n uint256 value;\n bytes data;\n uint256 gasLimit;\n bool delegateCall;\n bool onlyFallback;\n uint256 behaviorOnError;\n }\n\n /// @notice Decoded payload\n /// @param kind Kind of payload\n /// @param noChainId If the chain ID should be omitted\n /// @param calls Array of calls (transaction kind)\n /// @param space Nonce space for the calls (transaction kind)\n /// @param nonce Nonce value for the calls (transaction kind)\n /// @param message Message to validate (message kind)\n /// @param imageHash Image hash to update to (config update kind)\n /// @param digest Digest to validate (digest kind)\n /// @param parentWallets Parent wallets\n struct Decoded {\n uint8 kind;\n bool noChainId;\n // Transaction kind\n Call[] calls;\n uint256 space;\n uint256 nonce;\n // Message kind\n // TODO: Maybe native 721 ?\n bytes message;\n // Config update kind\n bytes32 imageHash;\n // Digest kind for 1271\n bytes32 digest;\n // Parent wallets\n address[] parentWallets;\n }\n\n function fromMessage(\n bytes memory message\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_MESSAGE;\n _decoded.message = message;\n }\n\n function fromConfigUpdate(\n bytes32 imageHash\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_CONFIG_UPDATE;\n _decoded.imageHash = imageHash;\n }\n\n function fromDigest(\n bytes32 digest\n ) internal pure returns (Decoded memory _decoded) {\n _decoded.kind = KIND_DIGEST;\n _decoded.digest = digest;\n }\n\n function fromPackedCalls(\n bytes calldata packed\n ) internal view returns (Decoded memory _decoded) {\n _decoded.kind = KIND_TRANSACTIONS;\n\n // Read the global flag\n (uint256 globalFlag, uint256 pointer) = packed.readFirstUint8();\n\n // First bit determines if space is zero or not\n if (globalFlag & 0x01 == 0x01) {\n _decoded.space = 0;\n } else {\n (_decoded.space, pointer) = packed.readUint160(pointer);\n }\n\n // Next 3 bits determine the size of the nonce\n uint256 nonceSize = (globalFlag >> 1) & 0x07;\n\n if (nonceSize > 0) {\n // Read the nonce\n (_decoded.nonce, pointer) = packed.readUintX(pointer, nonceSize);\n }\n\n uint256 numCalls;\n\n // Bit 5 determines if the batch contains a single call\n if (globalFlag & 0x10 == 0x10) {\n numCalls = 1;\n } else {\n // Bit 6 determines if the number of calls uses 1 byte or 2 bytes\n if (globalFlag & 0x20 == 0x20) {\n (numCalls, pointer) = packed.readUint16(pointer);\n } else {\n (numCalls, pointer) = packed.readUint8(pointer);\n }\n }\n\n // Read the calls\n _decoded.calls = new Call[](numCalls);\n\n for (uint256 i = 0; i < numCalls; i++) {\n uint8 flags;\n (flags, pointer) = packed.readUint8(pointer);\n\n // First bit determines if this is a call to self\n // or a call to another address\n if (flags & 0x01 == 0x01) {\n // Call to self\n _decoded.calls[i].to = address(this);\n } else {\n // Call to another address\n (_decoded.calls[i].to, pointer) = packed.readAddress(pointer);\n }\n\n // Second bit determines if the call has value or not\n if (flags & 0x02 == 0x02) {\n (_decoded.calls[i].value, pointer) = packed.readUint256(pointer);\n }\n\n // Third bit determines if the call has data or not\n if (flags & 0x04 == 0x04) {\n // 3 bytes determine the size of the calldata\n uint256 calldataSize;\n (calldataSize, pointer) = packed.readUint24(pointer);\n _decoded.calls[i].data = packed[pointer:pointer + calldataSize];\n pointer += calldataSize;\n }\n\n // Fourth bit determines if the call has a gas limit or not\n if (flags & 0x08 == 0x08) {\n (_decoded.calls[i].gasLimit, pointer) = packed.readUint256(pointer);\n }\n\n // Fifth bit determines if the call is a delegate call or not\n _decoded.calls[i].delegateCall = (flags & 0x10 == 0x10);\n\n // Sixth bit determines if the call is fallback only\n _decoded.calls[i].onlyFallback = (flags & 0x20 == 0x20);\n\n // Last 2 bits are directly mapped to the behavior on error\n _decoded.calls[i].behaviorOnError = (flags & 0xC0) >> 6;\n }\n }\n\n function hashCall(\n Call memory c\n ) internal pure returns (bytes32) {\n return keccak256(\n abi.encode(\n CALL_TYPEHASH, c.to, c.value, keccak256(c.data), c.gasLimit, c.delegateCall, c.onlyFallback, c.behaviorOnError\n )\n );\n }\n\n function hashCalls(\n Call[] memory calls\n ) internal pure returns (bytes32) {\n // In EIP712, an array is often hashed as the keccak256 of the concatenated\n // hashes of each item. So we hash each Call, pack them, and hash again.\n bytes32[] memory callHashes = new bytes32[](calls.length);\n for (uint256 i = 0; i < calls.length; i++) {\n callHashes[i] = hashCall(calls[i]);\n }\n return keccak256(abi.encodePacked(callHashes));\n }\n\n function toEIP712(\n Decoded memory _decoded\n ) internal pure returns (bytes32) {\n bytes32 walletsHash = keccak256(abi.encodePacked(_decoded.parentWallets));\n\n if (_decoded.kind == KIND_TRANSACTIONS) {\n bytes32 callsHash = hashCalls(_decoded.calls);\n // The top-level struct for Calls might be something like:\n // Calls(bytes32 callsHash,uint256 space,uint256 nonce,bytes32 walletsHash)\n return keccak256(abi.encode(CALLS_TYPEHASH, callsHash, _decoded.space, _decoded.nonce, walletsHash));\n } else if (_decoded.kind == KIND_MESSAGE) {\n // If you define your top-level as: Message(bytes32 messageHash,bytes32 walletsHash)\n return keccak256(abi.encode(MESSAGE_TYPEHASH, keccak256(_decoded.message), walletsHash));\n } else if (_decoded.kind == KIND_CONFIG_UPDATE) {\n // Top-level: ConfigUpdate(bytes32 imageHash,bytes32 walletsHash)\n return keccak256(abi.encode(CONFIG_UPDATE_TYPEHASH, _decoded.imageHash, walletsHash));\n } else if (_decoded.kind == KIND_DIGEST) {\n // Top-level: Use MESSAGE_TYPEHASH but assume the digest is already the hashed message\n return keccak256(abi.encode(MESSAGE_TYPEHASH, _decoded.digest, walletsHash));\n } else {\n // Unknown kind\n revert InvalidKind(_decoded.kind);\n }\n }\n\n function hash(\n Decoded memory _decoded\n ) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, address(this));\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n function hashFor(Decoded memory _decoded, address _wallet) internal view returns (bytes32) {\n bytes32 domain = domainSeparator(_decoded.noChainId, _wallet);\n bytes32 structHash = toEIP712(_decoded);\n return keccak256(abi.encodePacked("\\x19\\x01", domain, structHash));\n }\n\n}\n' + }, + 'lib/openzeppelin-contracts/contracts/access/IAccessControl.sol': { content: "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" }, - 'lib/openzeppelin/contracts/utils/Strings.sol': { + 'lib/openzeppelin-contracts/contracts/utils/Strings.sol': { content: '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport "./math/Math.sol";\nimport "./math/SignedMath.sol";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = "0123456789abcdef";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `int256` to its ASCII `string` decimal representation.\n */\n function toString(int256 value) internal pure returns (string memory) {\n return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = "0";\n buffer[1] = "x";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, "Strings: hex length insufficient");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n\n /**\n * @dev Returns true if the two strings are equal.\n */\n function equal(string memory a, string memory b) internal pure returns (bool) {\n return keccak256(bytes(a)) == keccak256(bytes(b));\n }\n}\n' }, - 'lib/openzeppelin/contracts/utils/math/Math.sol': { + '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: 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: { - evmVersion: 'paris', - libraries: {}, - metadata: { - useLiteralContent: false, - bytecodeHash: 'ipfs', - appendCBOR: true - }, - optimizer: { enabled: true, runs: 20000 }, remappings: [ - '@0xsequence/contracts-library/=src/', - 'ds-test/=lib/forge-std/lib/ds-test/src/', + '@openzeppelin/contracts/=lib/murky/lib/openzeppelin-contracts/contracts/', + 'ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/', + 'erc2470-libs/=lib/erc2470-libs/', + 'erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/', 'forge-std/=lib/forge-std/src/', - 'murky/=lib/murky/src/', - '@0xsequence/erc20-meta-token/=lib/0xsequence/erc20-meta-token/src/', - '@0xsequence/erc-1155/=lib/0xsequence/erc-1155/src/', - 'erc721a/=lib/chiru-labs/erc721a/', - 'erc721a-upgradeable/=lib/chiru-labs/erc721a-upgradeable/', - '@openzeppelin/=lib/openzeppelin/', - '@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable/', - 'solady/=lib/solady/src/', - '0xsequence/=lib/0xsequence/', - 'chiru-labs/=lib/chiru-labs/', + '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/' ], - 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: {} } } } diff --git a/scripts/factories/token_library/TransparentUpgradeableBeaconProxy.ts b/scripts/factories/token_library/TransparentUpgradeableBeaconProxy.ts deleted file mode 100644 index d378ccc..0000000 --- a/scripts/factories/token_library/TransparentUpgradeableBeaconProxy.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { ContractFactory, type ethers } from 'ethers' -import type { VerificationRequest } from 'scripts/types' - -// https://github.com/0xsequence/contracts-library/blob/87eea5e3a8b4c58448b275efe856d4c80891cc8f/src/proxies/TransparentUpgradeableBeaconProxy.sol - -const abi = [ - { - inputs: [], - name: 'InvalidInitialization', - type: 'error' - }, - { - anonymous: false, - inputs: [ - { - indexed: false, - internalType: 'address', - name: 'previousAdmin', - type: 'address' - }, - { - indexed: false, - internalType: 'address', - name: 'newAdmin', - type: 'address' - } - ], - name: 'AdminChanged', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'beacon', - type: 'address' - } - ], - name: 'BeaconUpgraded', - type: 'event' - }, - { - anonymous: false, - inputs: [ - { - indexed: true, - internalType: 'address', - name: 'implementation', - type: 'address' - } - ], - name: 'Upgraded', - type: 'event' - }, - { - stateMutability: 'payable', - type: 'fallback' - }, - { - stateMutability: 'payable', - type: 'receive' - } -] - -export class TransparentUpgradeableBeaconProxy extends ContractFactory { - constructor(signer?: ethers.Signer) { - super( - abi, - '0x60808060405234610016576111cf908161001c8239f35b600080fdfe604060808152366103825773ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000917fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000843516146100c057600484517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b6100c8611192565b60049136831161037e5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261037e578235916101088361067f565b602435926101158461067f565b60443567ffffffffffffffff811161037a57610135839136908801610789565b941692156103525761014791166107e3565b803b156102cf578451907f5c60da1b000000000000000000000000000000000000000000000000000000009384835260209687848381865afa9384156102a657889461019d9189916102b2575b503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff85161790555194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab575b610242575b8361023c6107d0565b80519101f35b8592839182525afa9182156102a65761026a9392610277575b506102646109b1565b91610a21565b5038808083818080610233565b610298919250843d861161029f575b610290818361070e565b810190610902565b903861025b565b503d610286565b61091a565b508661022e565b6102c99150863d881161029f57610290818361070e565b38610194565b60848360208751917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b8487517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8680fd5b8380fd5b73ffffffffffffffffffffffffffffffffffffffff807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035416158015610b94576000907fcf7a1d77000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000833516146104395760046040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b610441611192565b60049236841161067b5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261067b5783356104808161067f565b6024359161048d8361067f565b60443567ffffffffffffffff8111610677576104ad829136908901610789565b9316931561064e576104bf91166107e3565b813b156105ca576040517f5c60da1b000000000000000000000000000000000000000000000000000000009283825260209586838281855afa9283156102a65787936105149188916105b357503b1515610926565b7fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d5080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff841617905560405194827f1cf3b03a6cf19fa2baba4df148e9dcabedea7f8a5c07840e207e5c089be95d3e8880a28451158015906102ab57610242578361023c6107d0565b6102c99150853d871161029f57610290818361070e565b6084846020604051917f08c379a0000000000000000000000000000000000000000000000000000000008352820152602560248201527f455243313936373a206e657720626561636f6e206973206e6f74206120636f6e60448201527f74726163740000000000000000000000000000000000000000000000000000006064820152fd5b856040517ff92ee8a9000000000000000000000000000000000000000000000000000000008152fd5b8580fd5b8280fd5b73ffffffffffffffffffffffffffffffffffffffff81160361069d57565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6020810190811067ffffffffffffffff8211176106ed57604052565b6106a2565b6040810190811067ffffffffffffffff8211176106ed57604052565b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176106ed57604052565b67ffffffffffffffff81116106ed57601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660200190565b81601f8201121561069d578035906107a08261074f565b926107ae604051948561070e565b8284526020838301011161069d57816000926020809301838601378301015290565b604051906107dd826106d1565b60008252565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61039081547f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f604080519373ffffffffffffffffffffffffffffffffffffffff9081851686521693846020820152a1811561087e577fffffffffffffffffffffffff000000000000000000000000000000000000000016179055565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152fd5b9081602091031261069d57516109178161067f565b90565b6040513d6000823e3d90fd5b1561092d57565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603060248201527f455243313936373a20626561636f6e20696d706c656d656e746174696f6e206960448201527f73206e6f74206120636f6e7472616374000000000000000000000000000000006064820152fd5b604051906060820182811067ffffffffffffffff8211176106ed57604052602782527f206661696c6564000000000000000000000000000000000000000000000000006040837f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c60208201520152565b6000806109179493602081519101845af43d15610a60573d91610a438361074f565b92610a51604051948561070e565b83523d6000602085013e610acd565b606091610acd565b15610a6f57565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152fd5b91929015610aed5750815115610ae1575090565b610917903b1515610a68565b825190915015610b005750805190602001fd5b604051907f08c379a000000000000000000000000000000000000000000000000000000000825281602080600483015282519283602484015260005b848110610b7d575050507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f836000604480968601015201168101030190fd5b818101830151868201604401528593508201610b3c565b610bee610bd57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1690565b3303610d14576000357fffffffff00000000000000000000000000000000000000000000000000000000167f3659cfe6000000000000000000000000000000000000000000000000000000008103610c515750610c49610f0f565b602081519101f35b7f4f1ef286000000000000000000000000000000000000000000000000000000008103610c865750610c81611083565b610c49565b7f8f283970000000000000000000000000000000000000000000000000000000008103610cb65750610c81610ec5565b7ff851a440000000000000000000000000000000000000000000000000000000008103610ce65750610c81610dfd565b7f5c60da1b0000000000000000000000000000000000000000000000000000000003610d1457610c81610e53565b610d1c610d3b565b6000808092368280378136915af43d82803e15610d37573d90f35b3d90fd5b73ffffffffffffffffffffffffffffffffffffffff807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541680610df8575060206004917fa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d505416604051928380927f5c60da1b0000000000000000000000000000000000000000000000000000000082525afa9081156102a657600091610de0575090565b610917915060203d811161029f57610290818361070e565b905090565b610e05611192565b73ffffffffffffffffffffffffffffffffffffffff7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103541660405190602082015260208152610917816106f2565b610e5b611192565b610e63610d3b565b73ffffffffffffffffffffffffffffffffffffffff6040519116602082015260208152610917816106f2565b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc602091011261069d576004356109178161067f565b610ecd611192565b3660041161069d57610efc73ffffffffffffffffffffffffffffffffffffffff610ef636610e8f565b166107e3565b604051610f08816106d1565b6000815290565b610f17611192565b3660041161069d5773ffffffffffffffffffffffffffffffffffffffff610f3d36610e8f565b1660405190610f4b826106d1565b60008252803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a2815115801590610ff7575b610fe3575b5050604051610f08816106d1565b610fef916102646109b1565b503880610fd5565b506000610fd0565b60846040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201527f6f74206120636f6e7472616374000000000000000000000000000000000000006064820152fd5b3660041161069d5760407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261069d576004356110c18161067f565b60243567ffffffffffffffff811161069d576110f673ffffffffffffffffffffffffffffffffffffffff913690600401610789565b9116803b15610fff577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc817fffffffffffffffffffffffff0000000000000000000000000000000000000000825416179055807fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b600080a281511580159061118a57610fe3575050604051610f08816106d1565b506001610fd0565b3461069d5756fea264697066735822122019f840d2ec21d6e6c6d650eef546ce8fd590e6d8042a04516b47dd55a17345c664736f6c63430008130033', - signer - ) - } -} - -export const TUBPROXY_VERIFICATION: Omit = { - contractToVerify: 'src/proxies/TransparentUpgradeableBeaconProxy.sol:TransparentUpgradeableBeaconProxy', - version: 'v0.8.19+commit.7dd6d404', - licenceType: 'Apache-2.0', - compilerInput: { - language: 'Solidity', - sources: { - 'node_modules/@openzeppelin/contracts/interfaces/IERC1967.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (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.9._\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' - }, - 'node_modules/@openzeppelin/contracts/interfaces/draft-IERC1822.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n' - }, - 'node_modules/@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.3) (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 *\n * @custom:oz-upgrades-unsafe-allow delegatecall\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(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) 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(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) 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(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) 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/proxy/Proxy.sol': { - content: - "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - 'node_modules/@openzeppelin/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' - }, - 'node_modules/@openzeppelin/contracts/utils/Address.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 *\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://diligence.consensys.net/posts/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.5.11/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(\n address target,\n bytes memory data,\n uint256 value\n ) 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/StorageSlot.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\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 * ```\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`, and `uint256`._\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 /**\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' - }, - 'src/proxies/TransparentUpgradeableBeaconProxy.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' - }, - 'src/proxies/openzeppelin/BeaconProxy.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' - }, - 'src/proxies/openzeppelin/ERC1967Proxy.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' - }, - 'src/proxies/openzeppelin/TransparentUpgradeableProxy.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' - } - }, - 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/' - ], - viaIR: true, - outputSelection: { - '*': { - '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] - } - } - } - } -} diff --git a/scripts/factories/token_library/UpgradeableBeacon.ts b/scripts/factories/token_library/UpgradeableBeacon.ts index d004d7f..0c8f111 100644 --- a/scripts/factories/token_library/UpgradeableBeacon.ts +++ b/scripts/factories/token_library/UpgradeableBeacon.ts @@ -1,5 +1,4 @@ import { ContractFactory, type ethers } from 'ethers' -import type { VerificationRequest } from 'scripts/types' const abi = [ { @@ -97,58 +96,3 @@ export class UpgradeableBeacon extends ContractFactory { ) } } - -export const UPGRADEABLEBEACON_VERIFICATION: Omit = { - contractToVerify: 'node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol:UpgradeableBeacon', - version: 'v0.8.19+commit.7dd6d404', - licenceType: 'Apache-2.0', - compilerInput: { - language: 'Solidity', - sources: { - 'node_modules/@openzeppelin/contracts/access/Ownable.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.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 anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing 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/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' - }, - 'node_modules/@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/UpgradeableBeacon.sol)\n\npragma solidity ^0.8.0;\n\nimport "./IBeacon.sol";\nimport "../../access/Ownable.sol";\nimport "../../utils/Address.sol";\n\n/**\n * @dev This contract is used in conjunction with one or more instances of {BeaconProxy} to determine their\n * implementation contract, which is where they will delegate all function calls.\n *\n * An owner is able to change the implementation the beacon points to, thus upgrading the proxies that use this beacon.\n */\ncontract UpgradeableBeacon is IBeacon, Ownable {\n address private _implementation;\n\n /**\n * @dev Emitted when the implementation returned by the beacon is changed.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Sets the address of the initial implementation, and the deployer account as the owner who can upgrade the\n * beacon.\n */\n constructor(address implementation_) {\n _setImplementation(implementation_);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function implementation() public view virtual override returns (address) {\n return _implementation;\n }\n\n /**\n * @dev Upgrades the beacon to a new implementation.\n *\n * Emits an {Upgraded} event.\n *\n * Requirements:\n *\n * - msg.sender must be the owner of the contract.\n * - `newImplementation` must be a contract.\n */\n function upgradeTo(address newImplementation) public virtual onlyOwner {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation contract address for this beacon\n *\n * Requirements:\n *\n * - `newImplementation` must be a contract.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), "UpgradeableBeacon: implementation is not a contract");\n _implementation = newImplementation;\n }\n}\n' - }, - 'node_modules/@openzeppelin/contracts/utils/Address.sol': { - content: - '// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.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 *\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://diligence.consensys.net/posts/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.5.11/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(\n address target,\n bytes memory data,\n uint256 value\n ) 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': { - 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' - } - }, - 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/' - ], - viaIR: true, - outputSelection: { - '*': { - '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] - } - } - } - } -} diff --git a/scripts/factories/token_library/ValueForwarder.ts b/scripts/factories/token_library/ValueForwarder.ts new file mode 100644 index 0000000..f996099 --- /dev/null +++ b/scripts/factories/token_library/ValueForwarder.ts @@ -0,0 +1,67 @@ +import { ContractFactory, type ethers } from 'ethers' +import type { VerificationRequest } from 'scripts/types' + +const abi = [ + { + type: 'function', + name: 'forwardValue', + inputs: [ + { name: 'to', type: 'address', internalType: 'address' }, + { name: 'value', type: 'uint256', internalType: 'uint256' } + ], + outputs: [], + stateMutability: 'payable' + } +] + +export class ValueForwarder extends ContractFactory { + constructor(signer?: ethers.Signer) { + super( + abi, + '6080806040523460155761014f908161001b8239f35b600080fdfe6080604052600436101561001257600080fd5b60003560e01c6398f850f11461002757600080fd5b6040366003190112610114576004356001600160a01b038116810361011457600080808093602435905af13d1561010f573d67ffffffffffffffff81116100f95760405190601f8101601f19908116603f0116820167ffffffffffffffff8111838210176100f9576040528152600060203d92013e5b156100a457005b60405162461bcd60e51b815260206004820152602760248201527f56616c7565466f727761726465723a204661696c656420746f20666f72776172604482015266642076616c756560c81b6064820152608490fd5b634e487b7160e01b600052604160045260246000fd5b61009d565b600080fdfea26469706673582212202706a11f313e042ccf1cd42b40b5f01308364a2290592fe4e14dce33175da1bf64736f6c634300081c0033', + signer + ) + } +} + +export const VALUEFORWARDER_VERIFICATION: Omit = { + contractToVerify: 'test/mocks/ValueForwarder.sol:ValueForwarder', + version: 'v0.8.28+commit.7893614a', + licenceType: 'Apache-2.0', + compilerInput: { + language: 'Solidity', + sources: { + 'test/mocks/ValueForwarder.sol': { + content: + "// SPDX-License-Identifier: Apache-2.0\npragma solidity ^0.8.27;\n\n/// @title ValueForwarder\n/// @author Michael Standen\n/// @notice Forwarder for value\ncontract ValueForwarder {\n function forwardValue(address to, uint256 value) external payable {\n (bool success, ) = to.call{value: value}('');\n require(success, 'ValueForwarder: Failed to forward value');\n }\n}\n" + } + }, + settings: { + remappings: [ + '@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/', + 'erc2470-libs/=lib/erc2470-libs/', + 'erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/', + 'forge-std/=lib/forge-std/src/', + 'halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/', + 'openzeppelin-contracts/=lib/openzeppelin-contracts/' + ], + optimizer: { + enabled: true, + runs: 200 + }, + metadata: { + useLiteralContent: false, + bytecodeHash: 'ipfs', + appendCBOR: true + }, + outputSelection: { + '*': { + '*': ['evm.bytecode', 'evm.deployedBytecode', 'devdoc', 'userdoc', 'metadata', 'abi'] + } + }, + evmVersion: 'paris', + viaIR: true, + libraries: {} + } + } +} diff --git a/scripts/factories/token_library/constants.ts b/scripts/factories/token_library/constants.ts new file mode 100644 index 0000000..2131b9d --- /dev/null +++ b/scripts/factories/token_library/constants.ts @@ -0,0 +1,20 @@ +export const FACTORY_DEFAULT_ABI = [ + { + type: 'constructor', + inputs: [{ name: 'factoryOwner', type: 'address', internalType: 'address' }], + stateMutability: 'nonpayable' + }, + { + inputs: [], + name: 'beacon', + outputs: [ + { + internalType: 'contract UpgradeableBeacon', + name: '', + type: 'address' + } + ], + stateMutability: 'view', + type: 'function' + } +] diff --git a/scripts/types.ts b/scripts/types.ts index ec3b788..9b0c7d3 100644 --- a/scripts/types.ts +++ b/scripts/types.ts @@ -43,6 +43,7 @@ export type ContractName = | 'ClawbackMetadata' | 'PaymentCombiner' | 'PaymentsFactory' + | 'ValueForwarder' | `SequencePaymentsSigner-${SequenceEnvironment}` | `SequencePayments-${SequenceEnvironment}` diff --git a/scripts/verify-contracts.ts b/scripts/verify-contracts.ts index 2f581fa..e4a37fc 100644 --- a/scripts/verify-contracts.ts +++ b/scripts/verify-contracts.ts @@ -17,16 +17,16 @@ import { SEQUENCEMARKETV1_VERIFICATION } from './factories/marketplace/SequenceM import { CLAWBACK_VERIFICATION } from './factories/token_library/Clawback' import { CLAWBACKMETADATA_VERIFICATION } from './factories/token_library/ClawbackMetadata' import { ERC1155ItemsFactory, ERC1155ITEMSFACTORY_VERIFICATION } from './factories/token_library/ERC1155ItemsFactory' +import { ERC1155PackFactory, ERC1155PACKFACTORY_VERIFICATION } from './factories/token_library/ERC1155PackFactory' import { ERC1155SaleFactory, ERC1155SALEFACTORY_VERIFICATION } from './factories/token_library/ERC1155SaleFactory' import { ERC1155SoulboundFactory, ERC1155SOULBOUNDFACTORY_VERIFICATION } from './factories/token_library/ERC1155SoulboundFactory' -import { ERC1155PackFactory, ERC1155PACKFACTORY_VERIFICATION } from './factories/token_library/ERC1155PackFactory' import { ERC20ItemsFactory, ERC20ITEMSFACTORY_VERIFICATION } from './factories/token_library/ERC20ItemsFactory' import { ERC721ItemsFactory, ERC721ITEMSFACTORY_VERIFICATION } from './factories/token_library/ERC721ItemsFactory' import { ERC721SaleFactory, ERC721SALEFACTORY_VERIFICATION } from './factories/token_library/ERC721SaleFactory' import { ERC721SoulboundFactory, ERC721SOULBOUNDFACTORY_VERIFICATION } from './factories/token_library/ERC721SoulboundFactory' import { PaymentCombiner, PAYMENTCOMBINER_VERIFICATION } from './factories/token_library/PaymentCombiner' import { PAYMENTS_FACTORY_VERIFICATION, PaymentsFactory } from './factories/token_library/PaymentsFactory' -import { UpgradeableBeacon, UPGRADEABLEBEACON_VERIFICATION } from './factories/token_library/UpgradeableBeacon' +import { UpgradeableBeacon } from './factories/token_library/UpgradeableBeacon' // import { // ERC1155OperatorEnforcedFactory, // ERC1155OPERATORENFORCEDFACTORY_VERIFICATION @@ -35,6 +35,7 @@ import { UpgradeableBeacon, UPGRADEABLEBEACON_VERIFICATION } from './factories/t // ERC721OperatorEnforcedFactory, // ERC721OPERATORENFORCEDFACTORY_VERIFICATION // } from './factories/token_library/immutable/ERC721OperatorEnforcedFactory' +import { VALUEFORWARDER_VERIFICATION } from './factories/token_library/ValueForwarder' import { FACTORY_V1_VERIFICATION } from './factories/v1/FactoryV1' import { GUEST_MODULE_V1_VERIFICATION } from './factories/v1/GuestModuleV1' import { MAIN_MODULE_UPGRADABLE_V1_VERIFICATION } from './factories/v1/MainModuleUpgradableV1' @@ -185,6 +186,8 @@ export const verifyContracts = async (config: Config, walletContextAddrs: Contra prompt.start('Verifying Payments contracts\n') + await verifyContract(walletContextAddrs.ValueForwarder, { ...VALUEFORWARDER_VERIFICATION, waitForSuccess }) + await verifyContract(walletContextAddrs.PaymentCombiner, { ...PAYMENTCOMBINER_VERIFICATION, waitForSuccess }) // Verify the implementation if (provider && walletContextAddrs.PaymentCombiner) { @@ -318,17 +321,6 @@ export const verifyContracts = async (config: Config, walletContextAddrs: Contra waitForSuccess, constructorArgs: defaultAbiCoder.encode(['address'], [walletContextAddrs.DeveloperMultisig]) }) - // FIXME Also deploy the TUBProxy for verification purposes - // const tubProxy = await singletonDeployer.deploy( - // 'TransparentUpgradeableBeaconProxy', - // TransparentUpgradeableBeaconProxy, - // 0, - // txParams - // ) - // await verifyContract(tubProxy.address, { - // ...TUBPROXY_VERIFICATION, - // waitForSuccess - // }) // Token contracts deployed by the factories if (provider && walletContextAddrs.ERC20ItemsFactory) { const erc20ItemsFactory = new ERC20ItemsFactory().attach(walletContextAddrs.ERC20ItemsFactory).connect(provider) @@ -357,14 +349,6 @@ export const verifyContracts = async (config: Config, walletContextAddrs: Contra contractToVerify: 'src/tokens/ERC1155/presets/items/ERC1155Items.sol:ERC1155Items', waitForSuccess }) - if (erc1155ItemsImplementation) { - // Also verify the proxy - await verifyContract(erc1155ItemsBeacon, { - ...UPGRADEABLEBEACON_VERIFICATION, - waitForSuccess, - constructorArgs: defaultAbiCoder.encode(['address'], [erc1155ItemsImplementation]) - }) - } } if (provider && walletContextAddrs.ERC721SaleFactory) { const erc721SaleFactory = new ERC721SaleFactory().attach(walletContextAddrs.ERC721SaleFactory).connect(provider)