{"matchId":"43062208","creationMatch":"exact_match","runtimeMatch":"exact_match","verifiedAt":"2026-07-30T09:20:04Z","creationBytecode":{"onchainBytecode":"0x61124c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063037ac75b1461005b578063285674c11461007d57806376d8c33f146100af578063bd5f8572146100cf575b600080fd5b81801561006757600080fd5b5061007b610076366004610b75565b6100ef565b005b81801561008957600080fd5b5061009d610098366004610d41565b6102e3565b60405190815260200160405180910390f35b8180156100bb57600080fd5b5061009d6100ca366004610e6f565b610706565b8180156100db57600080fd5b5061007b6100ea366004610ef5565b6108e2565b858484836001600160a01b0383166101225760405162461bcd60e51b815260040161011990610f3d565b60405180910390fd5b6001600160a01b0382166101485760405162461bcd60e51b815260040161011990610f3d565b6001600160a01b0383166000908152602085905260409020548111156101a55760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b6000896001815181106101ba576101ba610f66565b60200260200101519050896000815181106101d7576101d7610f66565b6020908102919091010151604051632043f77360e01b81526001600160a01b038b811660048301528a81166024830152604482018a905290911690632043f773906064016020604051808303816000875af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610f7c565b506001600160a01b038916600090815260208c9052604081208054889290610287908490610fb6565b90915550506001600160a01b038816600090815260208c90526040812080548892906102b4908490610fcf565b909155506102c890508b828b896001610936565b6102d68b828a896000610936565b5050505050505050505050565b80516000906001600160a01b031661030d5760405162461bcd60e51b815260040161011990610f3d565b60008260200151116103515760405162461bcd60e51b815260206004820152600d60248201526c56616c7565206973207a65726f60981b6044820152606401610119565b816080015151826060015151146103aa5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206c656e677468206f6620706172616d65746572730000000000006044820152606401610119565b836000815181106103bd576103bd610f66565b6020908102919091018101518351918401516040808601519051632786ff6960e01b81526001600160a01b03948516600482015260248101929092526044820152911690632786ff69906064016020604051808303816000875af1158015610429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190610f7c565b5060c08201516020830151604051632a21b82b60e11b815260048101919091526000916001600160a01b031690635443705690602401602060405180830381865afa1580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610fe2565b9050808660020160008282546104da9190610fcf565b92505081905550808660030160008282546104f59190610fcf565b909155505082516001600160a01b031660009081526020879052604081208054839290610523908490610fcf565b92505081905550610556868660018151811061054157610541610f66565b60200260200101518560000151846000610936565b6000805b846060015151811015610644578460600151818151811061057d5761057d610f66565b6020026020010151826105909190610fcf565b9150856001600160a01b031663c0a0bde88660000151876060015184815181106105bc576105bc610f66565b60200260200101518860a00151896080015186815181106105df576105df610f66565b60200260200101516040518563ffffffff1660e01b8152600401610606949392919061101f565b600060405180830381600087803b15801561062057600080fd5b505af1158015610634573d6000803e3d6000fd5b50506001909201915061055a9050565b5083602001518111156106a85760405162461bcd60e51b815260206004820152602660248201527f76616c75654c6f636b6564206d75737420626520736d616c6c6572207468616e6044820152652076616c756560d01b6064820152608401610119565b83600001516001600160a01b03167f7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a8560200151836040516106f4929190918252602082015260400190565b60405180910390a25095945050505050565b604051632a21b82b60e11b81526004810183905260009081906001600160a01b03841690635443705690602401602060405180830381865afa158015610750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107749190610fe2565b6001600160a01b0386166000908152602089905260409020549091508111156107d45760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b856000815181106107e7576107e7610f66565b60209081029190910101516040516332ef868b60e11b81526001600160a01b03878116600483015260248201879052909116906365df0d16906044016020604051808303816000875af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190610f7c565b506001600160a01b0385166000908152602088905260408120805483929061088f908490610fb6565b925050819055506108be87876001815181106108ad576108ad610f66565b602002602001015187846001610936565b808760020160008282546108d29190610fb6565b9091555090979650505050505050565b600260006108f0848361115e565b9050828015610900575084548116155b156109105784548118855561092f565b8215801561092357508454600190821610155b1561092f578454811885555b5050505050565b60405163479ad3af60e11b81526001600160a01b03848116600483015260009190861690638f35a75e90602401600060405180830381865afa158015610980573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109a8919081019061116d565b90506109b381511590565b610a3957600086600101826040516109cb91906111e4565b90815260405190819003602001902054905060008360018111156109f1576109f1611200565b03610a0757610a008482610fcf565b9050610a14565b610a118482610fb6565b90505b808760010183604051610a2791906111e4565b90815260405190819003602001902055505b505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715610a7a57610a7a610a41565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a41565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a41565b5060051b60200190565b6001600160a01b0381168114610aea57600080fd5b50565b8035610af881610ad5565b919050565b600082601f830112610b0e57600080fd5b81356020610b23610b1e83610ab1565b610a80565b8083825260208201915060208460051b870101935086841115610b4557600080fd5b602086015b84811015610b6a578035610b5d81610ad5565b8352918301918301610b4a565b509695505050505050565b60008060008060008060c08789031215610b8e57600080fd5b86359550602087013567ffffffffffffffff811115610bac57600080fd5b610bb889828a01610afd565b9550506040870135610bc981610ad5565b93506060870135610bd981610ad5565b9598949750929560808101359460a0909101359350915050565b600082601f830112610c0457600080fd5b81356020610c14610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c3657600080fd5b602086015b84811015610b6a5780358352918301918301610c3b565b600082601f830112610c6357600080fd5b81356020610c73610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c9557600080fd5b602086015b84811015610b6a57803567ffffffffffffffff81168114610cbb5760008081fd5b8352918301918301610c9a565b600067ffffffffffffffff821115610ce257610ce2610a41565b50601f01601f191660200190565b600082601f830112610d0157600080fd5b8135610d0f610b1e82610cc8565b818152846020838601011115610d2457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610d5757600080fd5b84359350602085013567ffffffffffffffff80821115610d7657600080fd5b610d8288838901610afd565b945060408701359150610d9482610ad5565b90925060608601359080821115610daa57600080fd5b9086019060e08289031215610dbe57600080fd5b610dc6610a57565b610dcf83610aed565b81526020830135602082015260408301356040820152606083013582811115610df757600080fd5b610e038a828601610bf3565b606083015250608083013582811115610e1b57600080fd5b610e278a828601610c52565b60808301525060a083013582811115610e3f57600080fd5b610e4b8a828601610cf0565b60a083015250610e5d60c08401610aed565b60c08201529598949750929550505050565b600080600080600060a08688031215610e8757600080fd5b85359450602086013567ffffffffffffffff811115610ea557600080fd5b610eb188828901610afd565b9450506040860135610ec281610ad5565b9250606086013591506080860135610ed981610ad5565b809150509295509295909350565b8015158114610aea57600080fd5b600080600060608486031215610f0a57600080fd5b83359250602084013560ff81168114610f2257600080fd5b91506040840135610f3281610ee7565b809150509250925092565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8e57600080fd5b8151610f9981610ee7565b9392505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610fc957610fc9610fa0565b92915050565b80820180821115610fc957610fc9610fa0565b600060208284031215610ff457600080fd5b5051919050565b60005b83811015611016578181015183820152602001610ffe565b50506000910152565b60018060a01b038516815283602082015260806040820152600083518060808401526110528160a0850160208801610ffb565b67ffffffffffffffff93909316606083015250601f91909101601f19160160a0019392505050565b600181815b808511156110b557816000190482111561109b5761109b610fa0565b808516156110a857918102915b93841c939080029061107f565b509250929050565b6000826110cc57506001610fc9565b816110d957506000610fc9565b81600181146110ef57600281146110f957611115565b6001915050610fc9565b60ff84111561110a5761110a610fa0565b50506001821b610fc9565b5060208310610133831016604e8410600b8410161715611138575081810a610fc9565b611142838361107a565b806000190482111561115657611156610fa0565b029392505050565b6000610f9960ff8416836110bd565b60006020828403121561117f57600080fd5b815167ffffffffffffffff81111561119657600080fd5b8201601f810184136111a757600080fd5b80516111b5610b1e82610cc8565b8181528560208385010111156111ca57600080fd5b6111db826020830160208601610ffb565b95945050505050565b600082516111f6818460208701610ffb565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","recompiledBytecode":"0x61124c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063037ac75b1461005b578063285674c11461007d57806376d8c33f146100af578063bd5f8572146100cf575b600080fd5b81801561006757600080fd5b5061007b610076366004610b75565b6100ef565b005b81801561008957600080fd5b5061009d610098366004610d41565b6102e3565b60405190815260200160405180910390f35b8180156100bb57600080fd5b5061009d6100ca366004610e6f565b610706565b8180156100db57600080fd5b5061007b6100ea366004610ef5565b6108e2565b858484836001600160a01b0383166101225760405162461bcd60e51b815260040161011990610f3d565b60405180910390fd5b6001600160a01b0382166101485760405162461bcd60e51b815260040161011990610f3d565b6001600160a01b0383166000908152602085905260409020548111156101a55760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b6000896001815181106101ba576101ba610f66565b60200260200101519050896000815181106101d7576101d7610f66565b6020908102919091010151604051632043f77360e01b81526001600160a01b038b811660048301528a81166024830152604482018a905290911690632043f773906064016020604051808303816000875af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610f7c565b506001600160a01b038916600090815260208c9052604081208054889290610287908490610fb6565b90915550506001600160a01b038816600090815260208c90526040812080548892906102b4908490610fcf565b909155506102c890508b828b896001610936565b6102d68b828a896000610936565b5050505050505050505050565b80516000906001600160a01b031661030d5760405162461bcd60e51b815260040161011990610f3d565b60008260200151116103515760405162461bcd60e51b815260206004820152600d60248201526c56616c7565206973207a65726f60981b6044820152606401610119565b816080015151826060015151146103aa5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206c656e677468206f6620706172616d65746572730000000000006044820152606401610119565b836000815181106103bd576103bd610f66565b6020908102919091018101518351918401516040808601519051632786ff6960e01b81526001600160a01b03948516600482015260248101929092526044820152911690632786ff69906064016020604051808303816000875af1158015610429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190610f7c565b5060c08201516020830151604051632a21b82b60e11b815260048101919091526000916001600160a01b031690635443705690602401602060405180830381865afa1580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610fe2565b9050808660020160008282546104da9190610fcf565b92505081905550808660030160008282546104f59190610fcf565b909155505082516001600160a01b031660009081526020879052604081208054839290610523908490610fcf565b92505081905550610556868660018151811061054157610541610f66565b60200260200101518560000151846000610936565b6000805b846060015151811015610644578460600151818151811061057d5761057d610f66565b6020026020010151826105909190610fcf565b9150856001600160a01b031663c0a0bde88660000151876060015184815181106105bc576105bc610f66565b60200260200101518860a00151896080015186815181106105df576105df610f66565b60200260200101516040518563ffffffff1660e01b8152600401610606949392919061101f565b600060405180830381600087803b15801561062057600080fd5b505af1158015610634573d6000803e3d6000fd5b50506001909201915061055a9050565b5083602001518111156106a85760405162461bcd60e51b815260206004820152602660248201527f76616c75654c6f636b6564206d75737420626520736d616c6c6572207468616e6044820152652076616c756560d01b6064820152608401610119565b83600001516001600160a01b03167f7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a8560200151836040516106f4929190918252602082015260400190565b60405180910390a25095945050505050565b604051632a21b82b60e11b81526004810183905260009081906001600160a01b03841690635443705690602401602060405180830381865afa158015610750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107749190610fe2565b6001600160a01b0386166000908152602089905260409020549091508111156107d45760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b856000815181106107e7576107e7610f66565b60209081029190910101516040516332ef868b60e11b81526001600160a01b03878116600483015260248201879052909116906365df0d16906044016020604051808303816000875af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190610f7c565b506001600160a01b0385166000908152602088905260408120805483929061088f908490610fb6565b925050819055506108be87876001815181106108ad576108ad610f66565b602002602001015187846001610936565b808760020160008282546108d29190610fb6565b9091555090979650505050505050565b600260006108f0848361115e565b9050828015610900575084548116155b156109105784548118855561092f565b8215801561092357508454600190821610155b1561092f578454811885555b5050505050565b60405163479ad3af60e11b81526001600160a01b03848116600483015260009190861690638f35a75e90602401600060405180830381865afa158015610980573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109a8919081019061116d565b90506109b381511590565b610a3957600086600101826040516109cb91906111e4565b90815260405190819003602001902054905060008360018111156109f1576109f1611200565b03610a0757610a008482610fcf565b9050610a14565b610a118482610fb6565b90505b808760010183604051610a2791906111e4565b90815260405190819003602001902055505b505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715610a7a57610a7a610a41565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a41565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a41565b5060051b60200190565b6001600160a01b0381168114610aea57600080fd5b50565b8035610af881610ad5565b919050565b600082601f830112610b0e57600080fd5b81356020610b23610b1e83610ab1565b610a80565b8083825260208201915060208460051b870101935086841115610b4557600080fd5b602086015b84811015610b6a578035610b5d81610ad5565b8352918301918301610b4a565b509695505050505050565b60008060008060008060c08789031215610b8e57600080fd5b86359550602087013567ffffffffffffffff811115610bac57600080fd5b610bb889828a01610afd565b9550506040870135610bc981610ad5565b93506060870135610bd981610ad5565b9598949750929560808101359460a0909101359350915050565b600082601f830112610c0457600080fd5b81356020610c14610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c3657600080fd5b602086015b84811015610b6a5780358352918301918301610c3b565b600082601f830112610c6357600080fd5b81356020610c73610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c9557600080fd5b602086015b84811015610b6a57803567ffffffffffffffff81168114610cbb5760008081fd5b8352918301918301610c9a565b600067ffffffffffffffff821115610ce257610ce2610a41565b50601f01601f191660200190565b600082601f830112610d0157600080fd5b8135610d0f610b1e82610cc8565b818152846020838601011115610d2457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610d5757600080fd5b84359350602085013567ffffffffffffffff80821115610d7657600080fd5b610d8288838901610afd565b945060408701359150610d9482610ad5565b90925060608601359080821115610daa57600080fd5b9086019060e08289031215610dbe57600080fd5b610dc6610a57565b610dcf83610aed565b81526020830135602082015260408301356040820152606083013582811115610df757600080fd5b610e038a828601610bf3565b606083015250608083013582811115610e1b57600080fd5b610e278a828601610c52565b60808301525060a083013582811115610e3f57600080fd5b610e4b8a828601610cf0565b60a083015250610e5d60c08401610aed565b60c08201529598949750929550505050565b600080600080600060a08688031215610e8757600080fd5b85359450602086013567ffffffffffffffff811115610ea557600080fd5b610eb188828901610afd565b9450506040860135610ec281610ad5565b9250606086013591506080860135610ed981610ad5565b809150509295509295909350565b8015158114610aea57600080fd5b600080600060608486031215610f0a57600080fd5b83359250602084013560ff81168114610f2257600080fd5b91506040840135610f3281610ee7565b809150509250925092565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8e57600080fd5b8151610f9981610ee7565b9392505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610fc957610fc9610fa0565b92915050565b80820180821115610fc957610fc9610fa0565b600060208284031215610ff457600080fd5b5051919050565b60005b83811015611016578181015183820152602001610ffe565b50506000910152565b60018060a01b038516815283602082015260806040820152600083518060808401526110528160a0850160208801610ffb565b67ffffffffffffffff93909316606083015250601f91909101601f19160160a0019392505050565b600181815b808511156110b557816000190482111561109b5761109b610fa0565b808516156110a857918102915b93841c939080029061107f565b509250929050565b6000826110cc57506001610fc9565b816110d957506000610fc9565b81600181146110ef57600281146110f957611115565b6001915050610fc9565b60ff84111561110a5761110a610fa0565b50506001821b610fc9565b5060208310610133831016604e8410600b8410161715611138575081810a610fc9565b611142838361107a565b806000190482111561115657611156610fa0565b029392505050565b6000610f9960ff8416836110bd565b60006020828403121561117f57600080fd5b815167ffffffffffffffff81111561119657600080fd5b8201601f810184136111a757600080fd5b80516111b5610b1e82610cc8565b8181528560208385010111156111ca57600080fd5b6111db826020830160208601610ffb565b95945050505050565b600082516111f6818460208701610ffb565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","sourceMap":"1047:5930:72:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;1047:5930:72;;;;;;;;;;;;;;;;;","linkReferences":{},"cborAuxdata":{"1":{"value":"0xa264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","offset":4689}},"transformations":[],"transformationValues":{}},"runtimeBytecode":{"onchainBytecode":"0x73d9e2e5bc54dcff27cf219120eac4d4b11ca0b22430146080604052600436106100565760003560e01c8063037ac75b1461005b578063285674c11461007d57806376d8c33f146100af578063bd5f8572146100cf575b600080fd5b81801561006757600080fd5b5061007b610076366004610b75565b6100ef565b005b81801561008957600080fd5b5061009d610098366004610d41565b6102e3565b60405190815260200160405180910390f35b8180156100bb57600080fd5b5061009d6100ca366004610e6f565b610706565b8180156100db57600080fd5b5061007b6100ea366004610ef5565b6108e2565b858484836001600160a01b0383166101225760405162461bcd60e51b815260040161011990610f3d565b60405180910390fd5b6001600160a01b0382166101485760405162461bcd60e51b815260040161011990610f3d565b6001600160a01b0383166000908152602085905260409020548111156101a55760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b6000896001815181106101ba576101ba610f66565b60200260200101519050896000815181106101d7576101d7610f66565b6020908102919091010151604051632043f77360e01b81526001600160a01b038b811660048301528a81166024830152604482018a905290911690632043f773906064016020604051808303816000875af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610f7c565b506001600160a01b038916600090815260208c9052604081208054889290610287908490610fb6565b90915550506001600160a01b038816600090815260208c90526040812080548892906102b4908490610fcf565b909155506102c890508b828b896001610936565b6102d68b828a896000610936565b5050505050505050505050565b80516000906001600160a01b031661030d5760405162461bcd60e51b815260040161011990610f3d565b60008260200151116103515760405162461bcd60e51b815260206004820152600d60248201526c56616c7565206973207a65726f60981b6044820152606401610119565b816080015151826060015151146103aa5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206c656e677468206f6620706172616d65746572730000000000006044820152606401610119565b836000815181106103bd576103bd610f66565b6020908102919091018101518351918401516040808601519051632786ff6960e01b81526001600160a01b03948516600482015260248101929092526044820152911690632786ff69906064016020604051808303816000875af1158015610429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190610f7c565b5060c08201516020830151604051632a21b82b60e11b815260048101919091526000916001600160a01b031690635443705690602401602060405180830381865afa1580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610fe2565b9050808660020160008282546104da9190610fcf565b92505081905550808660030160008282546104f59190610fcf565b909155505082516001600160a01b031660009081526020879052604081208054839290610523908490610fcf565b92505081905550610556868660018151811061054157610541610f66565b60200260200101518560000151846000610936565b6000805b846060015151811015610644578460600151818151811061057d5761057d610f66565b6020026020010151826105909190610fcf565b9150856001600160a01b031663c0a0bde88660000151876060015184815181106105bc576105bc610f66565b60200260200101518860a00151896080015186815181106105df576105df610f66565b60200260200101516040518563ffffffff1660e01b8152600401610606949392919061101f565b600060405180830381600087803b15801561062057600080fd5b505af1158015610634573d6000803e3d6000fd5b50506001909201915061055a9050565b5083602001518111156106a85760405162461bcd60e51b815260206004820152602660248201527f76616c75654c6f636b6564206d75737420626520736d616c6c6572207468616e6044820152652076616c756560d01b6064820152608401610119565b83600001516001600160a01b03167f7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a8560200151836040516106f4929190918252602082015260400190565b60405180910390a25095945050505050565b604051632a21b82b60e11b81526004810183905260009081906001600160a01b03841690635443705690602401602060405180830381865afa158015610750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107749190610fe2565b6001600160a01b0386166000908152602089905260409020549091508111156107d45760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b856000815181106107e7576107e7610f66565b60209081029190910101516040516332ef868b60e11b81526001600160a01b03878116600483015260248201879052909116906365df0d16906044016020604051808303816000875af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190610f7c565b506001600160a01b0385166000908152602088905260408120805483929061088f908490610fb6565b925050819055506108be87876001815181106108ad576108ad610f66565b602002602001015187846001610936565b808760020160008282546108d29190610fb6565b9091555090979650505050505050565b600260006108f0848361115e565b9050828015610900575084548116155b156109105784548118855561092f565b8215801561092357508454600190821610155b1561092f578454811885555b5050505050565b60405163479ad3af60e11b81526001600160a01b03848116600483015260009190861690638f35a75e90602401600060405180830381865afa158015610980573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109a8919081019061116d565b90506109b381511590565b610a3957600086600101826040516109cb91906111e4565b90815260405190819003602001902054905060008360018111156109f1576109f1611200565b03610a0757610a008482610fcf565b9050610a14565b610a118482610fb6565b90505b808760010183604051610a2791906111e4565b90815260405190819003602001902055505b505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715610a7a57610a7a610a41565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a41565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a41565b5060051b60200190565b6001600160a01b0381168114610aea57600080fd5b50565b8035610af881610ad5565b919050565b600082601f830112610b0e57600080fd5b81356020610b23610b1e83610ab1565b610a80565b8083825260208201915060208460051b870101935086841115610b4557600080fd5b602086015b84811015610b6a578035610b5d81610ad5565b8352918301918301610b4a565b509695505050505050565b60008060008060008060c08789031215610b8e57600080fd5b86359550602087013567ffffffffffffffff811115610bac57600080fd5b610bb889828a01610afd565b9550506040870135610bc981610ad5565b93506060870135610bd981610ad5565b9598949750929560808101359460a0909101359350915050565b600082601f830112610c0457600080fd5b81356020610c14610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c3657600080fd5b602086015b84811015610b6a5780358352918301918301610c3b565b600082601f830112610c6357600080fd5b81356020610c73610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c9557600080fd5b602086015b84811015610b6a57803567ffffffffffffffff81168114610cbb5760008081fd5b8352918301918301610c9a565b600067ffffffffffffffff821115610ce257610ce2610a41565b50601f01601f191660200190565b600082601f830112610d0157600080fd5b8135610d0f610b1e82610cc8565b818152846020838601011115610d2457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610d5757600080fd5b84359350602085013567ffffffffffffffff80821115610d7657600080fd5b610d8288838901610afd565b945060408701359150610d9482610ad5565b90925060608601359080821115610daa57600080fd5b9086019060e08289031215610dbe57600080fd5b610dc6610a57565b610dcf83610aed565b81526020830135602082015260408301356040820152606083013582811115610df757600080fd5b610e038a828601610bf3565b606083015250608083013582811115610e1b57600080fd5b610e278a828601610c52565b60808301525060a083013582811115610e3f57600080fd5b610e4b8a828601610cf0565b60a083015250610e5d60c08401610aed565b60c08201529598949750929550505050565b600080600080600060a08688031215610e8757600080fd5b85359450602086013567ffffffffffffffff811115610ea557600080fd5b610eb188828901610afd565b9450506040860135610ec281610ad5565b9250606086013591506080860135610ed981610ad5565b809150509295509295909350565b8015158114610aea57600080fd5b600080600060608486031215610f0a57600080fd5b83359250602084013560ff81168114610f2257600080fd5b91506040840135610f3281610ee7565b809150509250925092565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8e57600080fd5b8151610f9981610ee7565b9392505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610fc957610fc9610fa0565b92915050565b80820180821115610fc957610fc9610fa0565b600060208284031215610ff457600080fd5b5051919050565b60005b83811015611016578181015183820152602001610ffe565b50506000910152565b60018060a01b038516815283602082015260806040820152600083518060808401526110528160a0850160208801610ffb565b67ffffffffffffffff93909316606083015250601f91909101601f19160160a0019392505050565b600181815b808511156110b557816000190482111561109b5761109b610fa0565b808516156110a857918102915b93841c939080029061107f565b509250929050565b6000826110cc57506001610fc9565b816110d957506000610fc9565b81600181146110ef57600281146110f957611115565b6001915050610fc9565b60ff84111561110a5761110a610fa0565b50506001821b610fc9565b5060208310610133831016604e8410600b8410161715611138575081810a610fc9565b611142838361107a565b806000190482111561115657611156610fa0565b029392505050565b6000610f9960ff8416836110bd565b60006020828403121561117f57600080fd5b815167ffffffffffffffff81111561119657600080fd5b8201601f810184136111a757600080fd5b80516111b5610b1e82610cc8565b8181528560208385010111156111ca57600080fd5b6111db826020830160208601610ffb565b95945050505050565b600082516111f6818460208701610ffb565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","recompiledBytecode":"0x73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063037ac75b1461005b578063285674c11461007d57806376d8c33f146100af578063bd5f8572146100cf575b600080fd5b81801561006757600080fd5b5061007b610076366004610b75565b6100ef565b005b81801561008957600080fd5b5061009d610098366004610d41565b6102e3565b60405190815260200160405180910390f35b8180156100bb57600080fd5b5061009d6100ca366004610e6f565b610706565b8180156100db57600080fd5b5061007b6100ea366004610ef5565b6108e2565b858484836001600160a01b0383166101225760405162461bcd60e51b815260040161011990610f3d565b60405180910390fd5b6001600160a01b0382166101485760405162461bcd60e51b815260040161011990610f3d565b6001600160a01b0383166000908152602085905260409020548111156101a55760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b6000896001815181106101ba576101ba610f66565b60200260200101519050896000815181106101d7576101d7610f66565b6020908102919091010151604051632043f77360e01b81526001600160a01b038b811660048301528a81166024830152604482018a905290911690632043f773906064016020604051808303816000875af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610f7c565b506001600160a01b038916600090815260208c9052604081208054889290610287908490610fb6565b90915550506001600160a01b038816600090815260208c90526040812080548892906102b4908490610fcf565b909155506102c890508b828b896001610936565b6102d68b828a896000610936565b5050505050505050505050565b80516000906001600160a01b031661030d5760405162461bcd60e51b815260040161011990610f3d565b60008260200151116103515760405162461bcd60e51b815260206004820152600d60248201526c56616c7565206973207a65726f60981b6044820152606401610119565b816080015151826060015151146103aa5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206c656e677468206f6620706172616d65746572730000000000006044820152606401610119565b836000815181106103bd576103bd610f66565b6020908102919091018101518351918401516040808601519051632786ff6960e01b81526001600160a01b03948516600482015260248101929092526044820152911690632786ff69906064016020604051808303816000875af1158015610429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190610f7c565b5060c08201516020830151604051632a21b82b60e11b815260048101919091526000916001600160a01b031690635443705690602401602060405180830381865afa1580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610fe2565b9050808660020160008282546104da9190610fcf565b92505081905550808660030160008282546104f59190610fcf565b909155505082516001600160a01b031660009081526020879052604081208054839290610523908490610fcf565b92505081905550610556868660018151811061054157610541610f66565b60200260200101518560000151846000610936565b6000805b846060015151811015610644578460600151818151811061057d5761057d610f66565b6020026020010151826105909190610fcf565b9150856001600160a01b031663c0a0bde88660000151876060015184815181106105bc576105bc610f66565b60200260200101518860a00151896080015186815181106105df576105df610f66565b60200260200101516040518563ffffffff1660e01b8152600401610606949392919061101f565b600060405180830381600087803b15801561062057600080fd5b505af1158015610634573d6000803e3d6000fd5b50506001909201915061055a9050565b5083602001518111156106a85760405162461bcd60e51b815260206004820152602660248201527f76616c75654c6f636b6564206d75737420626520736d616c6c6572207468616e6044820152652076616c756560d01b6064820152608401610119565b83600001516001600160a01b03167f7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a8560200151836040516106f4929190918252602082015260400190565b60405180910390a25095945050505050565b604051632a21b82b60e11b81526004810183905260009081906001600160a01b03841690635443705690602401602060405180830381865afa158015610750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107749190610fe2565b6001600160a01b0386166000908152602089905260409020549091508111156107d45760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b856000815181106107e7576107e7610f66565b60209081029190910101516040516332ef868b60e11b81526001600160a01b03878116600483015260248201879052909116906365df0d16906044016020604051808303816000875af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190610f7c565b506001600160a01b0385166000908152602088905260408120805483929061088f908490610fb6565b925050819055506108be87876001815181106108ad576108ad610f66565b602002602001015187846001610936565b808760020160008282546108d29190610fb6565b9091555090979650505050505050565b600260006108f0848361115e565b9050828015610900575084548116155b156109105784548118855561092f565b8215801561092357508454600190821610155b1561092f578454811885555b5050505050565b60405163479ad3af60e11b81526001600160a01b03848116600483015260009190861690638f35a75e90602401600060405180830381865afa158015610980573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109a8919081019061116d565b90506109b381511590565b610a3957600086600101826040516109cb91906111e4565b90815260405190819003602001902054905060008360018111156109f1576109f1611200565b03610a0757610a008482610fcf565b9050610a14565b610a118482610fb6565b90505b808760010183604051610a2791906111e4565b90815260405190819003602001902055505b505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715610a7a57610a7a610a41565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a41565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a41565b5060051b60200190565b6001600160a01b0381168114610aea57600080fd5b50565b8035610af881610ad5565b919050565b600082601f830112610b0e57600080fd5b81356020610b23610b1e83610ab1565b610a80565b8083825260208201915060208460051b870101935086841115610b4557600080fd5b602086015b84811015610b6a578035610b5d81610ad5565b8352918301918301610b4a565b509695505050505050565b60008060008060008060c08789031215610b8e57600080fd5b86359550602087013567ffffffffffffffff811115610bac57600080fd5b610bb889828a01610afd565b9550506040870135610bc981610ad5565b93506060870135610bd981610ad5565b9598949750929560808101359460a0909101359350915050565b600082601f830112610c0457600080fd5b81356020610c14610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c3657600080fd5b602086015b84811015610b6a5780358352918301918301610c3b565b600082601f830112610c6357600080fd5b81356020610c73610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c9557600080fd5b602086015b84811015610b6a57803567ffffffffffffffff81168114610cbb5760008081fd5b8352918301918301610c9a565b600067ffffffffffffffff821115610ce257610ce2610a41565b50601f01601f191660200190565b600082601f830112610d0157600080fd5b8135610d0f610b1e82610cc8565b818152846020838601011115610d2457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610d5757600080fd5b84359350602085013567ffffffffffffffff80821115610d7657600080fd5b610d8288838901610afd565b945060408701359150610d9482610ad5565b90925060608601359080821115610daa57600080fd5b9086019060e08289031215610dbe57600080fd5b610dc6610a57565b610dcf83610aed565b81526020830135602082015260408301356040820152606083013582811115610df757600080fd5b610e038a828601610bf3565b606083015250608083013582811115610e1b57600080fd5b610e278a828601610c52565b60808301525060a083013582811115610e3f57600080fd5b610e4b8a828601610cf0565b60a083015250610e5d60c08401610aed565b60c08201529598949750929550505050565b600080600080600060a08688031215610e8757600080fd5b85359450602086013567ffffffffffffffff811115610ea557600080fd5b610eb188828901610afd565b9450506040860135610ec281610ad5565b9250606086013591506080860135610ed981610ad5565b809150509295509295909350565b8015158114610aea57600080fd5b600080600060608486031215610f0a57600080fd5b83359250602084013560ff81168114610f2257600080fd5b91506040840135610f3281610ee7565b809150509250925092565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8e57600080fd5b8151610f9981610ee7565b9392505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610fc957610fc9610fa0565b92915050565b80820180821115610fc957610fc9610fa0565b600060208284031215610ff457600080fd5b5051919050565b60005b83811015611016578181015183820152602001610ffe565b50506000910152565b60018060a01b038516815283602082015260806040820152600083518060808401526110528160a0850160208801610ffb565b67ffffffffffffffff93909316606083015250601f91909101601f19160160a0019392505050565b600181815b808511156110b557816000190482111561109b5761109b610fa0565b808516156110a857918102915b93841c939080029061107f565b509250929050565b6000826110cc57506001610fc9565b816110d957506000610fc9565b81600181146110ef57600281146110f957611115565b6001915050610fc9565b60ff84111561110a5761110a610fa0565b50506001821b610fc9565b5060208310610133831016604e8410600b8410161715611138575081810a610fc9565b611142838361107a565b806000190482111561115657611156610fa0565b029392505050565b6000610f9960ff8416836110bd565b60006020828403121561117f57600080fd5b815167ffffffffffffffff81111561119657600080fd5b8201601f810184136111a757600080fd5b80516111b5610b1e82610cc8565b8181528560208385010111156111ca57600080fd5b6111db826020830160208601610ffb565b95945050505050565b600082516111f6818460208701610ffb565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","sourceMap":"1047:5930:72:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5590:768;;;;;;;;;;-1:-1:-1;5590:768:72;;;;;:::i;:::-;;:::i;:::-;;2697:1541;;;;;;;;;;-1:-1:-1;2697:1541:72;;;;;:::i;:::-;;:::i;:::-;;;6840:25:79;;;6828:2;6813:18;2697:1541:72;;;;;;;4571:1013;;;;;;;;;;-1:-1:-1;4571:1013:72;;;;;:::i;:::-;;:::i;2128:563::-;;;;;;;;;;-1:-1:-1;2128:563:72;;;;;:::i;:::-;;:::i;5590:768::-;5810:10;5822:5;5829:3;5834:7;-1:-1:-1;;;;;4367:19:72;;4359:47;;;;-1:-1:-1;;;4359:47:72;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;4424:17:72;;4416:45;;;;-1:-1:-1;;;4416:45:72;;;;;;;:::i;:::-;-1:-1:-1;;;;;4490:33:72;;:26;:33;;;;;;;;;;;4479:44;;;4471:75;;;;-1:-1:-1;;;4471:75:72;;8892:2:79;4471:75:72;;;8874:21:79;8931:2;8911:18;;;8904:30;-1:-1:-1;;;8950:18:79;;;8943:48;9008:18;;4471:75:72;8690:342:79;4471:75:72;5857:34:::1;5913:9;1247:1;5913:27;;;;;;;;:::i;:::-;;;;;;;5857:84;;5972:9;1195:1;5972:29;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;;5951:85:::1;::::0;-1:-1:-1;;;5951:85:72;;-1:-1:-1;;;;;9427:15:79;;;5951:85:72::1;::::0;::::1;9409:34:79::0;9479:15;;;9459:18;;;9452:43;9511:18;;;9504:34;;;5951:65:72;;::::1;::::0;::::1;::::0;9344:18:79;;5951:85:72::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;;6047:33:72;::::1;:26;:33:::0;;;::::1;::::0;;;;;;:44;;6084:7;;6047:26;:44:::1;::::0;6084:7;;6047:44:::1;:::i;:::-;::::0;;;-1:-1:-1;;;;;;;6101:31:72;::::1;:26;:31:::0;;;::::1;::::0;;;;;;:42;;6136:7;;6101:26;:42:::1;::::0;6136:7;;6101:42:::1;:::i;:::-;::::0;;;-1:-1:-1;6153:95:72::1;::::0;-1:-1:-1;6175:10:72;6187:15;6204:5;6211:7;6220:27:::1;6153:21;:95::i;:::-;6258:93;6280:10;6292:15;6309:3;6314:7;6323:27;6258:21;:93::i;:::-;5847:511;5590:768:::0;;;;;;;;;;:::o;2697:1541::-;2949:11;;2893:7;;-1:-1:-1;;;;;2949:25:72;2941:53;;;;-1:-1:-1;;;2941:53:72;;;;;;;:::i;:::-;3029:1;3012:7;:14;;;:18;3004:44;;;;-1:-1:-1;;;3004:44:72;;10396:2:79;3004:44:72;;;10378:21:79;10435:2;10415:18;;;10408:30;-1:-1:-1;;;10454:18:79;;;10447:43;10507:18;;3004:44:72;10194:337:79;3004:44:72;3098:7;:21;;;:28;3066:7;:21;;;:28;:60;3058:99;;;;-1:-1:-1;;;3058:99:72;;10738:2:79;3058:99:72;;;10720:21:79;10777:2;10757:18;;;10750:30;10816:28;10796:18;;;10789:56;10862:18;;3058:99:72;10536:350:79;3058:99:72;3284:9;1195:1;3284:29;;;;;;;;:::i;:::-;;;;;;;;;;;;3332:11;;3345:14;;;;3361:21;;;;;3263:120;;-1:-1:-1;;;3263:120:72;;-1:-1:-1;;;;;11111:32:79;;;3263:120:72;;;11093:51:79;11160:18;;;11153:34;;;;11203:18;;;11196:34;3263:68:72;;;;;11066:18:79;;3263:120:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;3412:25:72;;;;3460:14;;;;3412:63;;-1:-1:-1;;;3412:63:72;;;;;6840:25:79;;;;3394:14:72;;-1:-1:-1;;;;;3412:47:72;;;;6813:18:79;;3412:63:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3394:81;;3512:6;3486:10;:22;;;:32;;;;;;;:::i;:::-;;;;;;;;3554:6;3528:10;:22;;;:32;;;;;;;:::i;:::-;;;;-1:-1:-1;;3597:11:72;;-1:-1:-1;;;;;3570:39:72;:26;:39;;;;;;;;;;:49;;3613:6;;3570:26;:49;;3613:6;;3570:49;:::i;:::-;;;;;;;;3630:132;3652:10;3683:9;1247:1;3683:27;;;;;;;;:::i;:::-;;;;;;;3713:7;:11;;;3726:6;3734:27;3630:21;:132::i;:::-;3773:19;3811:9;3806:251;3830:7;:21;;;:28;3826:1;:32;3806:251;;;3894:7;:21;;;3916:1;3894:24;;;;;;;;:::i;:::-;;;;;;;3879:39;;;;;:::i;:::-;;;3932:12;-1:-1:-1;;;;;3932:32:72;;3965:7;:11;;;3978:7;:21;;;4000:1;3978:24;;;;;;;;:::i;:::-;;;;;;;4004:7;:15;;;4021:7;:21;;;4043:1;4021:24;;;;;;;;:::i;:::-;;;;;;;3932:114;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3860:3:72;;;;;-1:-1:-1;3806:251:72;;-1:-1:-1;3806:251:72;;;4089:7;:14;;;4074:11;:29;;4066:80;;;;-1:-1:-1;;;4066:80:72;;12737:2:79;4066:80:72;;;12719:21:79;12776:2;12756:18;;;12749:30;12815:34;12795:18;;;12788:62;-1:-1:-1;;;12866:18:79;;;12859:36;12912:19;;4066:80:72;12535:402:79;4066:80:72;4167:7;:11;;;-1:-1:-1;;;;;4161:47:72;;4180:7;:14;;;4196:11;4161:47;;;;;;13116:25:79;;;13172:2;13157:18;;13150:34;13104:2;13089:18;;12942:248;4161:47:72;;;;;;;;-1:-1:-1;4225:6:72;2697:1541;-1:-1:-1;;;;;2697:1541:72:o;4571:1013::-;4824:47;;-1:-1:-1;;;4824:47:72;;;;;6840:25:79;;;4782:7:72;;;;-1:-1:-1;;;;;4824:39:72;;;;;6813:18:79;;4824:47:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;4906:32:72;;:26;:32;;;;;;;;;;;4801:70;;-1:-1:-1;4890:48:72;;;4882:79;;;;-1:-1:-1;;;4882:79:72;;8892:2:79;4882:79:72;;;8874:21:79;8931:2;8911:18;;;8904:30;-1:-1:-1;;;8950:18:79;;;8943:48;9008:18;;4882:79:72;8690:342:79;4882:79:72;5172:9;1195:1;5172:29;;;;;;;;:::i;:::-;;;;;;;;;;;5151:78;;-1:-1:-1;;;5151:78:72;;-1:-1:-1;;;;;13387:32:79;;;5151:78:72;;;13369:51:79;13436:18;;;13429:34;;;5151:64:72;;;;;;13342:18:79;;5151:78:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;5240:32:72;;:26;:32;;;;;;;;;;:48;;5276:12;;5240:26;:48;;5276:12;;5240:48;:::i;:::-;;;;;;;;5298:201;5333:10;5376:9;1247:1;5376:27;;;;;;;;:::i;:::-;;;;;;;5418:4;5436:12;5462:27;5298:21;:201::i;:::-;5536:12;5510:10;:22;;;:38;;;;;;;:::i;:::-;;;;-1:-1:-1;5565:12:72;;4571:1013;-1:-1:-1;;;;;;;4571:1013:72:o;2128:563::-;2258:1;2243:12;2284:18;2290:12;2258:1;2284:18;:::i;:::-;2269:33;;2414:6;:47;;;;-1:-1:-1;2425:23:72;;:30;;:35;2414:47;2410:275;;;2503:23;;:30;;2477:56;;2410:275;;;2555:6;2554:7;:48;;;;-1:-1:-1;2566:23:72;;2600:1;2566:30;;;:35;;2554:48;2550:135;;;2644:23;;:30;;2618:56;;2550:135;2233:458;;2128:563;;;:::o;6364:611::-;6570:37;;-1:-1:-1;;;6570:37:72;;-1:-1:-1;;;;;15015:32:79;;;6570:37:72;;;14997:51:79;6545:22:72;;6570:28;;;;;;14970:18:79;;6570:37:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6570:37:72;;;;;;;;;;;;:::i;:::-;6545:62;;6622:35;6648:8;1123:18:77;:23;;1038:113;6622:35:72;6617:352;;6673:15;6691:10;:28;;6720:8;6691:38;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;6760:27:72;6747:9;:40;;;;;;;;:::i;:::-;;6743:154;;6807:18;6818:7;6807:18;;:::i;:::-;;;6743:154;;;6864:18;6875:7;6864:18;;:::i;:::-;;;6743:154;6951:7;6910:10;:28;;6939:8;6910:38;;;;;;:::i;:::-;;;;;;;;;;;;;;:48;-1:-1:-1;6617:352:72;6535:440;6364:611;;;;;:::o;14:127:79:-;75:10;70:3;66:20;63:1;56:31;106:4;103:1;96:15;130:4;127:1;120:15;146:253;218:2;212:9;260:4;248:17;;295:18;280:34;;316:22;;;277:62;274:88;;;342:18;;:::i;:::-;378:2;371:22;146:253;:::o;404:275::-;475:2;469:9;540:2;521:13;;-1:-1:-1;;517:27:79;505:40;;575:18;560:34;;596:22;;;557:62;554:88;;;622:18;;:::i;:::-;658:2;651:22;404:275;;-1:-1:-1;404:275:79:o;684:183::-;744:4;777:18;769:6;766:30;763:56;;;799:18;;:::i;:::-;-1:-1:-1;844:1:79;840:14;856:4;836:25;;684:183::o;872:131::-;-1:-1:-1;;;;;947:31:79;;937:42;;927:70;;993:1;990;983:12;927:70;872:131;:::o;1008:134::-;1076:20;;1105:31;1076:20;1105:31;:::i;:::-;1008:134;;;:::o;1147:743::-;1201:5;1254:3;1247:4;1239:6;1235:17;1231:27;1221:55;;1272:1;1269;1262:12;1221:55;1308:6;1295:20;1334:4;1358:60;1374:43;1414:2;1374:43;:::i;:::-;1358:60;:::i;:::-;1440:3;1464:2;1459:3;1452:15;1492:4;1487:3;1483:14;1476:21;;1549:4;1543:2;1540:1;1536:10;1528:6;1524:23;1520:34;1506:48;;1577:3;1569:6;1566:15;1563:35;;;1594:1;1591;1584:12;1563:35;1630:4;1622:6;1618:17;1644:217;1660:6;1655:3;1652:15;1644:217;;;1740:3;1727:17;1757:31;1782:5;1757:31;:::i;:::-;1801:18;;1839:12;;;;1677;;1644:217;;;-1:-1:-1;1879:5:79;1147:743;-1:-1:-1;;;;;;1147:743:79:o;1895:860::-;2053:6;2061;2069;2077;2085;2093;2146:3;2134:9;2125:7;2121:23;2117:33;2114:53;;;2163:1;2160;2153:12;2114:53;2199:9;2186:23;2176:33;;2260:2;2249:9;2245:18;2232:32;2287:18;2279:6;2276:30;2273:50;;;2319:1;2316;2309:12;2273:50;2342:61;2395:7;2386:6;2375:9;2371:22;2342:61;:::i;:::-;2332:71;;;2453:2;2442:9;2438:18;2425:32;2466:31;2491:5;2466:31;:::i;:::-;2516:5;-1:-1:-1;2573:2:79;2558:18;;2545:32;2586:33;2545:32;2586:33;:::i;:::-;1895:860;;;;-1:-1:-1;1895:860:79;;2692:3;2677:19;;2664:33;;2744:3;2729:19;;;2716:33;;-1:-1:-1;1895:860:79;-1:-1:-1;;1895:860:79:o;2760:668::-;2814:5;2867:3;2860:4;2852:6;2848:17;2844:27;2834:55;;2885:1;2882;2875:12;2834:55;2921:6;2908:20;2947:4;2971:60;2987:43;3027:2;2987:43;:::i;2971:60::-;3053:3;3077:2;3072:3;3065:15;3105:4;3100:3;3096:14;3089:21;;3162:4;3156:2;3153:1;3149:10;3141:6;3137:23;3133:34;3119:48;;3190:3;3182:6;3179:15;3176:35;;;3207:1;3204;3197:12;3176:35;3243:4;3235:6;3231:17;3257:142;3273:6;3268:3;3265:15;3257:142;;;3339:17;;3327:30;;3377:12;;;;3290;;3257:142;;3433:850;3486:5;3539:3;3532:4;3524:6;3520:17;3516:27;3506:55;;3557:1;3554;3547:12;3506:55;3593:6;3580:20;3619:4;3643:60;3659:43;3699:2;3659:43;:::i;3643:60::-;3725:3;3749:2;3744:3;3737:15;3777:4;3772:3;3768:14;3761:21;;3834:4;3828:2;3825:1;3821:10;3813:6;3809:23;3805:34;3791:48;;3862:3;3854:6;3851:15;3848:35;;;3879:1;3876;3869:12;3848:35;3915:4;3907:6;3903:17;3929:325;3945:6;3940:3;3937:15;3929:325;;;4025:3;4012:17;4073:18;4066:5;4062:30;4055:5;4052:41;4042:139;;4135:1;4164:2;4160;4153:14;4042:139;4194:18;;4232:12;;;;3962;;3929:325;;4288:187;4337:4;4370:18;4362:6;4359:30;4356:56;;;4392:18;;:::i;:::-;-1:-1:-1;4458:2:79;4437:15;-1:-1:-1;;4433:29:79;4464:4;4429:40;;4288:187::o;4480:464::-;4523:5;4576:3;4569:4;4561:6;4557:17;4553:27;4543:55;;4594:1;4591;4584:12;4543:55;4630:6;4617:20;4661:49;4677:32;4706:2;4677:32;:::i;4661:49::-;4735:2;4726:7;4719:19;4781:3;4774:4;4769:2;4761:6;4757:15;4753:26;4750:35;4747:55;;;4798:1;4795;4788:12;4747:55;4863:2;4856:4;4848:6;4844:17;4837:4;4828:7;4824:18;4811:55;4911:1;4886:16;;;4904:4;4882:27;4875:38;;;;4890:7;4480:464;-1:-1:-1;;;4480:464:79:o;4949:1732::-;5143:6;5151;5159;5167;5220:3;5208:9;5199:7;5195:23;5191:33;5188:53;;;5237:1;5234;5227:12;5188:53;5273:9;5260:23;5250:33;;5334:2;5323:9;5319:18;5306:32;5357:18;5398:2;5390:6;5387:14;5384:34;;;5414:1;5411;5404:12;5384:34;5437:61;5490:7;5481:6;5470:9;5466:22;5437:61;:::i;:::-;5427:71;;5548:2;5537:9;5533:18;5520:32;5507:45;;5561:31;5586:5;5561:31;:::i;:::-;5611:5;;-1:-1:-1;5669:2:79;5654:18;;5641:32;;5685:16;;;5682:36;;;5714:1;5711;5704:12;5682:36;5737:24;;;;5795:4;5777:16;;;5773:27;5770:47;;;5813:1;5810;5803:12;5770:47;5841:22;;:::i;:::-;5888;5907:2;5888:22;:::i;:::-;5879:7;5872:39;5966:2;5962;5958:11;5945:25;5940:2;5931:7;5927:16;5920:51;6026:2;6022;6018:11;6005:25;6000:2;5991:7;5987:16;5980:51;6077:2;6073;6069:11;6056:25;6106:2;6096:8;6093:16;6090:36;;;6122:1;6119;6112:12;6090:36;6160:56;6208:7;6197:8;6193:2;6189:17;6160:56;:::i;:::-;6155:2;6146:7;6142:16;6135:82;;6263:3;6259:2;6255:12;6242:26;6293:2;6283:8;6280:16;6277:36;;;6309:1;6306;6299:12;6277:36;6348:55;6395:7;6384:8;6380:2;6376:17;6348:55;:::i;:::-;6342:3;6333:7;6329:17;6322:82;;6450:3;6446:2;6442:12;6429:26;6480:2;6470:8;6467:16;6464:36;;;6496:1;6493;6486:12;6464:36;6535:45;6572:7;6561:8;6557:2;6553:17;6535:45;:::i;:::-;6529:3;6520:7;6516:17;6509:72;;6616:32;6643:3;6639:2;6635:12;6616:32;:::i;:::-;6610:3;6597:17;;6590:59;4949:1732;;;;-1:-1:-1;4949:1732:79;;-1:-1:-1;;;;4949:1732:79:o;6876:828::-;7062:6;7070;7078;7086;7094;7147:3;7135:9;7126:7;7122:23;7118:33;7115:53;;;7164:1;7161;7154:12;7115:53;7200:9;7187:23;7177:33;;7261:2;7250:9;7246:18;7233:32;7288:18;7280:6;7277:30;7274:50;;;7320:1;7317;7310:12;7274:50;7343:61;7396:7;7387:6;7376:9;7372:22;7343:61;:::i;:::-;7333:71;;;7454:2;7443:9;7439:18;7426:32;7467:31;7492:5;7467:31;:::i;:::-;7517:5;-1:-1:-1;7569:2:79;7554:18;;7541:32;;-1:-1:-1;7625:3:79;7610:19;;7597:33;7639;7597;7639;:::i;:::-;7691:7;7681:17;;;6876:828;;;;;;;;:::o;7709:118::-;7795:5;7788:13;7781:21;7774:5;7771:32;7761:60;;7817:1;7814;7807:12;7832:509;7941:6;7949;7957;8010:2;7998:9;7989:7;7985:23;7981:32;7978:52;;;8026:1;8023;8016:12;7978:52;8062:9;8049:23;8039:33;;8122:2;8111:9;8107:18;8094:32;8166:4;8159:5;8155:16;8148:5;8145:27;8135:55;;8186:1;8183;8176:12;8135:55;8209:5;-1:-1:-1;8266:2:79;8251:18;;8238:32;8279:30;8238:32;8279:30;:::i;:::-;8328:7;8318:17;;;7832:509;;;;;:::o;8346:339::-;8548:2;8530:21;;;8587:2;8567:18;;;8560:30;-1:-1:-1;;;8621:2:79;8606:18;;8599:45;8676:2;8661:18;;8346:339::o;9037:127::-;9098:10;9093:3;9089:20;9086:1;9079:31;9129:4;9126:1;9119:15;9153:4;9150:1;9143:15;9549:245;9616:6;9669:2;9657:9;9648:7;9644:23;9640:32;9637:52;;;9685:1;9682;9675:12;9637:52;9717:9;9711:16;9736:28;9758:5;9736:28;:::i;:::-;9783:5;9549:245;-1:-1:-1;;;9549:245:79:o;9799:127::-;9860:10;9855:3;9851:20;9848:1;9841:31;9891:4;9888:1;9881:15;9915:4;9912:1;9905:15;9931:128;9998:9;;;10019:11;;;10016:37;;;10033:18;;:::i;:::-;9931:128;;;;:::o;10064:125::-;10129:9;;;10150:10;;;10147:36;;;10163:18;;:::i;11423:184::-;11493:6;11546:2;11534:9;11525:7;11521:23;11517:32;11514:52;;;11562:1;11559;11552:12;11514:52;-1:-1:-1;11585:16:79;;11423:184;-1:-1:-1;11423:184:79:o;11612:250::-;11697:1;11707:113;11721:6;11718:1;11715:13;11707:113;;;11797:11;;;11791:18;11778:11;;;11771:39;11743:2;11736:10;11707:113;;;-1:-1:-1;;11854:1:79;11836:16;;11829:27;11612:250::o;11867:663::-;12128:1;12124;12119:3;12115:11;12111:19;12103:6;12099:32;12088:9;12081:51;12168:6;12163:2;12152:9;12148:18;12141:34;12211:3;12206:2;12195:9;12191:18;12184:31;12062:4;12244:6;12238:13;12288:6;12282:3;12271:9;12267:19;12260:35;12304:80;12377:6;12371:3;12360:9;12356:19;12351:2;12343:6;12339:15;12304:80;:::i;:::-;12504:18;12492:31;;;;12487:2;12472:18;;12465:59;-1:-1:-1;12445:2:79;12424:15;;;;-1:-1:-1;;12420:29:79;12405:45;12452:3;12401:55;;11867:663;-1:-1:-1;;;11867:663:79:o;13474:416::-;13563:1;13600:5;13563:1;13614:270;13635:7;13625:8;13622:21;13614:270;;;13694:4;13690:1;13686:6;13682:17;13676:4;13673:27;13670:53;;;13703:18;;:::i;:::-;13753:7;13743:8;13739:22;13736:55;;;13773:16;;;;13736:55;13852:22;;;;13812:15;;;;13614:270;;;13618:3;13474:416;;;;;:::o;13895:806::-;13944:5;13974:8;13964:80;;-1:-1:-1;14015:1:79;14029:5;;13964:80;14063:4;14053:76;;-1:-1:-1;14100:1:79;14114:5;;14053:76;14145:4;14163:1;14158:59;;;;14231:1;14226:130;;;;14138:218;;14158:59;14188:1;14179:10;;14202:5;;;14226:130;14263:3;14253:8;14250:17;14247:43;;;14270:18;;:::i;:::-;-1:-1:-1;;14326:1:79;14312:16;;14341:5;;14138:218;;14440:2;14430:8;14427:16;14421:3;14415:4;14412:13;14408:36;14402:2;14392:8;14389:16;14384:2;14378:4;14375:12;14371:35;14368:77;14365:159;;;-1:-1:-1;14477:19:79;;;14509:5;;14365:159;14556:34;14581:8;14575:4;14556:34;:::i;:::-;14626:6;14622:1;14618:6;14614:19;14605:7;14602:32;14599:58;;;14637:18;;:::i;:::-;14675:20;;13895:806;-1:-1:-1;;;13895:806:79:o;14706:140::-;14764:5;14793:47;14834:4;14824:8;14820:19;14814:4;14793:47;:::i;15059:649::-;15139:6;15192:2;15180:9;15171:7;15167:23;15163:32;15160:52;;;15208:1;15205;15198:12;15160:52;15241:9;15235:16;15274:18;15266:6;15263:30;15260:50;;;15306:1;15303;15296:12;15260:50;15329:22;;15382:4;15374:13;;15370:27;-1:-1:-1;15360:55:79;;15411:1;15408;15401:12;15360:55;15440:2;15434:9;15465:49;15481:32;15510:2;15481:32;:::i;15465:49::-;15537:2;15530:5;15523:17;15577:7;15572:2;15567;15563;15559:11;15555:20;15552:33;15549:53;;;15598:1;15595;15588:12;15549:53;15611:67;15675:2;15670;15663:5;15659:14;15654:2;15650;15646:11;15611:67;:::i;:::-;15697:5;15059:649;-1:-1:-1;;;;;15059:649:79:o;15713:289::-;15844:3;15882:6;15876:13;15898:66;15957:6;15952:3;15945:4;15937:6;15933:17;15898:66;:::i;:::-;15980:16;;;;;15713:289;-1:-1:-1;;15713:289:79:o;16007:127::-;16068:10;16063:3;16059:20;16056:1;16049:31;16099:4;16096:1;16089:15;16123:4;16120:1;16113:15","linkReferences":{},"cborAuxdata":{"1":{"value":"0xa264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","offset":4631}},"immutableReferences":{},"transformations":[{"type":"replace","offset":1,"reason":"callProtection"}],"transformationValues":{"callProtection":"0xd9e2e5bc54dcff27cf219120eac4d4b11ca0b224"}},"deployment":{"transactionHash":"0x3cca366e7696207b4eeac491dfd9767dd9467576079d00ffdc51ce8a89c8edc9","blockNumber":"23540776","transactionIndex":"13","deployer":"0xd69FefE5Df62373DCBdE3e1F9625Cf334a2Dae78"},"sources":{"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.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 * The initial owner is set to the address provided by the deployer. This can\n * 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 OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\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        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\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        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\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        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\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. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\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 ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: The upgradeable version of this contract does not use an immutable cache and recomputes the domain separator\n * each time {_domainSeparatorV4} is called. That is cheaper than accessing a cached version in cold storage.\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267 {\n    bytes32 private constant TYPE_HASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.EIP712\n    struct EIP712Storage {\n        /// @custom:oz-renamed-from _HASHED_NAME\n        bytes32 _hashedName;\n        /// @custom:oz-renamed-from _HASHED_VERSION\n        bytes32 _hashedVersion;\n\n        string _name;\n        string _version;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.EIP712\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;\n\n    function _getEIP712Storage() private pure returns (EIP712Storage storage $) {\n        assembly {\n            $.slot := EIP712StorageLocation\n        }\n    }\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     *\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n     * contract upgrade].\n     */\n    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n        __EIP712_init_unchained(name, version);\n    }\n\n    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n        EIP712Storage storage $ = _getEIP712Storage();\n        $._name = name;\n        $._version = version;\n\n        // Reset prior values in storage if upgrading\n        $._hashedName = 0;\n        $._hashedVersion = 0;\n    }\n\n    /**\n     * @dev Returns the domain separator for the current chain.\n     */\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        return _buildDomainSeparator();\n    }\n\n    function _buildDomainSeparator() private view returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n    }\n\n    /// @inheritdoc IERC5267\n    function eip712Domain()\n        public\n        view\n        virtual\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        )\n    {\n        EIP712Storage storage $ = _getEIP712Storage();\n        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized\n        // and the EIP712 domain is not reliable, as it will be missing name and version.\n        require($._hashedName == 0 && $._hashedVersion == 0, \"EIP712: Uninitialized\");\n\n        return (\n            hex\"0f\", // 01111\n            _EIP712Name(),\n            _EIP712Version(),\n            block.chainid,\n            address(this),\n            bytes32(0),\n            new uint256[](0)\n        );\n    }\n\n    /**\n     * @dev The name parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Name() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev The version parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Version() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._version;\n    }\n\n    /**\n     * @dev The hash of the name parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n     */\n    function _EIP712NameHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory name = _EIP712Name();\n        if (bytes(name).length > 0) {\n            return keccak256(bytes(name));\n        } else {\n            // If the name is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.\n            bytes32 hashedName = $._hashedName;\n            if (hashedName != 0) {\n                return hashedName;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n\n    /**\n     * @dev The hash of the version parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n     */\n    function _EIP712VersionHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory version = _EIP712Version();\n        if (bytes(version).length > 0) {\n            return keccak256(bytes(version));\n        } else {\n            // If the version is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.\n            bytes32 hashedVersion = $._hashedVersion;\n            if (hashedVersion != 0) {\n                return hashedVersion;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    function __Pausable_init() internal onlyInitializing {\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},"@openzeppelin/contracts/interfaces/draft-IERC1822.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev ERC-1822: 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"},"@openzeppelin/contracts/interfaces/draft-IERC6093.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC6093.sol)\npragma solidity >=0.8.4;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},"@openzeppelin/contracts/interfaces/IERC1967.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1967.sol)\n\npragma solidity >=0.4.11;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\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"},"@openzeppelin/contracts/interfaces/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},"@openzeppelin/contracts/interfaces/IERC5267.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC5267.sol)\n\npragma solidity >=0.4.16;\n\ninterface IERC5267 {\n    /**\n     * @dev MAY be emitted to signal that the domain could have changed.\n     */\n    event EIP712DomainChanged();\n\n    /**\n     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n     * signature.\n     */\n    function eip712Domain()\n        external\n        view\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        );\n}\n"},"@openzeppelin/contracts/proxy/beacon/IBeacon.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity >=0.4.16;\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     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.21;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\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.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\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 ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\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.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\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 ERC-1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\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 ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.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 the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\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 ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},"@openzeppelin/contracts/token/ERC20/ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.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 *\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 ERC-20\n * applications.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => 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     * Both values are immutable: they can only be set once during 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 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 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 returns (uint8) {\n        return 18;\n    }\n\n    /// @inheritdoc IERC20\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /// @inheritdoc IERC20\n    function balanceOf(address account) public view virtual 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 `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /// @inheritdoc IERC20\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` 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 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\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 `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` 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     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` 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     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\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"},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\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 value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens as the allowance of `spender` over the\n     * 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 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` 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 value) external returns (bool);\n}\n"},"@openzeppelin/contracts/utils/Address.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            _revert(returndata);\n        }\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 or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\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    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\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    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) 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            assembly (\"memory-safe\") {\n                revert(add(returndata, 0x20), mload(returndata))\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/Context.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"@openzeppelin/contracts/utils/cryptography/ECDSA.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS\n    }\n\n    /**\n     * @dev The signature derives the `address(0)`.\n     */\n    error ECDSAInvalidSignature();\n\n    /**\n     * @dev The signature has an invalid length.\n     */\n    error ECDSAInvalidSignatureLength(uint256 length);\n\n    /**\n     * @dev The signature has an S value that is in the upper half order.\n     */\n    error ECDSAInvalidSignatureS(bytes32 s);\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n     * and a bytes32 providing additional information about the error.\n     *\n     * If no error is returned, then the address can be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes memory signature\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly (\"memory-safe\") {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        unchecked {\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\n            return tryRecover(hash, v, r, s);\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS, s);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\n        }\n\n        return (signer, RecoverError.NoError, bytes32(0));\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n     */\n    function _throwError(RecoverError error, bytes32 errorArg) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert ECDSAInvalidSignature();\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert ECDSAInvalidSignatureS(errorArg);\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing a bytes32 `messageHash` with\n     * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n     * keccak256, although any bytes32 value can be safely used because the final digest will\n     * be re-hashed.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing an arbitrary `message` with\n     * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n        return\n            keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x00` (data with intended validator).\n     *\n     * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n     * `validator` address. Then hashing the result.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n    }\n\n    /**\n     * @dev Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.\n     */\n    function toDataWithIntendedValidatorHash(\n        address validator,\n        bytes32 messageHash\n    ) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, hex\"19_00\")\n            mstore(0x02, shl(96, validator))\n            mstore(0x16, messageHash)\n            digest := keccak256(0x00, 0x36)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            mstore(ptr, hex\"19_01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/Errors.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},"@openzeppelin/contracts/utils/math/Math.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n        // variables such that product = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\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 ternary(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 ternary(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 towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 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 low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / 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 high into low.\n            low |= high * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n            // is no longer required.\n            result = low * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev 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        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\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 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},"@openzeppelin/contracts/utils/math/SafeCast.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/math/SignedMath.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(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 ternary(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            // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n            // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n            int256 mask = n >> 255;\n\n            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n            return uint256((n + mask) ^ mask);\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/Panic.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/StorageSlot.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\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 ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\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(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\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 Int256Slot {\n        int256 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        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\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        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\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        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/Strings.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    using SafeCast for *;\n\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n    uint256 private constant SPECIAL_CHARS_LOOKUP =\n        (1 << 0x08) | // backspace\n            (1 << 0x09) | // tab\n            (1 << 0x0a) | // newline\n            (1 << 0x0c) | // form feed\n            (1 << 0x0d) | // carriage return\n            (1 << 0x22) | // double quote\n            (1 << 0x5c); // backslash\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev The string being parsed contains characters that are not in scope of the given base.\n     */\n    error StringsInvalidChar();\n\n    /**\n     * @dev The string being parsed is not a properly formatted address.\n     */\n    error StringsInvalidAddressFormat();\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            assembly (\"memory-safe\") {\n                ptr := add(add(buffer, 0x20), length)\n            }\n            while (true) {\n                ptr--;\n                assembly (\"memory-safe\") {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(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        uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\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\n     * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n     * representation, according to EIP-55.\n     */\n    function toChecksumHexString(address addr) internal pure returns (string memory) {\n        bytes memory buffer = bytes(toHexString(addr));\n\n        // hash the hex part of buffer (skip length + 2 bytes, length 40)\n        uint256 hashValue;\n        assembly (\"memory-safe\") {\n            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n        }\n\n        for (uint256 i = 41; i > 1; --i) {\n            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n                // case shift by xoring with 0x20\n                buffer[i] ^= 0x20;\n            }\n            hashValue >>= 4;\n        }\n        return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input) internal pure returns (uint256) {\n        return parseUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        uint256 result = 0;\n        for (uint256 i = begin; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 9) return (false, 0);\n            result *= 10;\n            result += chr;\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `int256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input) internal pure returns (int256) {\n        return parseInt(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\n        (bool success, int256 value) = tryParseInt(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n     * the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\n        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    uint256 private constant ABS_MIN_INT256 = 2 ** 255;\n\n    /**\n     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character or if the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, int256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseIntUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseIntUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, int256 value) {\n        bytes memory buffer = bytes(input);\n\n        // Check presence of a negative sign.\n        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        bool positiveSign = sign == bytes1(\"+\");\n        bool negativeSign = sign == bytes1(\"-\");\n        uint256 offset = (positiveSign || negativeSign).toUint();\n\n        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\n\n        if (absSuccess && absValue < ABS_MIN_INT256) {\n            return (true, negativeSign ? -int256(absValue) : int256(absValue));\n        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\n            return (true, type(int256).min);\n        } else return (false, 0);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input) internal pure returns (uint256) {\n        return parseHexUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseHexUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n     * invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseHexUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseHexUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        // skip 0x prefix if present\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 offset = hasPrefix.toUint() * 2;\n\n        uint256 result = 0;\n        for (uint256 i = begin + offset; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 15) return (false, 0);\n            result *= 16;\n            unchecked {\n                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\n                // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.\n                result += chr;\n            }\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input) internal pure returns (address) {\n        return parseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\n        (bool success, address value) = tryParseAddress(input, begin, end);\n        if (!success) revert StringsInvalidAddressFormat();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n     * formatted address. See {parseAddress-string} requirements.\n     */\n    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\n        return tryParseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n     * formatted address. See {parseAddress-string-uint256-uint256} requirements.\n     */\n    function tryParseAddress(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, address value) {\n        if (end > bytes(input).length || begin > end) return (false, address(0));\n\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\n\n        // check that input is the correct length\n        if (end - begin == expectedLength) {\n            // length guarantees that this does not overflow, and value is at most type(uint160).max\n            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\n            return (s, address(uint160(v)));\n        } else {\n            return (false, address(0));\n        }\n    }\n\n    function _tryParseChr(bytes1 chr) private pure returns (uint8) {\n        uint8 value = uint8(chr);\n\n        // Try to parse `chr`:\n        // - Case 1: [0-9]\n        // - Case 2: [a-f]\n        // - Case 3: [A-F]\n        // - otherwise not supported\n        unchecked {\n            if (value > 47 && value < 58) value -= 48;\n            else if (value > 96 && value < 103) value -= 87;\n            else if (value > 64 && value < 71) value -= 55;\n            else return type(uint8).max;\n        }\n\n        return value;\n    }\n\n    /**\n     * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\n     *\n     * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\n     *\n     * NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of\n     * RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode\n     * characters that are not in this range, but other tooling may provide different results.\n     */\n    function escapeJSON(string memory input) internal pure returns (string memory) {\n        bytes memory buffer = bytes(input);\n        bytes memory output = new bytes(2 * buffer.length); // worst case scenario\n        uint256 outputLength = 0;\n\n        for (uint256 i; i < buffer.length; ++i) {\n            bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));\n            if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {\n                output[outputLength++] = \"\\\\\";\n                if (char == 0x08) output[outputLength++] = \"b\";\n                else if (char == 0x09) output[outputLength++] = \"t\";\n                else if (char == 0x0a) output[outputLength++] = \"n\";\n                else if (char == 0x0c) output[outputLength++] = \"f\";\n                else if (char == 0x0d) output[outputLength++] = \"r\";\n                else if (char == 0x5c) output[outputLength++] = \"\\\\\";\n                else if (char == 0x22) {\n                    // solhint-disable-next-line quotes\n                    output[outputLength++] = '\"';\n                }\n            } else {\n                output[outputLength++] = char;\n            }\n        }\n        // write the actual length and deallocate unused memory\n        assembly (\"memory-safe\") {\n            mstore(output, outputLength)\n            mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))\n        }\n\n        return string(output);\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(add(buffer, 0x20), offset))\n        }\n    }\n}\n"},"contracts/bulk/BulkOperator.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IBulkOperator} from \"./IBulkOperator.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\nimport {IDSTrustService} from \"../trust/IDSTrustService.sol\";\nimport {TokenIssuer} from \"../issuance/TokenIssuer.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {PausableUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\n\ncontract BulkOperator is  IBulkOperator, BaseDSContract, PausableUpgradeable {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    IDSToken public dsToken;\n\n    function initialize(address _dsToken) public override initializer onlyProxy {\n        dsToken = IDSToken(_dsToken);\n        __Pausable_init();\n        __BaseDSContract_init();\n    }\n\n    function pause() external onlyOwner {\n        _pause();\n    }\n\n    function unpause() external onlyOwner {\n        _unpause();\n    }\n\n    function getVersion() external pure returns (uint8) {\n        return 2;\n    }\n\n    function bulkIssuance(address[] calldata addresses, uint256[] calldata values, uint256 issuanceTime) whenNotPaused onlyIssuerOrAbove external {\n        require(addresses.length == values.length, \"Addresses and values length mismatch\");\n\n        for (uint256 i = 0; i < addresses.length; i++) {\n            dsToken.issueTokensCustom(addresses[i], values[i], issuanceTime, 0, \"\", 0);\n        }\n    }\n\n    function bulkRegisterAndIssuance(BulkRegisterAndIssuance[] calldata data) whenNotPaused onlyIssuerOrAbove external {\n        TokenIssuer tokenIssuer = TokenIssuer(getDSService(TOKEN_ISSUER));\n        for (uint256 i = 0; i < data.length; i++) {\n            BulkRegisterAndIssuance memory currentBulkAndIssuance = data[i];\n\n            tokenIssuer.issueTokens(\n                currentBulkAndIssuance.id,\n                currentBulkAndIssuance.to,\n                currentBulkAndIssuance.issuanceValues,\n                currentBulkAndIssuance.reason,\n                currentBulkAndIssuance.locksValues,\n                currentBulkAndIssuance.lockReleaseTimes,\n                \"\",\n                currentBulkAndIssuance.country,\n                currentBulkAndIssuance.attributeValues,\n                currentBulkAndIssuance.attributeExpirations\n            );\n        }\n    }\n\n    function bulkBurn(address[] calldata addresses, uint256[] memory values) whenNotPaused onlyIssuerOrTransferAgentOrAbove external {\n        require(addresses.length == values.length, \"Addresses and values length mismatch\");\n\n        for (uint256 i = 0; i < addresses.length; i++) {\n            dsToken.burn(addresses[i], values[i], \"\");\n        }\n    }\n}\n"},"contracts/bulk/IBulkOperator.sol":{"content":"pragma solidity 0.8.22;\n\n/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninterface IBulkOperator {\n\n    struct BulkRegisterAndIssuance {\n        string id;\n        address to;\n        uint256[] issuanceValues;\n        string reason;\n        uint256[] locksValues;\n        uint64[] lockReleaseTimes;\n        string country;\n        uint256[] attributeValues;\n        uint256[] attributeExpirations;\n    }\n\n    /**\n     * @dev Function to be invoked by the proxy contract when the BulkOperator is deployed.\n     * @param _dsToken dsToken to issue\n    **/\n    function initialize(address _dsToken) external;\n\n    /**\n     * @dev Get the contract version\n     * @return Contract version\n    **/\n    function getVersion() external pure returns (uint8);\n\n    /**\n     * @dev Bulk Issuance to existing investors\n     * @param addresses - Array of addresses to be issued to\n     * @param values - Array of values to be issue\n     * @param issuanceTime - Issuance time for all issuances\n    **/\n    function bulkIssuance(address[] memory addresses, uint256[] memory values, uint256 issuanceTime) external;\n\n    /**\n     * @dev Bulk Issuance and registration of new investors\n     * @param data - Array of BulkRegisterAndIssuance struct\n    **/\n    function bulkRegisterAndIssuance(BulkRegisterAndIssuance[] memory data) external;\n\n    /**\n     * @dev Bulk Burn\n     * @param addresses - Array of addresses to be burn to\n     * @param values - Array of values to be burned\n    **/\n    function bulkBurn(address[] memory addresses, uint256[] memory values) external;\n}\n"},"contracts/compliance/ComplianceConfigurationService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSComplianceConfigurationService} from \"./IDSComplianceConfigurationService.sol\";\nimport {ComplianceConfigurationDataStore} from \"../data-stores/ComplianceConfigurationDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\n\ncontract ComplianceConfigurationService is IDSComplianceConfigurationService, ComplianceConfigurationDataStore, BaseDSContract {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function setCountriesCompliance(string[] calldata _countries, uint256[] calldata _values) public override onlyTransferAgentOrAbove {\n        require(_countries.length <= 35, \"Exceeded the maximum number of countries\");\n        require(_countries.length == _values.length, \"Wrong length of parameters\");\n        for (uint8 i = 0; i < _countries.length; i++) {\n            setCountryCompliance(_countries[i], _values[i]);\n        }\n    }\n\n    function setCountryCompliance(string calldata _country, uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceStringToUIntMapRuleSet(\"countryCompliance\", _country, countriesCompliances[_country], _value);\n        countriesCompliances[_country] = _value;\n    }\n\n    function getCountryCompliance(string calldata _country) public view override returns (uint256) {\n        return countriesCompliances[_country];\n    }\n\n    function getTotalInvestorsLimit() public view override returns (uint256) {\n        return totalInvestorsLimit;\n    }\n\n    function setTotalInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"totalInvestorsLimit\", totalInvestorsLimit, _value);\n        totalInvestorsLimit = _value;\n    }\n\n    function getMinUSTokens() public view override returns (uint256) {\n        return minUSTokens;\n    }\n\n    function setMinUSTokens(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minUSTokens\", minUSTokens, _value);\n        minUSTokens = _value;\n    }\n\n    function getMinEUTokens() public view override returns (uint256) {\n        return minEUTokens;\n    }\n\n    function setMinEUTokens(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minEUTokens\", minEUTokens, _value);\n        minEUTokens = _value;\n    }\n\n    function getUSInvestorsLimit() public view override returns (uint256) {\n        return usInvestorsLimit;\n    }\n\n    function setUSInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"usInvestorsLimit\", usInvestorsLimit, _value);\n        usInvestorsLimit = _value;\n    }\n\n    function getJPInvestorsLimit() public view override returns (uint256) {\n        return jpInvestorsLimit;\n    }\n\n    function setJPInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"jpInvestorsLimit\", jpInvestorsLimit, _value);\n        jpInvestorsLimit = _value;\n    }\n\n    function getUSAccreditedInvestorsLimit() public view override returns (uint256) {\n        return usAccreditedInvestorsLimit;\n    }\n\n    function setUSAccreditedInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"usAccreditedInvestorsLimit\", usAccreditedInvestorsLimit, _value);\n        usAccreditedInvestorsLimit = _value;\n    }\n\n    function getNonAccreditedInvestorsLimit() public view override returns (uint256) {\n        return nonAccreditedInvestorsLimit;\n    }\n\n    function setNonAccreditedInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"nonAccreditedInvestorsLimit\", nonAccreditedInvestorsLimit, _value);\n        nonAccreditedInvestorsLimit = _value;\n    }\n\n    function getMaxUSInvestorsPercentage() public view override returns (uint256) {\n        return maxUSInvestorsPercentage;\n    }\n\n    function setMaxUSInvestorsPercentage(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"maxUSInvestorsPercentage\", maxUSInvestorsPercentage, _value);\n        maxUSInvestorsPercentage = _value;\n    }\n\n    function getBlockFlowbackEndTime() public view override returns (uint256) {\n        return blockFlowbackEndTime;\n    }\n\n    function setBlockFlowbackEndTime(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"blockFlowbackEndTime\", blockFlowbackEndTime, _value);\n        blockFlowbackEndTime = _value;\n    }\n\n    function getNonUSLockPeriod() public view override returns (uint256) {\n        return nonUSLockPeriod;\n    }\n\n    function setNonUSLockPeriod(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"nonUSLockPeriod\", nonUSLockPeriod, _value);\n        nonUSLockPeriod = _value;\n    }\n\n    function getMinimumTotalInvestors() public view override returns (uint256) {\n        return minimumTotalInvestors;\n    }\n\n    function setMinimumTotalInvestors(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minimumTotalInvestors\", minimumTotalInvestors, _value);\n        minimumTotalInvestors = _value;\n    }\n\n    function getMinimumHoldingsPerInvestor() public view override returns (uint256) {\n        return minimumHoldingsPerInvestor;\n    }\n\n    function setMinimumHoldingsPerInvestor(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minimumHoldingsPerInvestor\", minimumHoldingsPerInvestor, _value);\n        minimumHoldingsPerInvestor = _value;\n    }\n\n    function getMaximumHoldingsPerInvestor() public view override returns (uint256) {\n        return maximumHoldingsPerInvestor;\n    }\n\n    function setMaximumHoldingsPerInvestor(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"maximumHoldingsPerInvestor\", maximumHoldingsPerInvestor, _value);\n        maximumHoldingsPerInvestor = _value;\n    }\n\n    function getEURetailInvestorsLimit() public view override returns (uint256) {\n        return euRetailInvestorsLimit;\n    }\n\n    function setEURetailInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"euRetailInvestorsLimit\", euRetailInvestorsLimit, _value);\n        euRetailInvestorsLimit = _value;\n    }\n\n    function getUSLockPeriod() public view override returns (uint256) {\n        return usLockPeriod;\n    }\n\n    function setUSLockPeriod(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"usLockPeriod\", usLockPeriod, _value);\n        usLockPeriod = _value;\n    }\n\n    function getForceFullTransfer() public view override returns (bool) {\n        return forceFullTransfer;\n    }\n\n    function setForceFullTransfer(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"forceFullTransfer\", forceFullTransfer, _value);\n        forceFullTransfer = _value;\n    }\n\n    function getForceAccreditedUS() public view override returns (bool) {\n        return forceAccreditedUS;\n    }\n\n    function setForceAccreditedUS(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"forceAccreditedUS\", forceAccreditedUS, _value);\n        forceAccreditedUS = _value;\n    }\n\n    function getForceAccredited() public view override returns (bool) {\n        return forceAccredited;\n    }\n\n    function setForceAccredited(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"forceAccredited\", forceAccredited, _value);\n        forceAccredited = _value;\n    }\n\n    function getWorldWideForceFullTransfer() public view override returns (bool) {\n        return worldWideForceFullTransfer;\n    }\n\n    function setWorldWideForceFullTransfer(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"worldWideForceFullTransfer\", worldWideForceFullTransfer, _value);\n        worldWideForceFullTransfer = _value;\n    }\n\n    function getAuthorizedSecurities() public view override returns (uint256) {\n        return authorizedSecurities;\n    }\n\n    function setAuthorizedSecurities(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"authorizedSecurities\", authorizedSecurities, _value);\n        authorizedSecurities = _value;\n    }\n\n    function getDisallowBackDating() public view override returns (bool) {\n        return disallowBackDating;\n    }\n\n    function setDisallowBackDating(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"disallowBackDating\", disallowBackDating, _value);\n        disallowBackDating = _value;\n    }\n\n    function setAll(uint256[] calldata _uint_values, bool[] calldata _bool_values) public override onlyTransferAgentOrAbove {\n        require(_uint_values.length == 16, \"Wrong length of parameters\");\n        require(_bool_values.length == 5, \"Wrong length of parameters\");\n        setTotalInvestorsLimit(_uint_values[0]);\n        setMinUSTokens(_uint_values[1]);\n        setMinEUTokens(_uint_values[2]);\n        setUSInvestorsLimit(_uint_values[3]);\n        setUSAccreditedInvestorsLimit(_uint_values[4]);\n        setNonAccreditedInvestorsLimit(_uint_values[5]);\n        setMaxUSInvestorsPercentage(_uint_values[6]);\n        setBlockFlowbackEndTime(_uint_values[7]);\n        setNonUSLockPeriod(_uint_values[8]);\n        setMinimumTotalInvestors(_uint_values[9]);\n        setMinimumHoldingsPerInvestor(_uint_values[10]);\n        setMaximumHoldingsPerInvestor(_uint_values[11]);\n        setEURetailInvestorsLimit(_uint_values[12]);\n        setUSLockPeriod(_uint_values[13]);\n        setJPInvestorsLimit(_uint_values[14]);\n        setAuthorizedSecurities(_uint_values[15]);\n        setForceFullTransfer(_bool_values[0]);\n        setForceAccredited(_bool_values[1]);\n        setForceAccreditedUS(_bool_values[2]);\n        setWorldWideForceFullTransfer(_bool_values[3]);\n        setDisallowBackDating(_bool_values[4]);\n    }\n\n    function getAll() public view override returns (uint256[] memory, bool[] memory) {\n        uint256[] memory uintValues = new uint256[](16);\n        bool[] memory boolValues = new bool[](5);\n\n        uintValues[0] = getTotalInvestorsLimit();\n        uintValues[1] = getMinUSTokens();\n        uintValues[2] = getMinEUTokens();\n        uintValues[3] = getUSInvestorsLimit();\n        uintValues[4] = getUSAccreditedInvestorsLimit();\n        uintValues[5] = getNonAccreditedInvestorsLimit();\n        uintValues[6] = getMaxUSInvestorsPercentage();\n        uintValues[7] = getBlockFlowbackEndTime();\n        uintValues[8] = getNonUSLockPeriod();\n        uintValues[9] = getMinimumTotalInvestors();\n        uintValues[10] = getMinimumHoldingsPerInvestor();\n        uintValues[11] = getMaximumHoldingsPerInvestor();\n        uintValues[12] = getEURetailInvestorsLimit();\n        uintValues[13] = getUSLockPeriod();\n        uintValues[14] = getJPInvestorsLimit();\n        uintValues[15] = getAuthorizedSecurities();\n        boolValues[0] = getForceFullTransfer();\n        boolValues[1] = getForceAccredited();\n        boolValues[2] = getForceAccreditedUS();\n        boolValues[3] = getWorldWideForceFullTransfer();\n        boolValues[4] = getDisallowBackDating();\n        return (uintValues, boolValues);\n    }\n}\n"},"contracts/compliance/ComplianceService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSComplianceService} from \"./IDSComplianceService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {ComplianceServiceDataStore} from \"../data-stores/ComplianceServiceDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\n\n\n/**\n *   @title Compliance service main implementation.\n *\n *   Combines the different implementation files for the compliance service and serves as a base class for\n *   concrete implementation.\n *\n *   To create a concrete implementation of a compliance service, one should inherit from this contract,\n *   and implement the five functions - recordIssuance,checkTransfer,recordTransfer,recordBurn and recordSeize.\n *   The rest of the functions should only be overridden in rare circumstances.\n */\n\nabstract contract ComplianceService is IDSComplianceService, ComplianceServiceDataStore, BaseDSContract {\n\n    function initialize() public virtual override onlyProxy onlyInitializing {\n        __BaseDSContract_init();\n    }\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public override onlyToken returns (bool) {\n        uint256 code;\n        string memory reason;\n\n        (code, reason) = preTransferCheck(_from, _to, _value);\n        require(code == 0, reason);\n\n        return recordTransfer(_from,_to, _value);\n    }\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value,\n        bool _paused,\n        uint256 _balanceFrom\n    ) public virtual override onlyToken returns (bool) {\n        uint256 code;\n        string memory reason;\n\n        (code, reason) = newPreTransferCheck(_from, _to, _value, _balanceFrom, _paused);\n        require(code == 0, reason);\n\n        return recordTransfer(_from,_to, _value);\n    }\n\n    function validateIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime\n    ) public override onlyToken returns (bool) {\n        uint256 code;\n        string memory reason;\n\n        uint256 authorizedSecurities = getComplianceConfigurationService().getAuthorizedSecurities();\n\n        uint256 totalSupply = getToken().totalSupply();\n\n        require(authorizedSecurities == 0 || totalSupply + _value <= authorizedSecurities,\n            MAX_AUTHORIZED_SECURITIES_EXCEEDED);\n\n        (code, reason) = preIssuanceCheck(_to, _value);\n        require(code == 0, reason);\n\n        uint256 issuanceTime = validateIssuanceTime(_issuanceTime);\n        return recordIssuance(_to, _value, issuanceTime);\n    }\n\n    function validateBurn(address _who, uint256 _value) public virtual override onlyToken returns (bool) {\n        return recordBurn(_who, _value);\n    }\n\n    function validateSeize(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public virtual override onlyToken returns (bool) {\n        require(getWalletManager().isIssuerSpecialWallet(_to), \"Target wallet type error\");\n\n        return recordSeize(_from, _to, _value);\n    }\n\n    /**\n     * @dev Verify disallowBackDating compliance: if set to false returns _issuanceTime parameter, otherwise returns current timestamp\n     * @param _issuanceTime.\n     * @return issuanceTime\n     */\n    function validateIssuanceTime(uint256 _issuanceTime) public view override returns (uint256 issuanceTime) {\n        if (!getComplianceConfigurationService().getDisallowBackDating()) {\n            return _issuanceTime;\n        }\n        return block.timestamp;\n    }\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        if (_pausedToken) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        if (_balanceFrom < _value) {\n            return (15, NOT_ENOUGH_TOKENS);\n        }\n\n        if (getLockManager().getTransferableTokens(_from, block.timestamp) < _value) {\n            return (16, TOKENS_LOCKED);\n        }\n\n        return checkTransfer(_from, _to, _value);\n    }\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        IDSToken token = getToken();\n        return newPreTransferCheck(_from, _to, _value, token.balanceOf(_from), token.isPaused());\n    }\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        if (getToken().isPaused()) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        return checkTransfer(_from, _to, _value);\n    }\n\n    function preIssuanceCheck(\n        address, /*_to*/\n        uint256 /*_value*/\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return (0, VALID);\n    }\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory, /*_id*/\n        string memory, /*_country*/\n        string memory /*_prevCountry*/\n    ) public virtual override returns (bool) {\n        return true;\n    }\n\n    // These functions should be implemented by the concrete compliance manager\n    function recordIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime\n    ) internal virtual returns (bool);\n\n    function recordTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal virtual returns (bool);\n\n    function recordBurn(address _who, uint256 _value) internal virtual returns (bool);\n\n    function recordSeize(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal virtual returns (bool);\n\n    function checkTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal view virtual returns (uint256, string memory);\n}\n"},"contracts/compliance/ComplianceServiceRegulated.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ComplianceServiceWhitelisted} from \"./ComplianceServiceWhitelisted.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\nimport {IDSComplianceConfigurationService} from \"./IDSComplianceConfigurationService.sol\";\nimport {IDSWalletManager} from \"./IDSWalletManager.sol\";\nimport {IDSLockManager} from \"./IDSLockManager.sol\";\n\nlibrary ComplianceServiceLibrary {\n    uint256 internal constant DS_TOKEN = 0;\n    uint256 internal constant REGISTRY_SERVICE = 1;\n    uint256 internal constant WALLET_MANAGER = 2;\n    uint256 internal constant COMPLIANCE_CONFIGURATION_SERVICE = 3;\n    uint256 internal constant LOCK_MANAGER = 4;\n    uint256 internal constant COMPLIANCE_SERVICE = 5;\n    uint256 internal constant DEPRECATED_OMNIBUS_TBE_CONTROLLER = 6; // Deprecated, kept for backward compatibility\n    uint256 internal constant NONE = 0;\n    uint256 internal constant US = 1;\n    uint256 internal constant EU = 2;\n    uint256 internal constant FORBIDDEN = 4;\n    uint256 internal constant JP = 8;\n    string internal constant TOKEN_PAUSED = \"Token paused\";\n    string internal constant NOT_ENOUGH_TOKENS = \"Not enough tokens\";\n    string internal constant VALID = \"Valid\";\n    string internal constant TOKENS_LOCKED = \"Tokens locked\";\n    string internal constant ONLY_FULL_TRANSFER = \"Only full transfer\";\n    string internal constant FLOWBACK = \"Flowback\";\n    string internal constant WALLET_NOT_IN_REGISTRY_SERVICE = \"Wallet not in registry service\";\n    string internal constant AMOUNT_OF_TOKENS_UNDER_MIN = \"Amount of tokens under min\";\n    string internal constant AMOUNT_OF_TOKENS_ABOVE_MAX = \"Amount of tokens above max\";\n    string internal constant HOLD_UP = \"Under lock-up\";\n    string internal constant DESTINATION_RESTRICTED = \"Destination restricted\";\n    string internal constant MAX_INVESTORS_IN_CATEGORY = \"Max investors in category\";\n    string internal constant ONLY_ACCREDITED = \"Only accredited\";\n    string internal constant ONLY_US_ACCREDITED = \"Only us accredited\";\n    string internal constant NOT_ENOUGH_INVESTORS = \"Not enough investors\";\n    string internal constant INVESTOR_LIQUIDATE_ONLY = \"Investor liquidate only\";\n\n    struct CompletePreTransferCheckArgs {\n        address from;\n        address to;\n        uint256 value;\n        uint256 fromInvestorBalance;\n        uint256 fromRegion;\n        bool isPlatformWalletTo;\n    }\n\n    /**\n     * @notice Determines if a wallet belongs to a retail investor for EU classification purposes.\n     * @dev WARNING: This function should ONLY be used for EU investors.\n     *      For EU investors, retail classification is based solely on the \"Qualified\" attribute.\n     *      For US investors, the correct definition of non-retail would require checking both\n     *      !isQualifiedInvestor() AND !isAccreditedInvestor(), as both Qualified Purchasers\n     *      and Accredited Investors are considered non-retail in US securities law.\n     *\n     *      Current usage: This function is correctly used only within EU region checks\n     *      (toRegion == EU) throughout the codebase. Do not use this function for US investors\n     *      or other jurisdictions without proper modification.\n     *\n     * @param _services Array of service addresses\n     * @param _wallet Address of the wallet to check\n     * @return bool True if the wallet is a retail investor (not qualified), false otherwise\n     */\n    function isRetail(address[] memory _services, address _wallet) internal view returns (bool) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n\n        return !registry.isQualifiedInvestor(_wallet);\n    }\n\n    function isAccredited(address[] memory _services, address _wallet) internal view returns (bool) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n\n        return registry.isAccreditedInvestor(_wallet);\n    }\n\n    function balanceOfInvestor(address[] memory _services, address _wallet) internal view returns (uint256) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n        IDSToken token = IDSToken(_services[DS_TOKEN]);\n\n        return token.balanceOfInvestor(registry.getInvestor(_wallet));\n    }\n\n    function isNewInvestor(uint256 _balanceOfInvestorTo) internal pure returns (bool) {\n        // Return whether this investor has 0 balance\n        return _balanceOfInvestorTo == 0;\n    }\n\n    function getCountry(address[] memory _services, address _wallet) internal view returns (string memory) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n\n        return registry.getCountry(registry.getInvestor(_wallet));\n    }\n\n    function getCountryCompliance(address[] memory _services, address _wallet) internal view returns (uint256) {\n        return IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getCountryCompliance(getCountry(_services, _wallet));\n    }\n\n    function getUSInvestorsLimit(address[] memory _services) internal view returns (uint256) {\n        ComplianceServiceRegulated complianceService = ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]);\n        IDSComplianceConfigurationService compConfService = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]);\n\n        if (compConfService.getMaxUSInvestorsPercentage() == 0) {\n            return compConfService.getUSInvestorsLimit();\n        }\n\n        if (compConfService.getUSInvestorsLimit() == 0) {\n            return compConfService.getMaxUSInvestorsPercentage() * (complianceService.getTotalInvestorsCount()) / 100;\n        }\n\n        return Math.min(compConfService.getUSInvestorsLimit(), compConfService.getMaxUSInvestorsPercentage() * (complianceService.getTotalInvestorsCount()) / 100);\n    }\n\n    function checkHoldUp(\n        address[] memory _services,\n        address _from,\n        uint256 _value,\n        bool _isUSLockPeriod,\n        bool _isPlatformWalletFrom\n    ) internal view returns (bool) {\n        if (!_isPlatformWalletFrom) {\n            ComplianceServiceRegulated complianceService = ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]);\n            uint256 lockPeriod;\n            if (_isUSLockPeriod) {\n                lockPeriod = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getUSLockPeriod();\n            } else {\n                lockPeriod = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getNonUSLockPeriod();\n            }\n\n            return\n                complianceService.getComplianceTransferableTokens(_from, block.timestamp, uint64(lockPeriod)) < _value;\n        }\n        return false;\n    }\n\n    function maxInvestorsInCategoryForNonAccredited(\n        address[] memory _services,\n        address _from,\n        uint256 _value,\n        uint256 fromInvestorBalance,\n        uint256 toInvestorBalance\n    ) internal view returns (bool) {\n        uint256 nonAccreditedInvestorLimit = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getNonAccreditedInvestorsLimit();\n        return\n        nonAccreditedInvestorLimit != 0 &&\n        ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getTotalInvestorsCount() -\n            ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getAccreditedInvestorsCount()\n        >=\n        nonAccreditedInvestorLimit &&\n        isNewInvestor(toInvestorBalance) &&\n        (isAccredited(_services, _from) || fromInvestorBalance > _value);\n    }\n\n    function newPreTransferCheck(\n        address[] calldata _services,\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _paused\n    ) public view returns (uint256 code, string memory reason) {\n        return doPreTransferCheckRegulated\n        (_services, _from, _to, _value, _balanceFrom, _paused);\n    }\n\n    function preTransferCheck(\n        address[] calldata _services,\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view returns (uint256 code, string memory reason) {\n        return doPreTransferCheckRegulated(_services, _from, _to, _value, IDSToken(_services[DS_TOKEN]).balanceOf(_from), IDSToken(_services[DS_TOKEN]).isPaused());\n    }\n\n    function doPreTransferCheckRegulated(\n        address[] calldata _services,\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _paused\n    ) internal view returns (uint256 code, string memory reason) {\n\n        if (_balanceFrom < _value) {\n            return (15, NOT_ENOUGH_TOKENS);\n        }\n\n        uint256 fromInvestorBalance = balanceOfInvestor(_services, _from); // tokens\n        uint256 fromRegion = getCountryCompliance(_services, _from);\n        bool isPlatformWalletTo = IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_to);\n        if (isPlatformWalletTo) {\n            if (\n                ((IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceFullTransfer()\n                && (fromRegion == US)) ||\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getWorldWideForceFullTransfer()) &&\n                fromInvestorBalance > _value\n            ) {\n                return (50, ONLY_FULL_TRANSFER);\n            }\n            return (0, VALID);\n        }\n\n        if (_paused ) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        CompletePreTransferCheckArgs memory args = CompletePreTransferCheckArgs(_from, _to, _value, fromInvestorBalance, fromRegion, isPlatformWalletTo);\n        return completeTransferCheck(_services, args);\n    }\n\n    function completeTransferCheck(\n        address[] calldata _services,\n        CompletePreTransferCheckArgs memory _args\n    ) internal view returns (uint256 code, string memory reason) {\n        (string memory investorFrom, string memory investorTo) = IDSRegistryService(_services[REGISTRY_SERVICE]).getInvestors(_args.from, _args.to);\n        if (\n            !CommonUtils.isEmptyString(investorFrom) && CommonUtils.isEqualString(investorFrom, investorTo)\n        ) {\n            return (0, VALID);\n        }\n\n        if (IDSLockManager(_services[LOCK_MANAGER]).isInvestorLiquidateOnly(investorTo)) {\n            return (90, INVESTOR_LIQUIDATE_ONLY);\n        }\n\n        if (!ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).checkWhitelisted(_args.to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        uint256 toRegion = getCountryCompliance(_services, _args.to);\n        if (toRegion == FORBIDDEN) {\n            return (26, DESTINATION_RESTRICTED);\n        }\n\n        bool isPlatformWalletFrom = IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_args.from);\n        if (\n            !isPlatformWalletFrom &&\n        IDSLockManager(_services[LOCK_MANAGER]).getTransferableTokens(_args.from, block.timestamp) < _args.value\n        ) {\n            return (16, TOKENS_LOCKED);\n        }\n\n        if (_args.fromRegion == US) {\n            if (checkHoldUp(_services, _args.from, _args.value, true, isPlatformWalletFrom)) {\n                return (32, HOLD_UP);\n            }\n\n            if (\n                _args.fromInvestorBalance > _args.value &&\n                _args.fromInvestorBalance - _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinUSTokens()\n            ) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceFullTransfer() &&\n                _args.fromInvestorBalance > _args.value\n            ) {\n                return (50, ONLY_FULL_TRANSFER);\n            }\n        } else {\n            if (checkHoldUp(_services, _args.from, _args.value, false, isPlatformWalletFrom)) {\n                return (33, HOLD_UP);\n            }\n\n            if (\n                toRegion == US &&\n                !isPlatformWalletFrom &&\n                isBlockFlowbackEndTimeOk(IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getBlockFlowbackEndTime())\n            ) {\n                return (25, FLOWBACK);\n            }\n\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getWorldWideForceFullTransfer() &&\n                _args.fromInvestorBalance > _args.value\n            ) {\n                return (50, ONLY_FULL_TRANSFER);\n            }\n        }\n\n        uint256 toInvestorBalance = balanceOfInvestor(_services, _args.to);\n        string memory toCountry = getCountry(_services, _args.to);\n\n        if (_args.fromRegion == EU) {\n            if (_args.fromInvestorBalance - _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinEUTokens() &&\n                _args.fromInvestorBalance > _args.value) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n        }\n\n        bool isAccreditedTo = isAccredited(_services, _args.to);\n        if (\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceAccredited() && !isAccreditedTo\n        ) {\n            return (61, ONLY_ACCREDITED);\n        }\n\n        if (toRegion == JP) {\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getJPInvestorsLimit() != 0 &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getJPInvestorsCount() >=\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getJPInvestorsLimit() &&\n                isNewInvestor(toInvestorBalance) &&\n                (!CommonUtils.isEqualString(getCountry(_services, _args.from), toCountry) || (_args.fromInvestorBalance > _args.value))\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n        } else if (toRegion == EU) {\n            if (\n                isRetail(_services, _args.to) &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getEURetailInvestorsCount(toCountry) >=\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getEURetailInvestorsLimit() &&\n                isNewInvestor(toInvestorBalance) &&\n                (!CommonUtils.isEqualString(getCountry(_services, _args.from), toCountry) ||\n                (_args.fromInvestorBalance > _args.value && isRetail(_services, _args.from)))\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (\n                toInvestorBalance + _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinEUTokens()\n            ) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n        } else if (toRegion == US) {\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceAccreditedUS() &&\n                !isAccreditedTo\n            ) {\n                return (62, ONLY_US_ACCREDITED);\n            }\n\n            uint256 usInvestorsLimit = getUSInvestorsLimit(_services);\n            if (\n                usInvestorsLimit != 0 &&\n                (_args.fromRegion != US || _args.fromInvestorBalance > _args.value) &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getUSInvestorsCount() >= usInvestorsLimit &&\n                isNewInvestor(toInvestorBalance)\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getUSAccreditedInvestorsLimit() != 0 &&\n                isAccreditedTo &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getUSAccreditedInvestorsCount() >=\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getUSAccreditedInvestorsLimit() &&\n                isNewInvestor(toInvestorBalance) &&\n                (_args.fromRegion != US || !isAccredited(_services, _args.from) || _args.fromInvestorBalance > _args.value)\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (\n                toInvestorBalance + _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinUSTokens()\n            ) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n        }\n\n        if (!isAccreditedTo) {\n            if (maxInvestorsInCategoryForNonAccredited(_services, _args.from, _args.value, _args.fromInvestorBalance, toInvestorBalance)) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n        }\n\n        if (\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getTotalInvestorsLimit() != 0 &&\n            _args.fromInvestorBalance > _args.value &&\n            ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getTotalInvestorsCount() >=\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getTotalInvestorsLimit() &&\n            isNewInvestor(toInvestorBalance)\n        ) {\n            return (40, MAX_INVESTORS_IN_CATEGORY);\n        }\n\n        if (\n            _args.fromInvestorBalance == _args.value &&\n            !isNewInvestor(toInvestorBalance) &&\n            ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getTotalInvestorsCount() <=\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinimumTotalInvestors()\n        ) {\n            return (71, NOT_ENOUGH_INVESTORS);\n        }\n\n        if (\n            !isPlatformWalletFrom &&\n        _args.fromInvestorBalance - _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinimumHoldingsPerInvestor() &&\n        _args.fromInvestorBalance > _args.value\n        ) {\n            return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n        }\n\n        if (\n            !_args.isPlatformWalletTo &&\n        toInvestorBalance + _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinimumHoldingsPerInvestor()\n        ) {\n            return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n        }\n\n        if (\n            !_args.isPlatformWalletTo &&\n            isMaximumHoldingsPerInvestorOk(\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMaximumHoldingsPerInvestor(),\n                toInvestorBalance, _args.value)\n        ) {\n            return (52, AMOUNT_OF_TOKENS_ABOVE_MAX);\n        }\n\n        return (0, VALID);\n    }\n\n\n    function preIssuanceCheck(\n        address[] calldata _services,\n        address _to,\n        uint256 _value\n    ) public view returns (uint256 code, string memory reason) {\n        ComplianceServiceRegulated complianceService = ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]);\n\n        if (!complianceService.checkWhitelisted(_to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        IDSComplianceConfigurationService complianceConfigurationService = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]);\n        string memory toCountry = IDSRegistryService(_services[REGISTRY_SERVICE]).getCountry(IDSRegistryService(_services[REGISTRY_SERVICE]).getInvestor(_to));\n        uint256 toRegion = complianceConfigurationService.getCountryCompliance(toCountry);\n\n        if (toRegion == FORBIDDEN) {\n            return (26, DESTINATION_RESTRICTED);\n        }\n\n        if (IDSLockManager(_services[LOCK_MANAGER]).isInvestorLiquidateOnly(IDSRegistryService(_services[REGISTRY_SERVICE]).getInvestor(_to))) {\n            return (90, INVESTOR_LIQUIDATE_ONLY);\n        }\n\n        uint256 balanceOfInvestorTo = balanceOfInvestor(_services, _to);\n        bool isAccreditedTo = isAccredited(_services, _to);\n\n        if (\n            complianceConfigurationService.getForceAccredited() &&\n            !isAccreditedTo\n        ) {\n            return (61, ONLY_ACCREDITED);\n        }\n\n        if (isNewInvestor(balanceOfInvestorTo)) {\n            // verify global non accredited limit\n            if (!isAccreditedTo) {\n                if (\n                    complianceConfigurationService.getNonAccreditedInvestorsLimit() != 0 &&\n                    complianceService.getTotalInvestorsCount() - complianceService.getAccreditedInvestorsCount() >=\n                    complianceConfigurationService.getNonAccreditedInvestorsLimit()\n                ) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            }\n            // verify global investors limit\n            if (\n                complianceConfigurationService.getTotalInvestorsLimit() != 0 &&\n                complianceService.getTotalInvestorsCount() >= complianceConfigurationService.getTotalInvestorsLimit()\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (toRegion == US) {\n                // verify US investors limit is not exceeded\n                if (complianceConfigurationService.getUSInvestorsLimit() != 0 && complianceService.getUSInvestorsCount() >= complianceConfigurationService.getUSInvestorsLimit()) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n                // verify accredited US limit is not exceeded\n                if (\n                    complianceConfigurationService.getUSAccreditedInvestorsLimit() != 0 &&\n                    isAccreditedTo &&\n                    complianceService.getUSAccreditedInvestorsCount() >= complianceConfigurationService.getUSAccreditedInvestorsLimit()\n                ) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            } else if (toRegion == EU) {\n                if (\n                    isRetail(_services, _to) &&\n                    complianceService.getEURetailInvestorsCount(getCountry(_services, _to)) >= complianceConfigurationService.getEURetailInvestorsLimit()\n                ) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            } else if (toRegion == JP) {\n                if (complianceConfigurationService.getJPInvestorsLimit() != 0 && complianceService.getJPInvestorsCount() >= complianceConfigurationService.getJPInvestorsLimit()) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            }\n        }\n\n        if (toRegion == US) {\n            if (\n                complianceConfigurationService.getForceAccreditedUS() &&\n                !isAccreditedTo\n            ) {\n                return (62, ONLY_US_ACCREDITED);\n            }\n        }\n\n        uint256 minimumHoldingsRequirement = complianceConfigurationService.getMinimumHoldingsPerInvestor();\n        if (toRegion == US) {\n            minimumHoldingsRequirement = complianceConfigurationService.getMinUSTokens();\n        }\n\n        if (\n            !IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_to) &&\n        balanceOfInvestorTo + _value < minimumHoldingsRequirement\n        ) {\n            return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n        }\n        // remains in tokens because maximun holdings per investor is set in tokens\n        if (\n            !IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_to) &&\n            isMaximumHoldingsPerInvestorOk(\n                complianceConfigurationService.getMaximumHoldingsPerInvestor(),\n                balanceOfInvestorTo,\n                _value)\n        ) {\n            return (52, AMOUNT_OF_TOKENS_ABOVE_MAX);\n        }\n\n        return (0, VALID);\n    }\n\n    function isMaximumHoldingsPerInvestorOk(uint256 _maximumHoldingsPerInvestor, uint256 _balanceOfInvestorTo, uint256 _value) internal pure returns (bool) {\n        return _maximumHoldingsPerInvestor != 0 && _balanceOfInvestorTo + _value >= _maximumHoldingsPerInvestor;\n    }\n\n    function isBlockFlowbackEndTimeOk(uint256 _blockFlowBackEndTime) private view returns (bool){\n        return  (_blockFlowBackEndTime == 0 || _blockFlowBackEndTime > block.timestamp);\n    }\n}\n\n/**\n *   @title Concrete compliance service for tokens with regulation\n *\n */\n\ncontract ComplianceServiceRegulated is ComplianceServiceWhitelisted {\n\n    function initialize() public virtual override onlyProxy initializer {\n        _initialize();\n    }\n\n    function compareInvestorBalance(\n        string memory _investor,\n        uint256 _value,\n        uint256 _compareTo\n    ) internal view returns (bool) {\n        return (_value != 0 && getToken().balanceOfInvestor(_investor) == _compareTo);\n    }\n\n    function recordTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal override returns (bool) {\n        string memory investorFrom = getRegistryService().getInvestor(_from);\n        string memory investorTo = getRegistryService().getInvestor(_to);\n\n        if (compareInvestorBalance(investorTo, _value, 0)) {\n            adjustTotalInvestorsCounts(_to, CommonUtils.IncDec.Increase);\n        }\n\n        if(!CommonUtils.isEqualString(investorFrom, investorTo)) {\n            if (compareInvestorBalance(investorFrom, _value, _value)) {\n                adjustTotalInvestorsCounts(_from, CommonUtils.IncDec.Decrease);\n            }\n        }\n\n        cleanupInvestorIssuances(investorFrom);\n        cleanupInvestorIssuances(investorTo);\n        return true;\n    }\n\n    function recordIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime\n    ) internal override returns (bool) {\n        string memory investorTo = getRegistryService().getInvestor(_to);\n        if (compareInvestorBalance(investorTo, _value, 0)) {\n            adjustTotalInvestorsCounts(_to, CommonUtils.IncDec.Increase);\n        }\n        uint256 shares = getRebasingProvider().convertTokensToShares(_value);\n\n        cleanupInvestorIssuances(investorTo);\n        return createIssuanceInformation(investorTo, shares, _issuanceTime);\n    }\n\n    function recordBurn(address _who, uint256 _value) internal override returns (bool) {\n        string memory investor = getRegistryService().getInvestor(_who);\n        if (compareInvestorBalance(investor, _value, _value)) {\n            adjustTotalInvestorsCounts(_who, CommonUtils.IncDec.Decrease);\n        }\n        return true;\n    }\n\n    function recordSeize(\n        address _from,\n        address, /*_to*/\n        uint256 _value\n    ) internal override returns (bool) {\n        return recordBurn(_from, _value);\n    }\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory _id,\n        string memory _country,\n        string memory _prevCountry\n    ) public override onlyRegistry returns (bool) {\n        if (getToken().balanceOfInvestor(_id) == 0) {\n            return false;\n        }\n\n        if (bytes(_prevCountry).length > 0) {\n            adjustInvestorsCountsByCountry(_prevCountry, _id, CommonUtils.IncDec.Decrease);\n        }\n\n        adjustInvestorsCountsByCountry(_country, _id, CommonUtils.IncDec.Increase);\n\n        return true;\n    }\n\n    function adjustTotalInvestorsCounts(address _wallet, CommonUtils.IncDec _increase) internal {\n        if (!getWalletManager().isSpecialWallet(_wallet)) {\n            if (_increase == CommonUtils.IncDec.Increase) {\n                totalInvestors++;\n            }\n            else {\n                totalInvestors--;\n            }\n\n            string memory id = getRegistryService().getInvestor(_wallet);\n            string memory country = getRegistryService().getCountry(id);\n\n            adjustInvestorsCountsByCountry(country, id, _increase);\n        }\n    }\n\n    function adjustInvestorsCountsByCountry(\n        string memory _country,\n        string memory _id,\n        CommonUtils.IncDec _increase\n    ) internal {\n        uint256 countryCompliance = getComplianceConfigurationService().getCountryCompliance(_country);\n\n        if (getRegistryService().isAccreditedInvestor(_id)) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                accreditedInvestorsCount++;\n            }\n            else {\n                accreditedInvestorsCount--;\n            }\n\n            if (countryCompliance == US) {\n                if(_increase == CommonUtils.IncDec.Increase) {\n                    usAccreditedInvestorsCount++;\n                }\n                else {\n                    usAccreditedInvestorsCount--;\n                }\n            }\n        }\n\n        if (countryCompliance == US) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                usInvestorsCount++;\n            }\n            else {\n                usInvestorsCount--;\n            }\n        } else if (countryCompliance == EU && !getRegistryService().isQualifiedInvestor(_id)) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                euRetailInvestorsCount[_country]++;\n            }\n            else {\n                euRetailInvestorsCount[_country]--;\n            }\n        } else if (countryCompliance == JP) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                jpInvestorsCount++;\n            }\n            else {\n                jpInvestorsCount--;\n            }\n        }\n    }\n\n    function createIssuanceInformation(\n        string memory _investor,\n        uint256 _shares,\n        uint256 _issuanceTime\n    ) internal returns (bool) {\n        uint256 issuancesCount = issuancesCounters[_investor];\n\n        issuancesValues[_investor][issuancesCount] = _shares;\n        issuancesTimestamps[_investor][issuancesCount] = _issuanceTime;\n        issuancesCounters[_investor] = issuancesCount + 1;\n\n        return true;\n    }\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.preTransferCheck(getServices(), _from, _to, _value);\n    }\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.newPreTransferCheck(getServices(), _from, _to, _value, _balanceFrom, _pausedToken);\n    }\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value)\n    public view override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.preTransferCheck(getServices(), _from, _to, _value);\n    }\n\n    /**\n     * @notice Calculates the number of transferable tokens for a given investor at a specific time,\n     *         taking into account issuance-level lockups (Investor Level Locks).\n     *\n     * @dev The calculation is performed as follows:\n     *      1. Retrieve the base transferable balance of the investor from the LockManager.\n     *      2. Determine the total amount of tokens from issuances that are still subject to a lockup period.\n     *      3. Subtract the locked tokens from the base transferable balance.\n     *\n     * @param _who Address of the investor being queried.\n     * @param _time Timestamp (in seconds) representing the evaluation moment. Must be greater than zero.\n     * @param _lockTime Duration of the lockup period in seconds.\n     *\n     * @return transferable The amount of transferable tokens\n     */\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        uint64 _lockTime\n    ) public view override returns (uint256) {\n        require(_time != 0, \"Time must be greater than zero\");\n        string memory investor = getRegistryService().getInvestor(_who);\n\n        uint256 balanceOfInvestor = getLockManager().getTransferableTokensForInvestor(investor, _time);\n\n        uint256 investorIssuancesCount = issuancesCounters[investor];\n\n        //No locks, go to base class implementation\n        if (investorIssuancesCount == 0) {\n            return balanceOfInvestor;\n        }\n\n        uint256 totalLockedTokens = 0;\n\n        for (uint256 i = 0; i < investorIssuancesCount; i++) {\n            uint256 issuanceTimestamp = issuancesTimestamps[investor][i];\n\n            if (uint256(_lockTime) > _time || issuanceTimestamp > (_time - uint256(_lockTime))) {\n                uint256 tokens = getRebasingProvider().convertSharesToTokens(issuancesValues[investor][i]);\n                totalLockedTokens = totalLockedTokens + tokens;\n            }\n        }\n\n        //there may be more locked tokens than actual tokens, so the minimum between the two\n        uint256 transferable = balanceOfInvestor - Math.min(totalLockedTokens, balanceOfInvestor);\n\n        return transferable;\n    }\n\n    function preIssuanceCheck(address _to, uint256 _value) public view override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.preIssuanceCheck(getServices(), _to, _value);\n    }\n\n    function getTotalInvestorsCount() public view returns (uint256) {\n        return totalInvestors;\n    }\n\n    function getUSInvestorsCount() public view returns (uint256) {\n        return usInvestorsCount;\n    }\n\n    function getUSAccreditedInvestorsCount() public view returns (uint256) {\n        return usAccreditedInvestorsCount;\n    }\n\n    function getAccreditedInvestorsCount() public view returns (uint256) {\n        return accreditedInvestorsCount;\n    }\n\n    function getEURetailInvestorsCount(string calldata _country) public view returns (uint256) {\n        return euRetailInvestorsCount[_country];\n    }\n\n    function getJPInvestorsCount() public view returns (uint256) {\n        return jpInvestorsCount;\n    }\n\n    function setTotalInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        totalInvestors = _value;\n\n        return true;\n    }\n\n    function setUSInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        usInvestorsCount = _value;\n\n        return true;\n    }\n\n    function setUSAccreditedInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        usAccreditedInvestorsCount = _value;\n\n        return true;\n    }\n\n    function setAccreditedInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        accreditedInvestorsCount = _value;\n\n        return true;\n    }\n\n    function setEURetailInvestorsCount(string calldata _country, uint256 _value) public onlyMaster returns (bool) {\n        euRetailInvestorsCount[_country] = _value;\n\n        return true;\n    }\n\n    function setJPInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        jpInvestorsCount = _value;\n\n        return true;\n    }\n\n    function cleanupInvestorIssuances(string memory investor) internal {\n        string memory country = getRegistryService().getCountry(investor);\n\n        uint256 region = getComplianceConfigurationService().getCountryCompliance(country);\n\n        uint256 lockTime;\n        if (region == ComplianceServiceLibrary.US) {\n            lockTime = getComplianceConfigurationService().getUSLockPeriod();\n        } else {\n            lockTime = getComplianceConfigurationService().getNonUSLockPeriod();\n        }\n\n        uint256 time = block.timestamp;\n\n        uint256 currentIssuancesCount = issuancesCounters[investor];\n        uint256 currentIndex = 0;\n\n        if (currentIssuancesCount == 0) {\n            return;\n        }\n\n        while (currentIndex < currentIssuancesCount) {\n            uint256 issuanceTimestamp = issuancesTimestamps[investor][currentIndex];\n\n            bool isNoLongerLocked = issuanceTimestamp <= (time - lockTime);\n\n            if (isNoLongerLocked) {\n                if (currentIndex != currentIssuancesCount - 1) {\n                    issuancesTimestamps[investor][currentIndex] = issuancesTimestamps[investor][currentIssuancesCount - 1];\n                    issuancesValues[investor][currentIndex] = issuancesValues[investor][currentIssuancesCount - 1];\n                }\n\n                delete issuancesTimestamps[investor][currentIssuancesCount - 1];\n                delete issuancesValues[investor][currentIssuancesCount - 1];\n\n                currentIssuancesCount--;\n            } else {\n                currentIndex++;\n            }\n        }\n\n        issuancesCounters[investor] = currentIssuancesCount;\n    }\n\n    function getServices() internal view returns (address[] memory services) {\n        services = new address[](6);\n        services[0] = getDSService(DS_TOKEN);\n        services[1] = getDSService(REGISTRY_SERVICE);\n        services[2] = getDSService(WALLET_MANAGER);\n        services[3] = getDSService(COMPLIANCE_CONFIGURATION_SERVICE);\n        services[4] = getDSService(LOCK_MANAGER);\n        services[5] = address(this);\n    }\n}\n"},"contracts/compliance/ComplianceServiceWhitelisted.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ComplianceService} from \"./ComplianceService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n/**\n*   @title Concrete compliance service for tokens with whitelisted wallets.\n*\n*   This simple compliance service is meant to be used for tokens that only need to be validated against an investor registry.\n*/\n\ncontract ComplianceServiceWhitelisted is ComplianceService {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public virtual override onlyProxy initializer {\n        _initialize();\n    }\n\n    function _initialize() internal onlyInitializing {\n        ComplianceService.initialize();\n    }\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return doPreTransferCheckWhitelisted(_from, _to, _value, _balanceFrom, _pausedToken);\n    }\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return doPreTransferCheckWhitelisted(_from, _to, _value, getToken().balanceOf(_from), getToken().isPaused());\n    }\n\n    function checkWhitelisted(address _who) public view returns (bool) {\n        return getWalletManager().isPlatformWallet(_who) || !CommonUtils.isEmptyString(getRegistryService().getInvestor(_who));\n    }\n\n    function recordIssuance(address, uint256, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function recordTransfer(address, address, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function checkTransfer(address, address _to, uint256) internal view override returns (uint256, string memory) {\n        if (!checkWhitelisted(_to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        return (0, VALID);\n    }\n\n    function preIssuanceCheck(address _to, uint256) public view virtual override returns (uint256, string memory) {\n        if (!checkWhitelisted(_to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        return (0, VALID);\n    }\n\n    function recordBurn(address, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function recordSeize(address, address, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function doPreTransferCheckWhitelisted(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) internal view returns (uint256 code, string memory reason) {\n        if (_pausedToken) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        if (_balanceFrom < _value) {\n            return (15, NOT_ENOUGH_TOKENS);\n        }\n\n        if (!getWalletManager().isPlatformWallet(_from) && getLockManager().getTransferableTokens(_from, block.timestamp) < _value) {\n            return (16, TOKENS_LOCKED);\n        }\n\n        return checkTransfer(_from, _to, _value);\n    }\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        uint64 /*_lockTime*/\n    ) public view virtual override returns (uint256) {\n        require(_time > 0, \"Time must be greater than zero\");\n        return getLockManager().getTransferableTokens(_who, _time);\n    }\n}\n"},"contracts/compliance/IDSComplianceConfigurationService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSComplianceConfigurationService {\n\n    function initialize() public virtual;\n\n    event DSComplianceUIntRuleSet(string ruleName, uint256 prevValue, uint256 newValue);\n    event DSComplianceBoolRuleSet(string ruleName, bool prevValue, bool newValue);\n    event DSComplianceStringToUIntMapRuleSet(string ruleName, string keyValue, uint256 prevValue, uint256 newValue);\n\n    function getCountryCompliance(string calldata _country) public view virtual returns (uint256);\n\n    function setCountriesCompliance(string[] calldata _countries, uint256[] calldata _values) public virtual;\n\n    function setCountryCompliance(\n        string calldata _country,\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getTotalInvestorsLimit() public view virtual returns (uint256);\n\n    function setTotalInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinUSTokens() public view virtual returns (uint256);\n\n    function setMinUSTokens(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinEUTokens() public view virtual returns (uint256);\n\n    function setMinEUTokens(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSInvestorsLimit() public view virtual returns (uint256);\n\n    function setUSInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getJPInvestorsLimit() public view virtual returns (uint256);\n\n    function setJPInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSAccreditedInvestorsLimit() public view virtual returns (uint256);\n\n    function setUSAccreditedInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getNonAccreditedInvestorsLimit() public view virtual returns (uint256);\n\n    function setNonAccreditedInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMaxUSInvestorsPercentage() public view virtual returns (uint256);\n\n    function setMaxUSInvestorsPercentage(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getBlockFlowbackEndTime() public view virtual returns (uint256);\n\n    function setBlockFlowbackEndTime(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getNonUSLockPeriod() public view virtual returns (uint256);\n\n    function setNonUSLockPeriod(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinimumTotalInvestors() public view virtual returns (uint256);\n\n    function setMinimumTotalInvestors(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinimumHoldingsPerInvestor() public view virtual returns (uint256);\n\n    function setMinimumHoldingsPerInvestor(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMaximumHoldingsPerInvestor() public view virtual returns (uint256);\n\n    function setMaximumHoldingsPerInvestor(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getEURetailInvestorsLimit() public view virtual returns (uint256);\n\n    function setEURetailInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSLockPeriod() public view virtual returns (uint256);\n\n    function setUSLockPeriod(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceFullTransfer() public view virtual returns (bool);\n\n    function setForceFullTransfer(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceAccredited() public view virtual returns (bool);\n\n    function setForceAccredited(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function setForceAccreditedUS(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceAccreditedUS() public view virtual returns (bool);\n\n    function setWorldWideForceFullTransfer(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getWorldWideForceFullTransfer() public view virtual returns (bool);\n\n    function getAuthorizedSecurities() public view virtual returns (uint256);\n\n    function setAuthorizedSecurities(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getDisallowBackDating() public view virtual returns (bool);\n\n    function setDisallowBackDating(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function setAll(\n        uint256[] calldata _uint_values,\n        bool[] calldata _bool_values /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getAll() public view virtual returns (uint256[] memory, bool[] memory);\n}\n"},"contracts/compliance/IDSComplianceService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSComplianceService {\n\n    uint256 internal constant NONE = 0;\n    uint256 internal constant US = 1;\n    uint256 internal constant EU = 2;\n    uint256 internal constant FORBIDDEN = 4;\n    uint256 internal constant JP = 8;\n    string internal constant TOKEN_PAUSED = \"Token Paused\";\n    string internal constant NOT_ENOUGH_TOKENS = \"Not Enough Tokens\";\n    string internal constant TOKENS_LOCKED = \"Tokens Locked\";\n    string internal constant WALLET_NOT_IN_REGISTRY_SERVICE = \"Wallet not in registry Service\";\n    string internal constant DESTINATION_RESTRICTED = \"Destination restricted\";\n    string internal constant VALID = \"Valid\";\n    string internal constant HOLD_UP = \"Under lock-up\";\n    string internal constant ONLY_FULL_TRANSFER = \"Only Full Transfer\";\n    string internal constant FLOWBACK = \"Flowback\";\n    string internal constant MAX_INVESTORS_IN_CATEGORY = \"Max Investors in category\";\n    string internal constant AMOUNT_OF_TOKENS_UNDER_MIN = \"Amount of tokens under min\";\n    string internal constant AMOUNT_OF_TOKENS_ABOVE_MAX = \"Amount of tokens above max\";\n    string internal constant ONLY_ACCREDITED = \"Only accredited\";\n    string internal constant ONLY_US_ACCREDITED = \"Only us accredited\";\n    string internal constant NOT_ENOUGH_INVESTORS = \"Not enough investors\";\n    string internal constant MAX_AUTHORIZED_SECURITIES_EXCEEDED = \"Max authorized securities exceeded\";\n\n    function initialize() public virtual;\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory _id,\n        string memory _country,\n        string memory _prevCountry\n    ) public virtual returns (bool);\n\n    //*****************************************\n    // TOKEN ACTION VALIDATIONS\n    //*****************************************\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value, /*onlyToken*/\n        bool _pausedToken,\n        uint256 _balanceFrom\n    ) public virtual returns (bool);\n\n    function validateIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateBurn(\n        address _who,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateSeize(\n        address _from,\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function preIssuanceCheck(address _to, uint256 _value) public view virtual returns (uint256 code, string memory reason);\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function validateIssuanceTime(uint256 _issuanceTime) public view virtual returns (uint256 issuanceTime);\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        uint64 _lockTime\n    ) public view virtual returns (uint256);\n}\n"},"contracts/compliance/IDSLockManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSLockManager {\n\n    function initialize() public virtual;\n\n    modifier validLock(uint256 _valueLocked, uint256 _releaseTime) {\n        require(_valueLocked > 0, \"Value is zero\");\n        require(_releaseTime == 0 || _releaseTime > uint256(block.timestamp), \"Release time is in the past\");\n        _;\n    }\n\n    event Locked(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    event Unlocked(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n\n    event HolderLocked(string holderId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    event HolderUnlocked(string holderId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    /**\n     * @dev creates a lock record for wallet address\n     * @param _to address to lock the tokens at\n     * @param _valueLocked value of tokens to lock\n     * @param _reason reason for lock\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * Note: The user MAY have at a certain time more locked tokens than actual tokens\n     */\n\n    function addManualLockRecord(\n        address _to,\n        uint256 _valueLocked,\n        string calldata _reason,\n        uint256 _releaseTime /*issuerOrAboveOrToken*/\n    ) public virtual;\n\n    /**\n     * @dev creates a lock record for investor Id\n     * @param _investor investor id to lock the tokens at\n     * @param _valueLocked value of tokens to lock\n     * @param _reasonCode reason code for lock\n     * @param _reasonString reason for lock\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * Note: The user MAY have at a certain time more locked tokens than actual tokens\n     */\n\n    function createLockForInvestor(\n        string memory _investor,\n        uint256 _valueLocked,\n        uint256 _reasonCode,\n        string calldata _reasonString,\n        uint256 _releaseTime /*onlyIssuerOrAboveOrToken*/\n    ) public virtual;\n\n    /**\n     * @dev Releases a specific lock record for a wallet\n     * @param _to address to release the tokens for\n     * @param _lockIndex the index of the lock to remove\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecord(\n        address _to,\n        uint256 _lockIndex /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Releases a specific lock record for a investor\n     * @param _investorId investor id to release the tokens for\n     * @param _lockIndex the index of the lock to remove\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecordForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Get number of locks currently associated with an address\n     * @param _who address to get count for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockCount(address _who) public view virtual returns (uint256);\n\n    /**\n     * @dev Get number of locks currently associated with a investor\n     * @param _investorId investor id to get count for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n\n    function lockCountForInvestor(string calldata _investorId) public view virtual returns (uint256);\n\n    /**\n     * @dev Get details of a specific lock associated with an address\n     * can be used to iterate through the locks of a user\n     * @param _who address to get token lock for\n     * @param _lockIndex the 0 based index of the lock.\n     * @return reasonCode the reason code\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfo(address _who, uint256 _lockIndex) public view virtual returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime);\n\n    /**\n     * @dev Get details of a specific lock associated with a investor\n     * can be used to iterate through the locks of a user\n     * @param _investorId investorId to get token lock for\n     * @param _lockIndex the 0 based index of the lock.\n     * @return reasonCode the reason code\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfoForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex\n    ) public view virtual  returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime);\n\n    /**\n     * @dev get total number of transferable tokens for a wallet, at a certain time\n     * @param _who address to get number of transferable tokens for\n     * @param _time time to calculate for\n     */\n    function getTransferableTokens(address _who, uint256 _time) public view virtual returns (uint256);\n\n    /**\n     * @dev get total number of transferable tokens for a investor, at a certain time\n     * @param _investorId investor id\n     * @param _time time to calculate for\n     */\n    function getTransferableTokensForInvestor(string memory _investorId, uint256 _time) public view virtual returns (uint256);\n\n    /**\n     * @dev pause investor\n     * @param _investorId investor id\n     */\n    function lockInvestor(\n        string calldata _investorId /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev unpauses investor\n     * @param _investorId investor id\n     */\n    function unlockInvestor(\n        string calldata _investorId /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Returns true if paused, otherwise false\n     * @param _investorId investor id\n     */\n    function isInvestorLocked(string calldata _investorId) public view virtual returns (bool);\n\n    /**\n     * @dev set investor to liquidate only mode\n     * @param _investorId investor id\n     * @param _enabled true to enable, false to disable\n     */\n    function setInvestorLiquidateOnly(string memory _investorId, bool _enabled) public virtual returns (bool);\n\n    /**\n     * @dev Returns true if the investor is in liquidate only mode\n     * @param _investorId investor id\n     */\n    function isInvestorLiquidateOnly(string calldata _investorId) public view virtual returns (bool);\n}\n"},"contracts/compliance/IDSWalletManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSWalletManager {\n\n    function initialize() public virtual;\n\n    // Special wallets constants\n    uint8 public constant NONE = 0;\n    uint8 public constant ISSUER = 1;\n    uint8 public constant PLATFORM = 2;\n    uint8 public constant EXCHANGE = 4;\n\n    /**\n     * @dev should be emitted when a special wallet is added.\n     */\n    event DSWalletManagerSpecialWalletAdded(address wallet, uint8 walletType, address sender);\n    /**\n     * @dev should be emitted when a special wallet is removed.\n     */\n    event DSWalletManagerSpecialWalletRemoved(address wallet, uint8 walletType, address sender);\n    /**\n     * @dev should be emitted when the number of reserved slots is set for a wallet.\n     */\n    event DSWalletManagerReservedSlotsSet(address wallet, string country, uint8 accreditationStatus, uint256 slots, address sender);\n\n    /**\n     * @dev Sets a wallet to be an special wallet. (internal)\n     * @param _wallet The address of the wallet.\n     * @param _type The type of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setSpecialWallet(address _wallet, uint8 _type) internal virtual returns (bool);\n\n    /**\n     * @dev gets a wallet type\n     * @param _wallet the address of the wallet to check.\n     */\n    function getWalletType(address _wallet) public view virtual returns (uint8);\n\n    /**\n     * @dev Returns true if it is platform wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isPlatformWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Returns true if it is special wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isSpecialWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Returns true if it is issuer special wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isIssuerSpecialWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be an issuer wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addIssuerWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets an array of wallets to be issuer wallets.\n     * @param _wallets The address of the wallets.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addIssuerWallets(address[] calldata _wallets) public virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be a platform wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addPlatformWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets an array of wallets to be platforms wallet.\n     * @param _wallets The address of the wallets.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addPlatformWallets(address[] calldata _wallets) public virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be an exchange wallet.\n     * @param _wallet The address of the wallet.\n     * @param _owner The address of the owner.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addExchangeWallet(address _wallet, address _owner) public virtual returns (bool);\n\n    /**\n     * @dev Removes a special wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function removeSpecialWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n}\n"},"contracts/compliance/InvestorLockManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSLockManager} from \"./IDSLockManager.sol\";\nimport {InvestorLockManagerBase} from \"./InvestorLockManagerBase.sol\";\nimport {InvestorLockManagerDataStore} from \"../data-stores/InvestorLockManagerDataStore.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\n\ncontract InvestorLockManager is InvestorLockManagerBase {\n    uint256 constant MAX_LOCKS_PER_INVESTOR = 30;\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function setLockInfoImpl(string memory _investor, uint256 _lockIndex, uint256 _valueLocked, uint256 _reasonCode, string memory _reasonString, uint256 _releaseTime) internal {\n        investorsLocks[_investor][_lockIndex] = Lock(_valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function createLockForInvestor(string memory _investor, uint256 _valueLocked, uint256 _reasonCode, string calldata _reasonString, uint256 _releaseTime)\n        public\n        override\n        validLock(_valueLocked, _releaseTime)\n        onlyTransferAgentOrAboveOrToken\n    {\n        //Get total count\n        uint256 totalLockCount = investorsLocksCounts[_investor];\n        //Only allow MAX_LOCKS_PER_INVESTOR locks per address, to prevent out-of-gas at transfer scenarios\n        require(totalLockCount < MAX_LOCKS_PER_INVESTOR, \"Too many locks for this investor\");\n        setLockInfoImpl(_investor, totalLockCount, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n        totalLockCount += 1;\n        investorsLocksCounts[_investor] = totalLockCount;\n        emit HolderLocked(_investor, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function createLock(address _to, uint256 _valueLocked, uint256 _reasonCode, string calldata _reasonString, uint256 _releaseTime) internal {\n        createLockForInvestor(getRegistryService().getInvestor(_to), _valueLocked, _reasonCode, _reasonString, _releaseTime);\n        emit Locked(_to, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function addManualLockRecord(address _to, uint256 _valueLocked, string calldata _reason, uint256 _releaseTime) public override onlyTransferAgentOrAboveOrToken {\n        require(_to != address(0), \"Invalid address\");\n        createLock(_to, _valueLocked, 0, _reason, _releaseTime);\n    }\n\n    function removeLockRecordForInvestor(string memory _investorId, uint256 _lockIndex) public override onlyTransferAgentOrAbove returns (bool) {\n        emit HolderUnlocked(\n            _investorId,\n            investorsLocks[_investorId][_lockIndex].value,\n            investorsLocks[_investorId][_lockIndex].reason,\n            investorsLocks[_investorId][_lockIndex].reasonString,\n            investorsLocks[_investorId][_lockIndex].releaseTime\n        );\n\n        //Put the last lock instead of the lock to remove (this will work even with 1 lock in the list)\n        uint256 lastLockNumber = investorsLocksCounts[_investorId];\n        require(_lockIndex < lastLockNumber, \"Index is greater than the number of locks\");\n        lastLockNumber -= 1;\n\n        //Move the lock\n        uint256 reasonCode = investorsLocks[_investorId][lastLockNumber].reason;\n        setLockInfoImpl(\n            _investorId,\n            _lockIndex,\n            investorsLocks[_investorId][lastLockNumber].value,\n            reasonCode,\n            investorsLocks[_investorId][lastLockNumber].reasonString,\n            investorsLocks[_investorId][lastLockNumber].releaseTime\n        );\n\n        //delete the last _lock\n        //Remove from reverse index\n        delete investorsLocks[_investorId][lastLockNumber];\n\n        //decrease the lock counter for the user\n        investorsLocksCounts[_investorId] = lastLockNumber;\n\n        return true;\n    }\n\n    /**\n     * @dev Releases a specific lock record\n     * @param _to address to release the tokens for\n     * @param _lockIndex the index of the lock\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecord(address _to, uint256 _lockIndex) public override onlyTransferAgentOrAbove returns (bool) {\n        require(_to != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_to);\n        //Emit must be done on start ,because we're going to overwrite this value\n        emit Unlocked(\n            _to,\n            investorsLocks[investor][_lockIndex].value,\n            investorsLocks[investor][_lockIndex].reason,\n            investorsLocks[investor][_lockIndex].reasonString,\n            investorsLocks[investor][_lockIndex].releaseTime\n        );\n        removeLockRecordForInvestor(investor, _lockIndex);\n\n        return true;\n    }\n\n    /**\n     * @dev Get number of locks currently associated with an address\n     * @param _who address to get token lock for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockCount(address _who) public view override returns (uint256) {\n        require(_who != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_who);\n        return investorsLocksCounts[investor];\n    }\n\n    function lockCountForInvestor(string calldata _investorId) public view override returns (uint256) {\n        return investorsLocksCounts[_investorId];\n    }\n\n    /**\n     * @dev Get details of a specific lock associated with an address\n     * can be used to iterate through the locks of a user\n     * @return reasonCode the reason code for the lock\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfo(address _who, uint256 _lockIndex) public view override returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime) {\n        require(_who != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_who);\n        return lockInfoForInvestor(investor, _lockIndex);\n    }\n\n    function lockInfoForInvestor(string memory _investorId, uint256 _lockIndex)\n        public\n        view\n        override\n        returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime)\n    {\n        uint256 lastLockNumber = investorsLocksCounts[_investorId];\n        require(_lockIndex < lastLockNumber, \"Index is greater than the number of locks\");\n        reasonCode = investorsLocks[_investorId][_lockIndex].reason;\n        reasonString = investorsLocks[_investorId][_lockIndex].reasonString;\n        value = investorsLocks[_investorId][_lockIndex].value;\n        autoReleaseTime = investorsLocks[_investorId][_lockIndex].releaseTime;\n    }\n\n    function getTransferableTokens(address _who, uint256 _time) public view override returns (uint256) {\n        string memory investor = getRegistryService().getInvestor(_who);\n        return getTransferableTokensForInvestor(investor, _time);\n    }\n\n    function getTransferableTokensForInvestor(string memory _investorId, uint256 _time) public view override returns (uint256) {\n        require(_time > 0, \"Time must be greater than zero\");\n        if (investorsLocked[_investorId]) {\n            return 0;\n        }\n\n        uint256 balanceOfInvestor = getToken().balanceOfInvestor(_investorId);\n        uint256 investorLockCount = investorsLocksCounts[_investorId];\n\n        //No locks, go to base class implementation\n        if (investorLockCount == 0) {\n            return balanceOfInvestor;\n        }\n\n        uint256 totalLockedTokens = 0;\n        for (uint256 i = 0; i < investorLockCount; i++) {\n            uint256 autoReleaseTime = investorsLocks[_investorId][i].releaseTime;\n\n            if (autoReleaseTime == 0 || autoReleaseTime > _time) {\n                totalLockedTokens = totalLockedTokens + investorsLocks[_investorId][i].value;\n            }\n        }\n\n        //there may be more locked tokens than actual tokens, so the minimum between the two\n        uint256 transferable = balanceOfInvestor - Math.min(totalLockedTokens, balanceOfInvestor);\n\n        return transferable;\n    }\n}\n"},"contracts/compliance/InvestorLockManagerBase.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {InvestorLockManagerDataStore} from \"../data-stores/InvestorLockManagerDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {IDSLockManager} from \"./IDSLockManager.sol\";\n\nabstract contract InvestorLockManagerBase is IDSLockManager, InvestorLockManagerDataStore, BaseDSContract {\n    event InvestorFullyLocked(string investorId);\n    event InvestorFullyUnlocked(string investorId);\n    event InvestorLiquidateOnlySet(string investorId, bool enabled);\n\n    function initialize() public virtual override;\n\n    function lockInvestor(string calldata _investorId) public override onlyTransferAgentOrAbove returns (bool) {\n        require(!investorsLocked[_investorId], \"Investor is already locked\");\n        investorsLocked[_investorId] = true;\n        emit InvestorFullyLocked(_investorId);\n        return true;\n    }\n\n    function unlockInvestor(string calldata _investorId) public override onlyTransferAgentOrAbove returns (bool) {\n        require(investorsLocked[_investorId], \"Investor is not locked\");\n        delete investorsLocked[_investorId];\n        emit InvestorFullyUnlocked(_investorId);\n        return true;\n    }\n\n    function isInvestorLocked(string calldata _investorId) public override view returns (bool) {\n        return investorsLocked[_investorId];\n    }\n\n    function setInvestorLiquidateOnly(string memory _investorId, bool _enabled) public override onlyTransferAgentOrAbove returns (bool) {\n        require(investorsLiquidateOnly[_investorId] != _enabled, \"already in this state\");\n        investorsLiquidateOnly[_investorId] = _enabled;\n        emit InvestorLiquidateOnlySet(_investorId, _enabled);\n        return true;\n    }\n\n    function isInvestorLiquidateOnly(string calldata _investorId) public override view returns (bool) {\n        return investorsLiquidateOnly[_investorId];\n    }\n}\n"},"contracts/compliance/WalletManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSWalletManager} from \"./IDSWalletManager.sol\";\nimport {WalletManagerDataStore} from \"../data-stores/WalletManagerDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n/**\n * @title WalletManager\n * @dev A wallet manager which allows marking special wallets in the system.\n * @dev Implements DSTrustServiceInterface and ESServiceConsumer.\n */\n\ncontract WalletManager is IDSWalletManager, WalletManagerDataStore, BaseDSContract {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    /**\n   * @dev Sets a wallet to be an special wallet. (internal)\n   * @param _wallet The address of the wallet.\n   * @param _type The type of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setSpecialWallet(address _wallet, uint8 _type) internal override returns (bool) {\n        require(CommonUtils.isEmptyString(getRegistryService().getInvestor(_wallet)), \"Wallet belongs to investor\");\n\n        uint8 oldType = getWalletType(_wallet);\n        require(oldType == NONE || _type == NONE, \"Direct wallet type change is not allowed\");\n\n        walletsTypes[_wallet] = _type;\n\n        if (oldType == NONE) {\n            emit DSWalletManagerSpecialWalletAdded(_wallet, _type, msg.sender);\n        } else {\n            emit DSWalletManagerSpecialWalletRemoved(_wallet, oldType, msg.sender);\n        }\n\n        return true;\n    }\n\n    /**\n   * @dev Sets a wallet to be an issuer wallet.\n   * @param _wallet The address of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function addIssuerWallet(address _wallet) public override onlyIssuerOrAbove returns (bool) {\n        return setSpecialWallet(_wallet, ISSUER);\n    }\n\n    /**\n    * @dev Sets an array of wallets to be issuer wallets.\n    * @param _wallets The address of the wallet.\n    * @return A boolean that indicates if the operation was successful.\n   */\n    function addIssuerWallets(address[] calldata _wallets) public override onlyIssuerOrAbove returns (bool) {\n        require(_wallets.length <= 30, \"Exceeded the maximum number of wallets\");\n        for (uint8 i = 0; i < _wallets.length; i++) {\n            addIssuerWallet(_wallets[i]);\n        }\n        return true;\n    }\n\n    /**\n   * @dev Sets a wallet to be an platform wallet.\n   * @param _wallet The address of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function addPlatformWallet(address _wallet) public override onlyIssuerOrAbove returns (bool) {\n        return setSpecialWallet(_wallet, PLATFORM);\n    }\n\n    /**\n    * @dev Sets an array of wallets to be platform wallet.\n    * @param _wallets The address of the wallet.\n    * @return A boolean that indicates if the operation was successful.\n   */\n    function addPlatformWallets(address[] calldata _wallets) public override onlyIssuerOrAbove returns (bool) {\n        require(_wallets.length <= 30, \"Exceeded the maximum number of wallets\");\n        for (uint8 i = 0; i < _wallets.length; i++) {\n            addPlatformWallet(_wallets[i]);\n        }\n        return true;\n    }\n\n    /**\n   * @dev Sets a wallet to be an exchange wallet.\n   * @param _wallet The address of the wallet.\n   * @param _owner The address of the owner.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function addExchangeWallet(address _wallet, address _owner) public override onlyIssuerOrAbove returns (bool) {\n        require(getTrustService().getRole(_owner) == EXCHANGE, \"Owner is not an exchange\");\n        return setSpecialWallet(_wallet, EXCHANGE);\n    }\n\n    function isSpecialWallet(address _wallet) external override view returns (bool) {\n        return walletsTypes[_wallet] != NONE;\n    }\n\n    function isIssuerSpecialWallet(address _wallet) external override view returns (bool) {\n        return walletsTypes[_wallet] == ISSUER;\n    }\n\n    function isPlatformWallet(address _wallet) external override view returns (bool) {\n        return walletsTypes[_wallet] == PLATFORM;\n    }\n\n    function getWalletType(address _wallet) public view override returns (uint8) {\n        return walletsTypes[_wallet];\n    }\n\n    /**\n   * @dev Removes a special wallet.\n   * @param _wallet The address of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function removeSpecialWallet(address _wallet) public override onlyIssuerOrAbove returns (bool) {\n        return setSpecialWallet(_wallet, NONE);\n    }\n}\n"},"contracts/data-stores/BaseLockManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract BaseLockManagerDataStore is ServiceConsumerDataStore {\n    struct Lock {\n        uint256 value;\n        uint256 reason;\n        string reasonString;\n        uint256 releaseTime;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},"contracts/data-stores/ComplianceConfigurationDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract ComplianceConfigurationDataStore is ServiceConsumerDataStore {\n    mapping(string country => uint256 compliance) public countriesCompliances;\n    uint256 public totalInvestorsLimit;\n    uint256 public minUSTokens;\n    uint256 public minEUTokens;\n    uint256 public usInvestorsLimit;\n    uint256 public jpInvestorsLimit;\n    uint256 public usAccreditedInvestorsLimit;\n    uint256 public nonAccreditedInvestorsLimit;\n    uint256 public maxUSInvestorsPercentage;\n    uint256 public blockFlowbackEndTime;\n    uint256 public nonUSLockPeriod;\n    uint256 public minimumTotalInvestors;\n    uint256 public minimumHoldingsPerInvestor;\n    uint256 public maximumHoldingsPerInvestor;\n    uint256 public euRetailInvestorsLimit;\n    uint256 public usLockPeriod;\n    bool public forceFullTransfer;\n    bool public forceAccreditedUS;\n    bool public forceAccredited;\n    bool public worldWideForceFullTransfer;\n    uint256 public authorizedSecurities;\n    bool public disallowBackDating;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[31] private __gap;\n}\n"},"contracts/data-stores/ComplianceServiceDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract ComplianceServiceDataStore is ServiceConsumerDataStore {\n    uint256 internal totalInvestors;\n    uint256 internal accreditedInvestorsCount;\n    uint256 internal usAccreditedInvestorsCount;\n    uint256 internal usInvestorsCount;\n    uint256 internal jpInvestorsCount;\n    mapping(string country => uint256 count) internal euRetailInvestorsCount;\n    mapping(string tokenId => uint256 count) internal issuancesCounters;\n    mapping(string tokenId => mapping(uint256 issuanceId => uint256 value)) issuancesValues;\n    mapping(string tokenId => mapping(uint256 issuanceId => uint256 timestamp)) issuancesTimestamps;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[41] private __gap;\n}\n"},"contracts/data-stores/InvestorLockManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {BaseLockManagerDataStore} from \"./BaseLockManagerDataStore.sol\";\n\ncontract InvestorLockManagerDataStore is BaseLockManagerDataStore {\n    mapping(string investorId => mapping(uint256 lockId => Lock lock)) internal investorsLocks;\n    mapping(string investorId => uint256 count) internal investorsLocksCounts;\n    mapping(string investorId => bool locked) internal investorsLocked;\n    mapping(string investorId => mapping(bytes32 partitionHash => mapping(uint256 lockId => Lock lock))) internal investorsPartitionsLocks;\n    mapping(string investorId => mapping(bytes32 partitionHash => uint256 count)) internal investorsPartitionsLocksCounts;\n    mapping(string investorId => bool liquidateOnly) internal investorsLiquidateOnly;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[44] private __gap;\n}\n"},"contracts/data-stores/LockManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {BaseLockManagerDataStore} from \"./BaseLockManagerDataStore.sol\";\n\ncontract LockManagerDataStore is BaseLockManagerDataStore {\n    mapping(address account => uint256 count) internal locksCounts;\n    mapping(address account => mapping(uint256 lockId => Lock lock)) internal locks;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n"},"contracts/data-stores/RegistryServiceDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract RegistryServiceDataStore is ServiceConsumerDataStore {\n    struct Attribute {\n        uint256 value;\n        uint256 expiry;\n        string proofHash;\n    }\n\n    struct Wallet {\n        string owner;\n        address creator;\n        address DEPRECATED_lastUpdatedBy;\n    }\n\n    struct Investor {\n        string id;\n        string collisionHash;\n        address creator;\n        address DEPRECATED_lastUpdatedBy;\n        string country;\n        uint256 walletCount;\n        // Mappings outside Storage\n        // Ref: https://docs.soliditylang.org/en/v0.7.1/070-breaking-changes.html#mappings-outside-storage\n        // mapping(uint8 => Attribute) attributes;\n    }\n\n    mapping(string investorId => Investor investor) internal investors;\n    mapping(address walletAddress => Wallet wallet) internal investorsWallets;\n\n    /**\n     * @dev DEPRECATED: This mapping is no longer used but must be kept for storage layout compatibility in the proxy.\n     * Do not use this mapping in new code. It will be removed in future non-proxy implementations.\n     * The interface type has been replaced with address to remove the interface dependency.\n     */\n    mapping(address wallet => address controller) internal DEPRECATED_omnibusWalletsControllers;\n\n    mapping(string investorId => mapping(uint8 attributeId => Attribute attribute)) public attributes;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[46] private __gap;\n}\n"},"contracts/data-stores/ServiceConsumerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\ncontract ServiceConsumerDataStore {\n\n    mapping(uint256 serviceId => address service) internal services;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"},"contracts/data-stores/TokenDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\nimport {TokenLibrary} from '../token/TokenLibrary.sol';\n\ncontract TokenDataStore is ServiceConsumerDataStore {\n\n    TokenLibrary.TokenData internal tokenData;\n    mapping(address owner => mapping(address spender => uint256 allowance)) internal allowances;\n    mapping(uint256 index => address wallet) internal walletsList;\n    uint256 internal walletsCount;\n    mapping(address wallet => uint256 index) internal walletsToIndexes;\n    // These two variables replace the 2-slot TokenPartitions struct to preserve storage layout\n    address internal DEPRECATED_PARTITIONS_WALLETS;\n    address internal DEPRECATED_PARTITIONS_BALANCES;\n    uint256 public DEPRECATED_CAP;\n    string public name;\n    string public symbol;\n    uint8 public decimals;\n    TokenLibrary.SupportedFeatures public supportedFeatures;\n    bool internal paused;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[35] private __gap;\n}\n"},"contracts/data-stores/TrustServiceDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\ncontract TrustServiceDataStore {\n    address internal owner;\n    mapping(address account => uint8 role) internal roles;\n    mapping(string entityId => address owner) internal DEPRECATED_entitiesOwners;\n    mapping(address owner => string entityId) internal DEPRECATED_ownersEntities;\n    mapping(address operator => string entityId) internal DEPRECATED_operatorsEntities;\n    mapping(address resource => string entityId) internal DEPRECATED_resourcesEntities;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[44] private __gap;\n}\n"},"contracts/data-stores/WalletManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract WalletManagerDataStore is ServiceConsumerDataStore {\n    mapping(address wallet => uint8 walletType) internal walletsTypes;\n    mapping(address wallet => mapping(string slotName => mapping(uint8 slotType => uint256 value))) internal walletsSlots;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n"},"contracts/issuance/IDSTokenIssuer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSTokenIssuer {\n\n    function initialize() public virtual;\n\n    function issueTokens(\n        string calldata _id,\n        address _to,\n        uint256[] memory _issuanceValues,\n        string memory _reason,\n        uint256[] memory _locksValues,\n        uint64[] memory _lockReleaseTimes,\n        string memory _collisionHash,\n        string memory _country,\n        uint256[] memory attributeValues,\n        uint256[] memory attributeExpirations /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n}\n"},"contracts/issuance/TokenIssuer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSTokenIssuer} from \"./IDSTokenIssuer.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\ncontract TokenIssuer is IDSTokenIssuer, BaseDSContract {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function issueTokens(\n        string calldata _id,\n        address _to,\n        uint256[] memory _issuanceValues,\n        string memory _reason,\n        uint256[] memory _locksValues,\n        uint64[] memory _lockReleaseTimes,\n        string memory _collisionHash,\n        string memory _country,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) public override onlyIssuerOrAbove returns (bool) {\n        require(_issuanceValues.length == 2, \"Wrong length of parameters\");\n        require(_attributeValues.length == _attributeExpirations.length, \"Wrong length of parameters\");\n        require(_locksValues.length == _lockReleaseTimes.length, \"Wrong length of parameters\");\n        if (getRegistryService().isWallet(_to)) {\n            require(CommonUtils.isEqualString(getRegistryService().getInvestor(_to), _id), \"Wallet does not belong to investor\");\n        } else {\n            registerInvestor(_id, _to, _collisionHash, _country, _attributeValues, _attributeExpirations);\n        }\n\n        getToken().issueTokensWithMultipleLocks(_to, _issuanceValues[0], _issuanceValues[1], _locksValues, _reason, _lockReleaseTimes);\n\n        return true;\n    }\n\n    function registerInvestor(\n        string memory _id,\n        address _wallet,\n        string memory _collisionHash,\n        string memory _country,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) private {\n        IDSRegistryService registryService = getRegistryService();\n        uint8 EXPECTED_NUM_ATTRIBUTES = 3;\n        // all parameters required or none for Token Issuer\n        require(_attributeValues.length == 0 || _attributeValues.length == EXPECTED_NUM_ATTRIBUTES, \"Wrong length of parameters\");\n        uint8[] memory attributesIds;\n        if (_attributeValues.length == EXPECTED_NUM_ATTRIBUTES) {\n            attributesIds = new uint8[](EXPECTED_NUM_ATTRIBUTES);\n            attributesIds[0] = registryService.KYC_APPROVED();\n            attributesIds[1] = registryService.ACCREDITED();\n            attributesIds[2] = registryService.QUALIFIED();\n        } else {\n            attributesIds = new uint8[](0);\n        }\n        address[] memory investorWallets = new address[](1);\n        investorWallets[0] = _wallet;\n        registryService.updateInvestor(\n            _id,\n            _collisionHash,\n            _country,\n            investorWallets,\n            attributesIds,\n            _attributeValues,\n            _attributeExpirations\n        );\n    }\n}\n"},"contracts/mocks/ComplianceServiceRegulatedMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ComplianceServiceRegulated} from \"../compliance/ComplianceServiceRegulated.sol\";\n\n/**\n * @title ComplianceServiceRegulatedMock\n * @notice Mock contract for testing ComplianceServiceRegulated internal state\n * @dev This contract exposes internal storage variables for testing purposes only\n */\ncontract ComplianceServiceRegulatedMock is ComplianceServiceRegulated {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        super.initialize();\n    }\n\n    /**\n     * @notice Get the number of issuances for an investor\n     * @param investor The investor ID\n     * @return The number of issuances\n     */\n    function getIssuancesCount(string memory investor) public view returns (uint256) {\n        return issuancesCounters[investor];\n    }\n\n    /**\n     * @notice Get the timestamp of a specific issuance\n     * @param investor The investor ID\n     * @param index The index of the issuance\n     * @return The timestamp of the issuance\n     */\n    function getIssuanceTimestamp(string memory investor, uint256 index) public view returns (uint256) {\n        return issuancesTimestamps[investor][index];\n    }\n\n    /**\n     * @notice Get the value (in shares) of a specific issuance\n     * @param investor The investor ID\n     * @param index The index of the issuance\n     * @return The value in shares of the issuance\n     */\n    function getIssuanceValue(string memory investor, uint256 index) public view returns (uint256) {\n        return issuancesValues[investor][index];\n    }\n}\n"},"contracts/mocks/RebasingLibraryMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\n\ncontract RebasingLibraryMock {\n    function convertTokensToShares(\n        uint256 tokens,\n        uint256 multiplier,\n        uint8 decimals\n    ) external pure returns (uint256) {\n        return RebasingLibrary.convertTokensToShares(tokens, multiplier, decimals);\n    }\n\n    function convertSharesToTokens(\n        uint256 shares,\n        uint256 multiplier,\n        uint8 decimals\n    ) external pure returns (uint256) {\n        return RebasingLibrary.convertSharesToTokens(shares, multiplier, decimals);\n    }\n}\n"},"contracts/mocks/SecuritizeInternalNavProviderMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ISecuritizeNavProvider} from \"../nav/ISecuritizeNavProvider.sol\";\n\n\ncontract SecuritizeInternalNavProviderMock is ISecuritizeNavProvider {\n    /**\n     * @dev rate: NAV rate expressed with 6 decimals\n     */\n    uint256 public rate;\n\n    constructor(uint256 _rate) {\n        rate = _rate;\n    }\n\n    function initialize(uint256 _rate) public {\n        rate = _rate;\n    }\n\n    function setRate(uint256 _rate) external override {\n        rate = _rate;\n    }\n}\n"},"contracts/mocks/StandardTokenMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {StandardToken} from \"../token/StandardToken.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n// mock class using StandardToken\ncontract StandardTokenMock is StandardToken {\n\n    function initialize(string calldata _name, string calldata _symbol, uint8 _decimals) public virtual override onlyProxy initializer {\n        name = _name;\n        symbol = _symbol;\n        decimals = _decimals;\n    }\n\n    function balanceOfInvestor(string memory) public pure override returns (uint256) {\n        revertFunction();\n    }\n\n    function burn(address, uint256, string calldata) public pure override {\n        revertFunction();\n    }\n\n    function getWalletAt(uint256) public pure override returns (address) {\n        revertFunction();\n    }\n\n    function issueTokens(address, uint256) public pure override returns (bool) {\n        revertFunction();\n    }\n\n    function issueTokensCustom(address, uint256, uint256, uint256, string memory, uint64) public pure override returns (bool) {\n        revertFunction();\n    }\n\n    function issueTokensWithMultipleLocks(address, uint256, uint256, uint256[] memory, string memory, uint64[] memory) public pure override returns (bool) {\n        revertFunction();\n    }\n\n    function preTransferCheck(address, address, uint256) public pure override returns (uint256, string memory) {\n        revertFunction();\n    }\n\n    function seize(address, address, uint256, string calldata) public pure override {\n        revertFunction();\n    }\n\n    function updateInvestorBalance(address, uint256, CommonUtils.IncDec) internal pure override {\n        revertFunction();\n    }\n\n    function walletCount() public pure override returns (uint256) {\n        revertFunction();\n    }\n\n    function revertFunction() private pure {\n        revert(\"not implemented\");\n    }\n}\n"},"contracts/mocks/TestCalls.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/// @title Contract for testing low-level calls issued from the multisig wallet\ncontract TestCalls {\n    // msg.data.length of the latest call to \"receive\" methods\n    uint256 public lastMsgDataLength;\n\n    // msg.value of the latest call to \"receive\" methods\n    uint256 public lastMsgValue;\n\n    uint256 public uint1;\n    uint256 public uint2;\n    bytes public byteArray1;\n\n    modifier setMsgFields {\n        lastMsgDataLength = msg.data.length;\n        lastMsgValue = msg.value;\n        _;\n    }\n\n    constructor() payable setMsgFields() {\n        // This constructor will be used to test the creation via multisig wallet\n    }\n\n    function receive1uint(uint256 a) public payable setMsgFields {\n        uint1 = a;\n    }\n\n    function receive2uints(uint256 a, uint256 b) public payable setMsgFields {\n        uint1 = a;\n        uint2 = b;\n    }\n\n    function receive1bytes(bytes memory c) public payable setMsgFields {\n        byteArray1 = c;\n    }\n\n    function nonPayable() public payable setMsgFields {}\n\n}\n"},"contracts/mocks/TestToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/// @title Test token contract - Allows testing of token transfers with multisig wallet.\ncontract TestToken {\n    /*\n     *  Events\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /*\n     *  Constants\n     */\n    string public constant name = \"Test Token\";\n    string public constant symbol = \"TT\";\n    uint8 public constant decimals = 1;\n\n    /*\n     *  Storage\n     */\n    mapping(address owner => uint256 balance) balances;\n    mapping(address owner => mapping(address spender => uint256 allowance)) allowed;\n    uint256 public totalSupply;\n\n    /*\n     * Public functions\n     */\n    /// @dev Issues new tokens.\n    /// @param _to Address of token receiver.\n    /// @param _value Number of tokens to issue.\n    function issueTokens(address _to, uint256 _value) public {\n        balances[_to] += _value;\n        totalSupply += _value;\n    }\n\n    /*\n     * This modifier is present in some real world token contracts, and due to a solidity\n     * bug it was not compatible with multisig wallets\n     */\n    modifier onlyPayloadSize(uint256 size) {\n        require(msg.data.length == size + 4, \"Payload size error\");\n        _;\n    }\n\n    /// @dev Transfers sender's tokens to a given address. Returns success.\n    /// @param _to Address of token receiver.\n    /// @param _value Number of tokens to transfer.\n    /// @return success Returns success of function call.\n    function transfer(address _to, uint256 _value) public onlyPayloadSize(2 * 32) returns (bool success) {\n        require(balances[msg.sender] >= _value, \"Insufficient balance\");\n        balances[msg.sender] -= _value;\n        balances[_to] += _value;\n        emit Transfer(msg.sender, _to, _value);\n        return true;\n    }\n\n    /// @dev Allows allowed third party to transfer tokens from one address to another. Returns success.\n    /// @param _from Address from where tokens are withdrawn.\n    /// @param _to Address to where tokens are sent.\n    /// @param _value Number of tokens to transfer.\n    /// @return success Returns success of function call.\n    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {\n        require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value, \"Insufficient balance or allowance issue\");\n        balances[_to] += _value;\n        balances[_from] -= _value;\n        allowed[_from][msg.sender] -= _value;\n        emit Transfer(_from, _to, _value);\n        return true;\n    }\n\n    /// @dev Sets approved amount of tokens for spender. Returns success.\n    /// @param _spender Address of allowed account.\n    /// @param _value Number of approved tokens.\n    /// @return success Returns success of function call.\n    function approve(address _spender, uint256 _value) public returns (bool success) {\n        allowed[msg.sender][_spender] = _value;\n        emit Approval(msg.sender, _spender, _value);\n        return true;\n    }\n\n    /// @dev Returns number of allowed tokens for given address.\n    /// @param _owner Address of token owner.\n    /// @param _spender Address of token spender.\n    /// @return remaining Returns remaining allowance for spender.\n    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {\n        return allowed[_owner][_spender];\n    }\n\n    /// @dev Returns number of tokens owned by given address.\n    /// @param _owner Address of token owner.\n    /// @return balance Returns balance of owner.\n    function balanceOf(address _owner) public view returns (uint256 balance) {\n        return balances[_owner];\n    }\n}\n"},"contracts/mocks/TokenERC20.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TokenERC20 is ERC20 {\n    uint8 private tokenDecimals;\n    /**\n     * @dev Constructor that gives msg.sender all of existing tokens.\n     */\n    constructor(\n        string memory _name,\n        string memory _symbol,\n        uint256 _initialSupply,\n        uint8 _decimals\n    ) ERC20(_name, _symbol) {\n        tokenDecimals = _decimals;\n        _mint(msg.sender, _initialSupply);\n    }\n\n    function decimals() public view virtual override returns (uint8) {\n        return tokenDecimals;\n    }\n}\n\n\n"},"contracts/nav/ISecuritizeNavProvider.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npragma solidity 0.8.22;\n\n/**\n * @title ISecuritizeNavProvider\n * @dev Defines a common interface to get NAV (Native Asset Value) Rate to\n */\ninterface ISecuritizeNavProvider {\n    /**\n     * @dev Emitted when owner updates rate.\n     * @param oldValue Old rate value\n     * @param newValue New rate value\n     */\n    event RateUpdated(uint256 oldValue, uint256 newValue);\n\n    /**\n     * @dev Emitted when new rate updater is added.\n     * @param rateUpdater new rate updater\n     */\n    event RateUpdaterAdded(address indexed rateUpdater);\n\n    /**\n     * @dev Emitted when new rate updater is removed.\n     * @param rateUpdater removed rate updater\n     */\n    event RateUpdaterRemoved(address indexed rateUpdater);\n\n    /**\n     * @dev Set the NAV rate.\n     * @param _rate NAV rate value with the same number of decimals as the asset\n     */\n    function setRate(uint256 _rate) external;\n\n    /**\n     * @dev Returns the current NAV rate.\n     * The returned rate will have the same number of decimals as the asset,\n     * being automatically normalized if necessary.\n     * @return rate NAV rate value with the same number of decimals as the asset\n     */\n    function rate() external view returns (uint256);\n}\n"},"contracts/rebasing/ISecuritizeRebasingProvider.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/**\n * @title ISecuritizeRebasingProvider\n * @dev Defines a common interface to get Rebasing multiplier\n */\ninterface ISecuritizeRebasingProvider {\n    /**\n     * @dev Emitted when owner updates multiplier.\n     * @param oldValue Old multiplier value\n     * @param newValue New multiplier value\n     */\n    event RebasingRateUpdated(uint256 oldValue, uint256 newValue);\n\n    /**\n     * @dev Proxy Initializer.\n     * @param _multiplier the initial rebasing multiplier value\n     * @param _tokenDecimals the token decimals for conversion calculations\n    */\n    function initialize(uint256 _multiplier, uint8 _tokenDecimals) external;\n\n\n    /**\n     * @dev Set rebasing multiplier. It is expressed with the same decimal numbers as stable coin\n     */\n    function setMultiplier(uint256 _multiplier) external;\n\n    /**\n     * @dev The asset:rebasing multiplier.\n     * @return The asset:rebasing multiplier.\n     */\n    function multiplier() external view returns (uint256);\n\n    /**\n     * @dev Convert tokens to shares using the current multiplier and token decimals.\n     * @param _tokens The amount of tokens to convert\n     * @return shares The equivalent amount in shares\n     */\n    function convertTokensToShares(uint256 _tokens) external view returns (uint256 shares);\n\n    /**\n     * @dev Convert shares to tokens using the current multiplier and token decimals.\n     * @param _shares The amount of shares to convert\n     * @return tokens The equivalent amount in tokens\n     */\n    function convertSharesToTokens(uint256 _shares) external view returns (uint256 tokens);\n}\n"},"contracts/rebasing/RebasingLibrary.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSToken} from \"../token/IDSToken.sol\";\n\n\nlibrary RebasingLibrary {\n    /*\n     * @notice Note for auditors regarding rounding logic in rebasing operations.\n     *\n     * A finding was raised concerning the \"rounding to the nearest\" logic in `convertTokensToShares`,\n     * which could potentially result in a wei being rounded up in favor of the investor.\n     * We have analyzed and tested different options and our conclusions are the following:\n     *\n     * 1. The risk for the protocol of losing a wei over a `convertTokensToShares` operation\n     *    is restricted to tokens with many decimals (17 or 18).\n     *\n     * 2. Trying to fix this by rounding down on every operation presents many problems:\n     *    - Users who deposit 1 token immediately see it reflected as less than 1 token (0.99999...),\n     *      which causes confusion and potential complaints.\n     *    - When locking 200 tokens for an investor who holds 500, it should leave 300 tokens\n     *      transferable. Applying a \"round down\" fix causes this to fail, as a wei is lost\n     *      for the investor who no longer holds the total shares needed to get back their 300 tokens.\n     *    - Similar situations happen with other operations of the protocol, none of which happen\n     *      with the \"rounding to the nearest\" approach.\n     *\n     * 3. Exploiting the wei being rounded up is not economically viable for an attacker. It would\n     *    require thousands of transactions, and the associated gas costs (plus any protocol fees,\n     *    like bridging fees) would exceed any potential gain.\n     *\n     * 4. Most of our tokens operate with 6 decimals, while all rebasing operations use 18 decimals\n     *    of precision. For a typical 6-decimal token, taking advantage of this is nearly impossible.\n     *\n     * Conclusion: We are leaving the logic as is (\"rounding to the nearest integer\"). It works well\n     * in all situations, and while it creates a theoretical risk, it is not practically actionable or\n     * economically feasible to exploit.\n     */    \n    uint256 private constant DECIMALS_FACTOR = 1e18;\n\n    /**\n     * @notice Converts a token amount to a share amount.\n     * @param _tokens The amount of tokens to convert.\n     * @param _rebasingMultiplier The current rebasing multiplier, fixed to 18 decimals.\n     * @param _tokenDecimals The number of decimals of the token.\n     * @return The corresponding amount of shares.\n     */\n    function convertTokensToShares(\n        uint256 _tokens,\n        uint256 _rebasingMultiplier, // should be fixed to 18 decimals\n        uint8 _tokenDecimals\n    ) internal pure returns (uint256) {\n        require(_rebasingMultiplier > 0, \"Invalid rebasing multiplier\");\n        uint256 shares;        \n        if (_tokenDecimals == 18) {\n            shares = (_tokens * DECIMALS_FACTOR + _rebasingMultiplier / 2) / _rebasingMultiplier;\n        } else if (_tokenDecimals < 18) {\n            uint256 scale = 10**(18 - _tokenDecimals);\n            shares = (_tokens * scale * DECIMALS_FACTOR + _rebasingMultiplier / 2) / _rebasingMultiplier;\n        } else {\n            revert(\"Token decimals greater than 18 not supported\");\n        }\n\n\n        if (_tokens > 0) {\n            require(shares > 0, \"Shares amount too small\");\n        }\n        return shares;        \n    }\n\n    /**\n     * @notice Converts a share amount to a token amount.\n     * @param _shares The amount of shares to convert.\n     * @param _rebasingMultiplier The current rebasing multiplier, fixed to 18 decimals.\n     * @param _tokenDecimals The number of decimals of the token.\n     * @return The corresponding amount of tokens.\n     */\n    function convertSharesToTokens(\n        uint256 _shares,\n        uint256 _rebasingMultiplier,\n        uint8 _tokenDecimals\n    ) internal pure returns (uint256) {\n        require(_rebasingMultiplier > 0, \"Invalid rebasing multiplier\");\n        if (_tokenDecimals == 18) {\n            return (_shares * _rebasingMultiplier + DECIMALS_FACTOR / 2) / DECIMALS_FACTOR;\n        } else if (_tokenDecimals < 18) {\n            uint256 scale = 10**(18 - _tokenDecimals);\n            return (((_shares * _rebasingMultiplier + DECIMALS_FACTOR / 2) / DECIMALS_FACTOR) + scale / 2) / scale;\n        } else {\n            revert(\"Token decimals greater than 18 not supported\");\n        }\n    }\n}"},"contracts/rebasing/SecuritizeRebasingProvider.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {ServiceConsumer} from \"../service/ServiceConsumer.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {RebasingLibrary} from \"./RebasingLibrary.sol\";\n\ncontract SecuritizeRebasingProvider is BaseDSContract, ISecuritizeRebasingProvider {\n    uint256 public multiplier; // Multiplier is fixed to 18 decimals\n    uint8 public tokenDecimals;\n\n    error InvalidMultiplier(uint256 providedMultiplier);\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(uint256 _multiplier, uint8 _tokenDecimals) public onlyProxy initializer override {\n        __BaseDSContract_init();\n        \n        if (_multiplier == 0) {\n            revert InvalidMultiplier(_multiplier);\n        }\n        \n        multiplier = _multiplier;\n        tokenDecimals = _tokenDecimals;\n    }\n    /**\n     * \n     * @param _multiplier The new multiplier value, fixed to 18 decimals\n     */\n    function setMultiplier(uint256 _multiplier) external override onlyMaster {\n        if (_multiplier == 0) {\n            revert InvalidMultiplier(_multiplier);\n        }\n        \n        uint256 old = multiplier;\n        multiplier = _multiplier;\n        emit RebasingRateUpdated(old, _multiplier);\n    }\n\n    function convertTokensToShares(uint256 _tokens) external view returns (uint256 shares) {\n        return RebasingLibrary.convertTokensToShares(_tokens, multiplier, tokenDecimals);\n    }\n\n    function convertSharesToTokens(uint256 _shares) external view returns (uint256 tokens) {\n        return RebasingLibrary.convertSharesToTokens(_shares, multiplier, tokenDecimals);\n    }\n}\n"},"contracts/registry/IDSRegistryService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\nabstract contract IDSRegistryService {\n\n    function initialize() public virtual;\n\n    event DSRegistryServiceInvestorAdded(string investorId, address sender);\n    event DSRegistryServiceInvestorRemoved(string investorId, address sender);\n    event DSRegistryServiceInvestorCountryChanged(string investorId, string country, address sender);\n    event DSRegistryServiceInvestorAttributeChanged(string investorId, uint256 attributeId, uint256 value, uint256 expiry, string proofHash, address sender);\n    event DSRegistryServiceWalletAdded(address wallet, string investorId, address sender);\n    event DSRegistryServiceWalletRemoved(address wallet, string investorId, address sender);\n\n    uint8 public constant NONE = 0;\n    uint8 public constant KYC_APPROVED = 1;\n    uint8 public constant ACCREDITED = 2;\n    uint8 public constant QUALIFIED = 4;\n    uint8 public constant PROFESSIONAL = 8;\n\n    uint8 public constant PENDING = 0;\n    uint8 public constant APPROVED = 1;\n    uint8 public constant REJECTED = 2;\n\n    uint8 public constant EXCHANGE = 4;\n\n    modifier investorExists(string memory _id) {\n        require(isInvestor(_id), \"Unknown investor\");\n        _;\n    }\n\n    modifier newInvestor(string memory _id) {\n        require(!CommonUtils.isEmptyString(_id), \"Investor id must not be empty\");\n        require(!isInvestor(_id), \"Investor already exists\");\n        _;\n    }\n\n    modifier walletExists(address _address) {\n        require(isWallet(_address), \"Unknown wallet\");\n        _;\n    }\n\n    modifier newWallet(address _address) {\n        require(!isWallet(_address), \"Wallet already exists\");\n        _;\n    }\n\n    modifier walletBelongsToInvestor(address _address, string memory _id) {\n        require(CommonUtils.isEqualString(getInvestor(_address), _id), \"Wallet does not belong to investor\");\n        _;\n    }\n\n    function registerInvestor(\n        string calldata _id,\n        string calldata _collision_hash /*onlyExchangeOrAbove newInvestor(_id)*/\n    ) public virtual returns (bool);\n\n    function updateInvestor(\n        string calldata _id,\n        string calldata _collisionHash,\n        string memory _country,\n        address[] memory _wallets,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function removeInvestor(\n        string calldata _id /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function setCountry(\n        string calldata _id,\n        string memory _country /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function getCountry(string memory _id) public view virtual returns (string memory);\n\n    function getCollisionHash(string calldata _id) public view virtual returns (string memory);\n\n    function setAttribute(\n        string calldata _id,\n        uint8 _attributeId,\n        uint256 _value,\n        uint256 _expiry,\n        string memory _proofHash /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function getAttributeValue(string memory _id, uint8 _attributeId) public view virtual returns (uint256);\n\n    function getAttributeExpiry(string memory _id, uint8 _attributeId) public view virtual returns (uint256);\n\n    function getAttributeProofHash(string memory _id, uint8 _attributeId) public view virtual returns (string memory);\n\n    function addWallet(\n        address _address,\n        string memory _id /*onlyExchangeOrAbove newWallet(_address)*/\n    ) public virtual returns (bool);\n\n\n    function removeWallet(\n        address _address,\n        string memory _id /*onlyExchangeOrAbove walletExists walletBelongsToInvestor(_address, _id)*/\n    ) public virtual returns (bool);\n\n    function getInvestor(address _address) public view virtual returns (string memory);\n\n    function getInvestorDetails(address _address) public view virtual returns (string memory, string memory);\n\n    function getInvestorDetailsFull(string memory _id)\n        public\n        view\n        virtual\n        returns (string memory, uint256[] memory, uint256[] memory, string memory, string memory, string memory, string memory);\n\n    function isInvestor(string memory _id) public view virtual returns (bool);\n\n    function isWallet(address _address) public view virtual returns (bool);\n\n    function isAccreditedInvestor(string calldata _id) external view virtual returns (bool);\n\n    function isQualifiedInvestor(string calldata _id) external view virtual returns (bool);\n\n    function isAccreditedInvestor(address _wallet) external view virtual returns (bool);\n\n    function isQualifiedInvestor(address _wallet) external view virtual returns (bool);\n\n    function getInvestors(address _from, address _to) external view virtual returns (string memory, string memory);\n}\n"},"contracts/registry/IDSWalletRegistrar.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSWalletRegistrar {\n\n    function initialize() public virtual;\n\n    function registerWallet(\n        string memory _id,\n        address[] calldata _wallets,\n        string calldata _collisionHash,\n        string memory _country,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations /*onlyOwner*/\n    ) public virtual returns (bool);\n}\n"},"contracts/registry/RegistryService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {IDSRegistryService} from \"./IDSRegistryService.sol\";\nimport {RegistryServiceDataStore} from \"../data-stores/RegistryServiceDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\n\ncontract RegistryService is IDSRegistryService, RegistryServiceDataStore, BaseDSContract {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function registerInvestor(string calldata _id, string calldata _collisionHash) public override onlyExchangeOrAbove newInvestor(_id) returns (bool) {\n        investors[_id] = Investor(_id, _collisionHash, msg.sender, msg.sender, \"\", 0);\n\n        emit DSRegistryServiceInvestorAdded(_id, msg.sender);\n\n        return true;\n    }\n\n    function removeInvestor(string calldata _id) public override onlyExchangeOrAbove investorExists(_id) returns (bool) {\n        require(getTrustService().getRole(msg.sender) != EXCHANGE || investors[_id].creator == msg.sender, \"Insufficient permissions\");\n        require(investors[_id].walletCount == 0, \"Investor has wallets\");\n\n        for (uint8 index = 0; index < 16; index++) {\n            delete attributes[_id][index];\n        }\n\n        delete investors[_id];\n\n        emit DSRegistryServiceInvestorRemoved(_id, msg.sender);\n\n        return true;\n    }\n\n    function updateInvestor(\n        string calldata _id,\n        string calldata _collisionHash,\n        string memory _country,\n        address[] memory _wallets,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) public override onlyIssuerOrTransferAgentOrAbove returns (bool) {\n        require(_attributeValues.length == _attributeIds.length, \"Wrong length of parameters\");\n        require(_attributeIds.length == _attributeExpirations.length, \"Wrong length of parameters\");\n\n        if (!isInvestor(_id)) {\n            registerInvestor(_id, _collisionHash);\n        }\n\n        if (bytes(_country).length > 0) {\n            setCountry(_id, _country);\n        }\n\n        for (uint256 i = 0; i < _wallets.length; i++) {\n            if (isWallet(_wallets[i])) {\n                require(CommonUtils.isEqualString(getInvestor(_wallets[i]), _id), \"Wallet belongs to a different investor\");\n            } else {\n                addWallet(_wallets[i], _id);\n            }\n        }\n\n        for (uint256 i = 0; i < _attributeIds.length; i++) {\n            setAttribute(_id, _attributeIds[i], _attributeValues[i], _attributeExpirations[i], \"\");\n        }\n\n        return true;\n    }\n\n    function getInvestorDetailsFull(string memory _id)\n        public\n        view\n        override\n        returns (string memory, uint256[] memory, uint256[] memory, string memory, string memory, string memory, string memory)\n    {\n        string memory country = investors[_id].country;\n        uint256[] memory attributeValues = new uint256[](4);\n        uint256[] memory attributeExpiries = new uint256[](4);\n        string[] memory attributeProofHashes = new string[](4);\n        for (uint8 i = 0; i < 4; i++) {\n            attributeValues[i] = getAttributeValue(_id, (uint8(2)**i));\n            attributeExpiries[i] = getAttributeExpiry(_id, (uint8(2)**i));\n            attributeProofHashes[i] = getAttributeProofHash(_id, (uint8(2)**i));\n        }\n        return (country, attributeValues, attributeExpiries, attributeProofHashes[0], attributeProofHashes[1], attributeProofHashes[2], attributeProofHashes[3]);\n    }\n\n    function setCountry(string calldata _id, string memory _country) public override onlyExchangeOrAbove investorExists(_id) returns (bool) {\n        string memory prevCountry = getCountry(_id);\n        if (!CommonUtils.isEqualString(prevCountry, _country)) {\n            getComplianceService().adjustInvestorCountsAfterCountryChange(_id, _country, prevCountry);\n\n            investors[_id].country = _country;\n\n            emit DSRegistryServiceInvestorCountryChanged(_id, _country, msg.sender);\n        }\n        return true;\n    }\n\n    function getCountry(string memory _id) public view override returns (string memory) {\n        return investors[_id].country;\n    }\n\n    function getCollisionHash(string calldata _id) public view override returns (string memory) {\n        return investors[_id].collisionHash;\n    }\n\n    function setAttribute(string calldata _id, uint8 _attributeId, uint256 _value, uint256 _expiry, string memory _proofHash)\n        public\n        override\n        onlyExchangeOrAbove\n        investorExists(_id)\n        returns (bool)\n    {\n        require(_attributeId < 16, \"Unknown attribute\");\n\n        attributes[_id][_attributeId].value = _value;\n        attributes[_id][_attributeId].expiry = _expiry;\n        attributes[_id][_attributeId].proofHash = _proofHash;\n\n        emit DSRegistryServiceInvestorAttributeChanged(_id, _attributeId, _value, _expiry, _proofHash, msg.sender);\n\n        return true;\n    }\n\n    function getAttributeValue(string memory _id, uint8 _attributeId) public view override returns (uint256) {\n        return attributes[_id][_attributeId].value;\n    }\n\n    function getAttributeExpiry(string memory _id, uint8 _attributeId) public view override returns (uint256) {\n        return attributes[_id][_attributeId].expiry;\n    }\n\n    function getAttributeProofHash(string memory _id, uint8 _attributeId) public view override returns (string memory) {\n        return attributes[_id][_attributeId].proofHash;\n    }\n\n    function addWallet(address _address, string memory _id) public override onlyExchangeOrAbove investorExists(_id) newWallet(_address) returns (bool) {\n        require(!getWalletManager().isSpecialWallet(_address), \"Wallet has special role\");\n        require(getToken().balanceOf(_address) == 0, \"Wallet with positive balance\");\n        investorsWallets[_address] = Wallet(_id, msg.sender, msg.sender);\n        investors[_id].walletCount++;\n\n        emit DSRegistryServiceWalletAdded(_address, _id, msg.sender);\n\n        return true;\n    }\n\n\n    function removeWallet(address _address, string memory _id) public override onlyExchangeOrAbove walletExists(_address) walletBelongsToInvestor(_address, _id) returns (bool) {\n        require(getTrustService().getRole(msg.sender) != EXCHANGE || investorsWallets[_address].creator == msg.sender, \"Insufficient permissions\");\n        require(getToken().balanceOf(_address) == 0, \"Wallet with positive balance\");\n\n        delete investorsWallets[_address];\n        investors[_id].walletCount--;\n\n        emit DSRegistryServiceWalletRemoved(_address, _id, msg.sender);\n\n        return true;\n    }\n\n    function getInvestor(address _address) public view override returns (string memory) {\n        return investorsWallets[_address].owner;\n    }\n\n    function getInvestorDetails(address _address) public view override returns (string memory, string memory) {\n        return (getInvestor(_address), getCountry(getInvestor(_address)));\n    }\n\n    function isInvestor(string memory _id) public view override returns (bool) {\n        return !CommonUtils.isEmptyString(investors[_id].id);\n    }\n\n    function isAccreditedInvestor(string calldata _id) external view override returns (bool) {\n        return getAttributeValue(_id, ACCREDITED) == APPROVED;\n    }\n\n    function isAccreditedInvestor(address _wallet) external view override returns (bool) {\n        string memory investor = investorsWallets[_wallet].owner;\n        return getAttributeValue(investor, ACCREDITED) == APPROVED;\n    }\n\n    function isQualifiedInvestor(address _wallet) external view override returns (bool) {\n        string memory investor = investorsWallets[_wallet].owner;\n        return getAttributeValue(investor, QUALIFIED) == APPROVED;\n    }\n\n    function isQualifiedInvestor(string calldata _id) external view override returns (bool) {\n        return getAttributeValue(_id, QUALIFIED) == APPROVED;\n    }\n\n    function getInvestors(address _from, address _to) external view override returns (string memory, string memory) {\n        return (investorsWallets[_from].owner, investorsWallets[_to].owner);\n    }\n\n    function isWallet(address _address) public view override returns (bool) {\n        return isInvestor(getInvestor(_address));\n    }\n}\n"},"contracts/registry/WalletRegistrar.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSWalletRegistrar} from \"./IDSWalletRegistrar.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {IDSRegistryService} from \"./IDSRegistryService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\ncontract WalletRegistrar is IDSWalletRegistrar, BaseDSContract {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function registerWallet(\n        string memory _id,\n        address[] calldata _wallets,\n        string calldata _collisionHash,\n        string memory _country,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) public override onlyOwnerOrIssuerOrAbove returns (bool) {\n        IDSRegistryService registryService = getRegistryService();\n\n        registryService.updateInvestor(\n            _id,\n            _collisionHash,\n            _country,\n            _wallets,\n            _attributeIds,\n            _attributeValues,\n            _attributeExpirations\n        );\n\n        return true;\n    }\n}\n"},"contracts/service/IDSServiceConsumer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSServiceConsumer {\n\n    uint256 public constant TRUST_SERVICE = 1;\n    uint256 public constant DS_TOKEN = 2;\n    uint256 public constant REGISTRY_SERVICE = 4;\n    uint256 public constant COMPLIANCE_SERVICE = 8;\n    uint256 public constant UNUSED_1 = 16;\n    uint256 public constant WALLET_MANAGER = 32;\n    uint256 public constant LOCK_MANAGER = 64;\n    uint256 public constant DEPRECATED_PARTITIONS_MANAGER = 128;\n    uint256 public constant COMPLIANCE_CONFIGURATION_SERVICE = 256;\n    uint256 public constant TOKEN_ISSUER = 512;\n    uint256 public constant WALLET_REGISTRAR = 1024;\n    uint256 public constant DEPRECATED_OMNIBUS_TBE_CONTROLLER = 2048; // Deprecated, keep for backward compatibility\n    uint256 public constant TRANSACTION_RELAYER = 4096;\n    uint256 public constant DEPRECATED_TOKEN_REALLOCATOR = 8192; // Deprecated, keep for backward compatibility\n    uint256 public constant DEPRECATED_ISSUER_MULTICALL = 0;\n    uint256 public constant DEPRECATED_TA_MULTICALL = 0;\n    uint256 public constant DEPRECATED_SECURITIZE_SWAP = 16384;\n    uint256 public constant REBASING_PROVIDER = 8196;\n\n    function getDSService(uint256 _serviceId) public view virtual returns (address);\n\n    function setDSService(\n        uint256 _serviceId,\n        address _address /*onlyMaster*/\n    ) public virtual returns (bool);\n\n    event DSServiceSet(uint256 serviceId, address serviceAddress);\n}\n"},"contracts/service/ServiceConsumer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSServiceConsumer} from \"./IDSServiceConsumer.sol\";\nimport {ServiceConsumerDataStore} from \"../data-stores/ServiceConsumerDataStore.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\nimport {IDSWalletManager} from \"../compliance/IDSWalletManager.sol\";\nimport {IDSLockManager} from \"../compliance/IDSLockManager.sol\";\nimport {IDSComplianceService} from \"../compliance/IDSComplianceService.sol\";\nimport {IDSComplianceConfigurationService} from \"../compliance/IDSComplianceConfigurationService.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {IDSTrustService} from \"../trust/IDSTrustService.sol\";\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n\n\nabstract contract ServiceConsumer is IDSServiceConsumer, ServiceConsumerDataStore, OwnableUpgradeable {\n\n    // Bring role constants to save gas both in deployment (less bytecode) and usage\n    uint8 public constant ROLE_NONE = 0;\n    uint8 public constant ROLE_MASTER = 1;\n    uint8 public constant ROLE_ISSUER = 2;\n    uint8 public constant ROLE_EXCHANGE = 4;\n    uint8 public constant ROLE_TRANSFER_AGENT = 8;\n\n    function __ServiceConsumer_init() public virtual onlyInitializing {\n        __Ownable_init(msg.sender);\n    }\n\n    modifier onlyMaster {\n        if(owner() != msg.sender) require(getTrustService().getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking functions only by the users who have the MASTER role or the ISSUER role or the TRANSFER AGENT role.\n   */\n    modifier onlyIssuerOrTransferAgentOrAbove() {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_TRANSFER_AGENT || role == ROLE_ISSUER || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyIssuerOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_ISSUER || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyTransferAgentOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_TRANSFER_AGENT || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyExchangeOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_EXCHANGE || role == ROLE_ISSUER || role == ROLE_TRANSFER_AGENT || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyToken {\n        require(msg.sender == getDSService(DS_TOKEN), \"This function can only called by the associated token\");\n        _;\n    }\n\n    modifier onlyRegistry {\n        require(msg.sender == getDSService(REGISTRY_SERVICE), \"This function can only called by the registry service\");\n        _;\n    }\n\n    modifier onlyIssuerOrAboveOrToken {\n        if (msg.sender != getDSService(DS_TOKEN)) {\n            IDSTrustService trustManager = IDSTrustService(getDSService(TRUST_SERVICE));\n            require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    modifier onlyTransferAgentOrAboveOrToken {\n        if (msg.sender != getDSService(DS_TOKEN)) {\n            IDSTrustService trustManager = IDSTrustService(getDSService(TRUST_SERVICE));\n            require(trustManager.getRole(msg.sender) == ROLE_TRANSFER_AGENT || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    modifier onlyOwnerOrIssuerOrAbove {\n        if(owner() != msg.sender) {\n            IDSTrustService trustManager = getTrustService();\n            require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    function getDSService(uint256 _serviceId) public view override returns (address) {\n        return services[_serviceId];\n    }\n\n    function setDSService(uint256 _serviceId, address _address) public override onlyMaster returns (bool) {\n        services[_serviceId] = _address;\n        emit DSServiceSet(_serviceId, _address);\n        return true;\n    }\n\n    function getToken() internal view returns (IDSToken) {\n        return IDSToken(getDSService(DS_TOKEN));\n    }\n\n    function getTrustService() internal view returns (IDSTrustService) {\n        return IDSTrustService(getDSService(TRUST_SERVICE));\n    }\n\n    function getWalletManager() internal view returns (IDSWalletManager) {\n        return IDSWalletManager(getDSService(WALLET_MANAGER));\n    }\n\n    function getLockManager() internal view returns (IDSLockManager) {\n        return IDSLockManager(getDSService(LOCK_MANAGER));\n    }\n\n    function getComplianceService() internal view returns (IDSComplianceService) {\n        return IDSComplianceService(getDSService(COMPLIANCE_SERVICE));\n    }\n\n    function getRegistryService() internal view returns (IDSRegistryService) {\n        return IDSRegistryService(getDSService(REGISTRY_SERVICE));\n    }\n\n    function getComplianceConfigurationService() internal view returns (IDSComplianceConfigurationService) {\n        return IDSComplianceConfigurationService(getDSService(COMPLIANCE_CONFIGURATION_SERVICE));\n    }\n\n    function getRebasingProvider() internal view returns (ISecuritizeRebasingProvider) {\n        return ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n    }\n}\n"},"contracts/token/DSToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSToken} from \"./IDSToken.sol\";\nimport {StandardToken} from \"./StandardToken.sol\";\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\nimport {TokenLibrary} from \"./TokenLibrary.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\ncontract DSToken is StandardToken {\n    // using FeaturesLibrary for SupportedFeatures;\n    using TokenLibrary for TokenLibrary.SupportedFeatures;\n    uint256 internal constant DEPRECATED_OMNIBUS_NO_ACTION = 0;  // Deprecated, kept for backward compatibility\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(\n        string calldata _name,\n        string calldata _symbol,\n        uint8 _decimals\n        ) public virtual override onlyProxy initializer {\n        __StandardToken_init();\n\n        name = _name;\n        symbol = _symbol;\n        decimals = _decimals;\n    }\n\n    /******************************\n       TOKEN CONFIGURATION\n   *******************************/\n\n    function setFeature(uint8 featureIndex, bool enable) public onlyMaster {\n        supportedFeatures.setFeature(featureIndex, enable);\n    }\n\n    function setFeatures(uint256 features) public onlyMaster {\n        supportedFeatures.value = features;\n    }\n\n    function totalIssued() public view returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        uint256 tokens = rebasingProvider.convertSharesToTokens(tokenData.totalIssued);\n        return tokens;\n    }\n\n    /******************************\n       TOKEN ISSUANCE (MINTING)\n   *******************************/\n\n    /**\n     * @dev Issues unlocked tokens\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @return true if successful\n     */\n    function issueTokens(\n        address _to,\n        uint256 _value /*onlyIssuerOrAbove*/\n    ) public override returns (bool) {\n        issueTokensCustom(_to, _value, block.timestamp, 0, \"\", 0);\n        return true;\n    }\n\n    /**\n     * @notice Issues tokens with optional locking parameters\n     * @dev Issues tokens to an address with custom issuance time and optional single lock\n     * @param _to The address which will receive the newly issued tokens\n     * @param _value The amount of tokens to issue\n     * @param _issuanceTime The timestamp when tokens are considered issued\n     * @param _valueLocked The amount of tokens to be locked (0 for no lock)\n     * @param _reason The reason for token issuance\n     * @param _releaseTime The timestamp when locked tokens will be released\n     * @return bool Returns true if successful\n     */\n    function issueTokensCustom(address _to, uint256 _value, uint256 _issuanceTime, uint256 _valueLocked, string memory _reason, uint64 _releaseTime)\n    public\n    virtual\n    override\n    returns (\n    /*onlyIssuerOrAbove*/\n        bool\n    )\n    {\n        uint256[] memory valuesLocked;\n        uint64[] memory releaseTimes;\n        if (_valueLocked > 0) {\n            valuesLocked = new uint256[](1);\n            releaseTimes = new uint64[](1);\n            valuesLocked[0] = _valueLocked;\n            releaseTimes[0] = _releaseTime;\n        }\n\n        issueTokensWithMultipleLocks(_to, _value, _issuanceTime, valuesLocked, _reason, releaseTimes);\n        return true;\n    }\n\n    function issueTokensWithMultipleLocks(address _to, uint256 _value, uint256 _issuanceTime, uint256[] memory _valuesLocked, string memory _reason, uint64[] memory _releaseTimes)\n    public\n    virtual\n    override\n    onlyIssuerOrAbove\n    returns (bool)\n    {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        TokenLibrary.IssueParams memory params = TokenLibrary.IssueParams({\n            _to: _to,\n            _value: _value,\n            _issuanceTime: _issuanceTime,\n            _valuesLocked: _valuesLocked,\n            _releaseTimes: _releaseTimes,\n            _reason: _reason,\n            _rebasingProvider: rebasingProvider\n        });\n        uint256 shares = TokenLibrary.issueTokensCustom(\n            tokenData,\n            getCommonServices(),\n            getLockManager(),\n            params\n            );\n\n        emit Transfer(address(0), _to, _value);\n        emit TxShares(address(0), _to, shares, rebasingProvider.multiplier());\n\n        checkWalletsForList(address(0), _to);\n        return true;\n    }\n\n    //*********************\n    // TOKEN BURNING\n    //*********************\n\n    function burn(address _who, uint256 _value, string calldata _reason) public virtual override onlyIssuerOrTransferAgentOrAbove {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        uint256 shares = TokenLibrary.burn(tokenData, getCommonServices(), _who, _value, rebasingProvider);\n        emit Burn(_who, _value, _reason);\n        emit Transfer(_who, address(0), _value);\n        emit TxShares(_who, address(0), shares, rebasingProvider.multiplier());\n        checkWalletsForList(_who, address(0));\n    }\n\n    //*********************\n    // TOKEN SEIZING\n    //*********************\n\n    function seize(address _from, address _to, uint256 _value, string calldata _reason) public virtual override onlyTransferAgentOrAbove {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        uint256 shares = rebasingProvider.convertTokensToShares(_value);\n\n        TokenLibrary.seize(tokenData, getCommonServices(), _from, _to, _value, shares);\n\n        emit Seize(_from, _to, _value, _reason);\n        emit Transfer(_from, _to, _value);\n        emit TxShares(_from, _to, shares, rebasingProvider.multiplier());\n        checkWalletsForList(_from, _to);\n    }\n\n    //*********************\n    // TRANSFER RESTRICTIONS\n    //*********************\n\n    /**\n     * @dev Checks whether it can transfer with the compliance manager, if not -throws.\n     */\n    modifier canTransfer(address _sender, address _receiver, uint256 _value) {\n        getComplianceService().validateTransfer(_sender, _receiver, _value, paused, super.balanceOf(_sender));\n        _;\n    }\n\n    /**\n     * @dev override for transfer with modifiers:\n     * whether the token is not paused (checked in super class)\n     * and that the sender is allowed to transfer tokens\n     * @param _to The address that will receive the tokens.\n     * @param _value The amount of tokens to be transferred.\n     */\n    function transfer(address _to, uint256 _value) public virtual override canTransfer(msg.sender, _to, _value) returns (bool) {\n        return postTransferImpl(super.transfer(_to, _value), msg.sender, _to, _value);\n    }\n\n    /**\n     * @dev override for transfer with modifiers:\n     * whether the token is not paused (checked in super class)\n     * and that the sender is allowed to transfer tokens\n     * @param _from The address that will send the tokens.\n     * @param _to The address that will receive the tokens.\n     * @param _value The amount of tokens to be transferred.\n     */\n    function transferFrom(address _from, address _to, uint256 _value) public virtual override canTransfer(_from, _to, _value) returns (bool) {\n        return postTransferImpl(super.transferFrom(_from, _to, _value), _from, _to, _value);\n    }\n\n    function postTransferImpl(bool _superResult, address _from, address _to, uint256 _value) internal returns (bool) {\n        if (_superResult) {\n            updateInvestorsBalancesOnTransfer(_from, _to, _value);\n        }\n\n        checkWalletsForList(_from, _to);\n\n        return _superResult;\n    }\n\n    //*********************\n    // WALLET ENUMERATION\n    //****\n\n    function getWalletAt(uint256 _index) public view override returns (address) {\n        require(_index > 0 && _index <= walletsCount);\n        return walletsList[_index];\n    }\n\n    function walletCount() public view override returns (uint256) {\n        return walletsCount;\n    }\n\n    function checkWalletsForList(address _from, address _to) private {\n        if (super.balanceOf(_from) == 0) {\n            removeWalletFromList(_from);\n        }\n        if (super.balanceOf(_to) > 0) {\n            addWalletToList(_to);\n        }\n    }\n\n    function addWalletToList(address _address) private {\n        //Check if it's already there\n        uint256 existingIndex = walletsToIndexes[_address];\n        if (existingIndex == 0) {\n            //If not - add it\n            uint256 index = walletsCount + 1;\n            walletsList[index] = _address;\n            walletsToIndexes[_address] = index;\n            walletsCount = index;\n        }\n    }\n\n    function removeWalletFromList(address _address) private {\n        //Make sure it's there\n        uint256 existingIndex = walletsToIndexes[_address];\n        if (existingIndex != 0) {\n            uint256 lastIndex = walletsCount;\n            if (lastIndex != existingIndex) {\n                //Put the last wallet instead of it (this will work even with 1 wallet in the list)\n                address lastWalletAddress = walletsList[lastIndex];\n                walletsList[existingIndex] = lastWalletAddress;\n                walletsToIndexes[lastWalletAddress] = existingIndex;\n            }\n\n            delete walletsToIndexes[_address];\n            delete walletsList[lastIndex];\n            walletsCount = lastIndex - 1;\n        }\n    }\n\n    //**************************************\n    // MISCELLANEOUS FUNCTIONS\n    //**************************************\n\n    function balanceOfInvestor(string memory _id) public view override returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n\n        uint256 tokens = rebasingProvider.convertSharesToTokens(tokenData.investorsBalances[_id]);\n\n        return tokens;\n    }\n\n\n    function updateInvestorsBalancesOnTransfer(address _from, address _to, uint256 _value) internal {\n        updateInvestorBalance(_from, _value, CommonUtils.IncDec.Decrease);\n        updateInvestorBalance(_to, _value, CommonUtils.IncDec.Increase);\n    }\n\n    function updateInvestorBalance(address _wallet, uint256 _value, CommonUtils.IncDec _increase) internal override {\n        string memory investor = getRegistryService().getInvestor(_wallet);\n        if (!CommonUtils.isEmptyString(investor)) {\n            uint256 balance = balanceOfInvestor(investor);\n            if (_increase == CommonUtils.IncDec.Increase) {\n                balance += _value;\n            } else {\n                balance -= _value;\n            }\n\n            ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n\n            uint256 sharesBalance = rebasingProvider.convertTokensToShares(balance);\n\n            tokenData.investorsBalances[investor] = sharesBalance;\n        }\n    }\n\n    function preTransferCheck(address _from, address _to, uint256 _value) public view override returns (uint256 code, string memory reason) {\n        return getComplianceService().preTransferCheck(_from, _to, _value);\n    }\n\n    function getCommonServices() internal view returns (address[] memory) {\n        address[] memory services = new address[](2);\n        services[0] = getDSService(COMPLIANCE_SERVICE);\n        services[1] = getDSService(REGISTRY_SERVICE);\n        return services;\n    }\n}\n"},"contracts/token/IDSToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IERC20} from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\nabstract contract IDSToken is IERC20, Initializable {\n    event Issue(address indexed to, uint256 value, uint256 valueLocked);\n    event TxShares(address indexed from, address indexed to, uint256 shares, uint256 multiplier);\n    event Burn(address indexed burner, uint256 value, string reason);\n    event Seize(address indexed from, address indexed to, uint256 value, string reason);\n\n    event WalletAdded(address wallet);\n    event WalletRemoved(address wallet);\n\n    function initialize(string calldata _name, string calldata _symbol, uint8 _decimals) public virtual;\n\n    /******************************\n       TOKEN ISSUANCE (MINTING)\n   *******************************/\n\n    /**\n     * @dev Issues unlocked tokens\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @return true if successful\n     */\n    function issueTokens(\n        address _to,\n        uint256 _value /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Issuing tokens from the fund\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @param _valueLocked uint256 value of tokens, from those issued, to lock immediately.\n     * @param _reason reason for token locking\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * @return true if successful\n     */\n    function issueTokensCustom(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime,\n        uint256 _valueLocked,\n        string memory _reason,\n        uint64 _releaseTime /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function issueTokensWithMultipleLocks(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime,\n        uint256[] memory _valuesLocked,\n        string memory _reason,\n        uint64[] memory _releaseTimes /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    //*********************\n    // TOKEN BURNING\n    //*********************\n\n    function burn(\n        address _who,\n        uint256 _value,\n        string calldata _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    //*********************\n    // TOKEN SIEZING\n    //*********************\n\n    function seize(\n        address _from,\n        address _to,\n        uint256 _value,\n        string calldata _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    //*********************\n    // WALLET ENUMERATION\n    //*********************\n\n    function getWalletAt(uint256 _index) public view virtual returns (address);\n\n    function walletCount() public view virtual returns (uint256);\n\n    //**************************************\n    // MISCELLANEOUS FUNCTIONS\n    //**************************************\n    function isPaused() public view virtual returns (bool);\n\n    function balanceOfInvestor(string memory _id) public view virtual returns (uint256);\n\n    function updateInvestorBalance(address _wallet, uint256 _value, CommonUtils.IncDec _increase) internal virtual;\n\n    function preTransferCheck(address _from, address _to, uint256 _value) public view virtual returns (uint256 code, string memory reason);\n\n}\n"},"contracts/token/StandardToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {TokenDataStore} from \"../data-stores/TokenDataStore.sol\";\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\nimport {IDSToken} from \"./IDSToken.sol\";\n\nabstract contract StandardToken is IDSToken, TokenDataStore, BaseDSContract {\n    event Pause();\n    event Unpause();\n\n    modifier whenNotPaused() {\n        require(!paused, \"Contract is paused\");\n        _;\n    }\n\n    modifier whenPaused() {\n        require(paused, \"Contract is not paused\");\n        _;\n    }\n\n    function __StandardToken_init() public onlyProxy onlyInitializing {\n        __BaseDSContract_init();\n    }\n\n    function pause() public onlyTransferAgentOrAbove whenNotPaused {\n        paused = true;\n        emit Pause();\n    }\n\n    function unpause() public onlyTransferAgentOrAbove whenPaused {\n        paused = false;\n        emit Unpause();\n    }\n\n    function isPaused() public view override returns (bool) {\n        return paused;\n    }\n\n    /**\n     * @dev Gets the balance of the specified address.\n     * @param _owner The address to query the the balance of.\n     * @return An uint256 representing the amount owned by the passed address.\n     */\n    function balanceOf(address _owner) public view returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n        uint256 shares = tokenData.walletsBalances[_owner];\n\n        uint256 tokens = rebasingProvider.convertSharesToTokens(shares);\n\n        return tokens;\n    }\n\n    function totalSupply() public view returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n\n        uint256 totalSupplyTokens = rebasingProvider.convertSharesToTokens(tokenData.totalSupply);\n\n        return totalSupplyTokens;\n    }\n\n    /**\n     * @dev transfer token for a specified address\n     * @param _to The address to transfer to.\n     * @param _value The amount to be transferred.\n     */\n    function transfer(address _to, uint256 _value) public virtual returns (bool) {\n        return transferImpl(msg.sender, _to, _value);\n    }\n\n    function transferFrom(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public virtual returns (bool) {\n        require(_value <= allowances[_from][msg.sender], \"Not enough allowance\");\n        allowances[_from][msg.sender] -= _value;\n        return transferImpl(_from, _to, _value);\n    }\n\n    function transferImpl(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal returns (bool) {\n        require(_to != address(0));\n        ISecuritizeRebasingProvider rebasingProvider = ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n\n        uint256 _shares = rebasingProvider.convertTokensToShares(_value);\n\n        require(_shares <= tokenData.walletsBalances[_from]);\n\n        tokenData.walletsBalances[_from] -= _shares;\n        tokenData.walletsBalances[_to] += _shares;\n\n        emit Transfer(_from, _to, _value);\n        emit TxShares(_from, _to, _shares, rebasingProvider.multiplier());\n        return true;\n    }\n\n    function approve(address _spender, uint256 _value) public returns (bool) {\n        allowances[msg.sender][_spender] = _value;\n        emit Approval(msg.sender, _spender, _value);\n        return true;\n    }\n\n    function allowance(address _owner, address _spender) public view returns (uint256) {\n        return allowances[_owner][_spender];\n    }\n\n    function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) {\n        allowances[msg.sender][_spender] = allowances[msg.sender][_spender] + _addedValue;\n        emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]);\n        return true;\n    }\n\n    function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {\n        uint256 oldValue = allowances[msg.sender][_spender];\n        if (_subtractedValue > oldValue) {\n            allowances[msg.sender][_spender] = 0;\n        } else {\n            allowances[msg.sender][_spender] = oldValue - _subtractedValue;\n        }\n        emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]);\n        return true;\n    }\n}\n"},"contracts/token/TokenLibrary.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {IDSLockManager} from \"../compliance/IDSLockManager.sol\";\nimport {IDSComplianceService} from \"../compliance/IDSComplianceService.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n\nlibrary TokenLibrary {\n    event Issue(address indexed to, uint256 value, uint256 valueLocked);\n\n    uint256 internal constant COMPLIANCE_SERVICE = 0;\n    uint256 internal constant REGISTRY_SERVICE = 1;\n    uint256 internal constant DEPRECATED_OMNIBUS_NO_ACTION = 0; // Deprecated, keep for backwards compatibility\n    uint256 internal constant DEPRECATED_OMNIBUS_DEPOSIT = 1; // Deprecated, keep for backwards compatibility\n    uint256 internal constant DEPRECATED_OMNIBUS_WITHDRAW = 2; // Deprecated, keep for backwards compatibility\n\n    struct TokenData {\n        mapping(address wallet => uint256 balance) walletsBalances;\n        mapping(string investor => uint256 balance) investorsBalances;\n        uint256 totalSupply;\n        uint256 totalIssued;\n    }\n\n    struct SupportedFeatures {\n        uint256 value;\n    }\n\n    struct IssueParams {\n        address _to;\n        uint256 _value;\n        uint256 _issuanceTime;\n        uint256[] _valuesLocked;\n        uint64[] _releaseTimes;\n        string _reason;\n        ISecuritizeRebasingProvider _rebasingProvider;\n    }\n\n    function setFeature(SupportedFeatures storage supportedFeatures, uint8 featureIndex, bool enable) public {\n        uint256 base = 2;\n        uint256 mask = base**featureIndex;\n\n        // Enable only if the feature is turned off and disable only if the feature is turned on\n        if (enable && (supportedFeatures.value & mask == 0)) {\n            supportedFeatures.value = supportedFeatures.value ^ mask;\n        } else if (!enable && (supportedFeatures.value & mask >= 1)) {\n            supportedFeatures.value = supportedFeatures.value ^ mask;\n        }\n    }\n\n    function issueTokensCustom(\n        TokenData storage _tokenData,\n        address[] memory _services,\n        IDSLockManager _lockManager,\n        IssueParams memory _params\n    ) public returns (uint256) {\n        //Check input values\n        require(_params._to != address(0), \"Invalid address\");\n        require(_params._value > 0, \"Value is zero\");\n        require(_params._valuesLocked.length == _params._releaseTimes.length, \"Wrong length of parameters\");\n\n        //Check issuance is allowed (and inform the compliance manager, possibly adding locks)\n        IDSComplianceService(_services[COMPLIANCE_SERVICE]).validateIssuance(_params._to, _params._value, _params._issuanceTime);\n\n        uint256 shares =  _params._rebasingProvider.convertTokensToShares(_params._value);\n\n        _tokenData.totalSupply += shares;\n        _tokenData.totalIssued += shares;\n        _tokenData.walletsBalances[_params._to] += shares;\n\n        updateInvestorBalance(_tokenData, IDSRegistryService(_services[REGISTRY_SERVICE]), _params._to, shares, CommonUtils.IncDec.Increase);\n\n        uint256 totalLocked = 0;\n        for (uint256 i = 0; i < _params._valuesLocked.length; i++) {\n            totalLocked += _params._valuesLocked[i];\n            _lockManager.addManualLockRecord(_params._to, _params._valuesLocked[i], _params._reason, _params._releaseTimes[i]);\n        }\n        require(totalLocked <= _params._value, \"valueLocked must be smaller than value\");\n        emit Issue(_params._to, _params._value, totalLocked);\n        return shares;\n    }\n\n    modifier validSeizeParameters(TokenData storage _tokenData, address _from, address _to, uint256 _shares) {\n        require(_from != address(0), \"Invalid address\");\n        require(_to != address(0), \"Invalid address\");\n        require(_shares <= _tokenData.walletsBalances[_from], \"Not enough balance\");\n\n        _;\n    }\n\n    function burn(\n        TokenData storage _tokenData,\n        address[] memory _services,\n        address _who,\n        uint256 _value,\n        ISecuritizeRebasingProvider _rebasingProvider\n    ) public returns (uint256) {\n        uint256 sharesToBurn = _rebasingProvider.convertTokensToShares(_value);\n\n        require(sharesToBurn <= _tokenData.walletsBalances[_who], \"Not enough balance\");\n        // no need to require value <= totalSupply, since that would imply the\n        // sender's balance is greater than the totalSupply, which *should* be an assertion failure\n\n        IDSComplianceService(_services[COMPLIANCE_SERVICE]).validateBurn(_who, _value);\n\n        _tokenData.walletsBalances[_who] -= sharesToBurn;\n        updateInvestorBalance(\n            _tokenData,\n            IDSRegistryService(_services[REGISTRY_SERVICE]),\n            _who,\n            sharesToBurn,\n            CommonUtils.IncDec.Decrease\n        );\n\n        _tokenData.totalSupply -= sharesToBurn;\n        return sharesToBurn;\n    }\n\n    function seize(\n        TokenData storage _tokenData,\n        address[] memory _services,\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _shares\n)\n    public\n    validSeizeParameters(_tokenData, _from, _to, _shares)\n    {\n        IDSRegistryService registryService = IDSRegistryService(_services[REGISTRY_SERVICE]);\n        IDSComplianceService(_services[COMPLIANCE_SERVICE]).validateSeize(_from, _to, _value);\n\n        _tokenData.walletsBalances[_from] -= _shares;\n        _tokenData.walletsBalances[_to] += _shares;\n        updateInvestorBalance(_tokenData, registryService, _from, _shares, CommonUtils.IncDec.Decrease);\n        updateInvestorBalance(_tokenData, registryService, _to, _shares, CommonUtils.IncDec.Increase);\n    }\n\n    function updateInvestorBalance(TokenData storage _tokenData, IDSRegistryService _registryService, address _wallet, uint256 _shares, CommonUtils.IncDec _increase) internal {\n        string memory investor = _registryService.getInvestor(_wallet);\n        if (!CommonUtils.isEmptyString(investor)) {\n            uint256 balance = _tokenData.investorsBalances[investor];\n            if (_increase == CommonUtils.IncDec.Increase) {\n                balance += _shares;\n            } else {\n                balance -= _shares;\n            }\n            _tokenData.investorsBalances[investor] = balance;\n        }\n    }\n}\n"},"contracts/trust/IDSTrustService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/**\n * @title IDSTrustService\n * @dev An interface for a trust service which allows role-based access control for other contracts.\n */\n\nabstract contract IDSTrustService {\n\n    function initialize() public virtual;\n\n    /**\n     * @dev Should be emitted when a role is set for a user.\n     */\n    event DSTrustServiceRoleAdded(address targetAddress, uint8 role, address sender);\n    /**\n     * @dev Should be emitted when a role is removed for a user.\n     */\n    event DSTrustServiceRoleRemoved(address targetAddress, uint8 role, address sender);\n\n    // Role constants\n    uint8 public constant NONE = 0;\n    uint8 public constant MASTER = 1;\n    uint8 public constant ISSUER = 2;\n    uint8 public constant EXCHANGE = 4;\n    uint8 public constant TRANSFER_AGENT = 8;\n\n    /**\n     * @dev Transfers the ownership (MASTER role) of the contract.\n     * @param _address The address which the ownership needs to be transferred to.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setServiceOwner(\n        address _address /*onlyMaster*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets a role for an array of wallets.\n     * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n     * @param _addresses The array of wallet whose role needs to be set.\n     * @param _roles The array of role to be set. The length and order must match with _addresses\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setRoles(address[] calldata _addresses, uint8[] calldata _roles) public virtual returns (bool);\n\n    /**\n     * @dev Sets a role for a wallet.\n     * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n     * @param _address The wallet whose role needs to be set.\n     * @param _role The role to be set.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setRole(\n        address _address,\n        uint8 _role /*onlyMasterOrIssuer*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Removes the role for a wallet.\n     * @dev Should not be used to remove MASTER (use setServiceOwner).\n     * @param _address The wallet whose role needs to be removed.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function removeRole(\n        address _address /*onlyMasterOrIssuer*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Gets the role for a wallet.\n     * @param _address The wallet whose role needs to be fetched.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function getRole(address _address) public view virtual returns (uint8);\n\n}\n"},"contracts/trust/TrustService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {IDSTrustService} from \"./IDSTrustService.sol\";\nimport {TrustServiceDataStore} from \"../data-stores/TrustServiceDataStore.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\n\n/**\n * @title TrustService\n * @dev A trust service which allows role-based access control for other contracts.\n * @dev Implements IDSTrustService.\n */\n\ncontract TrustService is IDSTrustService, TrustServiceDataStore, UUPSUpgradeable {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        owner = msg.sender;\n        roles[msg.sender] = MASTER;\n    }\n\n    /**\n     * @dev required by the OZ UUPS module\n     */\n    function _authorizeUpgrade(address) internal override onlyMaster {}\n\n    /**\n     * @dev returns proxy ERC1967 implementation address\n     */\n    function getImplementationAddress() external view returns (address) {\n        return ERC1967Utils.getImplementation();\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function getInitializedVersion() external view returns (uint64) {\n        return _getInitializedVersion();\n    }\n\n    /**\n   * @dev Allow invoking of functions only by the user who has the MASTER role.\n   */\n    modifier onlyMaster() {\n        require(roles[msg.sender] == MASTER, \"Not enough permissions\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking of functions only by the users who have the MASTER role or the ISSUER role.\n   */\n    modifier onlyMasterOrIssuer() {\n        require(roles[msg.sender] == MASTER || roles[msg.sender] == ISSUER, \"Not enough permissions\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking of functions only by the users who have the MASTER role or the ISSUER role or the TRANSFER AGENT role.\n   */\n    modifier onlyMasterOrIssuerOrTransferAgent() {\n        require(roles[msg.sender] == MASTER || roles[msg.sender] == ISSUER || roles[msg.sender] == TRANSFER_AGENT, \"Not enough permissions\");\n        _;\n    }\n\n    /**\n   * @dev Allow setting roles only by the user who has the same role.\n   */\n    modifier onlySameRole(uint8 _role) {\n        if (roles[msg.sender] != MASTER) {\n            if (roles[msg.sender] == ISSUER) {\n                require(_role == ISSUER || _role == EXCHANGE, \"Not enough permissions. Only same role allowed\");\n            } else {\n                require(roles[msg.sender] == _role, \"Not enough permissions. Only same role allowed\");\n            }\n        }\n        _;\n    }\n\n    /**\n   * @dev Allow setting roles only by the user who has the same role.\n   */\n    modifier onlySameRoleForAddress(address _address) {\n        if (roles[msg.sender] != MASTER) {\n            uint8 role = roles[_address];\n            if (roles[msg.sender] == ISSUER) {\n                require(role == ISSUER || role == EXCHANGE, \"Not enough permissions. Only same role allowed\");\n            } else {\n                require(roles[msg.sender] == role, \"Not enough permissions. Only same role allowed\");\n            }\n        }\n        _;\n    }\n\n\n    /**\n   * @dev Sets or removes a role for a wallet. (internal)\n   * @param _address The wallet whose role needs to be set or removed.\n   * @param _role The role to be set. NONE (0) indicates role removal.\n   */\n    function setRoleImpl(address _address, uint8 _role) internal {\n        uint8 old_role = roles[_address];\n\n        require(old_role == NONE || _role == NONE, \"No direct role-to-role change\");\n\n        roles[_address] = _role;\n\n        if (old_role == NONE) {\n            emit DSTrustServiceRoleAdded(_address, _role, msg.sender);\n        } else {\n            emit DSTrustServiceRoleRemoved(_address, old_role, msg.sender);\n        }\n    }\n\n    /**\n   * @dev Transfers the ownership (MASTER role) of the contract.\n   * @param _address The address which the ownership needs to be transferred to.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setServiceOwner(address _address) public override onlyMaster returns (bool) {\n        require(_address != address(0), \"Owner can not be zero address\");\n        setRoleImpl(owner, NONE);\n        owner = _address;\n        setRoleImpl(_address, MASTER);\n\n        return true;\n    }\n\n    /**\n   * @dev Sets roles to an array of wallets\n   * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n   * @param _addresses The array of wallet whose role needs to be set.\n   * @param _roles The array of role to be set. Length and order must match wit _addresss\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setRoles(address[] calldata _addresses, uint8[] calldata _roles) public override onlyMasterOrIssuerOrTransferAgent returns (bool) {\n        require(_addresses.length <= 30, \"Exceeded the maximum number of addresses\");\n        require(_addresses.length == _roles.length, \"Wrong length of parameters\");\n        for (uint8 i = 0; i < _addresses.length; i++) {\n            setRole(_addresses[i], _roles[i]);\n        }\n        return true;\n    }\n\n    /**\n   * @dev Sets a role for a wallet.\n   * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n   * @param _address The wallet whose role needs to be set.\n   * @param _role The role to be set.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setRole(address _address, uint8 _role) public override onlyMasterOrIssuerOrTransferAgent onlySameRole(_role) returns (bool) {\n        require(_role == ISSUER || _role == EXCHANGE || _role == TRANSFER_AGENT, \"Invalid target role\");\n\n        setRoleImpl(_address, _role);\n\n        return true;\n    }\n\n    /**\n   * @dev Removes the role for a wallet.\n   * @dev Should not be used to remove MASTER (use setServiceOwner).\n   * @param _address The wallet whose role needs to be removed.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function removeRole(address _address) public override onlyMasterOrIssuerOrTransferAgent onlySameRoleForAddress(_address) returns (bool) {\n        uint8 role = roles[_address];\n        require(role != MASTER, \"Cannot remove master\");\n\n        setRoleImpl(_address, NONE);\n\n        return true;\n    }\n\n    /**\n   * @dev Gets the role for a wallet.\n   * @param _address The wallet whose role needs to be fetched.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function getRole(address _address) public view override returns (uint8) {\n        return roles[_address];\n    }\n\n}\n"},"contracts/utils/BaseDSContract.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumer} from \"../service/ServiceConsumer.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\n\nabstract contract BaseDSContract is UUPSUpgradeable, ServiceConsumer {\n\n    function __BaseDSContract_init() public onlyProxy onlyInitializing {\n        __UUPSUpgradeable_init();\n        __ServiceConsumer_init();\n    }\n\n    /**\n     * @dev required by the OZ UUPS module\n     */\n    function _authorizeUpgrade(address) internal override onlyMaster {}\n\n    /**\n     * @dev returns proxy ERC1967 implementation address\n     */\n    function getImplementationAddress() external view returns (address) {\n        return ERC1967Utils.getImplementation();\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function getInitializedVersion() external view returns (uint64) {\n        return _getInitializedVersion();\n    }\n\n}\n"},"contracts/utils/BulkBalanceChecker.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract BulkBalanceChecker {\n    /**\n     * @notice Returns the ERC20 token balance for a list of wallets\n     * @param token The address of the ERC20 token contract\n     * @param wallets The list of wallet addresses to check\n     * @return balances The list of balances corresponding to each wallet\n     */\n    function getTokenBalances(address token, address[] calldata wallets)\n        external\n        view\n        returns (uint256[] memory balances)\n    {\n        balances = new uint256[](wallets.length);\n        IERC20 erc20 = IERC20(token);\n\n        for (uint256 i = 0; i < wallets.length; i++) {\n            balances[i] = erc20.balanceOf(wallets[i]);\n        }\n    }\n}\n"},"contracts/utils/CommonUtils.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nlibrary CommonUtils {\n  enum IncDec { Increase, Decrease }\n\n  function encodeString(string memory _str) internal pure returns (bytes32) {\n    return keccak256(abi.encodePacked(_str));\n  }\n\n  function isEqualString(string memory _str1, string memory _str2) internal pure returns (bool) {\n    return encodeString(_str1) == encodeString(_str2);\n  }\n\n  function isEmptyString(string memory _str) internal pure returns (bool) {\n    return bytes(_str).length == 0;\n  }\n}\n"},"contracts/utils/TransactionRelayer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport { BaseDSContract } from \"./BaseDSContract.sol\";\nimport { CommonUtils } from \"./CommonUtils.sol\";\nimport { EIP712Upgradeable } from \"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/**\n @dev Based on SimpleWallet (https://github.com/christianlundkvist/simple-multisig) and uses EIP-712 standard validate a signature\n*/\n\ncontract TransactionRelayer is BaseDSContract, EIP712Upgradeable {\n    using Address for address;\n\n    string public constant NAME = \"TransactionRelayer\";\n\n    // keccak256(\"ExecutePreApprovedTransaction(address destination,bytes32 data,uint256 nonce,bytes32 senderInvestor,uint256 blockLimit)\")\n    bytes32 public constant TXTYPE_HASH = 0x103eaa9a7f02c07fe1be89fcbaf6f0591b7ee351d8bef38fb2e3e71ce08a26c0;\n\n    string public constant CONTRACT_VERSION = \"5\";\n\n    mapping(bytes32 investorHash => uint256 nonce) internal noncePerInvestor;\n\n    event InvestorNonceUpdated(string investorId, uint256 newNonce);\n    struct ExecutePreApprovedTransaction {\n        address destination;\n        bytes data;\n        string senderInvestor;\n        uint256 nonce;\n        uint256 blockLimit;\n    }\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public onlyProxy initializer {\n        __BaseDSContract_init();\n        __EIP712_init(NAME, CONTRACT_VERSION);\n    }\n\n    // Note that address recovered from signatures must be strictly increasing, in order to prevent duplicates\n    function execute(\n        uint8 /*sigV*/,\n        bytes32 /*sigR*/,\n        bytes32 /*sigS*/,\n        address /*destination*/,\n        uint256 /*value*/,\n        bytes memory /*data*/,\n        address /*executor*/,\n        uint256 /*gasLimit*/\n    ) public pure {\n        require(false, \"not implemented\");\n    }\n\n    // Note that address recovered from signatures must be strictly increasing, in order to prevent duplicates\n    function executeByInvestor(\n        uint8 /*sigV*/,\n        bytes32 /*sigR*/,\n        bytes32 /*sigS*/,\n        string memory /*senderInvestor*/,\n        address /*destination*/,\n        uint256 /*value*/,\n        bytes memory /*data*/,\n        address /*executor*/,\n        uint256 /*gasLimit*/\n    ) public pure {\n        require(false, \"not implemented\");\n    }\n\n    /**\n     * @dev Legacy entrypoint kept for ABI compatibility.\n     */\n    function executeByInvestorWithBlockLimit(\n        uint8 /*sigV*/,\n        bytes32 /*sigR*/,\n        bytes32 /*sigS*/,\n        string memory /*senderInvestor*/,\n        address /*destination*/,\n        address /*executor*/,\n        bytes memory /*data*/,\n        uint256[] memory /*params*/\n    ) public pure {\n        require(false, \"not implemented\");\n    }\n\n    /**\n     * @dev Validates una firma EIP-712 y ejecuta la transacción preaprobada.\n     * @param signature Firma compacta de 65 bytes.\n     * @param txData Datos firmados y metadatos necesarios para ejecutar la llamada.\n     */\n    function executePreApprovedTransaction(\n        bytes memory signature,\n        ExecutePreApprovedTransaction calldata txData\n    ) public {\n        require(txData.blockLimit >= block.number, \"Transaction too old\");\n        _executePreApprovedTransaction(signature, txData);\n    }\n\n\n    function nonceByInvestor(string memory investorId) public view returns (uint256) {\n        return noncePerInvestor[CommonUtils.encodeString(investorId)];\n    }\n    /**\n     * @dev Legacy entrypoint kept for ABI compatibility.\n     */\n    function updateDomainSeparator(uint256) public pure {\n        revert(\"not implemented\");\n    }\n\n    function setInvestorNonce(string memory investorId, uint256 newNonce) public onlyMaster {\n        bytes32 investorKey = CommonUtils.encodeString(investorId);\n        uint256 investorNonce = noncePerInvestor[investorKey];\n        require(newNonce > investorNonce, \"New nonce should be greater than old\");\n        noncePerInvestor[investorKey] = newNonce;\n        emit InvestorNonceUpdated(investorId, newNonce);\n    }\n\n    function _executePreApprovedTransaction(\n        bytes memory signature,\n        ExecutePreApprovedTransaction calldata txData\n    ) private {\n        bytes32 investorKey = CommonUtils.encodeString(txData.senderInvestor);\n        uint256 currentNonce = noncePerInvestor[investorKey];\n\n        require(txData.nonce == currentNonce, \"Invalid nonce\");\n\n        bytes32 digest = _hashTx(txData);\n        address recovered = ECDSA.recover(digest, signature);\n        uint256 approverRole = getTrustService().getRole(recovered);\n        require(approverRole == ROLE_ISSUER || approverRole == ROLE_MASTER, 'Invalid signature');\n\n        noncePerInvestor[investorKey] = currentNonce + 1;\n        Address.functionCall(txData.destination, txData.data);\n    }\n\n    /// @dev Computes the digest to sign (EIP-712)\n    function _hashTx(ExecutePreApprovedTransaction calldata txData) private view returns (bytes32) {\n        bytes32 dataHash = keccak256(txData.data);\n        bytes32 senderInvestorHash = keccak256(bytes(txData.senderInvestor));\n        bytes32 structHash = keccak256(\n            abi.encode(\n                TXTYPE_HASH,\n                txData.destination,\n                dataHash,\n                txData.nonce,\n                senderInvestorHash,\n                txData.blockLimit\n            )\n        );\n\n        return _hashTypedDataV4(structHash);\n    }\n}\n"}},"compilation":{"language":"Solidity","compiler":"solc","compilerVersion":"0.8.22+commit.4fc1097e","compilerSettings":{"optimizer":{"runs":200,"enabled":true},"evmVersion":"paris"},"name":"TokenLibrary","fullyQualifiedName":"contracts/token/TokenLibrary.sol:TokenLibrary"},"abi":[{"name":"Issue","type":"event","inputs":[{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"valueLocked","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false}],"metadata":{"compiler":{"version":"0.8.22+commit.4fc1097e"},"language":"Solidity","output":{"abi":[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"valueLocked","type":"uint256"}],"name":"Issue","type":"event"}],"devdoc":{"kind":"dev","methods":{},"version":1},"userdoc":{"kind":"user","methods":{},"version":1}},"settings":{"compilationTarget":{"contracts/token/TokenLibrary.sol":"TokenLibrary"},"evmVersion":"paris","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[]},"sources":{"contracts/compliance/IDSComplianceService.sol":{"keccak256":"0x7ec87e6c3d9dbd0543c9a4ed311fc7f28d0f255085f354e2e66e0f59a925933d","license":"Apache-2.0","urls":["bzz-raw://eff19340b27ec907ca36db46c3b87188d8262319b9fcaa6a13c5aeb4cb7a9ac9","dweb:/ipfs/QmYn4D2sNMwUh1L2qptXvpYVpwJoZbjfwnSVWAHEAhpU8a"]},"contracts/compliance/IDSLockManager.sol":{"keccak256":"0xb64ef40c572a0336f239b37dfc37a0c000aa5a95ed13e59e4ad93a98906b5ad5","license":"Apache-2.0","urls":["bzz-raw://a116afade793478786678d28a69102801e3b24cde5f4907bbd88d6f525471d38","dweb:/ipfs/QmXmmMayfswQBQ81yZFjVzZvbmf88sK5i9L3PoEXWYMeaF"]},"contracts/rebasing/ISecuritizeRebasingProvider.sol":{"keccak256":"0x01beb0ca06b9c6d9509da8ff68ccaa6cdfe105110cec23f36ad5791241170d15","license":"Apache-2.0","urls":["bzz-raw://25405ad76355dbe489d1c6ec903ccc955f061fb07ac4e12ab61332ec3c1c121c","dweb:/ipfs/QmPQq8D6VQXhxqA2zgcHbK9hABZL1c13wdid4yffBotZ88"]},"contracts/registry/IDSRegistryService.sol":{"keccak256":"0x31818dbfd6d1a10a5be4ef4add1228a71a9a3529f313e431259ce143be51ebcb","license":"Apache-2.0","urls":["bzz-raw://573381bf8fb270e236c717a061a02873035cc29d9eb7437e476d792c5586a2d0","dweb:/ipfs/QmcB8RSwBZAEryTGMw4RtBgsuCi9V63tDZTXjXEuiVKBQ3"]},"contracts/token/TokenLibrary.sol":{"keccak256":"0x7d015fc4babdb22d776c94818df542294db14b69a75f8298a3b3cec123935c80","license":"Apache-2.0","urls":["bzz-raw://f39ee595db95e4ad92c426e70cdc8c2ead302a2e5bcc0697fb1473277f6b586f","dweb:/ipfs/QmbELcaRsaum6ZfyRRoFifzjfUm3GrFjqLiaMHXSSgNDUu"]},"contracts/utils/CommonUtils.sol":{"keccak256":"0xb4e8316d25f76902ccd344f8336e22a15da939547b681a1193d6072a58ce9308","license":"Apache-2.0","urls":["bzz-raw://7aacf875230d1333848d63f73ddecf4d3fc8cc854f57ff842c836daf992e77bc","dweb:/ipfs/QmXPhogwSYwELQ7DowjTJjpXX4AqGiLUX8REtQ4F7av7YY"]}},"version":1},"storageLayout":{"types":null,"storage":[]},"transientStorageLayout":null,"userdoc":{"kind":"user","methods":{},"version":1},"devdoc":{"kind":"dev","methods":{},"version":1},"sourceIds":{"contracts/token/DSToken.sol":{"id":69},"contracts/token/IDSToken.sol":{"id":70},"contracts/mocks/TestCalls.sol":{"id":56},"contracts/mocks/TestToken.sol":{"id":57},"contracts/mocks/TokenERC20.sol":{"id":58},"contracts/bulk/BulkOperator.sol":{"id":27},"contracts/utils/CommonUtils.sol":{"id":77},"contracts/bulk/IBulkOperator.sol":{"id":28},"contracts/token/TokenLibrary.sol":{"id":72},"contracts/trust/TrustService.sol":{"id":74},"contracts/token/StandardToken.sol":{"id":71},"contracts/issuance/TokenIssuer.sol":{"id":51},"contracts/utils/BaseDSContract.sol":{"id":75},"contracts/trust/IDSTrustService.sol":{"id":73},"contracts/issuance/IDSTokenIssuer.sol":{"id":50},"contracts/mocks/StandardTokenMock.sol":{"id":55},"contracts/service/ServiceConsumer.sol":{"id":68},"contracts/compliance/WalletManager.sol":{"id":39},"contracts/rebasing/RebasingLibrary.sol":{"id":61},"contracts/registry/RegistryService.sol":{"id":65},"contracts/registry/WalletRegistrar.sol":{"id":66},"contracts/utils/BulkBalanceChecker.sol":{"id":76},"contracts/utils/TransactionRelayer.sol":{"id":78},"@openzeppelin/contracts/utils/Panic.sol":{"id":19},"contracts/compliance/IDSLockManager.sol":{"id":35},"contracts/mocks/RebasingLibraryMock.sol":{"id":53},"@openzeppelin/contracts/utils/Errors.sol":{"id":18},"contracts/data-stores/TokenDataStore.sol":{"id":47},"contracts/nav/ISecuritizeNavProvider.sol":{"id":59},"contracts/service/IDSServiceConsumer.sol":{"id":67},"@openzeppelin/contracts/utils/Address.sol":{"id":16},"@openzeppelin/contracts/utils/Context.sol":{"id":17},"@openzeppelin/contracts/utils/Strings.sol":{"id":21},"contracts/compliance/IDSWalletManager.sol":{"id":36},"contracts/registry/IDSRegistryService.sol":{"id":63},"contracts/registry/IDSWalletRegistrar.sol":{"id":64},"contracts/compliance/ComplianceService.sol":{"id":30},"@openzeppelin/contracts/utils/math/Math.sol":{"id":24},"contracts/compliance/InvestorLockManager.sol":{"id":37},"@openzeppelin/contracts/interfaces/IERC20.sol":{"id":7},"@openzeppelin/contracts/token/ERC20/ERC20.sol":{"id":13},"@openzeppelin/contracts/utils/StorageSlot.sol":{"id":20},"contracts/compliance/IDSComplianceService.sol":{"id":34},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"id":14},"contracts/data-stores/LockManagerDataStore.sol":{"id":44},"@openzeppelin/contracts/interfaces/IERC1967.sol":{"id":6},"@openzeppelin/contracts/interfaces/IERC5267.sol":{"id":8},"@openzeppelin/contracts/utils/math/SafeCast.sol":{"id":25},"contracts/data-stores/TrustServiceDataStore.sol":{"id":48},"@openzeppelin/contracts/proxy/beacon/IBeacon.sol":{"id":12},"contracts/compliance/InvestorLockManagerBase.sol":{"id":38},"contracts/data-stores/WalletManagerDataStore.sol":{"id":49},"@openzeppelin/contracts/utils/math/SignedMath.sol":{"id":26},"contracts/rebasing/SecuritizeRebasingProvider.sol":{"id":62},"contracts/data-stores/BaseLockManagerDataStore.sol":{"id":40},"contracts/data-stores/RegistryServiceDataStore.sol":{"id":45},"contracts/data-stores/ServiceConsumerDataStore.sol":{"id":46},"contracts/mocks/ComplianceServiceRegulatedMock.sol":{"id":52},"contracts/rebasing/ISecuritizeRebasingProvider.sol":{"id":60},"contracts/compliance/ComplianceServiceRegulated.sol":{"id":31},"@openzeppelin/contracts/utils/cryptography/ECDSA.sol":{"id":22},"contracts/data-stores/ComplianceServiceDataStore.sol":{"id":42},"@openzeppelin/contracts/interfaces/draft-IERC1822.sol":{"id":9},"@openzeppelin/contracts/interfaces/draft-IERC6093.sol":{"id":10},"contracts/compliance/ComplianceServiceWhitelisted.sol":{"id":32},"contracts/mocks/SecuritizeInternalNavProviderMock.sol":{"id":54},"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol":{"id":11},"contracts/data-stores/InvestorLockManagerDataStore.sol":{"id":43},"contracts/compliance/ComplianceConfigurationService.sol":{"id":29},"contracts/compliance/IDSComplianceConfigurationService.sol":{"id":33},"contracts/data-stores/ComplianceConfigurationDataStore.sol":{"id":41},"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol":{"id":23},"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"id":3},"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"id":0},"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"id":1},"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol":{"id":4},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{"id":15},"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol":{"id":2},"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol":{"id":5}},"additionalInput":null,"stdJsonInput":{"sources":{"contracts/token/DSToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSToken} from \"./IDSToken.sol\";\nimport {StandardToken} from \"./StandardToken.sol\";\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\nimport {TokenLibrary} from \"./TokenLibrary.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\ncontract DSToken is StandardToken {\n    // using FeaturesLibrary for SupportedFeatures;\n    using TokenLibrary for TokenLibrary.SupportedFeatures;\n    uint256 internal constant DEPRECATED_OMNIBUS_NO_ACTION = 0;  // Deprecated, kept for backward compatibility\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(\n        string calldata _name,\n        string calldata _symbol,\n        uint8 _decimals\n        ) public virtual override onlyProxy initializer {\n        __StandardToken_init();\n\n        name = _name;\n        symbol = _symbol;\n        decimals = _decimals;\n    }\n\n    /******************************\n       TOKEN CONFIGURATION\n   *******************************/\n\n    function setFeature(uint8 featureIndex, bool enable) public onlyMaster {\n        supportedFeatures.setFeature(featureIndex, enable);\n    }\n\n    function setFeatures(uint256 features) public onlyMaster {\n        supportedFeatures.value = features;\n    }\n\n    function totalIssued() public view returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        uint256 tokens = rebasingProvider.convertSharesToTokens(tokenData.totalIssued);\n        return tokens;\n    }\n\n    /******************************\n       TOKEN ISSUANCE (MINTING)\n   *******************************/\n\n    /**\n     * @dev Issues unlocked tokens\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @return true if successful\n     */\n    function issueTokens(\n        address _to,\n        uint256 _value /*onlyIssuerOrAbove*/\n    ) public override returns (bool) {\n        issueTokensCustom(_to, _value, block.timestamp, 0, \"\", 0);\n        return true;\n    }\n\n    /**\n     * @notice Issues tokens with optional locking parameters\n     * @dev Issues tokens to an address with custom issuance time and optional single lock\n     * @param _to The address which will receive the newly issued tokens\n     * @param _value The amount of tokens to issue\n     * @param _issuanceTime The timestamp when tokens are considered issued\n     * @param _valueLocked The amount of tokens to be locked (0 for no lock)\n     * @param _reason The reason for token issuance\n     * @param _releaseTime The timestamp when locked tokens will be released\n     * @return bool Returns true if successful\n     */\n    function issueTokensCustom(address _to, uint256 _value, uint256 _issuanceTime, uint256 _valueLocked, string memory _reason, uint64 _releaseTime)\n    public\n    virtual\n    override\n    returns (\n    /*onlyIssuerOrAbove*/\n        bool\n    )\n    {\n        uint256[] memory valuesLocked;\n        uint64[] memory releaseTimes;\n        if (_valueLocked > 0) {\n            valuesLocked = new uint256[](1);\n            releaseTimes = new uint64[](1);\n            valuesLocked[0] = _valueLocked;\n            releaseTimes[0] = _releaseTime;\n        }\n\n        issueTokensWithMultipleLocks(_to, _value, _issuanceTime, valuesLocked, _reason, releaseTimes);\n        return true;\n    }\n\n    function issueTokensWithMultipleLocks(address _to, uint256 _value, uint256 _issuanceTime, uint256[] memory _valuesLocked, string memory _reason, uint64[] memory _releaseTimes)\n    public\n    virtual\n    override\n    onlyIssuerOrAbove\n    returns (bool)\n    {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        TokenLibrary.IssueParams memory params = TokenLibrary.IssueParams({\n            _to: _to,\n            _value: _value,\n            _issuanceTime: _issuanceTime,\n            _valuesLocked: _valuesLocked,\n            _releaseTimes: _releaseTimes,\n            _reason: _reason,\n            _rebasingProvider: rebasingProvider\n        });\n        uint256 shares = TokenLibrary.issueTokensCustom(\n            tokenData,\n            getCommonServices(),\n            getLockManager(),\n            params\n            );\n\n        emit Transfer(address(0), _to, _value);\n        emit TxShares(address(0), _to, shares, rebasingProvider.multiplier());\n\n        checkWalletsForList(address(0), _to);\n        return true;\n    }\n\n    //*********************\n    // TOKEN BURNING\n    //*********************\n\n    function burn(address _who, uint256 _value, string calldata _reason) public virtual override onlyIssuerOrTransferAgentOrAbove {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        uint256 shares = TokenLibrary.burn(tokenData, getCommonServices(), _who, _value, rebasingProvider);\n        emit Burn(_who, _value, _reason);\n        emit Transfer(_who, address(0), _value);\n        emit TxShares(_who, address(0), shares, rebasingProvider.multiplier());\n        checkWalletsForList(_who, address(0));\n    }\n\n    //*********************\n    // TOKEN SEIZING\n    //*********************\n\n    function seize(address _from, address _to, uint256 _value, string calldata _reason) public virtual override onlyTransferAgentOrAbove {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n        uint256 shares = rebasingProvider.convertTokensToShares(_value);\n\n        TokenLibrary.seize(tokenData, getCommonServices(), _from, _to, _value, shares);\n\n        emit Seize(_from, _to, _value, _reason);\n        emit Transfer(_from, _to, _value);\n        emit TxShares(_from, _to, shares, rebasingProvider.multiplier());\n        checkWalletsForList(_from, _to);\n    }\n\n    //*********************\n    // TRANSFER RESTRICTIONS\n    //*********************\n\n    /**\n     * @dev Checks whether it can transfer with the compliance manager, if not -throws.\n     */\n    modifier canTransfer(address _sender, address _receiver, uint256 _value) {\n        getComplianceService().validateTransfer(_sender, _receiver, _value, paused, super.balanceOf(_sender));\n        _;\n    }\n\n    /**\n     * @dev override for transfer with modifiers:\n     * whether the token is not paused (checked in super class)\n     * and that the sender is allowed to transfer tokens\n     * @param _to The address that will receive the tokens.\n     * @param _value The amount of tokens to be transferred.\n     */\n    function transfer(address _to, uint256 _value) public virtual override canTransfer(msg.sender, _to, _value) returns (bool) {\n        return postTransferImpl(super.transfer(_to, _value), msg.sender, _to, _value);\n    }\n\n    /**\n     * @dev override for transfer with modifiers:\n     * whether the token is not paused (checked in super class)\n     * and that the sender is allowed to transfer tokens\n     * @param _from The address that will send the tokens.\n     * @param _to The address that will receive the tokens.\n     * @param _value The amount of tokens to be transferred.\n     */\n    function transferFrom(address _from, address _to, uint256 _value) public virtual override canTransfer(_from, _to, _value) returns (bool) {\n        return postTransferImpl(super.transferFrom(_from, _to, _value), _from, _to, _value);\n    }\n\n    function postTransferImpl(bool _superResult, address _from, address _to, uint256 _value) internal returns (bool) {\n        if (_superResult) {\n            updateInvestorsBalancesOnTransfer(_from, _to, _value);\n        }\n\n        checkWalletsForList(_from, _to);\n\n        return _superResult;\n    }\n\n    //*********************\n    // WALLET ENUMERATION\n    //****\n\n    function getWalletAt(uint256 _index) public view override returns (address) {\n        require(_index > 0 && _index <= walletsCount);\n        return walletsList[_index];\n    }\n\n    function walletCount() public view override returns (uint256) {\n        return walletsCount;\n    }\n\n    function checkWalletsForList(address _from, address _to) private {\n        if (super.balanceOf(_from) == 0) {\n            removeWalletFromList(_from);\n        }\n        if (super.balanceOf(_to) > 0) {\n            addWalletToList(_to);\n        }\n    }\n\n    function addWalletToList(address _address) private {\n        //Check if it's already there\n        uint256 existingIndex = walletsToIndexes[_address];\n        if (existingIndex == 0) {\n            //If not - add it\n            uint256 index = walletsCount + 1;\n            walletsList[index] = _address;\n            walletsToIndexes[_address] = index;\n            walletsCount = index;\n        }\n    }\n\n    function removeWalletFromList(address _address) private {\n        //Make sure it's there\n        uint256 existingIndex = walletsToIndexes[_address];\n        if (existingIndex != 0) {\n            uint256 lastIndex = walletsCount;\n            if (lastIndex != existingIndex) {\n                //Put the last wallet instead of it (this will work even with 1 wallet in the list)\n                address lastWalletAddress = walletsList[lastIndex];\n                walletsList[existingIndex] = lastWalletAddress;\n                walletsToIndexes[lastWalletAddress] = existingIndex;\n            }\n\n            delete walletsToIndexes[_address];\n            delete walletsList[lastIndex];\n            walletsCount = lastIndex - 1;\n        }\n    }\n\n    //**************************************\n    // MISCELLANEOUS FUNCTIONS\n    //**************************************\n\n    function balanceOfInvestor(string memory _id) public view override returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n\n        uint256 tokens = rebasingProvider.convertSharesToTokens(tokenData.investorsBalances[_id]);\n\n        return tokens;\n    }\n\n\n    function updateInvestorsBalancesOnTransfer(address _from, address _to, uint256 _value) internal {\n        updateInvestorBalance(_from, _value, CommonUtils.IncDec.Decrease);\n        updateInvestorBalance(_to, _value, CommonUtils.IncDec.Increase);\n    }\n\n    function updateInvestorBalance(address _wallet, uint256 _value, CommonUtils.IncDec _increase) internal override {\n        string memory investor = getRegistryService().getInvestor(_wallet);\n        if (!CommonUtils.isEmptyString(investor)) {\n            uint256 balance = balanceOfInvestor(investor);\n            if (_increase == CommonUtils.IncDec.Increase) {\n                balance += _value;\n            } else {\n                balance -= _value;\n            }\n\n            ISecuritizeRebasingProvider rebasingProvider = getRebasingProvider();\n\n            uint256 sharesBalance = rebasingProvider.convertTokensToShares(balance);\n\n            tokenData.investorsBalances[investor] = sharesBalance;\n        }\n    }\n\n    function preTransferCheck(address _from, address _to, uint256 _value) public view override returns (uint256 code, string memory reason) {\n        return getComplianceService().preTransferCheck(_from, _to, _value);\n    }\n\n    function getCommonServices() internal view returns (address[] memory) {\n        address[] memory services = new address[](2);\n        services[0] = getDSService(COMPLIANCE_SERVICE);\n        services[1] = getDSService(REGISTRY_SERVICE);\n        return services;\n    }\n}\n"},"contracts/token/IDSToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IERC20} from \"@openzeppelin/contracts/interfaces/IERC20.sol\";\nimport {Initializable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\nabstract contract IDSToken is IERC20, Initializable {\n    event Issue(address indexed to, uint256 value, uint256 valueLocked);\n    event TxShares(address indexed from, address indexed to, uint256 shares, uint256 multiplier);\n    event Burn(address indexed burner, uint256 value, string reason);\n    event Seize(address indexed from, address indexed to, uint256 value, string reason);\n\n    event WalletAdded(address wallet);\n    event WalletRemoved(address wallet);\n\n    function initialize(string calldata _name, string calldata _symbol, uint8 _decimals) public virtual;\n\n    /******************************\n       TOKEN ISSUANCE (MINTING)\n   *******************************/\n\n    /**\n     * @dev Issues unlocked tokens\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @return true if successful\n     */\n    function issueTokens(\n        address _to,\n        uint256 _value /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Issuing tokens from the fund\n     * @param _to address The address which is going to receive the newly issued tokens\n     * @param _value uint256 the value of tokens to issue\n     * @param _valueLocked uint256 value of tokens, from those issued, to lock immediately.\n     * @param _reason reason for token locking\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * @return true if successful\n     */\n    function issueTokensCustom(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime,\n        uint256 _valueLocked,\n        string memory _reason,\n        uint64 _releaseTime /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function issueTokensWithMultipleLocks(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime,\n        uint256[] memory _valuesLocked,\n        string memory _reason,\n        uint64[] memory _releaseTimes /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    //*********************\n    // TOKEN BURNING\n    //*********************\n\n    function burn(\n        address _who,\n        uint256 _value,\n        string calldata _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    //*********************\n    // TOKEN SIEZING\n    //*********************\n\n    function seize(\n        address _from,\n        address _to,\n        uint256 _value,\n        string calldata _reason /*onlyIssuerOrAbove*/\n    ) public virtual;\n\n    //*********************\n    // WALLET ENUMERATION\n    //*********************\n\n    function getWalletAt(uint256 _index) public view virtual returns (address);\n\n    function walletCount() public view virtual returns (uint256);\n\n    //**************************************\n    // MISCELLANEOUS FUNCTIONS\n    //**************************************\n    function isPaused() public view virtual returns (bool);\n\n    function balanceOfInvestor(string memory _id) public view virtual returns (uint256);\n\n    function updateInvestorBalance(address _wallet, uint256 _value, CommonUtils.IncDec _increase) internal virtual;\n\n    function preTransferCheck(address _from, address _to, uint256 _value) public view virtual returns (uint256 code, string memory reason);\n\n}\n"},"contracts/mocks/TestCalls.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/// @title Contract for testing low-level calls issued from the multisig wallet\ncontract TestCalls {\n    // msg.data.length of the latest call to \"receive\" methods\n    uint256 public lastMsgDataLength;\n\n    // msg.value of the latest call to \"receive\" methods\n    uint256 public lastMsgValue;\n\n    uint256 public uint1;\n    uint256 public uint2;\n    bytes public byteArray1;\n\n    modifier setMsgFields {\n        lastMsgDataLength = msg.data.length;\n        lastMsgValue = msg.value;\n        _;\n    }\n\n    constructor() payable setMsgFields() {\n        // This constructor will be used to test the creation via multisig wallet\n    }\n\n    function receive1uint(uint256 a) public payable setMsgFields {\n        uint1 = a;\n    }\n\n    function receive2uints(uint256 a, uint256 b) public payable setMsgFields {\n        uint1 = a;\n        uint2 = b;\n    }\n\n    function receive1bytes(bytes memory c) public payable setMsgFields {\n        byteArray1 = c;\n    }\n\n    function nonPayable() public payable setMsgFields {}\n\n}\n"},"contracts/mocks/TestToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/// @title Test token contract - Allows testing of token transfers with multisig wallet.\ncontract TestToken {\n    /*\n     *  Events\n     */\n    event Transfer(address indexed from, address indexed to, uint256 value);\n    event Approval(address indexed owner, address indexed spender, uint256 value);\n\n    /*\n     *  Constants\n     */\n    string public constant name = \"Test Token\";\n    string public constant symbol = \"TT\";\n    uint8 public constant decimals = 1;\n\n    /*\n     *  Storage\n     */\n    mapping(address owner => uint256 balance) balances;\n    mapping(address owner => mapping(address spender => uint256 allowance)) allowed;\n    uint256 public totalSupply;\n\n    /*\n     * Public functions\n     */\n    /// @dev Issues new tokens.\n    /// @param _to Address of token receiver.\n    /// @param _value Number of tokens to issue.\n    function issueTokens(address _to, uint256 _value) public {\n        balances[_to] += _value;\n        totalSupply += _value;\n    }\n\n    /*\n     * This modifier is present in some real world token contracts, and due to a solidity\n     * bug it was not compatible with multisig wallets\n     */\n    modifier onlyPayloadSize(uint256 size) {\n        require(msg.data.length == size + 4, \"Payload size error\");\n        _;\n    }\n\n    /// @dev Transfers sender's tokens to a given address. Returns success.\n    /// @param _to Address of token receiver.\n    /// @param _value Number of tokens to transfer.\n    /// @return success Returns success of function call.\n    function transfer(address _to, uint256 _value) public onlyPayloadSize(2 * 32) returns (bool success) {\n        require(balances[msg.sender] >= _value, \"Insufficient balance\");\n        balances[msg.sender] -= _value;\n        balances[_to] += _value;\n        emit Transfer(msg.sender, _to, _value);\n        return true;\n    }\n\n    /// @dev Allows allowed third party to transfer tokens from one address to another. Returns success.\n    /// @param _from Address from where tokens are withdrawn.\n    /// @param _to Address to where tokens are sent.\n    /// @param _value Number of tokens to transfer.\n    /// @return success Returns success of function call.\n    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {\n        require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value, \"Insufficient balance or allowance issue\");\n        balances[_to] += _value;\n        balances[_from] -= _value;\n        allowed[_from][msg.sender] -= _value;\n        emit Transfer(_from, _to, _value);\n        return true;\n    }\n\n    /// @dev Sets approved amount of tokens for spender. Returns success.\n    /// @param _spender Address of allowed account.\n    /// @param _value Number of approved tokens.\n    /// @return success Returns success of function call.\n    function approve(address _spender, uint256 _value) public returns (bool success) {\n        allowed[msg.sender][_spender] = _value;\n        emit Approval(msg.sender, _spender, _value);\n        return true;\n    }\n\n    /// @dev Returns number of allowed tokens for given address.\n    /// @param _owner Address of token owner.\n    /// @param _spender Address of token spender.\n    /// @return remaining Returns remaining allowance for spender.\n    function allowance(address _owner, address _spender) public view returns (uint256 remaining) {\n        return allowed[_owner][_spender];\n    }\n\n    /// @dev Returns number of tokens owned by given address.\n    /// @param _owner Address of token owner.\n    /// @return balance Returns balance of owner.\n    function balanceOf(address _owner) public view returns (uint256 balance) {\n        return balances[_owner];\n    }\n}\n"},"contracts/mocks/TokenERC20.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ERC20} from \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\n\ncontract TokenERC20 is ERC20 {\n    uint8 private tokenDecimals;\n    /**\n     * @dev Constructor that gives msg.sender all of existing tokens.\n     */\n    constructor(\n        string memory _name,\n        string memory _symbol,\n        uint256 _initialSupply,\n        uint8 _decimals\n    ) ERC20(_name, _symbol) {\n        tokenDecimals = _decimals;\n        _mint(msg.sender, _initialSupply);\n    }\n\n    function decimals() public view virtual override returns (uint8) {\n        return tokenDecimals;\n    }\n}\n\n\n"},"contracts/bulk/BulkOperator.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IBulkOperator} from \"./IBulkOperator.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\nimport {IDSTrustService} from \"../trust/IDSTrustService.sol\";\nimport {TokenIssuer} from \"../issuance/TokenIssuer.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {PausableUpgradeable} from \"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol\";\n\ncontract BulkOperator is  IBulkOperator, BaseDSContract, PausableUpgradeable {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    IDSToken public dsToken;\n\n    function initialize(address _dsToken) public override initializer onlyProxy {\n        dsToken = IDSToken(_dsToken);\n        __Pausable_init();\n        __BaseDSContract_init();\n    }\n\n    function pause() external onlyOwner {\n        _pause();\n    }\n\n    function unpause() external onlyOwner {\n        _unpause();\n    }\n\n    function getVersion() external pure returns (uint8) {\n        return 2;\n    }\n\n    function bulkIssuance(address[] calldata addresses, uint256[] calldata values, uint256 issuanceTime) whenNotPaused onlyIssuerOrAbove external {\n        require(addresses.length == values.length, \"Addresses and values length mismatch\");\n\n        for (uint256 i = 0; i < addresses.length; i++) {\n            dsToken.issueTokensCustom(addresses[i], values[i], issuanceTime, 0, \"\", 0);\n        }\n    }\n\n    function bulkRegisterAndIssuance(BulkRegisterAndIssuance[] calldata data) whenNotPaused onlyIssuerOrAbove external {\n        TokenIssuer tokenIssuer = TokenIssuer(getDSService(TOKEN_ISSUER));\n        for (uint256 i = 0; i < data.length; i++) {\n            BulkRegisterAndIssuance memory currentBulkAndIssuance = data[i];\n\n            tokenIssuer.issueTokens(\n                currentBulkAndIssuance.id,\n                currentBulkAndIssuance.to,\n                currentBulkAndIssuance.issuanceValues,\n                currentBulkAndIssuance.reason,\n                currentBulkAndIssuance.locksValues,\n                currentBulkAndIssuance.lockReleaseTimes,\n                \"\",\n                currentBulkAndIssuance.country,\n                currentBulkAndIssuance.attributeValues,\n                currentBulkAndIssuance.attributeExpirations\n            );\n        }\n    }\n\n    function bulkBurn(address[] calldata addresses, uint256[] memory values) whenNotPaused onlyIssuerOrTransferAgentOrAbove external {\n        require(addresses.length == values.length, \"Addresses and values length mismatch\");\n\n        for (uint256 i = 0; i < addresses.length; i++) {\n            dsToken.burn(addresses[i], values[i], \"\");\n        }\n    }\n}\n"},"contracts/utils/CommonUtils.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nlibrary CommonUtils {\n  enum IncDec { Increase, Decrease }\n\n  function encodeString(string memory _str) internal pure returns (bytes32) {\n    return keccak256(abi.encodePacked(_str));\n  }\n\n  function isEqualString(string memory _str1, string memory _str2) internal pure returns (bool) {\n    return encodeString(_str1) == encodeString(_str2);\n  }\n\n  function isEmptyString(string memory _str) internal pure returns (bool) {\n    return bytes(_str).length == 0;\n  }\n}\n"},"contracts/bulk/IBulkOperator.sol":{"content":"pragma solidity 0.8.22;\n\n/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninterface IBulkOperator {\n\n    struct BulkRegisterAndIssuance {\n        string id;\n        address to;\n        uint256[] issuanceValues;\n        string reason;\n        uint256[] locksValues;\n        uint64[] lockReleaseTimes;\n        string country;\n        uint256[] attributeValues;\n        uint256[] attributeExpirations;\n    }\n\n    /**\n     * @dev Function to be invoked by the proxy contract when the BulkOperator is deployed.\n     * @param _dsToken dsToken to issue\n    **/\n    function initialize(address _dsToken) external;\n\n    /**\n     * @dev Get the contract version\n     * @return Contract version\n    **/\n    function getVersion() external pure returns (uint8);\n\n    /**\n     * @dev Bulk Issuance to existing investors\n     * @param addresses - Array of addresses to be issued to\n     * @param values - Array of values to be issue\n     * @param issuanceTime - Issuance time for all issuances\n    **/\n    function bulkIssuance(address[] memory addresses, uint256[] memory values, uint256 issuanceTime) external;\n\n    /**\n     * @dev Bulk Issuance and registration of new investors\n     * @param data - Array of BulkRegisterAndIssuance struct\n    **/\n    function bulkRegisterAndIssuance(BulkRegisterAndIssuance[] memory data) external;\n\n    /**\n     * @dev Bulk Burn\n     * @param addresses - Array of addresses to be burn to\n     * @param values - Array of values to be burned\n    **/\n    function bulkBurn(address[] memory addresses, uint256[] memory values) external;\n}\n"},"contracts/token/TokenLibrary.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {IDSLockManager} from \"../compliance/IDSLockManager.sol\";\nimport {IDSComplianceService} from \"../compliance/IDSComplianceService.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n\nlibrary TokenLibrary {\n    event Issue(address indexed to, uint256 value, uint256 valueLocked);\n\n    uint256 internal constant COMPLIANCE_SERVICE = 0;\n    uint256 internal constant REGISTRY_SERVICE = 1;\n    uint256 internal constant DEPRECATED_OMNIBUS_NO_ACTION = 0; // Deprecated, keep for backwards compatibility\n    uint256 internal constant DEPRECATED_OMNIBUS_DEPOSIT = 1; // Deprecated, keep for backwards compatibility\n    uint256 internal constant DEPRECATED_OMNIBUS_WITHDRAW = 2; // Deprecated, keep for backwards compatibility\n\n    struct TokenData {\n        mapping(address wallet => uint256 balance) walletsBalances;\n        mapping(string investor => uint256 balance) investorsBalances;\n        uint256 totalSupply;\n        uint256 totalIssued;\n    }\n\n    struct SupportedFeatures {\n        uint256 value;\n    }\n\n    struct IssueParams {\n        address _to;\n        uint256 _value;\n        uint256 _issuanceTime;\n        uint256[] _valuesLocked;\n        uint64[] _releaseTimes;\n        string _reason;\n        ISecuritizeRebasingProvider _rebasingProvider;\n    }\n\n    function setFeature(SupportedFeatures storage supportedFeatures, uint8 featureIndex, bool enable) public {\n        uint256 base = 2;\n        uint256 mask = base**featureIndex;\n\n        // Enable only if the feature is turned off and disable only if the feature is turned on\n        if (enable && (supportedFeatures.value & mask == 0)) {\n            supportedFeatures.value = supportedFeatures.value ^ mask;\n        } else if (!enable && (supportedFeatures.value & mask >= 1)) {\n            supportedFeatures.value = supportedFeatures.value ^ mask;\n        }\n    }\n\n    function issueTokensCustom(\n        TokenData storage _tokenData,\n        address[] memory _services,\n        IDSLockManager _lockManager,\n        IssueParams memory _params\n    ) public returns (uint256) {\n        //Check input values\n        require(_params._to != address(0), \"Invalid address\");\n        require(_params._value > 0, \"Value is zero\");\n        require(_params._valuesLocked.length == _params._releaseTimes.length, \"Wrong length of parameters\");\n\n        //Check issuance is allowed (and inform the compliance manager, possibly adding locks)\n        IDSComplianceService(_services[COMPLIANCE_SERVICE]).validateIssuance(_params._to, _params._value, _params._issuanceTime);\n\n        uint256 shares =  _params._rebasingProvider.convertTokensToShares(_params._value);\n\n        _tokenData.totalSupply += shares;\n        _tokenData.totalIssued += shares;\n        _tokenData.walletsBalances[_params._to] += shares;\n\n        updateInvestorBalance(_tokenData, IDSRegistryService(_services[REGISTRY_SERVICE]), _params._to, shares, CommonUtils.IncDec.Increase);\n\n        uint256 totalLocked = 0;\n        for (uint256 i = 0; i < _params._valuesLocked.length; i++) {\n            totalLocked += _params._valuesLocked[i];\n            _lockManager.addManualLockRecord(_params._to, _params._valuesLocked[i], _params._reason, _params._releaseTimes[i]);\n        }\n        require(totalLocked <= _params._value, \"valueLocked must be smaller than value\");\n        emit Issue(_params._to, _params._value, totalLocked);\n        return shares;\n    }\n\n    modifier validSeizeParameters(TokenData storage _tokenData, address _from, address _to, uint256 _shares) {\n        require(_from != address(0), \"Invalid address\");\n        require(_to != address(0), \"Invalid address\");\n        require(_shares <= _tokenData.walletsBalances[_from], \"Not enough balance\");\n\n        _;\n    }\n\n    function burn(\n        TokenData storage _tokenData,\n        address[] memory _services,\n        address _who,\n        uint256 _value,\n        ISecuritizeRebasingProvider _rebasingProvider\n    ) public returns (uint256) {\n        uint256 sharesToBurn = _rebasingProvider.convertTokensToShares(_value);\n\n        require(sharesToBurn <= _tokenData.walletsBalances[_who], \"Not enough balance\");\n        // no need to require value <= totalSupply, since that would imply the\n        // sender's balance is greater than the totalSupply, which *should* be an assertion failure\n\n        IDSComplianceService(_services[COMPLIANCE_SERVICE]).validateBurn(_who, _value);\n\n        _tokenData.walletsBalances[_who] -= sharesToBurn;\n        updateInvestorBalance(\n            _tokenData,\n            IDSRegistryService(_services[REGISTRY_SERVICE]),\n            _who,\n            sharesToBurn,\n            CommonUtils.IncDec.Decrease\n        );\n\n        _tokenData.totalSupply -= sharesToBurn;\n        return sharesToBurn;\n    }\n\n    function seize(\n        TokenData storage _tokenData,\n        address[] memory _services,\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _shares\n)\n    public\n    validSeizeParameters(_tokenData, _from, _to, _shares)\n    {\n        IDSRegistryService registryService = IDSRegistryService(_services[REGISTRY_SERVICE]);\n        IDSComplianceService(_services[COMPLIANCE_SERVICE]).validateSeize(_from, _to, _value);\n\n        _tokenData.walletsBalances[_from] -= _shares;\n        _tokenData.walletsBalances[_to] += _shares;\n        updateInvestorBalance(_tokenData, registryService, _from, _shares, CommonUtils.IncDec.Decrease);\n        updateInvestorBalance(_tokenData, registryService, _to, _shares, CommonUtils.IncDec.Increase);\n    }\n\n    function updateInvestorBalance(TokenData storage _tokenData, IDSRegistryService _registryService, address _wallet, uint256 _shares, CommonUtils.IncDec _increase) internal {\n        string memory investor = _registryService.getInvestor(_wallet);\n        if (!CommonUtils.isEmptyString(investor)) {\n            uint256 balance = _tokenData.investorsBalances[investor];\n            if (_increase == CommonUtils.IncDec.Increase) {\n                balance += _shares;\n            } else {\n                balance -= _shares;\n            }\n            _tokenData.investorsBalances[investor] = balance;\n        }\n    }\n}\n"},"contracts/trust/TrustService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {IDSTrustService} from \"./IDSTrustService.sol\";\nimport {TrustServiceDataStore} from \"../data-stores/TrustServiceDataStore.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\n\n/**\n * @title TrustService\n * @dev A trust service which allows role-based access control for other contracts.\n * @dev Implements IDSTrustService.\n */\n\ncontract TrustService is IDSTrustService, TrustServiceDataStore, UUPSUpgradeable {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        owner = msg.sender;\n        roles[msg.sender] = MASTER;\n    }\n\n    /**\n     * @dev required by the OZ UUPS module\n     */\n    function _authorizeUpgrade(address) internal override onlyMaster {}\n\n    /**\n     * @dev returns proxy ERC1967 implementation address\n     */\n    function getImplementationAddress() external view returns (address) {\n        return ERC1967Utils.getImplementation();\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function getInitializedVersion() external view returns (uint64) {\n        return _getInitializedVersion();\n    }\n\n    /**\n   * @dev Allow invoking of functions only by the user who has the MASTER role.\n   */\n    modifier onlyMaster() {\n        require(roles[msg.sender] == MASTER, \"Not enough permissions\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking of functions only by the users who have the MASTER role or the ISSUER role.\n   */\n    modifier onlyMasterOrIssuer() {\n        require(roles[msg.sender] == MASTER || roles[msg.sender] == ISSUER, \"Not enough permissions\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking of functions only by the users who have the MASTER role or the ISSUER role or the TRANSFER AGENT role.\n   */\n    modifier onlyMasterOrIssuerOrTransferAgent() {\n        require(roles[msg.sender] == MASTER || roles[msg.sender] == ISSUER || roles[msg.sender] == TRANSFER_AGENT, \"Not enough permissions\");\n        _;\n    }\n\n    /**\n   * @dev Allow setting roles only by the user who has the same role.\n   */\n    modifier onlySameRole(uint8 _role) {\n        if (roles[msg.sender] != MASTER) {\n            if (roles[msg.sender] == ISSUER) {\n                require(_role == ISSUER || _role == EXCHANGE, \"Not enough permissions. Only same role allowed\");\n            } else {\n                require(roles[msg.sender] == _role, \"Not enough permissions. Only same role allowed\");\n            }\n        }\n        _;\n    }\n\n    /**\n   * @dev Allow setting roles only by the user who has the same role.\n   */\n    modifier onlySameRoleForAddress(address _address) {\n        if (roles[msg.sender] != MASTER) {\n            uint8 role = roles[_address];\n            if (roles[msg.sender] == ISSUER) {\n                require(role == ISSUER || role == EXCHANGE, \"Not enough permissions. Only same role allowed\");\n            } else {\n                require(roles[msg.sender] == role, \"Not enough permissions. Only same role allowed\");\n            }\n        }\n        _;\n    }\n\n\n    /**\n   * @dev Sets or removes a role for a wallet. (internal)\n   * @param _address The wallet whose role needs to be set or removed.\n   * @param _role The role to be set. NONE (0) indicates role removal.\n   */\n    function setRoleImpl(address _address, uint8 _role) internal {\n        uint8 old_role = roles[_address];\n\n        require(old_role == NONE || _role == NONE, \"No direct role-to-role change\");\n\n        roles[_address] = _role;\n\n        if (old_role == NONE) {\n            emit DSTrustServiceRoleAdded(_address, _role, msg.sender);\n        } else {\n            emit DSTrustServiceRoleRemoved(_address, old_role, msg.sender);\n        }\n    }\n\n    /**\n   * @dev Transfers the ownership (MASTER role) of the contract.\n   * @param _address The address which the ownership needs to be transferred to.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setServiceOwner(address _address) public override onlyMaster returns (bool) {\n        require(_address != address(0), \"Owner can not be zero address\");\n        setRoleImpl(owner, NONE);\n        owner = _address;\n        setRoleImpl(_address, MASTER);\n\n        return true;\n    }\n\n    /**\n   * @dev Sets roles to an array of wallets\n   * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n   * @param _addresses The array of wallet whose role needs to be set.\n   * @param _roles The array of role to be set. Length and order must match wit _addresss\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setRoles(address[] calldata _addresses, uint8[] calldata _roles) public override onlyMasterOrIssuerOrTransferAgent returns (bool) {\n        require(_addresses.length <= 30, \"Exceeded the maximum number of addresses\");\n        require(_addresses.length == _roles.length, \"Wrong length of parameters\");\n        for (uint8 i = 0; i < _addresses.length; i++) {\n            setRole(_addresses[i], _roles[i]);\n        }\n        return true;\n    }\n\n    /**\n   * @dev Sets a role for a wallet.\n   * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n   * @param _address The wallet whose role needs to be set.\n   * @param _role The role to be set.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setRole(address _address, uint8 _role) public override onlyMasterOrIssuerOrTransferAgent onlySameRole(_role) returns (bool) {\n        require(_role == ISSUER || _role == EXCHANGE || _role == TRANSFER_AGENT, \"Invalid target role\");\n\n        setRoleImpl(_address, _role);\n\n        return true;\n    }\n\n    /**\n   * @dev Removes the role for a wallet.\n   * @dev Should not be used to remove MASTER (use setServiceOwner).\n   * @param _address The wallet whose role needs to be removed.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function removeRole(address _address) public override onlyMasterOrIssuerOrTransferAgent onlySameRoleForAddress(_address) returns (bool) {\n        uint8 role = roles[_address];\n        require(role != MASTER, \"Cannot remove master\");\n\n        setRoleImpl(_address, NONE);\n\n        return true;\n    }\n\n    /**\n   * @dev Gets the role for a wallet.\n   * @param _address The wallet whose role needs to be fetched.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function getRole(address _address) public view override returns (uint8) {\n        return roles[_address];\n    }\n\n}\n"},"contracts/token/StandardToken.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {TokenDataStore} from \"../data-stores/TokenDataStore.sol\";\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\nimport {IDSToken} from \"./IDSToken.sol\";\n\nabstract contract StandardToken is IDSToken, TokenDataStore, BaseDSContract {\n    event Pause();\n    event Unpause();\n\n    modifier whenNotPaused() {\n        require(!paused, \"Contract is paused\");\n        _;\n    }\n\n    modifier whenPaused() {\n        require(paused, \"Contract is not paused\");\n        _;\n    }\n\n    function __StandardToken_init() public onlyProxy onlyInitializing {\n        __BaseDSContract_init();\n    }\n\n    function pause() public onlyTransferAgentOrAbove whenNotPaused {\n        paused = true;\n        emit Pause();\n    }\n\n    function unpause() public onlyTransferAgentOrAbove whenPaused {\n        paused = false;\n        emit Unpause();\n    }\n\n    function isPaused() public view override returns (bool) {\n        return paused;\n    }\n\n    /**\n     * @dev Gets the balance of the specified address.\n     * @param _owner The address to query the the balance of.\n     * @return An uint256 representing the amount owned by the passed address.\n     */\n    function balanceOf(address _owner) public view returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n        uint256 shares = tokenData.walletsBalances[_owner];\n\n        uint256 tokens = rebasingProvider.convertSharesToTokens(shares);\n\n        return tokens;\n    }\n\n    function totalSupply() public view returns (uint256) {\n        ISecuritizeRebasingProvider rebasingProvider = ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n\n        uint256 totalSupplyTokens = rebasingProvider.convertSharesToTokens(tokenData.totalSupply);\n\n        return totalSupplyTokens;\n    }\n\n    /**\n     * @dev transfer token for a specified address\n     * @param _to The address to transfer to.\n     * @param _value The amount to be transferred.\n     */\n    function transfer(address _to, uint256 _value) public virtual returns (bool) {\n        return transferImpl(msg.sender, _to, _value);\n    }\n\n    function transferFrom(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public virtual returns (bool) {\n        require(_value <= allowances[_from][msg.sender], \"Not enough allowance\");\n        allowances[_from][msg.sender] -= _value;\n        return transferImpl(_from, _to, _value);\n    }\n\n    function transferImpl(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal returns (bool) {\n        require(_to != address(0));\n        ISecuritizeRebasingProvider rebasingProvider = ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n\n        uint256 _shares = rebasingProvider.convertTokensToShares(_value);\n\n        require(_shares <= tokenData.walletsBalances[_from]);\n\n        tokenData.walletsBalances[_from] -= _shares;\n        tokenData.walletsBalances[_to] += _shares;\n\n        emit Transfer(_from, _to, _value);\n        emit TxShares(_from, _to, _shares, rebasingProvider.multiplier());\n        return true;\n    }\n\n    function approve(address _spender, uint256 _value) public returns (bool) {\n        allowances[msg.sender][_spender] = _value;\n        emit Approval(msg.sender, _spender, _value);\n        return true;\n    }\n\n    function allowance(address _owner, address _spender) public view returns (uint256) {\n        return allowances[_owner][_spender];\n    }\n\n    function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) {\n        allowances[msg.sender][_spender] = allowances[msg.sender][_spender] + _addedValue;\n        emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]);\n        return true;\n    }\n\n    function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool) {\n        uint256 oldValue = allowances[msg.sender][_spender];\n        if (_subtractedValue > oldValue) {\n            allowances[msg.sender][_spender] = 0;\n        } else {\n            allowances[msg.sender][_spender] = oldValue - _subtractedValue;\n        }\n        emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]);\n        return true;\n    }\n}\n"},"contracts/issuance/TokenIssuer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSTokenIssuer} from \"./IDSTokenIssuer.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\ncontract TokenIssuer is IDSTokenIssuer, BaseDSContract {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function issueTokens(\n        string calldata _id,\n        address _to,\n        uint256[] memory _issuanceValues,\n        string memory _reason,\n        uint256[] memory _locksValues,\n        uint64[] memory _lockReleaseTimes,\n        string memory _collisionHash,\n        string memory _country,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) public override onlyIssuerOrAbove returns (bool) {\n        require(_issuanceValues.length == 2, \"Wrong length of parameters\");\n        require(_attributeValues.length == _attributeExpirations.length, \"Wrong length of parameters\");\n        require(_locksValues.length == _lockReleaseTimes.length, \"Wrong length of parameters\");\n        if (getRegistryService().isWallet(_to)) {\n            require(CommonUtils.isEqualString(getRegistryService().getInvestor(_to), _id), \"Wallet does not belong to investor\");\n        } else {\n            registerInvestor(_id, _to, _collisionHash, _country, _attributeValues, _attributeExpirations);\n        }\n\n        getToken().issueTokensWithMultipleLocks(_to, _issuanceValues[0], _issuanceValues[1], _locksValues, _reason, _lockReleaseTimes);\n\n        return true;\n    }\n\n    function registerInvestor(\n        string memory _id,\n        address _wallet,\n        string memory _collisionHash,\n        string memory _country,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) private {\n        IDSRegistryService registryService = getRegistryService();\n        uint8 EXPECTED_NUM_ATTRIBUTES = 3;\n        // all parameters required or none for Token Issuer\n        require(_attributeValues.length == 0 || _attributeValues.length == EXPECTED_NUM_ATTRIBUTES, \"Wrong length of parameters\");\n        uint8[] memory attributesIds;\n        if (_attributeValues.length == EXPECTED_NUM_ATTRIBUTES) {\n            attributesIds = new uint8[](EXPECTED_NUM_ATTRIBUTES);\n            attributesIds[0] = registryService.KYC_APPROVED();\n            attributesIds[1] = registryService.ACCREDITED();\n            attributesIds[2] = registryService.QUALIFIED();\n        } else {\n            attributesIds = new uint8[](0);\n        }\n        address[] memory investorWallets = new address[](1);\n        investorWallets[0] = _wallet;\n        registryService.updateInvestor(\n            _id,\n            _collisionHash,\n            _country,\n            investorWallets,\n            attributesIds,\n            _attributeValues,\n            _attributeExpirations\n        );\n    }\n}\n"},"contracts/utils/BaseDSContract.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumer} from \"../service/ServiceConsumer.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\n\nabstract contract BaseDSContract is UUPSUpgradeable, ServiceConsumer {\n\n    function __BaseDSContract_init() public onlyProxy onlyInitializing {\n        __UUPSUpgradeable_init();\n        __ServiceConsumer_init();\n    }\n\n    /**\n     * @dev required by the OZ UUPS module\n     */\n    function _authorizeUpgrade(address) internal override onlyMaster {}\n\n    /**\n     * @dev returns proxy ERC1967 implementation address\n     */\n    function getImplementationAddress() external view returns (address) {\n        return ERC1967Utils.getImplementation();\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function getInitializedVersion() external view returns (uint64) {\n        return _getInitializedVersion();\n    }\n\n}\n"},"contracts/trust/IDSTrustService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/**\n * @title IDSTrustService\n * @dev An interface for a trust service which allows role-based access control for other contracts.\n */\n\nabstract contract IDSTrustService {\n\n    function initialize() public virtual;\n\n    /**\n     * @dev Should be emitted when a role is set for a user.\n     */\n    event DSTrustServiceRoleAdded(address targetAddress, uint8 role, address sender);\n    /**\n     * @dev Should be emitted when a role is removed for a user.\n     */\n    event DSTrustServiceRoleRemoved(address targetAddress, uint8 role, address sender);\n\n    // Role constants\n    uint8 public constant NONE = 0;\n    uint8 public constant MASTER = 1;\n    uint8 public constant ISSUER = 2;\n    uint8 public constant EXCHANGE = 4;\n    uint8 public constant TRANSFER_AGENT = 8;\n\n    /**\n     * @dev Transfers the ownership (MASTER role) of the contract.\n     * @param _address The address which the ownership needs to be transferred to.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setServiceOwner(\n        address _address /*onlyMaster*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets a role for an array of wallets.\n     * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n     * @param _addresses The array of wallet whose role needs to be set.\n     * @param _roles The array of role to be set. The length and order must match with _addresses\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setRoles(address[] calldata _addresses, uint8[] calldata _roles) public virtual returns (bool);\n\n    /**\n     * @dev Sets a role for a wallet.\n     * @dev Should not be used for setting MASTER (use setServiceOwner) or role removal (use removeRole).\n     * @param _address The wallet whose role needs to be set.\n     * @param _role The role to be set.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setRole(\n        address _address,\n        uint8 _role /*onlyMasterOrIssuer*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Removes the role for a wallet.\n     * @dev Should not be used to remove MASTER (use setServiceOwner).\n     * @param _address The wallet whose role needs to be removed.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function removeRole(\n        address _address /*onlyMasterOrIssuer*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Gets the role for a wallet.\n     * @param _address The wallet whose role needs to be fetched.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function getRole(address _address) public view virtual returns (uint8);\n\n}\n"},"contracts/issuance/IDSTokenIssuer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSTokenIssuer {\n\n    function initialize() public virtual;\n\n    function issueTokens(\n        string calldata _id,\n        address _to,\n        uint256[] memory _issuanceValues,\n        string memory _reason,\n        uint256[] memory _locksValues,\n        uint64[] memory _lockReleaseTimes,\n        string memory _collisionHash,\n        string memory _country,\n        uint256[] memory attributeValues,\n        uint256[] memory attributeExpirations /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n}\n"},"contracts/mocks/StandardTokenMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {StandardToken} from \"../token/StandardToken.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n// mock class using StandardToken\ncontract StandardTokenMock is StandardToken {\n\n    function initialize(string calldata _name, string calldata _symbol, uint8 _decimals) public virtual override onlyProxy initializer {\n        name = _name;\n        symbol = _symbol;\n        decimals = _decimals;\n    }\n\n    function balanceOfInvestor(string memory) public pure override returns (uint256) {\n        revertFunction();\n    }\n\n    function burn(address, uint256, string calldata) public pure override {\n        revertFunction();\n    }\n\n    function getWalletAt(uint256) public pure override returns (address) {\n        revertFunction();\n    }\n\n    function issueTokens(address, uint256) public pure override returns (bool) {\n        revertFunction();\n    }\n\n    function issueTokensCustom(address, uint256, uint256, uint256, string memory, uint64) public pure override returns (bool) {\n        revertFunction();\n    }\n\n    function issueTokensWithMultipleLocks(address, uint256, uint256, uint256[] memory, string memory, uint64[] memory) public pure override returns (bool) {\n        revertFunction();\n    }\n\n    function preTransferCheck(address, address, uint256) public pure override returns (uint256, string memory) {\n        revertFunction();\n    }\n\n    function seize(address, address, uint256, string calldata) public pure override {\n        revertFunction();\n    }\n\n    function updateInvestorBalance(address, uint256, CommonUtils.IncDec) internal pure override {\n        revertFunction();\n    }\n\n    function walletCount() public pure override returns (uint256) {\n        revertFunction();\n    }\n\n    function revertFunction() private pure {\n        revert(\"not implemented\");\n    }\n}\n"},"contracts/service/ServiceConsumer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSServiceConsumer} from \"./IDSServiceConsumer.sol\";\nimport {ServiceConsumerDataStore} from \"../data-stores/ServiceConsumerDataStore.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\nimport {IDSWalletManager} from \"../compliance/IDSWalletManager.sol\";\nimport {IDSLockManager} from \"../compliance/IDSLockManager.sol\";\nimport {IDSComplianceService} from \"../compliance/IDSComplianceService.sol\";\nimport {IDSComplianceConfigurationService} from \"../compliance/IDSComplianceConfigurationService.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {IDSTrustService} from \"../trust/IDSTrustService.sol\";\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {OwnableUpgradeable} from \"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\";\n\n\n\nabstract contract ServiceConsumer is IDSServiceConsumer, ServiceConsumerDataStore, OwnableUpgradeable {\n\n    // Bring role constants to save gas both in deployment (less bytecode) and usage\n    uint8 public constant ROLE_NONE = 0;\n    uint8 public constant ROLE_MASTER = 1;\n    uint8 public constant ROLE_ISSUER = 2;\n    uint8 public constant ROLE_EXCHANGE = 4;\n    uint8 public constant ROLE_TRANSFER_AGENT = 8;\n\n    function __ServiceConsumer_init() public virtual onlyInitializing {\n        __Ownable_init(msg.sender);\n    }\n\n    modifier onlyMaster {\n        if(owner() != msg.sender) require(getTrustService().getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    /**\n   * @dev Allow invoking functions only by the users who have the MASTER role or the ISSUER role or the TRANSFER AGENT role.\n   */\n    modifier onlyIssuerOrTransferAgentOrAbove() {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_TRANSFER_AGENT || role == ROLE_ISSUER || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyIssuerOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_ISSUER || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyTransferAgentOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_TRANSFER_AGENT || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyExchangeOrAbove {\n        IDSTrustService trustManager = getTrustService();\n        uint8 role = trustManager.getRole(msg.sender);\n        require(role == ROLE_EXCHANGE || role == ROLE_ISSUER || role == ROLE_TRANSFER_AGENT || role == ROLE_MASTER, \"Insufficient trust level\");\n        _;\n    }\n\n    modifier onlyToken {\n        require(msg.sender == getDSService(DS_TOKEN), \"This function can only called by the associated token\");\n        _;\n    }\n\n    modifier onlyRegistry {\n        require(msg.sender == getDSService(REGISTRY_SERVICE), \"This function can only called by the registry service\");\n        _;\n    }\n\n    modifier onlyIssuerOrAboveOrToken {\n        if (msg.sender != getDSService(DS_TOKEN)) {\n            IDSTrustService trustManager = IDSTrustService(getDSService(TRUST_SERVICE));\n            require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    modifier onlyTransferAgentOrAboveOrToken {\n        if (msg.sender != getDSService(DS_TOKEN)) {\n            IDSTrustService trustManager = IDSTrustService(getDSService(TRUST_SERVICE));\n            require(trustManager.getRole(msg.sender) == ROLE_TRANSFER_AGENT || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    modifier onlyOwnerOrIssuerOrAbove {\n        if(owner() != msg.sender) {\n            IDSTrustService trustManager = getTrustService();\n            require(trustManager.getRole(msg.sender) == ROLE_ISSUER || trustManager.getRole(msg.sender) == ROLE_MASTER, \"Insufficient trust level\");\n        }\n        _;\n    }\n\n    function getDSService(uint256 _serviceId) public view override returns (address) {\n        return services[_serviceId];\n    }\n\n    function setDSService(uint256 _serviceId, address _address) public override onlyMaster returns (bool) {\n        services[_serviceId] = _address;\n        emit DSServiceSet(_serviceId, _address);\n        return true;\n    }\n\n    function getToken() internal view returns (IDSToken) {\n        return IDSToken(getDSService(DS_TOKEN));\n    }\n\n    function getTrustService() internal view returns (IDSTrustService) {\n        return IDSTrustService(getDSService(TRUST_SERVICE));\n    }\n\n    function getWalletManager() internal view returns (IDSWalletManager) {\n        return IDSWalletManager(getDSService(WALLET_MANAGER));\n    }\n\n    function getLockManager() internal view returns (IDSLockManager) {\n        return IDSLockManager(getDSService(LOCK_MANAGER));\n    }\n\n    function getComplianceService() internal view returns (IDSComplianceService) {\n        return IDSComplianceService(getDSService(COMPLIANCE_SERVICE));\n    }\n\n    function getRegistryService() internal view returns (IDSRegistryService) {\n        return IDSRegistryService(getDSService(REGISTRY_SERVICE));\n    }\n\n    function getComplianceConfigurationService() internal view returns (IDSComplianceConfigurationService) {\n        return IDSComplianceConfigurationService(getDSService(COMPLIANCE_CONFIGURATION_SERVICE));\n    }\n\n    function getRebasingProvider() internal view returns (ISecuritizeRebasingProvider) {\n        return ISecuritizeRebasingProvider(getDSService(REBASING_PROVIDER));\n    }\n}\n"},"contracts/compliance/WalletManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSWalletManager} from \"./IDSWalletManager.sol\";\nimport {WalletManagerDataStore} from \"../data-stores/WalletManagerDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n/**\n * @title WalletManager\n * @dev A wallet manager which allows marking special wallets in the system.\n * @dev Implements DSTrustServiceInterface and ESServiceConsumer.\n */\n\ncontract WalletManager is IDSWalletManager, WalletManagerDataStore, BaseDSContract {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    /**\n   * @dev Sets a wallet to be an special wallet. (internal)\n   * @param _wallet The address of the wallet.\n   * @param _type The type of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function setSpecialWallet(address _wallet, uint8 _type) internal override returns (bool) {\n        require(CommonUtils.isEmptyString(getRegistryService().getInvestor(_wallet)), \"Wallet belongs to investor\");\n\n        uint8 oldType = getWalletType(_wallet);\n        require(oldType == NONE || _type == NONE, \"Direct wallet type change is not allowed\");\n\n        walletsTypes[_wallet] = _type;\n\n        if (oldType == NONE) {\n            emit DSWalletManagerSpecialWalletAdded(_wallet, _type, msg.sender);\n        } else {\n            emit DSWalletManagerSpecialWalletRemoved(_wallet, oldType, msg.sender);\n        }\n\n        return true;\n    }\n\n    /**\n   * @dev Sets a wallet to be an issuer wallet.\n   * @param _wallet The address of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function addIssuerWallet(address _wallet) public override onlyIssuerOrAbove returns (bool) {\n        return setSpecialWallet(_wallet, ISSUER);\n    }\n\n    /**\n    * @dev Sets an array of wallets to be issuer wallets.\n    * @param _wallets The address of the wallet.\n    * @return A boolean that indicates if the operation was successful.\n   */\n    function addIssuerWallets(address[] calldata _wallets) public override onlyIssuerOrAbove returns (bool) {\n        require(_wallets.length <= 30, \"Exceeded the maximum number of wallets\");\n        for (uint8 i = 0; i < _wallets.length; i++) {\n            addIssuerWallet(_wallets[i]);\n        }\n        return true;\n    }\n\n    /**\n   * @dev Sets a wallet to be an platform wallet.\n   * @param _wallet The address of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function addPlatformWallet(address _wallet) public override onlyIssuerOrAbove returns (bool) {\n        return setSpecialWallet(_wallet, PLATFORM);\n    }\n\n    /**\n    * @dev Sets an array of wallets to be platform wallet.\n    * @param _wallets The address of the wallet.\n    * @return A boolean that indicates if the operation was successful.\n   */\n    function addPlatformWallets(address[] calldata _wallets) public override onlyIssuerOrAbove returns (bool) {\n        require(_wallets.length <= 30, \"Exceeded the maximum number of wallets\");\n        for (uint8 i = 0; i < _wallets.length; i++) {\n            addPlatformWallet(_wallets[i]);\n        }\n        return true;\n    }\n\n    /**\n   * @dev Sets a wallet to be an exchange wallet.\n   * @param _wallet The address of the wallet.\n   * @param _owner The address of the owner.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function addExchangeWallet(address _wallet, address _owner) public override onlyIssuerOrAbove returns (bool) {\n        require(getTrustService().getRole(_owner) == EXCHANGE, \"Owner is not an exchange\");\n        return setSpecialWallet(_wallet, EXCHANGE);\n    }\n\n    function isSpecialWallet(address _wallet) external override view returns (bool) {\n        return walletsTypes[_wallet] != NONE;\n    }\n\n    function isIssuerSpecialWallet(address _wallet) external override view returns (bool) {\n        return walletsTypes[_wallet] == ISSUER;\n    }\n\n    function isPlatformWallet(address _wallet) external override view returns (bool) {\n        return walletsTypes[_wallet] == PLATFORM;\n    }\n\n    function getWalletType(address _wallet) public view override returns (uint8) {\n        return walletsTypes[_wallet];\n    }\n\n    /**\n   * @dev Removes a special wallet.\n   * @param _wallet The address of the wallet.\n   * @return A boolean that indicates if the operation was successful.\n   */\n    function removeSpecialWallet(address _wallet) public override onlyIssuerOrAbove returns (bool) {\n        return setSpecialWallet(_wallet, NONE);\n    }\n}\n"},"contracts/rebasing/RebasingLibrary.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSToken} from \"../token/IDSToken.sol\";\n\n\nlibrary RebasingLibrary {\n    /*\n     * @notice Note for auditors regarding rounding logic in rebasing operations.\n     *\n     * A finding was raised concerning the \"rounding to the nearest\" logic in `convertTokensToShares`,\n     * which could potentially result in a wei being rounded up in favor of the investor.\n     * We have analyzed and tested different options and our conclusions are the following:\n     *\n     * 1. The risk for the protocol of losing a wei over a `convertTokensToShares` operation\n     *    is restricted to tokens with many decimals (17 or 18).\n     *\n     * 2. Trying to fix this by rounding down on every operation presents many problems:\n     *    - Users who deposit 1 token immediately see it reflected as less than 1 token (0.99999...),\n     *      which causes confusion and potential complaints.\n     *    - When locking 200 tokens for an investor who holds 500, it should leave 300 tokens\n     *      transferable. Applying a \"round down\" fix causes this to fail, as a wei is lost\n     *      for the investor who no longer holds the total shares needed to get back their 300 tokens.\n     *    - Similar situations happen with other operations of the protocol, none of which happen\n     *      with the \"rounding to the nearest\" approach.\n     *\n     * 3. Exploiting the wei being rounded up is not economically viable for an attacker. It would\n     *    require thousands of transactions, and the associated gas costs (plus any protocol fees,\n     *    like bridging fees) would exceed any potential gain.\n     *\n     * 4. Most of our tokens operate with 6 decimals, while all rebasing operations use 18 decimals\n     *    of precision. For a typical 6-decimal token, taking advantage of this is nearly impossible.\n     *\n     * Conclusion: We are leaving the logic as is (\"rounding to the nearest integer\"). It works well\n     * in all situations, and while it creates a theoretical risk, it is not practically actionable or\n     * economically feasible to exploit.\n     */    \n    uint256 private constant DECIMALS_FACTOR = 1e18;\n\n    /**\n     * @notice Converts a token amount to a share amount.\n     * @param _tokens The amount of tokens to convert.\n     * @param _rebasingMultiplier The current rebasing multiplier, fixed to 18 decimals.\n     * @param _tokenDecimals The number of decimals of the token.\n     * @return The corresponding amount of shares.\n     */\n    function convertTokensToShares(\n        uint256 _tokens,\n        uint256 _rebasingMultiplier, // should be fixed to 18 decimals\n        uint8 _tokenDecimals\n    ) internal pure returns (uint256) {\n        require(_rebasingMultiplier > 0, \"Invalid rebasing multiplier\");\n        uint256 shares;        \n        if (_tokenDecimals == 18) {\n            shares = (_tokens * DECIMALS_FACTOR + _rebasingMultiplier / 2) / _rebasingMultiplier;\n        } else if (_tokenDecimals < 18) {\n            uint256 scale = 10**(18 - _tokenDecimals);\n            shares = (_tokens * scale * DECIMALS_FACTOR + _rebasingMultiplier / 2) / _rebasingMultiplier;\n        } else {\n            revert(\"Token decimals greater than 18 not supported\");\n        }\n\n\n        if (_tokens > 0) {\n            require(shares > 0, \"Shares amount too small\");\n        }\n        return shares;        \n    }\n\n    /**\n     * @notice Converts a share amount to a token amount.\n     * @param _shares The amount of shares to convert.\n     * @param _rebasingMultiplier The current rebasing multiplier, fixed to 18 decimals.\n     * @param _tokenDecimals The number of decimals of the token.\n     * @return The corresponding amount of tokens.\n     */\n    function convertSharesToTokens(\n        uint256 _shares,\n        uint256 _rebasingMultiplier,\n        uint8 _tokenDecimals\n    ) internal pure returns (uint256) {\n        require(_rebasingMultiplier > 0, \"Invalid rebasing multiplier\");\n        if (_tokenDecimals == 18) {\n            return (_shares * _rebasingMultiplier + DECIMALS_FACTOR / 2) / DECIMALS_FACTOR;\n        } else if (_tokenDecimals < 18) {\n            uint256 scale = 10**(18 - _tokenDecimals);\n            return (((_shares * _rebasingMultiplier + DECIMALS_FACTOR / 2) / DECIMALS_FACTOR) + scale / 2) / scale;\n        } else {\n            revert(\"Token decimals greater than 18 not supported\");\n        }\n    }\n}"},"contracts/registry/RegistryService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {IDSRegistryService} from \"./IDSRegistryService.sol\";\nimport {RegistryServiceDataStore} from \"../data-stores/RegistryServiceDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\n\ncontract RegistryService is IDSRegistryService, RegistryServiceDataStore, BaseDSContract {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function registerInvestor(string calldata _id, string calldata _collisionHash) public override onlyExchangeOrAbove newInvestor(_id) returns (bool) {\n        investors[_id] = Investor(_id, _collisionHash, msg.sender, msg.sender, \"\", 0);\n\n        emit DSRegistryServiceInvestorAdded(_id, msg.sender);\n\n        return true;\n    }\n\n    function removeInvestor(string calldata _id) public override onlyExchangeOrAbove investorExists(_id) returns (bool) {\n        require(getTrustService().getRole(msg.sender) != EXCHANGE || investors[_id].creator == msg.sender, \"Insufficient permissions\");\n        require(investors[_id].walletCount == 0, \"Investor has wallets\");\n\n        for (uint8 index = 0; index < 16; index++) {\n            delete attributes[_id][index];\n        }\n\n        delete investors[_id];\n\n        emit DSRegistryServiceInvestorRemoved(_id, msg.sender);\n\n        return true;\n    }\n\n    function updateInvestor(\n        string calldata _id,\n        string calldata _collisionHash,\n        string memory _country,\n        address[] memory _wallets,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) public override onlyIssuerOrTransferAgentOrAbove returns (bool) {\n        require(_attributeValues.length == _attributeIds.length, \"Wrong length of parameters\");\n        require(_attributeIds.length == _attributeExpirations.length, \"Wrong length of parameters\");\n\n        if (!isInvestor(_id)) {\n            registerInvestor(_id, _collisionHash);\n        }\n\n        if (bytes(_country).length > 0) {\n            setCountry(_id, _country);\n        }\n\n        for (uint256 i = 0; i < _wallets.length; i++) {\n            if (isWallet(_wallets[i])) {\n                require(CommonUtils.isEqualString(getInvestor(_wallets[i]), _id), \"Wallet belongs to a different investor\");\n            } else {\n                addWallet(_wallets[i], _id);\n            }\n        }\n\n        for (uint256 i = 0; i < _attributeIds.length; i++) {\n            setAttribute(_id, _attributeIds[i], _attributeValues[i], _attributeExpirations[i], \"\");\n        }\n\n        return true;\n    }\n\n    function getInvestorDetailsFull(string memory _id)\n        public\n        view\n        override\n        returns (string memory, uint256[] memory, uint256[] memory, string memory, string memory, string memory, string memory)\n    {\n        string memory country = investors[_id].country;\n        uint256[] memory attributeValues = new uint256[](4);\n        uint256[] memory attributeExpiries = new uint256[](4);\n        string[] memory attributeProofHashes = new string[](4);\n        for (uint8 i = 0; i < 4; i++) {\n            attributeValues[i] = getAttributeValue(_id, (uint8(2)**i));\n            attributeExpiries[i] = getAttributeExpiry(_id, (uint8(2)**i));\n            attributeProofHashes[i] = getAttributeProofHash(_id, (uint8(2)**i));\n        }\n        return (country, attributeValues, attributeExpiries, attributeProofHashes[0], attributeProofHashes[1], attributeProofHashes[2], attributeProofHashes[3]);\n    }\n\n    function setCountry(string calldata _id, string memory _country) public override onlyExchangeOrAbove investorExists(_id) returns (bool) {\n        string memory prevCountry = getCountry(_id);\n        if (!CommonUtils.isEqualString(prevCountry, _country)) {\n            getComplianceService().adjustInvestorCountsAfterCountryChange(_id, _country, prevCountry);\n\n            investors[_id].country = _country;\n\n            emit DSRegistryServiceInvestorCountryChanged(_id, _country, msg.sender);\n        }\n        return true;\n    }\n\n    function getCountry(string memory _id) public view override returns (string memory) {\n        return investors[_id].country;\n    }\n\n    function getCollisionHash(string calldata _id) public view override returns (string memory) {\n        return investors[_id].collisionHash;\n    }\n\n    function setAttribute(string calldata _id, uint8 _attributeId, uint256 _value, uint256 _expiry, string memory _proofHash)\n        public\n        override\n        onlyExchangeOrAbove\n        investorExists(_id)\n        returns (bool)\n    {\n        require(_attributeId < 16, \"Unknown attribute\");\n\n        attributes[_id][_attributeId].value = _value;\n        attributes[_id][_attributeId].expiry = _expiry;\n        attributes[_id][_attributeId].proofHash = _proofHash;\n\n        emit DSRegistryServiceInvestorAttributeChanged(_id, _attributeId, _value, _expiry, _proofHash, msg.sender);\n\n        return true;\n    }\n\n    function getAttributeValue(string memory _id, uint8 _attributeId) public view override returns (uint256) {\n        return attributes[_id][_attributeId].value;\n    }\n\n    function getAttributeExpiry(string memory _id, uint8 _attributeId) public view override returns (uint256) {\n        return attributes[_id][_attributeId].expiry;\n    }\n\n    function getAttributeProofHash(string memory _id, uint8 _attributeId) public view override returns (string memory) {\n        return attributes[_id][_attributeId].proofHash;\n    }\n\n    function addWallet(address _address, string memory _id) public override onlyExchangeOrAbove investorExists(_id) newWallet(_address) returns (bool) {\n        require(!getWalletManager().isSpecialWallet(_address), \"Wallet has special role\");\n        require(getToken().balanceOf(_address) == 0, \"Wallet with positive balance\");\n        investorsWallets[_address] = Wallet(_id, msg.sender, msg.sender);\n        investors[_id].walletCount++;\n\n        emit DSRegistryServiceWalletAdded(_address, _id, msg.sender);\n\n        return true;\n    }\n\n\n    function removeWallet(address _address, string memory _id) public override onlyExchangeOrAbove walletExists(_address) walletBelongsToInvestor(_address, _id) returns (bool) {\n        require(getTrustService().getRole(msg.sender) != EXCHANGE || investorsWallets[_address].creator == msg.sender, \"Insufficient permissions\");\n        require(getToken().balanceOf(_address) == 0, \"Wallet with positive balance\");\n\n        delete investorsWallets[_address];\n        investors[_id].walletCount--;\n\n        emit DSRegistryServiceWalletRemoved(_address, _id, msg.sender);\n\n        return true;\n    }\n\n    function getInvestor(address _address) public view override returns (string memory) {\n        return investorsWallets[_address].owner;\n    }\n\n    function getInvestorDetails(address _address) public view override returns (string memory, string memory) {\n        return (getInvestor(_address), getCountry(getInvestor(_address)));\n    }\n\n    function isInvestor(string memory _id) public view override returns (bool) {\n        return !CommonUtils.isEmptyString(investors[_id].id);\n    }\n\n    function isAccreditedInvestor(string calldata _id) external view override returns (bool) {\n        return getAttributeValue(_id, ACCREDITED) == APPROVED;\n    }\n\n    function isAccreditedInvestor(address _wallet) external view override returns (bool) {\n        string memory investor = investorsWallets[_wallet].owner;\n        return getAttributeValue(investor, ACCREDITED) == APPROVED;\n    }\n\n    function isQualifiedInvestor(address _wallet) external view override returns (bool) {\n        string memory investor = investorsWallets[_wallet].owner;\n        return getAttributeValue(investor, QUALIFIED) == APPROVED;\n    }\n\n    function isQualifiedInvestor(string calldata _id) external view override returns (bool) {\n        return getAttributeValue(_id, QUALIFIED) == APPROVED;\n    }\n\n    function getInvestors(address _from, address _to) external view override returns (string memory, string memory) {\n        return (investorsWallets[_from].owner, investorsWallets[_to].owner);\n    }\n\n    function isWallet(address _address) public view override returns (bool) {\n        return isInvestor(getInvestor(_address));\n    }\n}\n"},"contracts/registry/WalletRegistrar.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSWalletRegistrar} from \"./IDSWalletRegistrar.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {IDSRegistryService} from \"./IDSRegistryService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\ncontract WalletRegistrar is IDSWalletRegistrar, BaseDSContract {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function registerWallet(\n        string memory _id,\n        address[] calldata _wallets,\n        string calldata _collisionHash,\n        string memory _country,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations\n    ) public override onlyOwnerOrIssuerOrAbove returns (bool) {\n        IDSRegistryService registryService = getRegistryService();\n\n        registryService.updateInvestor(\n            _id,\n            _collisionHash,\n            _country,\n            _wallets,\n            _attributeIds,\n            _attributeValues,\n            _attributeExpirations\n        );\n\n        return true;\n    }\n}\n"},"contracts/utils/BulkBalanceChecker.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IERC20} from \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\n\ncontract BulkBalanceChecker {\n    /**\n     * @notice Returns the ERC20 token balance for a list of wallets\n     * @param token The address of the ERC20 token contract\n     * @param wallets The list of wallet addresses to check\n     * @return balances The list of balances corresponding to each wallet\n     */\n    function getTokenBalances(address token, address[] calldata wallets)\n        external\n        view\n        returns (uint256[] memory balances)\n    {\n        balances = new uint256[](wallets.length);\n        IERC20 erc20 = IERC20(token);\n\n        for (uint256 i = 0; i < wallets.length; i++) {\n            balances[i] = erc20.balanceOf(wallets[i]);\n        }\n    }\n}\n"},"contracts/utils/TransactionRelayer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport { BaseDSContract } from \"./BaseDSContract.sol\";\nimport { CommonUtils } from \"./CommonUtils.sol\";\nimport { EIP712Upgradeable } from \"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol\";\nimport { Address } from \"@openzeppelin/contracts/utils/Address.sol\";\nimport { ECDSA } from \"@openzeppelin/contracts/utils/cryptography/ECDSA.sol\";\n\n/**\n @dev Based on SimpleWallet (https://github.com/christianlundkvist/simple-multisig) and uses EIP-712 standard validate a signature\n*/\n\ncontract TransactionRelayer is BaseDSContract, EIP712Upgradeable {\n    using Address for address;\n\n    string public constant NAME = \"TransactionRelayer\";\n\n    // keccak256(\"ExecutePreApprovedTransaction(address destination,bytes32 data,uint256 nonce,bytes32 senderInvestor,uint256 blockLimit)\")\n    bytes32 public constant TXTYPE_HASH = 0x103eaa9a7f02c07fe1be89fcbaf6f0591b7ee351d8bef38fb2e3e71ce08a26c0;\n\n    string public constant CONTRACT_VERSION = \"5\";\n\n    mapping(bytes32 investorHash => uint256 nonce) internal noncePerInvestor;\n\n    event InvestorNonceUpdated(string investorId, uint256 newNonce);\n    struct ExecutePreApprovedTransaction {\n        address destination;\n        bytes data;\n        string senderInvestor;\n        uint256 nonce;\n        uint256 blockLimit;\n    }\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public onlyProxy initializer {\n        __BaseDSContract_init();\n        __EIP712_init(NAME, CONTRACT_VERSION);\n    }\n\n    // Note that address recovered from signatures must be strictly increasing, in order to prevent duplicates\n    function execute(\n        uint8 /*sigV*/,\n        bytes32 /*sigR*/,\n        bytes32 /*sigS*/,\n        address /*destination*/,\n        uint256 /*value*/,\n        bytes memory /*data*/,\n        address /*executor*/,\n        uint256 /*gasLimit*/\n    ) public pure {\n        require(false, \"not implemented\");\n    }\n\n    // Note that address recovered from signatures must be strictly increasing, in order to prevent duplicates\n    function executeByInvestor(\n        uint8 /*sigV*/,\n        bytes32 /*sigR*/,\n        bytes32 /*sigS*/,\n        string memory /*senderInvestor*/,\n        address /*destination*/,\n        uint256 /*value*/,\n        bytes memory /*data*/,\n        address /*executor*/,\n        uint256 /*gasLimit*/\n    ) public pure {\n        require(false, \"not implemented\");\n    }\n\n    /**\n     * @dev Legacy entrypoint kept for ABI compatibility.\n     */\n    function executeByInvestorWithBlockLimit(\n        uint8 /*sigV*/,\n        bytes32 /*sigR*/,\n        bytes32 /*sigS*/,\n        string memory /*senderInvestor*/,\n        address /*destination*/,\n        address /*executor*/,\n        bytes memory /*data*/,\n        uint256[] memory /*params*/\n    ) public pure {\n        require(false, \"not implemented\");\n    }\n\n    /**\n     * @dev Validates una firma EIP-712 y ejecuta la transacción preaprobada.\n     * @param signature Firma compacta de 65 bytes.\n     * @param txData Datos firmados y metadatos necesarios para ejecutar la llamada.\n     */\n    function executePreApprovedTransaction(\n        bytes memory signature,\n        ExecutePreApprovedTransaction calldata txData\n    ) public {\n        require(txData.blockLimit >= block.number, \"Transaction too old\");\n        _executePreApprovedTransaction(signature, txData);\n    }\n\n\n    function nonceByInvestor(string memory investorId) public view returns (uint256) {\n        return noncePerInvestor[CommonUtils.encodeString(investorId)];\n    }\n    /**\n     * @dev Legacy entrypoint kept for ABI compatibility.\n     */\n    function updateDomainSeparator(uint256) public pure {\n        revert(\"not implemented\");\n    }\n\n    function setInvestorNonce(string memory investorId, uint256 newNonce) public onlyMaster {\n        bytes32 investorKey = CommonUtils.encodeString(investorId);\n        uint256 investorNonce = noncePerInvestor[investorKey];\n        require(newNonce > investorNonce, \"New nonce should be greater than old\");\n        noncePerInvestor[investorKey] = newNonce;\n        emit InvestorNonceUpdated(investorId, newNonce);\n    }\n\n    function _executePreApprovedTransaction(\n        bytes memory signature,\n        ExecutePreApprovedTransaction calldata txData\n    ) private {\n        bytes32 investorKey = CommonUtils.encodeString(txData.senderInvestor);\n        uint256 currentNonce = noncePerInvestor[investorKey];\n\n        require(txData.nonce == currentNonce, \"Invalid nonce\");\n\n        bytes32 digest = _hashTx(txData);\n        address recovered = ECDSA.recover(digest, signature);\n        uint256 approverRole = getTrustService().getRole(recovered);\n        require(approverRole == ROLE_ISSUER || approverRole == ROLE_MASTER, 'Invalid signature');\n\n        noncePerInvestor[investorKey] = currentNonce + 1;\n        Address.functionCall(txData.destination, txData.data);\n    }\n\n    /// @dev Computes the digest to sign (EIP-712)\n    function _hashTx(ExecutePreApprovedTransaction calldata txData) private view returns (bytes32) {\n        bytes32 dataHash = keccak256(txData.data);\n        bytes32 senderInvestorHash = keccak256(bytes(txData.senderInvestor));\n        bytes32 structHash = keccak256(\n            abi.encode(\n                TXTYPE_HASH,\n                txData.destination,\n                dataHash,\n                txData.nonce,\n                senderInvestorHash,\n                txData.blockLimit\n            )\n        );\n\n        return _hashTypedDataV4(structHash);\n    }\n}\n"},"@openzeppelin/contracts/utils/Panic.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Panic.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Helper library for emitting standardized panic codes.\n *\n * ```solidity\n * contract Example {\n *      using Panic for uint256;\n *\n *      // Use any of the declared internal constants\n *      function foo() { Panic.GENERIC.panic(); }\n *\n *      // Alternatively\n *      function foo() { Panic.panic(Panic.GENERIC); }\n * }\n * ```\n *\n * Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].\n *\n * _Available since v5.1._\n */\n// slither-disable-next-line unused-state\nlibrary Panic {\n    /// @dev generic / unspecified error\n    uint256 internal constant GENERIC = 0x00;\n    /// @dev used by the assert() builtin\n    uint256 internal constant ASSERT = 0x01;\n    /// @dev arithmetic underflow or overflow\n    uint256 internal constant UNDER_OVERFLOW = 0x11;\n    /// @dev division or modulo by zero\n    uint256 internal constant DIVISION_BY_ZERO = 0x12;\n    /// @dev enum conversion error\n    uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;\n    /// @dev invalid encoding in storage\n    uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;\n    /// @dev empty array pop\n    uint256 internal constant EMPTY_ARRAY_POP = 0x31;\n    /// @dev array out of bounds access\n    uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;\n    /// @dev resource error (too large allocation or too large array)\n    uint256 internal constant RESOURCE_ERROR = 0x41;\n    /// @dev calling invalid internal function\n    uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;\n\n    /// @dev Reverts with a panic code. Recommended to use with\n    /// the internal constants with predefined codes.\n    function panic(uint256 code) internal pure {\n        assembly (\"memory-safe\") {\n            mstore(0x00, 0x4e487b71)\n            mstore(0x20, code)\n            revert(0x1c, 0x24)\n        }\n    }\n}\n"},"contracts/compliance/IDSLockManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSLockManager {\n\n    function initialize() public virtual;\n\n    modifier validLock(uint256 _valueLocked, uint256 _releaseTime) {\n        require(_valueLocked > 0, \"Value is zero\");\n        require(_releaseTime == 0 || _releaseTime > uint256(block.timestamp), \"Release time is in the past\");\n        _;\n    }\n\n    event Locked(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    event Unlocked(address indexed who, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n\n    event HolderLocked(string holderId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    event HolderUnlocked(string holderId, uint256 value, uint256 indexed reason, string reasonString, uint256 releaseTime);\n    /**\n     * @dev creates a lock record for wallet address\n     * @param _to address to lock the tokens at\n     * @param _valueLocked value of tokens to lock\n     * @param _reason reason for lock\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * Note: The user MAY have at a certain time more locked tokens than actual tokens\n     */\n\n    function addManualLockRecord(\n        address _to,\n        uint256 _valueLocked,\n        string calldata _reason,\n        uint256 _releaseTime /*issuerOrAboveOrToken*/\n    ) public virtual;\n\n    /**\n     * @dev creates a lock record for investor Id\n     * @param _investor investor id to lock the tokens at\n     * @param _valueLocked value of tokens to lock\n     * @param _reasonCode reason code for lock\n     * @param _reasonString reason for lock\n     * @param _releaseTime timestamp to release the lock (or 0 for locks which can only released by an unlockTokens call)\n     * Note: The user MAY have at a certain time more locked tokens than actual tokens\n     */\n\n    function createLockForInvestor(\n        string memory _investor,\n        uint256 _valueLocked,\n        uint256 _reasonCode,\n        string calldata _reasonString,\n        uint256 _releaseTime /*onlyIssuerOrAboveOrToken*/\n    ) public virtual;\n\n    /**\n     * @dev Releases a specific lock record for a wallet\n     * @param _to address to release the tokens for\n     * @param _lockIndex the index of the lock to remove\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecord(\n        address _to,\n        uint256 _lockIndex /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Releases a specific lock record for a investor\n     * @param _investorId investor id to release the tokens for\n     * @param _lockIndex the index of the lock to remove\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecordForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Get number of locks currently associated with an address\n     * @param _who address to get count for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockCount(address _who) public view virtual returns (uint256);\n\n    /**\n     * @dev Get number of locks currently associated with a investor\n     * @param _investorId investor id to get count for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n\n    function lockCountForInvestor(string calldata _investorId) public view virtual returns (uint256);\n\n    /**\n     * @dev Get details of a specific lock associated with an address\n     * can be used to iterate through the locks of a user\n     * @param _who address to get token lock for\n     * @param _lockIndex the 0 based index of the lock.\n     * @return reasonCode the reason code\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfo(address _who, uint256 _lockIndex) public view virtual returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime);\n\n    /**\n     * @dev Get details of a specific lock associated with a investor\n     * can be used to iterate through the locks of a user\n     * @param _investorId investorId to get token lock for\n     * @param _lockIndex the 0 based index of the lock.\n     * @return reasonCode the reason code\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfoForInvestor(\n        string memory _investorId,\n        uint256 _lockIndex\n    ) public view virtual  returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime);\n\n    /**\n     * @dev get total number of transferable tokens for a wallet, at a certain time\n     * @param _who address to get number of transferable tokens for\n     * @param _time time to calculate for\n     */\n    function getTransferableTokens(address _who, uint256 _time) public view virtual returns (uint256);\n\n    /**\n     * @dev get total number of transferable tokens for a investor, at a certain time\n     * @param _investorId investor id\n     * @param _time time to calculate for\n     */\n    function getTransferableTokensForInvestor(string memory _investorId, uint256 _time) public view virtual returns (uint256);\n\n    /**\n     * @dev pause investor\n     * @param _investorId investor id\n     */\n    function lockInvestor(\n        string calldata _investorId /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev unpauses investor\n     * @param _investorId investor id\n     */\n    function unlockInvestor(\n        string calldata _investorId /*issuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Returns true if paused, otherwise false\n     * @param _investorId investor id\n     */\n    function isInvestorLocked(string calldata _investorId) public view virtual returns (bool);\n\n    /**\n     * @dev set investor to liquidate only mode\n     * @param _investorId investor id\n     * @param _enabled true to enable, false to disable\n     */\n    function setInvestorLiquidateOnly(string memory _investorId, bool _enabled) public virtual returns (bool);\n\n    /**\n     * @dev Returns true if the investor is in liquidate only mode\n     * @param _investorId investor id\n     */\n    function isInvestorLiquidateOnly(string calldata _investorId) public view virtual returns (bool);\n}\n"},"contracts/mocks/RebasingLibraryMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\n\ncontract RebasingLibraryMock {\n    function convertTokensToShares(\n        uint256 tokens,\n        uint256 multiplier,\n        uint8 decimals\n    ) external pure returns (uint256) {\n        return RebasingLibrary.convertTokensToShares(tokens, multiplier, decimals);\n    }\n\n    function convertSharesToTokens(\n        uint256 shares,\n        uint256 multiplier,\n        uint8 decimals\n    ) external pure returns (uint256) {\n        return RebasingLibrary.convertSharesToTokens(shares, multiplier, decimals);\n    }\n}\n"},"@openzeppelin/contracts/utils/Errors.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Collection of common custom errors used in multiple contracts\n *\n * IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.\n * It is recommended to avoid relying on the error API for critical functionality.\n *\n * _Available since v5.1._\n */\nlibrary Errors {\n    /**\n     * @dev The ETH balance of the account is not enough to perform the operation.\n     */\n    error InsufficientBalance(uint256 balance, uint256 needed);\n\n    /**\n     * @dev A call to an address target failed. The target may have reverted.\n     */\n    error FailedCall();\n\n    /**\n     * @dev The deployment failed.\n     */\n    error FailedDeployment();\n\n    /**\n     * @dev A necessary precompile is missing.\n     */\n    error MissingPrecompile(address);\n}\n"},"contracts/data-stores/TokenDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\nimport {TokenLibrary} from '../token/TokenLibrary.sol';\n\ncontract TokenDataStore is ServiceConsumerDataStore {\n\n    TokenLibrary.TokenData internal tokenData;\n    mapping(address owner => mapping(address spender => uint256 allowance)) internal allowances;\n    mapping(uint256 index => address wallet) internal walletsList;\n    uint256 internal walletsCount;\n    mapping(address wallet => uint256 index) internal walletsToIndexes;\n    // These two variables replace the 2-slot TokenPartitions struct to preserve storage layout\n    address internal DEPRECATED_PARTITIONS_WALLETS;\n    address internal DEPRECATED_PARTITIONS_BALANCES;\n    uint256 public DEPRECATED_CAP;\n    string public name;\n    string public symbol;\n    uint8 public decimals;\n    TokenLibrary.SupportedFeatures public supportedFeatures;\n    bool internal paused;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[35] private __gap;\n}\n"},"contracts/nav/ISecuritizeNavProvider.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npragma solidity 0.8.22;\n\n/**\n * @title ISecuritizeNavProvider\n * @dev Defines a common interface to get NAV (Native Asset Value) Rate to\n */\ninterface ISecuritizeNavProvider {\n    /**\n     * @dev Emitted when owner updates rate.\n     * @param oldValue Old rate value\n     * @param newValue New rate value\n     */\n    event RateUpdated(uint256 oldValue, uint256 newValue);\n\n    /**\n     * @dev Emitted when new rate updater is added.\n     * @param rateUpdater new rate updater\n     */\n    event RateUpdaterAdded(address indexed rateUpdater);\n\n    /**\n     * @dev Emitted when new rate updater is removed.\n     * @param rateUpdater removed rate updater\n     */\n    event RateUpdaterRemoved(address indexed rateUpdater);\n\n    /**\n     * @dev Set the NAV rate.\n     * @param _rate NAV rate value with the same number of decimals as the asset\n     */\n    function setRate(uint256 _rate) external;\n\n    /**\n     * @dev Returns the current NAV rate.\n     * The returned rate will have the same number of decimals as the asset,\n     * being automatically normalized if necessary.\n     * @return rate NAV rate value with the same number of decimals as the asset\n     */\n    function rate() external view returns (uint256);\n}\n"},"contracts/service/IDSServiceConsumer.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSServiceConsumer {\n\n    uint256 public constant TRUST_SERVICE = 1;\n    uint256 public constant DS_TOKEN = 2;\n    uint256 public constant REGISTRY_SERVICE = 4;\n    uint256 public constant COMPLIANCE_SERVICE = 8;\n    uint256 public constant UNUSED_1 = 16;\n    uint256 public constant WALLET_MANAGER = 32;\n    uint256 public constant LOCK_MANAGER = 64;\n    uint256 public constant DEPRECATED_PARTITIONS_MANAGER = 128;\n    uint256 public constant COMPLIANCE_CONFIGURATION_SERVICE = 256;\n    uint256 public constant TOKEN_ISSUER = 512;\n    uint256 public constant WALLET_REGISTRAR = 1024;\n    uint256 public constant DEPRECATED_OMNIBUS_TBE_CONTROLLER = 2048; // Deprecated, keep for backward compatibility\n    uint256 public constant TRANSACTION_RELAYER = 4096;\n    uint256 public constant DEPRECATED_TOKEN_REALLOCATOR = 8192; // Deprecated, keep for backward compatibility\n    uint256 public constant DEPRECATED_ISSUER_MULTICALL = 0;\n    uint256 public constant DEPRECATED_TA_MULTICALL = 0;\n    uint256 public constant DEPRECATED_SECURITIZE_SWAP = 16384;\n    uint256 public constant REBASING_PROVIDER = 8196;\n\n    function getDSService(uint256 _serviceId) public view virtual returns (address);\n\n    function setDSService(\n        uint256 _serviceId,\n        address _address /*onlyMaster*/\n    ) public virtual returns (bool);\n\n    event DSServiceSet(uint256 serviceId, address serviceAddress);\n}\n"},"@openzeppelin/contracts/utils/Address.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Address.sol)\n\npragma solidity ^0.8.20;\n\nimport {Errors} from \"./Errors.sol\";\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n    /**\n     * @dev There's no code at `target` (it is not a contract).\n     */\n    error AddressEmptyCode(address target);\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.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n     */\n    function sendValue(address payable recipient, uint256 amount) internal {\n        if (address(this).balance < amount) {\n            revert Errors.InsufficientBalance(address(this).balance, amount);\n        }\n\n        (bool success, bytes memory returndata) = recipient.call{value: amount}(\"\");\n        if (!success) {\n            _revert(returndata);\n        }\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 or custom error, it is bubbled\n     * up by this function (like regular Solidity function calls). However, if\n     * the call reverted with no returned reason, this function reverts with a\n     * {Errors.FailedCall} error.\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    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n        return functionCallWithValue(target, data, 0);\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    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {\n        if (address(this).balance < value) {\n            revert Errors.InsufficientBalance(address(this).balance, value);\n        }\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a static call.\n     */\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.staticcall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n     * but performing a delegate call.\n     */\n    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n        (bool success, bytes memory returndata) = target.delegatecall(data);\n        return verifyCallResultFromTarget(target, success, returndata);\n    }\n\n    /**\n     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target\n     * was not a contract or bubbling up the revert reason (falling back to {Errors.FailedCall}) in case\n     * of an unsuccessful call.\n     */\n    function verifyCallResultFromTarget(\n        address target,\n        bool success,\n        bytes memory returndata\n    ) internal view returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            // only check if target is a contract if the call was successful and the return data is empty\n            // otherwise we already know that it was a contract\n            if (returndata.length == 0 && target.code.length == 0) {\n                revert AddressEmptyCode(target);\n            }\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the\n     * revert reason or with a default {Errors.FailedCall} error.\n     */\n    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {\n        if (!success) {\n            _revert(returndata);\n        } else {\n            return returndata;\n        }\n    }\n\n    /**\n     * @dev Reverts with returndata if present. Otherwise reverts with {Errors.FailedCall}.\n     */\n    function _revert(bytes memory returndata) 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            assembly (\"memory-safe\") {\n                revert(add(returndata, 0x20), mload(returndata))\n            }\n        } else {\n            revert Errors.FailedCall();\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/Context.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"@openzeppelin/contracts/utils/Strings.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/Strings.sol)\n\npragma solidity ^0.8.20;\n\nimport {Math} from \"./math/Math.sol\";\nimport {SafeCast} from \"./math/SafeCast.sol\";\nimport {SignedMath} from \"./math/SignedMath.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n    using SafeCast for *;\n\n    bytes16 private constant HEX_DIGITS = \"0123456789abcdef\";\n    uint8 private constant ADDRESS_LENGTH = 20;\n    uint256 private constant SPECIAL_CHARS_LOOKUP =\n        (1 << 0x08) | // backspace\n            (1 << 0x09) | // tab\n            (1 << 0x0a) | // newline\n            (1 << 0x0c) | // form feed\n            (1 << 0x0d) | // carriage return\n            (1 << 0x22) | // double quote\n            (1 << 0x5c); // backslash\n\n    /**\n     * @dev The `value` string doesn't fit in the specified `length`.\n     */\n    error StringsInsufficientHexLength(uint256 value, uint256 length);\n\n    /**\n     * @dev The string being parsed contains characters that are not in scope of the given base.\n     */\n    error StringsInvalidChar();\n\n    /**\n     * @dev The string being parsed is not a properly formatted address.\n     */\n    error StringsInvalidAddressFormat();\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            assembly (\"memory-safe\") {\n                ptr := add(add(buffer, 0x20), length)\n            }\n            while (true) {\n                ptr--;\n                assembly (\"memory-safe\") {\n                    mstore8(ptr, byte(mod(value, 10), HEX_DIGITS))\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 toStringSigned(int256 value) internal pure returns (string memory) {\n        return string.concat(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        uint256 localValue = value;\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] = HEX_DIGITS[localValue & 0xf];\n            localValue >>= 4;\n        }\n        if (localValue != 0) {\n            revert StringsInsufficientHexLength(value, length);\n        }\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\n     * 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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal\n     * representation, according to EIP-55.\n     */\n    function toChecksumHexString(address addr) internal pure returns (string memory) {\n        bytes memory buffer = bytes(toHexString(addr));\n\n        // hash the hex part of buffer (skip length + 2 bytes, length 40)\n        uint256 hashValue;\n        assembly (\"memory-safe\") {\n            hashValue := shr(96, keccak256(add(buffer, 0x22), 40))\n        }\n\n        for (uint256 i = 41; i > 1; --i) {\n            // possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)\n            if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {\n                // case shift by xoring with 0x20\n                buffer[i] ^= 0x20;\n            }\n            hashValue >>= 4;\n        }\n        return string(buffer);\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 bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input) internal pure returns (uint256) {\n        return parseUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[0-9]*`\n     * - The result must fit into an `uint256` type\n     */\n    function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        uint256 result = 0;\n        for (uint256 i = begin; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 9) return (false, 0);\n            result *= 10;\n            result += chr;\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a decimal string and returns the value as a `int256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input) internal pure returns (int256) {\n        return parseInt(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `[-+]?[0-9]*`\n     * - The result must fit in an `int256` type.\n     */\n    function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {\n        (bool success, int256 value) = tryParseInt(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if\n     * the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {\n        return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    uint256 private constant ABS_MIN_INT256 = 2 ** 255;\n\n    /**\n     * @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid\n     * character or if the result does not fit in a `int256`.\n     *\n     * NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.\n     */\n    function tryParseInt(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, int256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseIntUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseInt-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseIntUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, int256 value) {\n        bytes memory buffer = bytes(input);\n\n        // Check presence of a negative sign.\n        bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        bool positiveSign = sign == bytes1(\"+\");\n        bool negativeSign = sign == bytes1(\"-\");\n        uint256 offset = (positiveSign || negativeSign).toUint();\n\n        (bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);\n\n        if (absSuccess && absValue < ABS_MIN_INT256) {\n            return (true, negativeSign ? -int256(absValue) : int256(absValue));\n        } else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {\n            return (true, type(int256).min);\n        } else return (false, 0);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as a `uint256`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input) internal pure returns (uint256) {\n        return parseHexUint(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]*`\n     * - The result must fit in an `uint256` type.\n     */\n    function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {\n        (bool success, uint256 value) = tryParseHexUint(input, begin, end);\n        if (!success) revert StringsInvalidChar();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {\n        return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an\n     * invalid character.\n     *\n     * NOTE: This function will revert if the result does not fit in a `uint256`.\n     */\n    function tryParseHexUint(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, uint256 value) {\n        if (end > bytes(input).length || begin > end) return (false, 0);\n        return _tryParseHexUintUncheckedBounds(input, begin, end);\n    }\n\n    /**\n     * @dev Implementation of {tryParseHexUint-string-uint256-uint256} that does not check bounds. Caller should make sure that\n     * `begin <= end <= input.length`. Other inputs would result in undefined behavior.\n     */\n    function _tryParseHexUintUncheckedBounds(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) private pure returns (bool success, uint256 value) {\n        bytes memory buffer = bytes(input);\n\n        // skip 0x prefix if present\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 offset = hasPrefix.toUint() * 2;\n\n        uint256 result = 0;\n        for (uint256 i = begin + offset; i < end; ++i) {\n            uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));\n            if (chr > 15) return (false, 0);\n            result *= 16;\n            unchecked {\n                // Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).\n                // This guarantees that adding a value < 16 will not cause an overflow, hence the unchecked.\n                result += chr;\n            }\n        }\n        return (true, result);\n    }\n\n    /**\n     * @dev Parse a hexadecimal string (with or without \"0x\" prefix), and returns the value as an `address`.\n     *\n     * Requirements:\n     * - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input) internal pure returns (address) {\n        return parseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that parses a substring of `input` located between position `begin` (included) and\n     * `end` (excluded).\n     *\n     * Requirements:\n     * - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`\n     */\n    function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {\n        (bool success, address value) = tryParseAddress(input, begin, end);\n        if (!success) revert StringsInvalidAddressFormat();\n        return value;\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly\n     * formatted address. See {parseAddress-string} requirements.\n     */\n    function tryParseAddress(string memory input) internal pure returns (bool success, address value) {\n        return tryParseAddress(input, 0, bytes(input).length);\n    }\n\n    /**\n     * @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly\n     * formatted address. See {parseAddress-string-uint256-uint256} requirements.\n     */\n    function tryParseAddress(\n        string memory input,\n        uint256 begin,\n        uint256 end\n    ) internal pure returns (bool success, address value) {\n        if (end > bytes(input).length || begin > end) return (false, address(0));\n\n        bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2(\"0x\"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty\n        uint256 expectedLength = 40 + hasPrefix.toUint() * 2;\n\n        // check that input is the correct length\n        if (end - begin == expectedLength) {\n            // length guarantees that this does not overflow, and value is at most type(uint160).max\n            (bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);\n            return (s, address(uint160(v)));\n        } else {\n            return (false, address(0));\n        }\n    }\n\n    function _tryParseChr(bytes1 chr) private pure returns (uint8) {\n        uint8 value = uint8(chr);\n\n        // Try to parse `chr`:\n        // - Case 1: [0-9]\n        // - Case 2: [a-f]\n        // - Case 3: [A-F]\n        // - otherwise not supported\n        unchecked {\n            if (value > 47 && value < 58) value -= 48;\n            else if (value > 96 && value < 103) value -= 87;\n            else if (value > 64 && value < 71) value -= 55;\n            else return type(uint8).max;\n        }\n\n        return value;\n    }\n\n    /**\n     * @dev Escape special characters in JSON strings. This can be useful to prevent JSON injection in NFT metadata.\n     *\n     * WARNING: This function should only be used in double quoted JSON strings. Single quotes are not escaped.\n     *\n     * NOTE: This function escapes all unicode characters, and not just the ones in ranges defined in section 2.5 of\n     * RFC-4627 (U+0000 to U+001F, U+0022 and U+005C). ECMAScript's `JSON.parse` does recover escaped unicode\n     * characters that are not in this range, but other tooling may provide different results.\n     */\n    function escapeJSON(string memory input) internal pure returns (string memory) {\n        bytes memory buffer = bytes(input);\n        bytes memory output = new bytes(2 * buffer.length); // worst case scenario\n        uint256 outputLength = 0;\n\n        for (uint256 i; i < buffer.length; ++i) {\n            bytes1 char = bytes1(_unsafeReadBytesOffset(buffer, i));\n            if (((SPECIAL_CHARS_LOOKUP & (1 << uint8(char))) != 0)) {\n                output[outputLength++] = \"\\\\\";\n                if (char == 0x08) output[outputLength++] = \"b\";\n                else if (char == 0x09) output[outputLength++] = \"t\";\n                else if (char == 0x0a) output[outputLength++] = \"n\";\n                else if (char == 0x0c) output[outputLength++] = \"f\";\n                else if (char == 0x0d) output[outputLength++] = \"r\";\n                else if (char == 0x5c) output[outputLength++] = \"\\\\\";\n                else if (char == 0x22) {\n                    // solhint-disable-next-line quotes\n                    output[outputLength++] = '\"';\n                }\n            } else {\n                output[outputLength++] = char;\n            }\n        }\n        // write the actual length and deallocate unused memory\n        assembly (\"memory-safe\") {\n            mstore(output, outputLength)\n            mstore(0x40, add(output, shl(5, shr(5, add(outputLength, 63)))))\n        }\n\n        return string(output);\n    }\n\n    /**\n     * @dev Reads a bytes32 from a bytes array without bounds checking.\n     *\n     * NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the\n     * assembly block as such would prevent some optimizations.\n     */\n    function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {\n        // This is not memory safe in the general case, but all calls to this private function are within bounds.\n        assembly (\"memory-safe\") {\n            value := mload(add(add(buffer, 0x20), offset))\n        }\n    }\n}\n"},"contracts/compliance/IDSWalletManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSWalletManager {\n\n    function initialize() public virtual;\n\n    // Special wallets constants\n    uint8 public constant NONE = 0;\n    uint8 public constant ISSUER = 1;\n    uint8 public constant PLATFORM = 2;\n    uint8 public constant EXCHANGE = 4;\n\n    /**\n     * @dev should be emitted when a special wallet is added.\n     */\n    event DSWalletManagerSpecialWalletAdded(address wallet, uint8 walletType, address sender);\n    /**\n     * @dev should be emitted when a special wallet is removed.\n     */\n    event DSWalletManagerSpecialWalletRemoved(address wallet, uint8 walletType, address sender);\n    /**\n     * @dev should be emitted when the number of reserved slots is set for a wallet.\n     */\n    event DSWalletManagerReservedSlotsSet(address wallet, string country, uint8 accreditationStatus, uint256 slots, address sender);\n\n    /**\n     * @dev Sets a wallet to be an special wallet. (internal)\n     * @param _wallet The address of the wallet.\n     * @param _type The type of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function setSpecialWallet(address _wallet, uint8 _type) internal virtual returns (bool);\n\n    /**\n     * @dev gets a wallet type\n     * @param _wallet the address of the wallet to check.\n     */\n    function getWalletType(address _wallet) public view virtual returns (uint8);\n\n    /**\n     * @dev Returns true if it is platform wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isPlatformWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Returns true if it is special wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isSpecialWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Returns true if it is issuer special wallet\n     * @param _wallet the address of the wallet to check.\n     */\n    function isIssuerSpecialWallet(address _wallet) external view virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be an issuer wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addIssuerWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets an array of wallets to be issuer wallets.\n     * @param _wallets The address of the wallets.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addIssuerWallets(address[] calldata _wallets) public virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be a platform wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addPlatformWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    /**\n     * @dev Sets an array of wallets to be platforms wallet.\n     * @param _wallets The address of the wallets.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addPlatformWallets(address[] calldata _wallets) public virtual returns (bool);\n\n    /**\n     * @dev Sets a wallet to be an exchange wallet.\n     * @param _wallet The address of the wallet.\n     * @param _owner The address of the owner.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function addExchangeWallet(address _wallet, address _owner) public virtual returns (bool);\n\n    /**\n     * @dev Removes a special wallet.\n     * @param _wallet The address of the wallet.\n     * @return A boolean that indicates if the operation was successful.\n     */\n    function removeSpecialWallet(\n        address _wallet /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n}\n"},"contracts/registry/IDSRegistryService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\nabstract contract IDSRegistryService {\n\n    function initialize() public virtual;\n\n    event DSRegistryServiceInvestorAdded(string investorId, address sender);\n    event DSRegistryServiceInvestorRemoved(string investorId, address sender);\n    event DSRegistryServiceInvestorCountryChanged(string investorId, string country, address sender);\n    event DSRegistryServiceInvestorAttributeChanged(string investorId, uint256 attributeId, uint256 value, uint256 expiry, string proofHash, address sender);\n    event DSRegistryServiceWalletAdded(address wallet, string investorId, address sender);\n    event DSRegistryServiceWalletRemoved(address wallet, string investorId, address sender);\n\n    uint8 public constant NONE = 0;\n    uint8 public constant KYC_APPROVED = 1;\n    uint8 public constant ACCREDITED = 2;\n    uint8 public constant QUALIFIED = 4;\n    uint8 public constant PROFESSIONAL = 8;\n\n    uint8 public constant PENDING = 0;\n    uint8 public constant APPROVED = 1;\n    uint8 public constant REJECTED = 2;\n\n    uint8 public constant EXCHANGE = 4;\n\n    modifier investorExists(string memory _id) {\n        require(isInvestor(_id), \"Unknown investor\");\n        _;\n    }\n\n    modifier newInvestor(string memory _id) {\n        require(!CommonUtils.isEmptyString(_id), \"Investor id must not be empty\");\n        require(!isInvestor(_id), \"Investor already exists\");\n        _;\n    }\n\n    modifier walletExists(address _address) {\n        require(isWallet(_address), \"Unknown wallet\");\n        _;\n    }\n\n    modifier newWallet(address _address) {\n        require(!isWallet(_address), \"Wallet already exists\");\n        _;\n    }\n\n    modifier walletBelongsToInvestor(address _address, string memory _id) {\n        require(CommonUtils.isEqualString(getInvestor(_address), _id), \"Wallet does not belong to investor\");\n        _;\n    }\n\n    function registerInvestor(\n        string calldata _id,\n        string calldata _collision_hash /*onlyExchangeOrAbove newInvestor(_id)*/\n    ) public virtual returns (bool);\n\n    function updateInvestor(\n        string calldata _id,\n        string calldata _collisionHash,\n        string memory _country,\n        address[] memory _wallets,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations /*onlyIssuerOrAbove*/\n    ) public virtual returns (bool);\n\n    function removeInvestor(\n        string calldata _id /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function setCountry(\n        string calldata _id,\n        string memory _country /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function getCountry(string memory _id) public view virtual returns (string memory);\n\n    function getCollisionHash(string calldata _id) public view virtual returns (string memory);\n\n    function setAttribute(\n        string calldata _id,\n        uint8 _attributeId,\n        uint256 _value,\n        uint256 _expiry,\n        string memory _proofHash /*onlyExchangeOrAbove investorExists(_id)*/\n    ) public virtual returns (bool);\n\n    function getAttributeValue(string memory _id, uint8 _attributeId) public view virtual returns (uint256);\n\n    function getAttributeExpiry(string memory _id, uint8 _attributeId) public view virtual returns (uint256);\n\n    function getAttributeProofHash(string memory _id, uint8 _attributeId) public view virtual returns (string memory);\n\n    function addWallet(\n        address _address,\n        string memory _id /*onlyExchangeOrAbove newWallet(_address)*/\n    ) public virtual returns (bool);\n\n\n    function removeWallet(\n        address _address,\n        string memory _id /*onlyExchangeOrAbove walletExists walletBelongsToInvestor(_address, _id)*/\n    ) public virtual returns (bool);\n\n    function getInvestor(address _address) public view virtual returns (string memory);\n\n    function getInvestorDetails(address _address) public view virtual returns (string memory, string memory);\n\n    function getInvestorDetailsFull(string memory _id)\n        public\n        view\n        virtual\n        returns (string memory, uint256[] memory, uint256[] memory, string memory, string memory, string memory, string memory);\n\n    function isInvestor(string memory _id) public view virtual returns (bool);\n\n    function isWallet(address _address) public view virtual returns (bool);\n\n    function isAccreditedInvestor(string calldata _id) external view virtual returns (bool);\n\n    function isQualifiedInvestor(string calldata _id) external view virtual returns (bool);\n\n    function isAccreditedInvestor(address _wallet) external view virtual returns (bool);\n\n    function isQualifiedInvestor(address _wallet) external view virtual returns (bool);\n\n    function getInvestors(address _from, address _to) external view virtual returns (string memory, string memory);\n}\n"},"contracts/registry/IDSWalletRegistrar.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSWalletRegistrar {\n\n    function initialize() public virtual;\n\n    function registerWallet(\n        string memory _id,\n        address[] calldata _wallets,\n        string calldata _collisionHash,\n        string memory _country,\n        uint8[] memory _attributeIds,\n        uint256[] memory _attributeValues,\n        uint256[] memory _attributeExpirations /*onlyOwner*/\n    ) public virtual returns (bool);\n}\n"},"contracts/compliance/ComplianceService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSComplianceService} from \"./IDSComplianceService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {ComplianceServiceDataStore} from \"../data-stores/ComplianceServiceDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {RebasingLibrary} from \"../rebasing/RebasingLibrary.sol\";\nimport {IERC20Metadata} from \"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\n\n\n/**\n *   @title Compliance service main implementation.\n *\n *   Combines the different implementation files for the compliance service and serves as a base class for\n *   concrete implementation.\n *\n *   To create a concrete implementation of a compliance service, one should inherit from this contract,\n *   and implement the five functions - recordIssuance,checkTransfer,recordTransfer,recordBurn and recordSeize.\n *   The rest of the functions should only be overridden in rare circumstances.\n */\n\nabstract contract ComplianceService is IDSComplianceService, ComplianceServiceDataStore, BaseDSContract {\n\n    function initialize() public virtual override onlyProxy onlyInitializing {\n        __BaseDSContract_init();\n    }\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public override onlyToken returns (bool) {\n        uint256 code;\n        string memory reason;\n\n        (code, reason) = preTransferCheck(_from, _to, _value);\n        require(code == 0, reason);\n\n        return recordTransfer(_from,_to, _value);\n    }\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value,\n        bool _paused,\n        uint256 _balanceFrom\n    ) public virtual override onlyToken returns (bool) {\n        uint256 code;\n        string memory reason;\n\n        (code, reason) = newPreTransferCheck(_from, _to, _value, _balanceFrom, _paused);\n        require(code == 0, reason);\n\n        return recordTransfer(_from,_to, _value);\n    }\n\n    function validateIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime\n    ) public override onlyToken returns (bool) {\n        uint256 code;\n        string memory reason;\n\n        uint256 authorizedSecurities = getComplianceConfigurationService().getAuthorizedSecurities();\n\n        uint256 totalSupply = getToken().totalSupply();\n\n        require(authorizedSecurities == 0 || totalSupply + _value <= authorizedSecurities,\n            MAX_AUTHORIZED_SECURITIES_EXCEEDED);\n\n        (code, reason) = preIssuanceCheck(_to, _value);\n        require(code == 0, reason);\n\n        uint256 issuanceTime = validateIssuanceTime(_issuanceTime);\n        return recordIssuance(_to, _value, issuanceTime);\n    }\n\n    function validateBurn(address _who, uint256 _value) public virtual override onlyToken returns (bool) {\n        return recordBurn(_who, _value);\n    }\n\n    function validateSeize(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public virtual override onlyToken returns (bool) {\n        require(getWalletManager().isIssuerSpecialWallet(_to), \"Target wallet type error\");\n\n        return recordSeize(_from, _to, _value);\n    }\n\n    /**\n     * @dev Verify disallowBackDating compliance: if set to false returns _issuanceTime parameter, otherwise returns current timestamp\n     * @param _issuanceTime.\n     * @return issuanceTime\n     */\n    function validateIssuanceTime(uint256 _issuanceTime) public view override returns (uint256 issuanceTime) {\n        if (!getComplianceConfigurationService().getDisallowBackDating()) {\n            return _issuanceTime;\n        }\n        return block.timestamp;\n    }\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        if (_pausedToken) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        if (_balanceFrom < _value) {\n            return (15, NOT_ENOUGH_TOKENS);\n        }\n\n        if (getLockManager().getTransferableTokens(_from, block.timestamp) < _value) {\n            return (16, TOKENS_LOCKED);\n        }\n\n        return checkTransfer(_from, _to, _value);\n    }\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        IDSToken token = getToken();\n        return newPreTransferCheck(_from, _to, _value, token.balanceOf(_from), token.isPaused());\n    }\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        if (getToken().isPaused()) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        return checkTransfer(_from, _to, _value);\n    }\n\n    function preIssuanceCheck(\n        address, /*_to*/\n        uint256 /*_value*/\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return (0, VALID);\n    }\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory, /*_id*/\n        string memory, /*_country*/\n        string memory /*_prevCountry*/\n    ) public virtual override returns (bool) {\n        return true;\n    }\n\n    // These functions should be implemented by the concrete compliance manager\n    function recordIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime\n    ) internal virtual returns (bool);\n\n    function recordTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal virtual returns (bool);\n\n    function recordBurn(address _who, uint256 _value) internal virtual returns (bool);\n\n    function recordSeize(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal virtual returns (bool);\n\n    function checkTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal view virtual returns (uint256, string memory);\n}\n"},"@openzeppelin/contracts/utils/math/Math.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.20;\n\nimport {Panic} from \"../Panic.sol\";\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n    enum Rounding {\n        Floor, // Toward negative infinity\n        Ceil, // Toward positive infinity\n        Trunc, // Toward zero\n        Expand // Away from zero\n    }\n\n    /**\n     * @dev Return the 512-bit addition of two uint256.\n     *\n     * The result is stored in two 256 variables such that sum = high * 2²⁵⁶ + low.\n     */\n    function add512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        assembly (\"memory-safe\") {\n            low := add(a, b)\n            high := lt(low, a)\n        }\n    }\n\n    /**\n     * @dev Return the 512-bit multiplication of two uint256.\n     *\n     * The result is stored in two 256 variables such that product = high * 2²⁵⁶ + low.\n     */\n    function mul512(uint256 a, uint256 b) internal pure returns (uint256 high, uint256 low) {\n        // 512-bit multiply [high low] = x * y. Compute the product mod 2²⁵⁶ and mod 2²⁵⁶ - 1, then use\n        // the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n        // variables such that product = high * 2²⁵⁶ + low.\n        assembly (\"memory-safe\") {\n            let mm := mulmod(a, b, not(0))\n            low := mul(a, b)\n            high := sub(sub(mm, low), lt(mm, low))\n        }\n    }\n\n    /**\n     * @dev Returns the addition of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a + b;\n            success = c >= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the subtraction of two unsigned integers, with a success flag (no overflow).\n     */\n    function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a - b;\n            success = c <= a;\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the multiplication of two unsigned integers, with a success flag (no overflow).\n     */\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            uint256 c = a * b;\n            assembly (\"memory-safe\") {\n                // Only true when the multiplication doesn't overflow\n                // (c / a == b) || (a == 0)\n                success := or(eq(div(c, a), b), iszero(a))\n            }\n            // equivalent to: success ? c : 0\n            result = c * SafeCast.toUint(success);\n        }\n    }\n\n    /**\n     * @dev Returns the division of two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `DIV` opcode returns zero when the denominator is 0.\n                result := div(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).\n     */\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {\n        unchecked {\n            success = b > 0;\n            assembly (\"memory-safe\") {\n                // The `MOD` opcode returns zero when the denominator is 0.\n                result := mod(a, b)\n            }\n        }\n    }\n\n    /**\n     * @dev Unsigned saturating addition, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingAdd(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryAdd(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Unsigned saturating subtraction, bounds to zero instead of overflowing.\n     */\n    function saturatingSub(uint256 a, uint256 b) internal pure returns (uint256) {\n        (, uint256 result) = trySub(a, b);\n        return result;\n    }\n\n    /**\n     * @dev Unsigned saturating multiplication, bounds to `2²⁵⁶ - 1` instead of overflowing.\n     */\n    function saturatingMul(uint256 a, uint256 b) internal pure returns (uint256) {\n        (bool success, uint256 result) = tryMul(a, b);\n        return ternary(success, result, type(uint256).max);\n    }\n\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * SafeCast.toUint(condition));\n        }\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 ternary(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 ternary(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 towards infinity instead\n     * of rounding towards zero.\n     */\n    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n        if (b == 0) {\n            // Guarantee the same behavior as in a regular Solidity division.\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n\n        // The following calculation ensures accurate ceiling division without overflow.\n        // Since a is non-zero, (a - 1) / b will not overflow.\n        // The largest possible result occurs when (a - 1) / b is type(uint256).max,\n        // but the largest value we can obtain is type(uint256).max - 1, which happens\n        // when a = type(uint256).max and b = 1.\n        unchecked {\n            return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);\n        }\n    }\n\n    /**\n     * @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or\n     * denominator == 0.\n     *\n     * Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by\n     * Uniswap Labs also under MIT license.\n     */\n    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n\n            // Handle non-overflow cases, 256 by 256 division.\n            if (high == 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 low / denominator;\n            }\n\n            // Make sure the result is less than 2²⁵⁶. Also prevents denominator == 0.\n            if (denominator <= high) {\n                Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));\n            }\n\n            ///////////////////////////////////////////////\n            // 512 by 256 division.\n            ///////////////////////////////////////////////\n\n            // Make division exact by subtracting the remainder from [high low].\n            uint256 remainder;\n            assembly (\"memory-safe\") {\n                // Compute remainder using mulmod.\n                remainder := mulmod(x, y, denominator)\n\n                // Subtract 256 bit number from 512 bit number.\n                high := sub(high, gt(remainder, low))\n                low := sub(low, remainder)\n            }\n\n            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.\n            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.\n\n            uint256 twos = denominator & (0 - denominator);\n            assembly (\"memory-safe\") {\n                // Divide denominator by twos.\n                denominator := div(denominator, twos)\n\n                // Divide [high low] by twos.\n                low := div(low, twos)\n\n                // Flip twos such that it is 2²⁵⁶ / 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 high into low.\n            low |= high * twos;\n\n            // Invert denominator mod 2²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such\n            // that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for\n            // four bits. That is, denominator * inv ≡ 1 mod 2⁴.\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\n            // works in modular arithmetic, doubling the correct bits in each step.\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶\n            inverse *= 2 - denominator * inverse; // inverse mod 2³²\n            inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴\n            inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸\n            inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶\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²⁵⁶. Since the preconditions guarantee that the outcome is\n            // less than 2²⁵⁶, this is the final result. We don't need to compute the high bits of the result and high\n            // is no longer required.\n            result = low * inverse;\n            return result;\n        }\n    }\n\n    /**\n     * @dev 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        return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);\n    }\n\n    /**\n     * @dev Calculates floor(x * y >> n) with full precision. Throws if result overflows a uint256.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n) internal pure returns (uint256 result) {\n        unchecked {\n            (uint256 high, uint256 low) = mul512(x, y);\n            if (high >= 1 << n) {\n                Panic.panic(Panic.UNDER_OVERFLOW);\n            }\n            return (high << (256 - n)) | (low >> n);\n        }\n    }\n\n    /**\n     * @dev Calculates x * y >> n with full precision, following the selected rounding direction.\n     */\n    function mulShr(uint256 x, uint256 y, uint8 n, Rounding rounding) internal pure returns (uint256) {\n        return mulShr(x, y, n) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, 1 << n) > 0);\n    }\n\n    /**\n     * @dev Calculate the modular multiplicative inverse of a number in Z/nZ.\n     *\n     * If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.\n     * If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.\n     *\n     * If the input value is not inversible, 0 is returned.\n     *\n     * NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the\n     * inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.\n     */\n    function invMod(uint256 a, uint256 n) internal pure returns (uint256) {\n        unchecked {\n            if (n == 0) return 0;\n\n            // The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)\n            // Used to compute integers x and y such that: ax + ny = gcd(a, n).\n            // When the gcd is 1, then the inverse of a modulo n exists and it's x.\n            // ax + ny = 1\n            // ax = 1 + (-y)n\n            // ax ≡ 1 (mod n) # x is the inverse of a modulo n\n\n            // If the remainder is 0 the gcd is n right away.\n            uint256 remainder = a % n;\n            uint256 gcd = n;\n\n            // Therefore the initial coefficients are:\n            // ax + ny = gcd(a, n) = n\n            // 0a + 1n = n\n            int256 x = 0;\n            int256 y = 1;\n\n            while (remainder != 0) {\n                uint256 quotient = gcd / remainder;\n\n                (gcd, remainder) = (\n                    // The old remainder is the next gcd to try.\n                    remainder,\n                    // Compute the next remainder.\n                    // Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd\n                    // where gcd is at most n (capped to type(uint256).max)\n                    gcd - remainder * quotient\n                );\n\n                (x, y) = (\n                    // Increment the coefficient of a.\n                    y,\n                    // Decrement the coefficient of n.\n                    // Can overflow, but the result is casted to uint256 so that the\n                    // next value of y is \"wrapped around\" to a value between 0 and n - 1.\n                    x - y * int256(quotient)\n                );\n            }\n\n            if (gcd != 1) return 0; // No inverse exists.\n            return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.\n        }\n    }\n\n    /**\n     * @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.\n     *\n     * From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is\n     * prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that\n     * `a**(p-2)` is the modular multiplicative inverse of a in Fp.\n     *\n     * NOTE: this function does NOT check that `p` is a prime greater than `2`.\n     */\n    function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {\n        unchecked {\n            return Math.modExp(a, p - 2, p);\n        }\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)\n     *\n     * Requirements:\n     * - modulus can't be zero\n     * - underlying staticcall to precompile must succeed\n     *\n     * IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make\n     * sure the chain you're using it on supports the precompiled contract for modular exponentiation\n     * at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,\n     * the underlying function will succeed given the lack of a revert, but the result may be incorrectly\n     * interpreted as 0.\n     */\n    function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {\n        (bool success, uint256 result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).\n     * It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying\n     * to operate modulo 0 or if the underlying precompile reverted.\n     *\n     * IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain\n     * you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in\n     * https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack\n     * of a revert, but the result may be incorrectly interpreted as 0.\n     */\n    function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {\n        if (m == 0) return (false, 0);\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            // | Offset    | Content    | Content (Hex)                                                      |\n            // |-----------|------------|--------------------------------------------------------------------|\n            // | 0x00:0x1f | size of b  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x20:0x3f | size of e  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x40:0x5f | size of m  | 0x0000000000000000000000000000000000000000000000000000000000000020 |\n            // | 0x60:0x7f | value of b | 0x<.............................................................b> |\n            // | 0x80:0x9f | value of e | 0x<.............................................................e> |\n            // | 0xa0:0xbf | value of m | 0x<.............................................................m> |\n            mstore(ptr, 0x20)\n            mstore(add(ptr, 0x20), 0x20)\n            mstore(add(ptr, 0x40), 0x20)\n            mstore(add(ptr, 0x60), b)\n            mstore(add(ptr, 0x80), e)\n            mstore(add(ptr, 0xa0), m)\n\n            // Given the result < m, it's guaranteed to fit in 32 bytes,\n            // so we can use the memory scratch space located at offset 0.\n            success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)\n            result := mload(0x00)\n        }\n    }\n\n    /**\n     * @dev Variant of {modExp} that supports inputs of arbitrary length.\n     */\n    function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {\n        (bool success, bytes memory result) = tryModExp(b, e, m);\n        if (!success) {\n            Panic.panic(Panic.DIVISION_BY_ZERO);\n        }\n        return result;\n    }\n\n    /**\n     * @dev Variant of {tryModExp} that supports inputs of arbitrary length.\n     */\n    function tryModExp(\n        bytes memory b,\n        bytes memory e,\n        bytes memory m\n    ) internal view returns (bool success, bytes memory result) {\n        if (_zeroBytes(m)) return (false, new bytes(0));\n\n        uint256 mLen = m.length;\n\n        // Encode call args in result and move the free memory pointer\n        result = abi.encodePacked(b.length, e.length, mLen, b, e, m);\n\n        assembly (\"memory-safe\") {\n            let dataPtr := add(result, 0x20)\n            // Write result on top of args to avoid allocating extra memory.\n            success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)\n            // Overwrite the length.\n            // result.length > returndatasize() is guaranteed because returndatasize() == m.length\n            mstore(result, mLen)\n            // Set the memory pointer after the returned data.\n            mstore(0x40, add(dataPtr, mLen))\n        }\n    }\n\n    /**\n     * @dev Returns whether the provided byte array is zero.\n     */\n    function _zeroBytes(bytes memory byteArray) private pure returns (bool) {\n        for (uint256 i = 0; i < byteArray.length; ++i) {\n            if (byteArray[i] != 0) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded\n     * towards zero.\n     *\n     * This method is based on Newton's method for computing square roots; the algorithm is restricted to only\n     * using integer operations.\n     */\n    function sqrt(uint256 a) internal pure returns (uint256) {\n        unchecked {\n            // Take care of easy edge cases when a == 0 or a == 1\n            if (a <= 1) {\n                return a;\n            }\n\n            // In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a\n            // sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between\n            // the current value as `ε_n = | x_n - sqrt(a) |`.\n            //\n            // For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root\n            // of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is\n            // bigger than any uint256.\n            //\n            // By noticing that\n            // `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`\n            // we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar\n            // to the msb function.\n            uint256 aa = a;\n            uint256 xn = 1;\n\n            if (aa >= (1 << 128)) {\n                aa >>= 128;\n                xn <<= 64;\n            }\n            if (aa >= (1 << 64)) {\n                aa >>= 64;\n                xn <<= 32;\n            }\n            if (aa >= (1 << 32)) {\n                aa >>= 32;\n                xn <<= 16;\n            }\n            if (aa >= (1 << 16)) {\n                aa >>= 16;\n                xn <<= 8;\n            }\n            if (aa >= (1 << 8)) {\n                aa >>= 8;\n                xn <<= 4;\n            }\n            if (aa >= (1 << 4)) {\n                aa >>= 4;\n                xn <<= 2;\n            }\n            if (aa >= (1 << 2)) {\n                xn <<= 1;\n            }\n\n            // We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).\n            //\n            // We can refine our estimation by noticing that the middle of that interval minimizes the error.\n            // If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).\n            // This is going to be our x_0 (and ε_0)\n            xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)\n\n            // From here, Newton's method give us:\n            // x_{n+1} = (x_n + a / x_n) / 2\n            //\n            // One should note that:\n            // x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a\n            //              = ((x_n² + a) / (2 * x_n))² - a\n            //              = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a\n            //              = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)\n            //              = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)\n            //              = (x_n² - a)² / (2 * x_n)²\n            //              = ((x_n² - a) / (2 * x_n))²\n            //              ≥ 0\n            // Which proves that for all n ≥ 1, sqrt(a) ≤ x_n\n            //\n            // This gives us the proof of quadratic convergence of the sequence:\n            // ε_{n+1} = | x_{n+1} - sqrt(a) |\n            //         = | (x_n + a / x_n) / 2 - sqrt(a) |\n            //         = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |\n            //         = | (x_n - sqrt(a))² / (2 * x_n) |\n            //         = | ε_n² / (2 * x_n) |\n            //         = ε_n² / | (2 * x_n) |\n            //\n            // For the first iteration, we have a special case where x_0 is known:\n            // ε_1 = ε_0² / | (2 * x_0) |\n            //     ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))\n            //     ≤ 2**(2*e-4) / (3 * 2**(e-1))\n            //     ≤ 2**(e-3) / 3\n            //     ≤ 2**(e-3-log2(3))\n            //     ≤ 2**(e-4.5)\n            //\n            // For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:\n            // ε_{n+1} = ε_n² / | (2 * x_n) |\n            //         ≤ (2**(e-k))² / (2 * 2**(e-1))\n            //         ≤ 2**(2*e-2*k) / 2**e\n            //         ≤ 2**(e-2*k)\n            xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5)  -- special case, see above\n            xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9)    -- general case with k = 4.5\n            xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18)   -- general case with k = 9\n            xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36)   -- general case with k = 18\n            xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72)   -- general case with k = 36\n            xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144)  -- general case with k = 72\n\n            // Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision\n            // ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either\n            // sqrt(a) or sqrt(a) + 1.\n            return xn - SafeCast.toUint(xn > a / xn);\n        }\n    }\n\n    /**\n     * @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 2 of a positive value rounded towards zero.\n     * Returns 0 if given 0.\n     */\n    function log2(uint256 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // If upper 8 bits of 16-bit half set, add 8 to result\n        r |= SafeCast.toUint((x >> r) > 0xff) << 3;\n        // If upper 4 bits of 8-bit half set, add 4 to result\n        r |= SafeCast.toUint((x >> r) > 0xf) << 2;\n\n        // Shifts value right by the current result and use it as an index into this lookup table:\n        //\n        // | x (4 bits) |  index  | table[index] = MSB position |\n        // |------------|---------|-----------------------------|\n        // |    0000    |    0    |        table[0] = 0         |\n        // |    0001    |    1    |        table[1] = 0         |\n        // |    0010    |    2    |        table[2] = 1         |\n        // |    0011    |    3    |        table[3] = 1         |\n        // |    0100    |    4    |        table[4] = 2         |\n        // |    0101    |    5    |        table[5] = 2         |\n        // |    0110    |    6    |        table[6] = 2         |\n        // |    0111    |    7    |        table[7] = 2         |\n        // |    1000    |    8    |        table[8] = 3         |\n        // |    1001    |    9    |        table[9] = 3         |\n        // |    1010    |   10    |        table[10] = 3        |\n        // |    1011    |   11    |        table[11] = 3        |\n        // |    1100    |   12    |        table[12] = 3        |\n        // |    1101    |   13    |        table[13] = 3        |\n        // |    1110    |   14    |        table[14] = 3        |\n        // |    1111    |   15    |        table[15] = 3        |\n        //\n        // The lookup table is represented as a 32-byte value with the MSB positions for 0-15 in the last 16 bytes.\n        assembly (\"memory-safe\") {\n            r := or(r, byte(shr(r, x), 0x0000010102020202030303030303030300000000000000000000000000000000))\n        }\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 10 of a positive value rounded towards zero.\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);\n        }\n    }\n\n    /**\n     * @dev Return the log in base 256 of a positive value rounded towards zero.\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 x) internal pure returns (uint256 r) {\n        // If value has upper 128 bits set, log2 result is at least 128\n        r = SafeCast.toUint(x > 0xffffffffffffffffffffffffffffffff) << 7;\n        // If upper 64 bits of 128-bit half set, add 64 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffffffffffff) << 6;\n        // If upper 32 bits of 64-bit half set, add 32 to result\n        r |= SafeCast.toUint((x >> r) > 0xffffffff) << 5;\n        // If upper 16 bits of 32-bit half set, add 16 to result\n        r |= SafeCast.toUint((x >> r) > 0xffff) << 4;\n        // Add 1 if upper 8 bits of 16-bit half set, and divide accumulated result by 8\n        return (r >> 3) | SafeCast.toUint((x >> r) > 0xff);\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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);\n        }\n    }\n\n    /**\n     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.\n     */\n    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {\n        return uint8(rounding) % 2 == 1;\n    }\n}\n"},"contracts/compliance/InvestorLockManager.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSLockManager} from \"./IDSLockManager.sol\";\nimport {InvestorLockManagerBase} from \"./InvestorLockManagerBase.sol\";\nimport {InvestorLockManagerDataStore} from \"../data-stores/InvestorLockManagerDataStore.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\n\ncontract InvestorLockManager is InvestorLockManagerBase {\n    uint256 constant MAX_LOCKS_PER_INVESTOR = 30;\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function setLockInfoImpl(string memory _investor, uint256 _lockIndex, uint256 _valueLocked, uint256 _reasonCode, string memory _reasonString, uint256 _releaseTime) internal {\n        investorsLocks[_investor][_lockIndex] = Lock(_valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function createLockForInvestor(string memory _investor, uint256 _valueLocked, uint256 _reasonCode, string calldata _reasonString, uint256 _releaseTime)\n        public\n        override\n        validLock(_valueLocked, _releaseTime)\n        onlyTransferAgentOrAboveOrToken\n    {\n        //Get total count\n        uint256 totalLockCount = investorsLocksCounts[_investor];\n        //Only allow MAX_LOCKS_PER_INVESTOR locks per address, to prevent out-of-gas at transfer scenarios\n        require(totalLockCount < MAX_LOCKS_PER_INVESTOR, \"Too many locks for this investor\");\n        setLockInfoImpl(_investor, totalLockCount, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n        totalLockCount += 1;\n        investorsLocksCounts[_investor] = totalLockCount;\n        emit HolderLocked(_investor, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function createLock(address _to, uint256 _valueLocked, uint256 _reasonCode, string calldata _reasonString, uint256 _releaseTime) internal {\n        createLockForInvestor(getRegistryService().getInvestor(_to), _valueLocked, _reasonCode, _reasonString, _releaseTime);\n        emit Locked(_to, _valueLocked, _reasonCode, _reasonString, _releaseTime);\n    }\n\n    function addManualLockRecord(address _to, uint256 _valueLocked, string calldata _reason, uint256 _releaseTime) public override onlyTransferAgentOrAboveOrToken {\n        require(_to != address(0), \"Invalid address\");\n        createLock(_to, _valueLocked, 0, _reason, _releaseTime);\n    }\n\n    function removeLockRecordForInvestor(string memory _investorId, uint256 _lockIndex) public override onlyTransferAgentOrAbove returns (bool) {\n        emit HolderUnlocked(\n            _investorId,\n            investorsLocks[_investorId][_lockIndex].value,\n            investorsLocks[_investorId][_lockIndex].reason,\n            investorsLocks[_investorId][_lockIndex].reasonString,\n            investorsLocks[_investorId][_lockIndex].releaseTime\n        );\n\n        //Put the last lock instead of the lock to remove (this will work even with 1 lock in the list)\n        uint256 lastLockNumber = investorsLocksCounts[_investorId];\n        require(_lockIndex < lastLockNumber, \"Index is greater than the number of locks\");\n        lastLockNumber -= 1;\n\n        //Move the lock\n        uint256 reasonCode = investorsLocks[_investorId][lastLockNumber].reason;\n        setLockInfoImpl(\n            _investorId,\n            _lockIndex,\n            investorsLocks[_investorId][lastLockNumber].value,\n            reasonCode,\n            investorsLocks[_investorId][lastLockNumber].reasonString,\n            investorsLocks[_investorId][lastLockNumber].releaseTime\n        );\n\n        //delete the last _lock\n        //Remove from reverse index\n        delete investorsLocks[_investorId][lastLockNumber];\n\n        //decrease the lock counter for the user\n        investorsLocksCounts[_investorId] = lastLockNumber;\n\n        return true;\n    }\n\n    /**\n     * @dev Releases a specific lock record\n     * @param _to address to release the tokens for\n     * @param _lockIndex the index of the lock\n     *\n     * note - this may change the order of the locks on an address, so if iterating the iteration should be restarted.\n     * @return true on success\n     */\n    function removeLockRecord(address _to, uint256 _lockIndex) public override onlyTransferAgentOrAbove returns (bool) {\n        require(_to != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_to);\n        //Emit must be done on start ,because we're going to overwrite this value\n        emit Unlocked(\n            _to,\n            investorsLocks[investor][_lockIndex].value,\n            investorsLocks[investor][_lockIndex].reason,\n            investorsLocks[investor][_lockIndex].reasonString,\n            investorsLocks[investor][_lockIndex].releaseTime\n        );\n        removeLockRecordForInvestor(investor, _lockIndex);\n\n        return true;\n    }\n\n    /**\n     * @dev Get number of locks currently associated with an address\n     * @param _who address to get token lock for\n     *\n     * @return number of locks\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockCount(address _who) public view override returns (uint256) {\n        require(_who != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_who);\n        return investorsLocksCounts[investor];\n    }\n\n    function lockCountForInvestor(string calldata _investorId) public view override returns (uint256) {\n        return investorsLocksCounts[_investorId];\n    }\n\n    /**\n     * @dev Get details of a specific lock associated with an address\n     * can be used to iterate through the locks of a user\n     * @return reasonCode the reason code for the lock\n     * @return reasonString the reason for the lock\n     * @return value the value of tokens locked\n     * @return autoReleaseTime the timestamp in which the lock will be inactive (or 0 if it's always active until removed)\n     *\n     * Note - a lock can be inactive (due to its time expired) but still exists for a specific address\n     */\n    function lockInfo(address _who, uint256 _lockIndex) public view override returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime) {\n        require(_who != address(0), \"Invalid address\");\n        string memory investor = getRegistryService().getInvestor(_who);\n        return lockInfoForInvestor(investor, _lockIndex);\n    }\n\n    function lockInfoForInvestor(string memory _investorId, uint256 _lockIndex)\n        public\n        view\n        override\n        returns (uint256 reasonCode, string memory reasonString, uint256 value, uint256 autoReleaseTime)\n    {\n        uint256 lastLockNumber = investorsLocksCounts[_investorId];\n        require(_lockIndex < lastLockNumber, \"Index is greater than the number of locks\");\n        reasonCode = investorsLocks[_investorId][_lockIndex].reason;\n        reasonString = investorsLocks[_investorId][_lockIndex].reasonString;\n        value = investorsLocks[_investorId][_lockIndex].value;\n        autoReleaseTime = investorsLocks[_investorId][_lockIndex].releaseTime;\n    }\n\n    function getTransferableTokens(address _who, uint256 _time) public view override returns (uint256) {\n        string memory investor = getRegistryService().getInvestor(_who);\n        return getTransferableTokensForInvestor(investor, _time);\n    }\n\n    function getTransferableTokensForInvestor(string memory _investorId, uint256 _time) public view override returns (uint256) {\n        require(_time > 0, \"Time must be greater than zero\");\n        if (investorsLocked[_investorId]) {\n            return 0;\n        }\n\n        uint256 balanceOfInvestor = getToken().balanceOfInvestor(_investorId);\n        uint256 investorLockCount = investorsLocksCounts[_investorId];\n\n        //No locks, go to base class implementation\n        if (investorLockCount == 0) {\n            return balanceOfInvestor;\n        }\n\n        uint256 totalLockedTokens = 0;\n        for (uint256 i = 0; i < investorLockCount; i++) {\n            uint256 autoReleaseTime = investorsLocks[_investorId][i].releaseTime;\n\n            if (autoReleaseTime == 0 || autoReleaseTime > _time) {\n                totalLockedTokens = totalLockedTokens + investorsLocks[_investorId][i].value;\n            }\n        }\n\n        //there may be more locked tokens than actual tokens, so the minimum between the two\n        uint256 transferable = balanceOfInvestor - Math.min(totalLockedTokens, balanceOfInvestor);\n\n        return transferable;\n    }\n}\n"},"@openzeppelin/contracts/interfaces/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC20.sol)\n\npragma solidity >=0.4.16;\n\nimport {IERC20} from \"../token/ERC20/IERC20.sol\";\n"},"@openzeppelin/contracts/token/ERC20/ERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/ERC20.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC20} from \"./IERC20.sol\";\nimport {IERC20Metadata} from \"./extensions/IERC20Metadata.sol\";\nimport {Context} from \"../../utils/Context.sol\";\nimport {IERC20Errors} from \"../../interfaces/draft-IERC6093.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 *\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 ERC-20\n * applications.\n */\nabstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {\n    mapping(address account => uint256) private _balances;\n\n    mapping(address account => mapping(address spender => 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     * Both values are immutable: they can only be set once during 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 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 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 returns (uint8) {\n        return 18;\n    }\n\n    /// @inheritdoc IERC20\n    function totalSupply() public view virtual returns (uint256) {\n        return _totalSupply;\n    }\n\n    /// @inheritdoc IERC20\n    function balanceOf(address account) public view virtual 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 `value`.\n     */\n    function transfer(address to, uint256 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _transfer(owner, to, value);\n        return true;\n    }\n\n    /// @inheritdoc IERC20\n    function allowance(address owner, address spender) public view virtual returns (uint256) {\n        return _allowances[owner][spender];\n    }\n\n    /**\n     * @dev See {IERC20-approve}.\n     *\n     * NOTE: If `value` 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 value) public virtual returns (bool) {\n        address owner = _msgSender();\n        _approve(owner, spender, value);\n        return true;\n    }\n\n    /**\n     * @dev See {IERC20-transferFrom}.\n     *\n     * Skips emitting an {Approval} event indicating an allowance update. This is not\n     * required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].\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 `value`.\n     * - the caller must have allowance for ``from``'s tokens of at least\n     * `value`.\n     */\n    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {\n        address spender = _msgSender();\n        _spendAllowance(from, spender, value);\n        _transfer(from, to, value);\n        return true;\n    }\n\n    /**\n     * @dev Moves a `value` 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     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _transfer(address from, address to, uint256 value) internal {\n        if (from == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        if (to == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(from, to, value);\n    }\n\n    /**\n     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`\n     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding\n     * this function.\n     *\n     * Emits a {Transfer} event.\n     */\n    function _update(address from, address to, uint256 value) internal virtual {\n        if (from == address(0)) {\n            // Overflow check required: The rest of the code assumes that totalSupply never overflows\n            _totalSupply += value;\n        } else {\n            uint256 fromBalance = _balances[from];\n            if (fromBalance < value) {\n                revert ERC20InsufficientBalance(from, fromBalance, value);\n            }\n            unchecked {\n                // Overflow not possible: value <= fromBalance <= totalSupply.\n                _balances[from] = fromBalance - value;\n            }\n        }\n\n        if (to == address(0)) {\n            unchecked {\n                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.\n                _totalSupply -= value;\n            }\n        } else {\n            unchecked {\n                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.\n                _balances[to] += value;\n            }\n        }\n\n        emit Transfer(from, to, value);\n    }\n\n    /**\n     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).\n     * Relies on the `_update` mechanism\n     *\n     * Emits a {Transfer} event with `from` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead.\n     */\n    function _mint(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidReceiver(address(0));\n        }\n        _update(address(0), account, value);\n    }\n\n    /**\n     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.\n     * Relies on the `_update` mechanism.\n     *\n     * Emits a {Transfer} event with `to` set to the zero address.\n     *\n     * NOTE: This function is not virtual, {_update} should be overridden instead\n     */\n    function _burn(address account, uint256 value) internal {\n        if (account == address(0)) {\n            revert ERC20InvalidSender(address(0));\n        }\n        _update(account, address(0), value);\n    }\n\n    /**\n     * @dev Sets `value` 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     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.\n     */\n    function _approve(address owner, address spender, uint256 value) internal {\n        _approve(owner, spender, value, true);\n    }\n\n    /**\n     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.\n     *\n     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by\n     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any\n     * `Approval` event during `transferFrom` operations.\n     *\n     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to\n     * true using the following override:\n     *\n     * ```solidity\n     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {\n     *     super._approve(owner, spender, value, true);\n     * }\n     * ```\n     *\n     * Requirements are the same as {_approve}.\n     */\n    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {\n        if (owner == address(0)) {\n            revert ERC20InvalidApprover(address(0));\n        }\n        if (spender == address(0)) {\n            revert ERC20InvalidSpender(address(0));\n        }\n        _allowances[owner][spender] = value;\n        if (emitEvent) {\n            emit Approval(owner, spender, value);\n        }\n    }\n\n    /**\n     * @dev Updates `owner`'s allowance for `spender` based on spent `value`.\n     *\n     * Does not update the allowance value in case of infinite allowance.\n     * Revert if not enough allowance is available.\n     *\n     * Does not emit an {Approval} event.\n     */\n    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {\n        uint256 currentAllowance = allowance(owner, spender);\n        if (currentAllowance < type(uint256).max) {\n            if (currentAllowance < value) {\n                revert ERC20InsufficientAllowance(spender, currentAllowance, value);\n            }\n            unchecked {\n                _approve(owner, spender, currentAllowance - value, false);\n            }\n        }\n    }\n}\n"},"@openzeppelin/contracts/utils/StorageSlot.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/StorageSlot.sol)\n// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.\n\npragma solidity ^0.8.20;\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 ERC-1967 implementation slot:\n * ```solidity\n * contract ERC1967 {\n *     // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.\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(newImplementation.code.length > 0);\n *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n *     }\n * }\n * ```\n *\n * TIP: Consider using this library along with {SlotDerivation}.\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 Int256Slot {\n        int256 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        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BooleanSlot` with member `value` located at `slot`.\n     */\n    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Bytes32Slot` with member `value` located at `slot`.\n     */\n    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Uint256Slot` with member `value` located at `slot`.\n     */\n    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `Int256Slot` with member `value` located at `slot`.\n     */\n    function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {\n        assembly (\"memory-safe\") {\n            r.slot := slot\n        }\n    }\n\n    /**\n     * @dev Returns a `StringSlot` with member `value` located at `slot`.\n     */\n    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {\n        assembly (\"memory-safe\") {\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        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n\n    /**\n     * @dev Returns a `BytesSlot` with member `value` located at `slot`.\n     */\n    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {\n        assembly (\"memory-safe\") {\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        assembly (\"memory-safe\") {\n            r.slot := store.slot\n        }\n    }\n}\n"},"contracts/compliance/IDSComplianceService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSComplianceService {\n\n    uint256 internal constant NONE = 0;\n    uint256 internal constant US = 1;\n    uint256 internal constant EU = 2;\n    uint256 internal constant FORBIDDEN = 4;\n    uint256 internal constant JP = 8;\n    string internal constant TOKEN_PAUSED = \"Token Paused\";\n    string internal constant NOT_ENOUGH_TOKENS = \"Not Enough Tokens\";\n    string internal constant TOKENS_LOCKED = \"Tokens Locked\";\n    string internal constant WALLET_NOT_IN_REGISTRY_SERVICE = \"Wallet not in registry Service\";\n    string internal constant DESTINATION_RESTRICTED = \"Destination restricted\";\n    string internal constant VALID = \"Valid\";\n    string internal constant HOLD_UP = \"Under lock-up\";\n    string internal constant ONLY_FULL_TRANSFER = \"Only Full Transfer\";\n    string internal constant FLOWBACK = \"Flowback\";\n    string internal constant MAX_INVESTORS_IN_CATEGORY = \"Max Investors in category\";\n    string internal constant AMOUNT_OF_TOKENS_UNDER_MIN = \"Amount of tokens under min\";\n    string internal constant AMOUNT_OF_TOKENS_ABOVE_MAX = \"Amount of tokens above max\";\n    string internal constant ONLY_ACCREDITED = \"Only accredited\";\n    string internal constant ONLY_US_ACCREDITED = \"Only us accredited\";\n    string internal constant NOT_ENOUGH_INVESTORS = \"Not enough investors\";\n    string internal constant MAX_AUTHORIZED_SECURITIES_EXCEEDED = \"Max authorized securities exceeded\";\n\n    function initialize() public virtual;\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory _id,\n        string memory _country,\n        string memory _prevCountry\n    ) public virtual returns (bool);\n\n    //*****************************************\n    // TOKEN ACTION VALIDATIONS\n    //*****************************************\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateTransfer(\n        address _from,\n        address _to,\n        uint256 _value, /*onlyToken*/\n        bool _pausedToken,\n        uint256 _balanceFrom\n    ) public virtual returns (bool);\n\n    function validateIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateBurn(\n        address _who,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function validateSeize(\n        address _from,\n        address _to,\n        uint256 _value /*onlyToken*/\n    ) public virtual returns (bool);\n\n    function preIssuanceCheck(address _to, uint256 _value) public view virtual returns (uint256 code, string memory reason);\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual returns (uint256 code, string memory reason);\n\n    function validateIssuanceTime(uint256 _issuanceTime) public view virtual returns (uint256 issuanceTime);\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        uint64 _lockTime\n    ) public view virtual returns (uint256);\n}\n"},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/IERC20.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev Interface of the ERC-20 standard as defined in the ERC.\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 value of tokens in existence.\n     */\n    function totalSupply() external view returns (uint256);\n\n    /**\n     * @dev Returns the value of tokens owned by `account`.\n     */\n    function balanceOf(address account) external view returns (uint256);\n\n    /**\n     * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens as the allowance of `spender` over the\n     * 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 value) external returns (bool);\n\n    /**\n     * @dev Moves a `value` amount of tokens from `from` to `to` using the\n     * allowance mechanism. `value` 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 value) external returns (bool);\n}\n"},"contracts/data-stores/LockManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {BaseLockManagerDataStore} from \"./BaseLockManagerDataStore.sol\";\n\ncontract LockManagerDataStore is BaseLockManagerDataStore {\n    mapping(address account => uint256 count) internal locksCounts;\n    mapping(address account => mapping(uint256 lockId => Lock lock)) internal locks;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n"},"@openzeppelin/contracts/interfaces/IERC1967.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC1967.sol)\n\npragma solidity >=0.4.11;\n\n/**\n * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC.\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"},"@openzeppelin/contracts/interfaces/IERC5267.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/IERC5267.sol)\n\npragma solidity >=0.4.16;\n\ninterface IERC5267 {\n    /**\n     * @dev MAY be emitted to signal that the domain could have changed.\n     */\n    event EIP712DomainChanged();\n\n    /**\n     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712\n     * signature.\n     */\n    function eip712Domain()\n        external\n        view\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        );\n}\n"},"@openzeppelin/contracts/utils/math/SafeCast.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SafeCast.sol)\n// This file was procedurally generated from scripts/generate/templates/SafeCast.js.\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow\n * checks.\n *\n * Downcasting from uint256/int256 in Solidity does not revert on overflow. This can\n * easily result in undesired exploitation or bugs, since developers usually\n * assume that overflows raise errors. `SafeCast` restores this intuition by\n * reverting the transaction when such an operation overflows.\n *\n * Using this library instead of the unchecked operations eliminates an entire\n * class of bugs, so it's recommended to use it always.\n */\nlibrary SafeCast {\n    /**\n     * @dev Value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);\n\n    /**\n     * @dev An int value doesn't fit in an uint of `bits` size.\n     */\n    error SafeCastOverflowedIntToUint(int256 value);\n\n    /**\n     * @dev Value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);\n\n    /**\n     * @dev An uint value doesn't fit in an int of `bits` size.\n     */\n    error SafeCastOverflowedUintToInt(uint256 value);\n\n    /**\n     * @dev Returns the downcasted uint248 from uint256, reverting on\n     * overflow (when the input is greater than largest uint248).\n     *\n     * Counterpart to Solidity's `uint248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toUint248(uint256 value) internal pure returns (uint248) {\n        if (value > type(uint248).max) {\n            revert SafeCastOverflowedUintDowncast(248, value);\n        }\n        return uint248(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint240 from uint256, reverting on\n     * overflow (when the input is greater than largest uint240).\n     *\n     * Counterpart to Solidity's `uint240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toUint240(uint256 value) internal pure returns (uint240) {\n        if (value > type(uint240).max) {\n            revert SafeCastOverflowedUintDowncast(240, value);\n        }\n        return uint240(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint232 from uint256, reverting on\n     * overflow (when the input is greater than largest uint232).\n     *\n     * Counterpart to Solidity's `uint232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toUint232(uint256 value) internal pure returns (uint232) {\n        if (value > type(uint232).max) {\n            revert SafeCastOverflowedUintDowncast(232, value);\n        }\n        return uint232(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint224 from uint256, reverting on\n     * overflow (when the input is greater than largest uint224).\n     *\n     * Counterpart to Solidity's `uint224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toUint224(uint256 value) internal pure returns (uint224) {\n        if (value > type(uint224).max) {\n            revert SafeCastOverflowedUintDowncast(224, value);\n        }\n        return uint224(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint216 from uint256, reverting on\n     * overflow (when the input is greater than largest uint216).\n     *\n     * Counterpart to Solidity's `uint216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toUint216(uint256 value) internal pure returns (uint216) {\n        if (value > type(uint216).max) {\n            revert SafeCastOverflowedUintDowncast(216, value);\n        }\n        return uint216(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint208 from uint256, reverting on\n     * overflow (when the input is greater than largest uint208).\n     *\n     * Counterpart to Solidity's `uint208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toUint208(uint256 value) internal pure returns (uint208) {\n        if (value > type(uint208).max) {\n            revert SafeCastOverflowedUintDowncast(208, value);\n        }\n        return uint208(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint200 from uint256, reverting on\n     * overflow (when the input is greater than largest uint200).\n     *\n     * Counterpart to Solidity's `uint200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toUint200(uint256 value) internal pure returns (uint200) {\n        if (value > type(uint200).max) {\n            revert SafeCastOverflowedUintDowncast(200, value);\n        }\n        return uint200(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint192 from uint256, reverting on\n     * overflow (when the input is greater than largest uint192).\n     *\n     * Counterpart to Solidity's `uint192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toUint192(uint256 value) internal pure returns (uint192) {\n        if (value > type(uint192).max) {\n            revert SafeCastOverflowedUintDowncast(192, value);\n        }\n        return uint192(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint184 from uint256, reverting on\n     * overflow (when the input is greater than largest uint184).\n     *\n     * Counterpart to Solidity's `uint184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toUint184(uint256 value) internal pure returns (uint184) {\n        if (value > type(uint184).max) {\n            revert SafeCastOverflowedUintDowncast(184, value);\n        }\n        return uint184(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint176 from uint256, reverting on\n     * overflow (when the input is greater than largest uint176).\n     *\n     * Counterpart to Solidity's `uint176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toUint176(uint256 value) internal pure returns (uint176) {\n        if (value > type(uint176).max) {\n            revert SafeCastOverflowedUintDowncast(176, value);\n        }\n        return uint176(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint168 from uint256, reverting on\n     * overflow (when the input is greater than largest uint168).\n     *\n     * Counterpart to Solidity's `uint168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toUint168(uint256 value) internal pure returns (uint168) {\n        if (value > type(uint168).max) {\n            revert SafeCastOverflowedUintDowncast(168, value);\n        }\n        return uint168(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint160 from uint256, reverting on\n     * overflow (when the input is greater than largest uint160).\n     *\n     * Counterpart to Solidity's `uint160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toUint160(uint256 value) internal pure returns (uint160) {\n        if (value > type(uint160).max) {\n            revert SafeCastOverflowedUintDowncast(160, value);\n        }\n        return uint160(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint152 from uint256, reverting on\n     * overflow (when the input is greater than largest uint152).\n     *\n     * Counterpart to Solidity's `uint152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toUint152(uint256 value) internal pure returns (uint152) {\n        if (value > type(uint152).max) {\n            revert SafeCastOverflowedUintDowncast(152, value);\n        }\n        return uint152(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint144 from uint256, reverting on\n     * overflow (when the input is greater than largest uint144).\n     *\n     * Counterpart to Solidity's `uint144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toUint144(uint256 value) internal pure returns (uint144) {\n        if (value > type(uint144).max) {\n            revert SafeCastOverflowedUintDowncast(144, value);\n        }\n        return uint144(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint136 from uint256, reverting on\n     * overflow (when the input is greater than largest uint136).\n     *\n     * Counterpart to Solidity's `uint136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toUint136(uint256 value) internal pure returns (uint136) {\n        if (value > type(uint136).max) {\n            revert SafeCastOverflowedUintDowncast(136, value);\n        }\n        return uint136(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint128 from uint256, reverting on\n     * overflow (when the input is greater than largest uint128).\n     *\n     * Counterpart to Solidity's `uint128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toUint128(uint256 value) internal pure returns (uint128) {\n        if (value > type(uint128).max) {\n            revert SafeCastOverflowedUintDowncast(128, value);\n        }\n        return uint128(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint120 from uint256, reverting on\n     * overflow (when the input is greater than largest uint120).\n     *\n     * Counterpart to Solidity's `uint120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toUint120(uint256 value) internal pure returns (uint120) {\n        if (value > type(uint120).max) {\n            revert SafeCastOverflowedUintDowncast(120, value);\n        }\n        return uint120(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint112 from uint256, reverting on\n     * overflow (when the input is greater than largest uint112).\n     *\n     * Counterpart to Solidity's `uint112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toUint112(uint256 value) internal pure returns (uint112) {\n        if (value > type(uint112).max) {\n            revert SafeCastOverflowedUintDowncast(112, value);\n        }\n        return uint112(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint104 from uint256, reverting on\n     * overflow (when the input is greater than largest uint104).\n     *\n     * Counterpart to Solidity's `uint104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toUint104(uint256 value) internal pure returns (uint104) {\n        if (value > type(uint104).max) {\n            revert SafeCastOverflowedUintDowncast(104, value);\n        }\n        return uint104(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint96 from uint256, reverting on\n     * overflow (when the input is greater than largest uint96).\n     *\n     * Counterpart to Solidity's `uint96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toUint96(uint256 value) internal pure returns (uint96) {\n        if (value > type(uint96).max) {\n            revert SafeCastOverflowedUintDowncast(96, value);\n        }\n        return uint96(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint88 from uint256, reverting on\n     * overflow (when the input is greater than largest uint88).\n     *\n     * Counterpart to Solidity's `uint88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toUint88(uint256 value) internal pure returns (uint88) {\n        if (value > type(uint88).max) {\n            revert SafeCastOverflowedUintDowncast(88, value);\n        }\n        return uint88(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint80 from uint256, reverting on\n     * overflow (when the input is greater than largest uint80).\n     *\n     * Counterpart to Solidity's `uint80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toUint80(uint256 value) internal pure returns (uint80) {\n        if (value > type(uint80).max) {\n            revert SafeCastOverflowedUintDowncast(80, value);\n        }\n        return uint80(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint72 from uint256, reverting on\n     * overflow (when the input is greater than largest uint72).\n     *\n     * Counterpart to Solidity's `uint72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toUint72(uint256 value) internal pure returns (uint72) {\n        if (value > type(uint72).max) {\n            revert SafeCastOverflowedUintDowncast(72, value);\n        }\n        return uint72(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint64 from uint256, reverting on\n     * overflow (when the input is greater than largest uint64).\n     *\n     * Counterpart to Solidity's `uint64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toUint64(uint256 value) internal pure returns (uint64) {\n        if (value > type(uint64).max) {\n            revert SafeCastOverflowedUintDowncast(64, value);\n        }\n        return uint64(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint56 from uint256, reverting on\n     * overflow (when the input is greater than largest uint56).\n     *\n     * Counterpart to Solidity's `uint56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toUint56(uint256 value) internal pure returns (uint56) {\n        if (value > type(uint56).max) {\n            revert SafeCastOverflowedUintDowncast(56, value);\n        }\n        return uint56(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint48 from uint256, reverting on\n     * overflow (when the input is greater than largest uint48).\n     *\n     * Counterpart to Solidity's `uint48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toUint48(uint256 value) internal pure returns (uint48) {\n        if (value > type(uint48).max) {\n            revert SafeCastOverflowedUintDowncast(48, value);\n        }\n        return uint48(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint40 from uint256, reverting on\n     * overflow (when the input is greater than largest uint40).\n     *\n     * Counterpart to Solidity's `uint40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toUint40(uint256 value) internal pure returns (uint40) {\n        if (value > type(uint40).max) {\n            revert SafeCastOverflowedUintDowncast(40, value);\n        }\n        return uint40(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint32 from uint256, reverting on\n     * overflow (when the input is greater than largest uint32).\n     *\n     * Counterpart to Solidity's `uint32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toUint32(uint256 value) internal pure returns (uint32) {\n        if (value > type(uint32).max) {\n            revert SafeCastOverflowedUintDowncast(32, value);\n        }\n        return uint32(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint24 from uint256, reverting on\n     * overflow (when the input is greater than largest uint24).\n     *\n     * Counterpart to Solidity's `uint24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toUint24(uint256 value) internal pure returns (uint24) {\n        if (value > type(uint24).max) {\n            revert SafeCastOverflowedUintDowncast(24, value);\n        }\n        return uint24(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint16 from uint256, reverting on\n     * overflow (when the input is greater than largest uint16).\n     *\n     * Counterpart to Solidity's `uint16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toUint16(uint256 value) internal pure returns (uint16) {\n        if (value > type(uint16).max) {\n            revert SafeCastOverflowedUintDowncast(16, value);\n        }\n        return uint16(value);\n    }\n\n    /**\n     * @dev Returns the downcasted uint8 from uint256, reverting on\n     * overflow (when the input is greater than largest uint8).\n     *\n     * Counterpart to Solidity's `uint8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toUint8(uint256 value) internal pure returns (uint8) {\n        if (value > type(uint8).max) {\n            revert SafeCastOverflowedUintDowncast(8, value);\n        }\n        return uint8(value);\n    }\n\n    /**\n     * @dev Converts a signed int256 into an unsigned uint256.\n     *\n     * Requirements:\n     *\n     * - input must be greater than or equal to 0.\n     */\n    function toUint256(int256 value) internal pure returns (uint256) {\n        if (value < 0) {\n            revert SafeCastOverflowedIntToUint(value);\n        }\n        return uint256(value);\n    }\n\n    /**\n     * @dev Returns the downcasted int248 from int256, reverting on\n     * overflow (when the input is less than smallest int248 or\n     * greater than largest int248).\n     *\n     * Counterpart to Solidity's `int248` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 248 bits\n     */\n    function toInt248(int256 value) internal pure returns (int248 downcasted) {\n        downcasted = int248(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(248, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int240 from int256, reverting on\n     * overflow (when the input is less than smallest int240 or\n     * greater than largest int240).\n     *\n     * Counterpart to Solidity's `int240` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 240 bits\n     */\n    function toInt240(int256 value) internal pure returns (int240 downcasted) {\n        downcasted = int240(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(240, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int232 from int256, reverting on\n     * overflow (when the input is less than smallest int232 or\n     * greater than largest int232).\n     *\n     * Counterpart to Solidity's `int232` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 232 bits\n     */\n    function toInt232(int256 value) internal pure returns (int232 downcasted) {\n        downcasted = int232(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(232, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int224 from int256, reverting on\n     * overflow (when the input is less than smallest int224 or\n     * greater than largest int224).\n     *\n     * Counterpart to Solidity's `int224` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 224 bits\n     */\n    function toInt224(int256 value) internal pure returns (int224 downcasted) {\n        downcasted = int224(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(224, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int216 from int256, reverting on\n     * overflow (when the input is less than smallest int216 or\n     * greater than largest int216).\n     *\n     * Counterpart to Solidity's `int216` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 216 bits\n     */\n    function toInt216(int256 value) internal pure returns (int216 downcasted) {\n        downcasted = int216(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(216, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int208 from int256, reverting on\n     * overflow (when the input is less than smallest int208 or\n     * greater than largest int208).\n     *\n     * Counterpart to Solidity's `int208` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 208 bits\n     */\n    function toInt208(int256 value) internal pure returns (int208 downcasted) {\n        downcasted = int208(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(208, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int200 from int256, reverting on\n     * overflow (when the input is less than smallest int200 or\n     * greater than largest int200).\n     *\n     * Counterpart to Solidity's `int200` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 200 bits\n     */\n    function toInt200(int256 value) internal pure returns (int200 downcasted) {\n        downcasted = int200(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(200, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int192 from int256, reverting on\n     * overflow (when the input is less than smallest int192 or\n     * greater than largest int192).\n     *\n     * Counterpart to Solidity's `int192` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 192 bits\n     */\n    function toInt192(int256 value) internal pure returns (int192 downcasted) {\n        downcasted = int192(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(192, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int184 from int256, reverting on\n     * overflow (when the input is less than smallest int184 or\n     * greater than largest int184).\n     *\n     * Counterpart to Solidity's `int184` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 184 bits\n     */\n    function toInt184(int256 value) internal pure returns (int184 downcasted) {\n        downcasted = int184(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(184, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int176 from int256, reverting on\n     * overflow (when the input is less than smallest int176 or\n     * greater than largest int176).\n     *\n     * Counterpart to Solidity's `int176` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 176 bits\n     */\n    function toInt176(int256 value) internal pure returns (int176 downcasted) {\n        downcasted = int176(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(176, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int168 from int256, reverting on\n     * overflow (when the input is less than smallest int168 or\n     * greater than largest int168).\n     *\n     * Counterpart to Solidity's `int168` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 168 bits\n     */\n    function toInt168(int256 value) internal pure returns (int168 downcasted) {\n        downcasted = int168(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(168, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int160 from int256, reverting on\n     * overflow (when the input is less than smallest int160 or\n     * greater than largest int160).\n     *\n     * Counterpart to Solidity's `int160` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 160 bits\n     */\n    function toInt160(int256 value) internal pure returns (int160 downcasted) {\n        downcasted = int160(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(160, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int152 from int256, reverting on\n     * overflow (when the input is less than smallest int152 or\n     * greater than largest int152).\n     *\n     * Counterpart to Solidity's `int152` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 152 bits\n     */\n    function toInt152(int256 value) internal pure returns (int152 downcasted) {\n        downcasted = int152(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(152, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int144 from int256, reverting on\n     * overflow (when the input is less than smallest int144 or\n     * greater than largest int144).\n     *\n     * Counterpart to Solidity's `int144` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 144 bits\n     */\n    function toInt144(int256 value) internal pure returns (int144 downcasted) {\n        downcasted = int144(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(144, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int136 from int256, reverting on\n     * overflow (when the input is less than smallest int136 or\n     * greater than largest int136).\n     *\n     * Counterpart to Solidity's `int136` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 136 bits\n     */\n    function toInt136(int256 value) internal pure returns (int136 downcasted) {\n        downcasted = int136(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(136, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int128 from int256, reverting on\n     * overflow (when the input is less than smallest int128 or\n     * greater than largest int128).\n     *\n     * Counterpart to Solidity's `int128` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 128 bits\n     */\n    function toInt128(int256 value) internal pure returns (int128 downcasted) {\n        downcasted = int128(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(128, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int120 from int256, reverting on\n     * overflow (when the input is less than smallest int120 or\n     * greater than largest int120).\n     *\n     * Counterpart to Solidity's `int120` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 120 bits\n     */\n    function toInt120(int256 value) internal pure returns (int120 downcasted) {\n        downcasted = int120(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(120, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int112 from int256, reverting on\n     * overflow (when the input is less than smallest int112 or\n     * greater than largest int112).\n     *\n     * Counterpart to Solidity's `int112` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 112 bits\n     */\n    function toInt112(int256 value) internal pure returns (int112 downcasted) {\n        downcasted = int112(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(112, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int104 from int256, reverting on\n     * overflow (when the input is less than smallest int104 or\n     * greater than largest int104).\n     *\n     * Counterpart to Solidity's `int104` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 104 bits\n     */\n    function toInt104(int256 value) internal pure returns (int104 downcasted) {\n        downcasted = int104(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(104, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int96 from int256, reverting on\n     * overflow (when the input is less than smallest int96 or\n     * greater than largest int96).\n     *\n     * Counterpart to Solidity's `int96` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 96 bits\n     */\n    function toInt96(int256 value) internal pure returns (int96 downcasted) {\n        downcasted = int96(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(96, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int88 from int256, reverting on\n     * overflow (when the input is less than smallest int88 or\n     * greater than largest int88).\n     *\n     * Counterpart to Solidity's `int88` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 88 bits\n     */\n    function toInt88(int256 value) internal pure returns (int88 downcasted) {\n        downcasted = int88(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(88, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int80 from int256, reverting on\n     * overflow (when the input is less than smallest int80 or\n     * greater than largest int80).\n     *\n     * Counterpart to Solidity's `int80` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 80 bits\n     */\n    function toInt80(int256 value) internal pure returns (int80 downcasted) {\n        downcasted = int80(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(80, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int72 from int256, reverting on\n     * overflow (when the input is less than smallest int72 or\n     * greater than largest int72).\n     *\n     * Counterpart to Solidity's `int72` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 72 bits\n     */\n    function toInt72(int256 value) internal pure returns (int72 downcasted) {\n        downcasted = int72(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(72, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int64 from int256, reverting on\n     * overflow (when the input is less than smallest int64 or\n     * greater than largest int64).\n     *\n     * Counterpart to Solidity's `int64` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 64 bits\n     */\n    function toInt64(int256 value) internal pure returns (int64 downcasted) {\n        downcasted = int64(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(64, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int56 from int256, reverting on\n     * overflow (when the input is less than smallest int56 or\n     * greater than largest int56).\n     *\n     * Counterpart to Solidity's `int56` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 56 bits\n     */\n    function toInt56(int256 value) internal pure returns (int56 downcasted) {\n        downcasted = int56(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(56, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int48 from int256, reverting on\n     * overflow (when the input is less than smallest int48 or\n     * greater than largest int48).\n     *\n     * Counterpart to Solidity's `int48` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 48 bits\n     */\n    function toInt48(int256 value) internal pure returns (int48 downcasted) {\n        downcasted = int48(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(48, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int40 from int256, reverting on\n     * overflow (when the input is less than smallest int40 or\n     * greater than largest int40).\n     *\n     * Counterpart to Solidity's `int40` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 40 bits\n     */\n    function toInt40(int256 value) internal pure returns (int40 downcasted) {\n        downcasted = int40(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(40, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int32 from int256, reverting on\n     * overflow (when the input is less than smallest int32 or\n     * greater than largest int32).\n     *\n     * Counterpart to Solidity's `int32` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 32 bits\n     */\n    function toInt32(int256 value) internal pure returns (int32 downcasted) {\n        downcasted = int32(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(32, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int24 from int256, reverting on\n     * overflow (when the input is less than smallest int24 or\n     * greater than largest int24).\n     *\n     * Counterpart to Solidity's `int24` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 24 bits\n     */\n    function toInt24(int256 value) internal pure returns (int24 downcasted) {\n        downcasted = int24(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(24, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int16 from int256, reverting on\n     * overflow (when the input is less than smallest int16 or\n     * greater than largest int16).\n     *\n     * Counterpart to Solidity's `int16` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 16 bits\n     */\n    function toInt16(int256 value) internal pure returns (int16 downcasted) {\n        downcasted = int16(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(16, value);\n        }\n    }\n\n    /**\n     * @dev Returns the downcasted int8 from int256, reverting on\n     * overflow (when the input is less than smallest int8 or\n     * greater than largest int8).\n     *\n     * Counterpart to Solidity's `int8` operator.\n     *\n     * Requirements:\n     *\n     * - input must fit into 8 bits\n     */\n    function toInt8(int256 value) internal pure returns (int8 downcasted) {\n        downcasted = int8(value);\n        if (downcasted != value) {\n            revert SafeCastOverflowedIntDowncast(8, value);\n        }\n    }\n\n    /**\n     * @dev Converts an unsigned uint256 into a signed int256.\n     *\n     * Requirements:\n     *\n     * - input must be less than or equal to maxInt256.\n     */\n    function toInt256(uint256 value) internal pure returns (int256) {\n        // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive\n        if (value > uint256(type(int256).max)) {\n            revert SafeCastOverflowedUintToInt(value);\n        }\n        return int256(value);\n    }\n\n    /**\n     * @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.\n     */\n    function toUint(bool b) internal pure returns (uint256 u) {\n        assembly (\"memory-safe\") {\n            u := iszero(iszero(b))\n        }\n    }\n}\n"},"contracts/data-stores/TrustServiceDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\ncontract TrustServiceDataStore {\n    address internal owner;\n    mapping(address account => uint8 role) internal roles;\n    mapping(string entityId => address owner) internal DEPRECATED_entitiesOwners;\n    mapping(address owner => string entityId) internal DEPRECATED_ownersEntities;\n    mapping(address operator => string entityId) internal DEPRECATED_operatorsEntities;\n    mapping(address resource => string entityId) internal DEPRECATED_resourcesEntities;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[44] private __gap;\n}\n"},"@openzeppelin/contracts/proxy/beacon/IBeacon.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/beacon/IBeacon.sol)\n\npragma solidity >=0.4.16;\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     * {UpgradeableBeacon} will check that this address is a contract.\n     */\n    function implementation() external view returns (address);\n}\n"},"contracts/compliance/InvestorLockManagerBase.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {InvestorLockManagerDataStore} from \"../data-stores/InvestorLockManagerDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {IDSLockManager} from \"./IDSLockManager.sol\";\n\nabstract contract InvestorLockManagerBase is IDSLockManager, InvestorLockManagerDataStore, BaseDSContract {\n    event InvestorFullyLocked(string investorId);\n    event InvestorFullyUnlocked(string investorId);\n    event InvestorLiquidateOnlySet(string investorId, bool enabled);\n\n    function initialize() public virtual override;\n\n    function lockInvestor(string calldata _investorId) public override onlyTransferAgentOrAbove returns (bool) {\n        require(!investorsLocked[_investorId], \"Investor is already locked\");\n        investorsLocked[_investorId] = true;\n        emit InvestorFullyLocked(_investorId);\n        return true;\n    }\n\n    function unlockInvestor(string calldata _investorId) public override onlyTransferAgentOrAbove returns (bool) {\n        require(investorsLocked[_investorId], \"Investor is not locked\");\n        delete investorsLocked[_investorId];\n        emit InvestorFullyUnlocked(_investorId);\n        return true;\n    }\n\n    function isInvestorLocked(string calldata _investorId) public override view returns (bool) {\n        return investorsLocked[_investorId];\n    }\n\n    function setInvestorLiquidateOnly(string memory _investorId, bool _enabled) public override onlyTransferAgentOrAbove returns (bool) {\n        require(investorsLiquidateOnly[_investorId] != _enabled, \"already in this state\");\n        investorsLiquidateOnly[_investorId] = _enabled;\n        emit InvestorLiquidateOnlySet(_investorId, _enabled);\n        return true;\n    }\n\n    function isInvestorLiquidateOnly(string calldata _investorId) public override view returns (bool) {\n        return investorsLiquidateOnly[_investorId];\n    }\n}\n"},"contracts/data-stores/WalletManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract WalletManagerDataStore is ServiceConsumerDataStore {\n    mapping(address wallet => uint8 walletType) internal walletsTypes;\n    mapping(address wallet => mapping(string slotName => mapping(uint8 slotType => uint256 value))) internal walletsSlots;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[48] private __gap;\n}\n"},"@openzeppelin/contracts/utils/math/SignedMath.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.20;\n\nimport {SafeCast} from \"./SafeCast.sol\";\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n    /**\n     * @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.\n     *\n     * IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.\n     * However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute\n     * one branch when needed, making this function more expensive.\n     */\n    function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {\n        unchecked {\n            // branchless ternary works because:\n            // b ^ (a ^ b) == a\n            // b ^ 0 == b\n            return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));\n        }\n    }\n\n    /**\n     * @dev Returns the largest of two signed numbers.\n     */\n    function max(int256 a, int256 b) internal pure returns (int256) {\n        return ternary(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 ternary(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            // Formula from the \"Bit Twiddling Hacks\" by Sean Eron Anderson.\n            // Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,\n            // taking advantage of the most significant (or \"sign\" bit) in two's complement representation.\n            // This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,\n            // the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).\n            int256 mask = n >> 255;\n\n            // A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.\n            return uint256((n + mask) ^ mask);\n        }\n    }\n}\n"},"contracts/rebasing/SecuritizeRebasingProvider.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ISecuritizeRebasingProvider} from \"../rebasing/ISecuritizeRebasingProvider.sol\";\nimport {ServiceConsumer} from \"../service/ServiceConsumer.sol\";\nimport {UUPSUpgradeable} from \"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\nimport {RebasingLibrary} from \"./RebasingLibrary.sol\";\n\ncontract SecuritizeRebasingProvider is BaseDSContract, ISecuritizeRebasingProvider {\n    uint256 public multiplier; // Multiplier is fixed to 18 decimals\n    uint8 public tokenDecimals;\n\n    error InvalidMultiplier(uint256 providedMultiplier);\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize(uint256 _multiplier, uint8 _tokenDecimals) public onlyProxy initializer override {\n        __BaseDSContract_init();\n        \n        if (_multiplier == 0) {\n            revert InvalidMultiplier(_multiplier);\n        }\n        \n        multiplier = _multiplier;\n        tokenDecimals = _tokenDecimals;\n    }\n    /**\n     * \n     * @param _multiplier The new multiplier value, fixed to 18 decimals\n     */\n    function setMultiplier(uint256 _multiplier) external override onlyMaster {\n        if (_multiplier == 0) {\n            revert InvalidMultiplier(_multiplier);\n        }\n        \n        uint256 old = multiplier;\n        multiplier = _multiplier;\n        emit RebasingRateUpdated(old, _multiplier);\n    }\n\n    function convertTokensToShares(uint256 _tokens) external view returns (uint256 shares) {\n        return RebasingLibrary.convertTokensToShares(_tokens, multiplier, tokenDecimals);\n    }\n\n    function convertSharesToTokens(uint256 _shares) external view returns (uint256 tokens) {\n        return RebasingLibrary.convertSharesToTokens(_shares, multiplier, tokenDecimals);\n    }\n}\n"},"contracts/data-stores/BaseLockManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract BaseLockManagerDataStore is ServiceConsumerDataStore {\n    struct Lock {\n        uint256 value;\n        uint256 reason;\n        string reasonString;\n        uint256 releaseTime;\n    }\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[50] private __gap;\n}\n"},"contracts/data-stores/RegistryServiceDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract RegistryServiceDataStore is ServiceConsumerDataStore {\n    struct Attribute {\n        uint256 value;\n        uint256 expiry;\n        string proofHash;\n    }\n\n    struct Wallet {\n        string owner;\n        address creator;\n        address DEPRECATED_lastUpdatedBy;\n    }\n\n    struct Investor {\n        string id;\n        string collisionHash;\n        address creator;\n        address DEPRECATED_lastUpdatedBy;\n        string country;\n        uint256 walletCount;\n        // Mappings outside Storage\n        // Ref: https://docs.soliditylang.org/en/v0.7.1/070-breaking-changes.html#mappings-outside-storage\n        // mapping(uint8 => Attribute) attributes;\n    }\n\n    mapping(string investorId => Investor investor) internal investors;\n    mapping(address walletAddress => Wallet wallet) internal investorsWallets;\n\n    /**\n     * @dev DEPRECATED: This mapping is no longer used but must be kept for storage layout compatibility in the proxy.\n     * Do not use this mapping in new code. It will be removed in future non-proxy implementations.\n     * The interface type has been replaced with address to remove the interface dependency.\n     */\n    mapping(address wallet => address controller) internal DEPRECATED_omnibusWalletsControllers;\n\n    mapping(string investorId => mapping(uint8 attributeId => Attribute attribute)) public attributes;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[46] private __gap;\n}\n"},"contracts/data-stores/ServiceConsumerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\ncontract ServiceConsumerDataStore {\n\n    mapping(uint256 serviceId => address service) internal services;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[49] private __gap;\n}\n"},"contracts/mocks/ComplianceServiceRegulatedMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ComplianceServiceRegulated} from \"../compliance/ComplianceServiceRegulated.sol\";\n\n/**\n * @title ComplianceServiceRegulatedMock\n * @notice Mock contract for testing ComplianceServiceRegulated internal state\n * @dev This contract exposes internal storage variables for testing purposes only\n */\ncontract ComplianceServiceRegulatedMock is ComplianceServiceRegulated {\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        super.initialize();\n    }\n\n    /**\n     * @notice Get the number of issuances for an investor\n     * @param investor The investor ID\n     * @return The number of issuances\n     */\n    function getIssuancesCount(string memory investor) public view returns (uint256) {\n        return issuancesCounters[investor];\n    }\n\n    /**\n     * @notice Get the timestamp of a specific issuance\n     * @param investor The investor ID\n     * @param index The index of the issuance\n     * @return The timestamp of the issuance\n     */\n    function getIssuanceTimestamp(string memory investor, uint256 index) public view returns (uint256) {\n        return issuancesTimestamps[investor][index];\n    }\n\n    /**\n     * @notice Get the value (in shares) of a specific issuance\n     * @param investor The investor ID\n     * @param index The index of the issuance\n     * @return The value in shares of the issuance\n     */\n    function getIssuanceValue(string memory investor, uint256 index) public view returns (uint256) {\n        return issuancesValues[investor][index];\n    }\n}\n"},"contracts/rebasing/ISecuritizeRebasingProvider.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\n/**\n * @title ISecuritizeRebasingProvider\n * @dev Defines a common interface to get Rebasing multiplier\n */\ninterface ISecuritizeRebasingProvider {\n    /**\n     * @dev Emitted when owner updates multiplier.\n     * @param oldValue Old multiplier value\n     * @param newValue New multiplier value\n     */\n    event RebasingRateUpdated(uint256 oldValue, uint256 newValue);\n\n    /**\n     * @dev Proxy Initializer.\n     * @param _multiplier the initial rebasing multiplier value\n     * @param _tokenDecimals the token decimals for conversion calculations\n    */\n    function initialize(uint256 _multiplier, uint8 _tokenDecimals) external;\n\n\n    /**\n     * @dev Set rebasing multiplier. It is expressed with the same decimal numbers as stable coin\n     */\n    function setMultiplier(uint256 _multiplier) external;\n\n    /**\n     * @dev The asset:rebasing multiplier.\n     * @return The asset:rebasing multiplier.\n     */\n    function multiplier() external view returns (uint256);\n\n    /**\n     * @dev Convert tokens to shares using the current multiplier and token decimals.\n     * @param _tokens The amount of tokens to convert\n     * @return shares The equivalent amount in shares\n     */\n    function convertTokensToShares(uint256 _tokens) external view returns (uint256 shares);\n\n    /**\n     * @dev Convert shares to tokens using the current multiplier and token decimals.\n     * @param _shares The amount of shares to convert\n     * @return tokens The equivalent amount in tokens\n     */\n    function convertSharesToTokens(uint256 _shares) external view returns (uint256 tokens);\n}\n"},"contracts/compliance/ComplianceServiceRegulated.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ComplianceServiceWhitelisted} from \"./ComplianceServiceWhitelisted.sol\";\nimport {Math} from \"@openzeppelin/contracts/utils/math/Math.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\nimport {IDSRegistryService} from \"../registry/IDSRegistryService.sol\";\nimport {IDSToken} from \"../token/IDSToken.sol\";\nimport {IDSComplianceConfigurationService} from \"./IDSComplianceConfigurationService.sol\";\nimport {IDSWalletManager} from \"./IDSWalletManager.sol\";\nimport {IDSLockManager} from \"./IDSLockManager.sol\";\n\nlibrary ComplianceServiceLibrary {\n    uint256 internal constant DS_TOKEN = 0;\n    uint256 internal constant REGISTRY_SERVICE = 1;\n    uint256 internal constant WALLET_MANAGER = 2;\n    uint256 internal constant COMPLIANCE_CONFIGURATION_SERVICE = 3;\n    uint256 internal constant LOCK_MANAGER = 4;\n    uint256 internal constant COMPLIANCE_SERVICE = 5;\n    uint256 internal constant DEPRECATED_OMNIBUS_TBE_CONTROLLER = 6; // Deprecated, kept for backward compatibility\n    uint256 internal constant NONE = 0;\n    uint256 internal constant US = 1;\n    uint256 internal constant EU = 2;\n    uint256 internal constant FORBIDDEN = 4;\n    uint256 internal constant JP = 8;\n    string internal constant TOKEN_PAUSED = \"Token paused\";\n    string internal constant NOT_ENOUGH_TOKENS = \"Not enough tokens\";\n    string internal constant VALID = \"Valid\";\n    string internal constant TOKENS_LOCKED = \"Tokens locked\";\n    string internal constant ONLY_FULL_TRANSFER = \"Only full transfer\";\n    string internal constant FLOWBACK = \"Flowback\";\n    string internal constant WALLET_NOT_IN_REGISTRY_SERVICE = \"Wallet not in registry service\";\n    string internal constant AMOUNT_OF_TOKENS_UNDER_MIN = \"Amount of tokens under min\";\n    string internal constant AMOUNT_OF_TOKENS_ABOVE_MAX = \"Amount of tokens above max\";\n    string internal constant HOLD_UP = \"Under lock-up\";\n    string internal constant DESTINATION_RESTRICTED = \"Destination restricted\";\n    string internal constant MAX_INVESTORS_IN_CATEGORY = \"Max investors in category\";\n    string internal constant ONLY_ACCREDITED = \"Only accredited\";\n    string internal constant ONLY_US_ACCREDITED = \"Only us accredited\";\n    string internal constant NOT_ENOUGH_INVESTORS = \"Not enough investors\";\n    string internal constant INVESTOR_LIQUIDATE_ONLY = \"Investor liquidate only\";\n\n    struct CompletePreTransferCheckArgs {\n        address from;\n        address to;\n        uint256 value;\n        uint256 fromInvestorBalance;\n        uint256 fromRegion;\n        bool isPlatformWalletTo;\n    }\n\n    /**\n     * @notice Determines if a wallet belongs to a retail investor for EU classification purposes.\n     * @dev WARNING: This function should ONLY be used for EU investors.\n     *      For EU investors, retail classification is based solely on the \"Qualified\" attribute.\n     *      For US investors, the correct definition of non-retail would require checking both\n     *      !isQualifiedInvestor() AND !isAccreditedInvestor(), as both Qualified Purchasers\n     *      and Accredited Investors are considered non-retail in US securities law.\n     *\n     *      Current usage: This function is correctly used only within EU region checks\n     *      (toRegion == EU) throughout the codebase. Do not use this function for US investors\n     *      or other jurisdictions without proper modification.\n     *\n     * @param _services Array of service addresses\n     * @param _wallet Address of the wallet to check\n     * @return bool True if the wallet is a retail investor (not qualified), false otherwise\n     */\n    function isRetail(address[] memory _services, address _wallet) internal view returns (bool) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n\n        return !registry.isQualifiedInvestor(_wallet);\n    }\n\n    function isAccredited(address[] memory _services, address _wallet) internal view returns (bool) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n\n        return registry.isAccreditedInvestor(_wallet);\n    }\n\n    function balanceOfInvestor(address[] memory _services, address _wallet) internal view returns (uint256) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n        IDSToken token = IDSToken(_services[DS_TOKEN]);\n\n        return token.balanceOfInvestor(registry.getInvestor(_wallet));\n    }\n\n    function isNewInvestor(uint256 _balanceOfInvestorTo) internal pure returns (bool) {\n        // Return whether this investor has 0 balance\n        return _balanceOfInvestorTo == 0;\n    }\n\n    function getCountry(address[] memory _services, address _wallet) internal view returns (string memory) {\n        IDSRegistryService registry = IDSRegistryService(_services[REGISTRY_SERVICE]);\n\n        return registry.getCountry(registry.getInvestor(_wallet));\n    }\n\n    function getCountryCompliance(address[] memory _services, address _wallet) internal view returns (uint256) {\n        return IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getCountryCompliance(getCountry(_services, _wallet));\n    }\n\n    function getUSInvestorsLimit(address[] memory _services) internal view returns (uint256) {\n        ComplianceServiceRegulated complianceService = ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]);\n        IDSComplianceConfigurationService compConfService = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]);\n\n        if (compConfService.getMaxUSInvestorsPercentage() == 0) {\n            return compConfService.getUSInvestorsLimit();\n        }\n\n        if (compConfService.getUSInvestorsLimit() == 0) {\n            return compConfService.getMaxUSInvestorsPercentage() * (complianceService.getTotalInvestorsCount()) / 100;\n        }\n\n        return Math.min(compConfService.getUSInvestorsLimit(), compConfService.getMaxUSInvestorsPercentage() * (complianceService.getTotalInvestorsCount()) / 100);\n    }\n\n    function checkHoldUp(\n        address[] memory _services,\n        address _from,\n        uint256 _value,\n        bool _isUSLockPeriod,\n        bool _isPlatformWalletFrom\n    ) internal view returns (bool) {\n        if (!_isPlatformWalletFrom) {\n            ComplianceServiceRegulated complianceService = ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]);\n            uint256 lockPeriod;\n            if (_isUSLockPeriod) {\n                lockPeriod = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getUSLockPeriod();\n            } else {\n                lockPeriod = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getNonUSLockPeriod();\n            }\n\n            return\n                complianceService.getComplianceTransferableTokens(_from, block.timestamp, uint64(lockPeriod)) < _value;\n        }\n        return false;\n    }\n\n    function maxInvestorsInCategoryForNonAccredited(\n        address[] memory _services,\n        address _from,\n        uint256 _value,\n        uint256 fromInvestorBalance,\n        uint256 toInvestorBalance\n    ) internal view returns (bool) {\n        uint256 nonAccreditedInvestorLimit = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getNonAccreditedInvestorsLimit();\n        return\n        nonAccreditedInvestorLimit != 0 &&\n        ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getTotalInvestorsCount() -\n            ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getAccreditedInvestorsCount()\n        >=\n        nonAccreditedInvestorLimit &&\n        isNewInvestor(toInvestorBalance) &&\n        (isAccredited(_services, _from) || fromInvestorBalance > _value);\n    }\n\n    function newPreTransferCheck(\n        address[] calldata _services,\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _paused\n    ) public view returns (uint256 code, string memory reason) {\n        return doPreTransferCheckRegulated\n        (_services, _from, _to, _value, _balanceFrom, _paused);\n    }\n\n    function preTransferCheck(\n        address[] calldata _services,\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view returns (uint256 code, string memory reason) {\n        return doPreTransferCheckRegulated(_services, _from, _to, _value, IDSToken(_services[DS_TOKEN]).balanceOf(_from), IDSToken(_services[DS_TOKEN]).isPaused());\n    }\n\n    function doPreTransferCheckRegulated(\n        address[] calldata _services,\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _paused\n    ) internal view returns (uint256 code, string memory reason) {\n\n        if (_balanceFrom < _value) {\n            return (15, NOT_ENOUGH_TOKENS);\n        }\n\n        uint256 fromInvestorBalance = balanceOfInvestor(_services, _from); // tokens\n        uint256 fromRegion = getCountryCompliance(_services, _from);\n        bool isPlatformWalletTo = IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_to);\n        if (isPlatformWalletTo) {\n            if (\n                ((IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceFullTransfer()\n                && (fromRegion == US)) ||\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getWorldWideForceFullTransfer()) &&\n                fromInvestorBalance > _value\n            ) {\n                return (50, ONLY_FULL_TRANSFER);\n            }\n            return (0, VALID);\n        }\n\n        if (_paused ) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        CompletePreTransferCheckArgs memory args = CompletePreTransferCheckArgs(_from, _to, _value, fromInvestorBalance, fromRegion, isPlatformWalletTo);\n        return completeTransferCheck(_services, args);\n    }\n\n    function completeTransferCheck(\n        address[] calldata _services,\n        CompletePreTransferCheckArgs memory _args\n    ) internal view returns (uint256 code, string memory reason) {\n        (string memory investorFrom, string memory investorTo) = IDSRegistryService(_services[REGISTRY_SERVICE]).getInvestors(_args.from, _args.to);\n        if (\n            !CommonUtils.isEmptyString(investorFrom) && CommonUtils.isEqualString(investorFrom, investorTo)\n        ) {\n            return (0, VALID);\n        }\n\n        if (IDSLockManager(_services[LOCK_MANAGER]).isInvestorLiquidateOnly(investorTo)) {\n            return (90, INVESTOR_LIQUIDATE_ONLY);\n        }\n\n        if (!ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).checkWhitelisted(_args.to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        uint256 toRegion = getCountryCompliance(_services, _args.to);\n        if (toRegion == FORBIDDEN) {\n            return (26, DESTINATION_RESTRICTED);\n        }\n\n        bool isPlatformWalletFrom = IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_args.from);\n        if (\n            !isPlatformWalletFrom &&\n        IDSLockManager(_services[LOCK_MANAGER]).getTransferableTokens(_args.from, block.timestamp) < _args.value\n        ) {\n            return (16, TOKENS_LOCKED);\n        }\n\n        if (_args.fromRegion == US) {\n            if (checkHoldUp(_services, _args.from, _args.value, true, isPlatformWalletFrom)) {\n                return (32, HOLD_UP);\n            }\n\n            if (\n                _args.fromInvestorBalance > _args.value &&\n                _args.fromInvestorBalance - _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinUSTokens()\n            ) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceFullTransfer() &&\n                _args.fromInvestorBalance > _args.value\n            ) {\n                return (50, ONLY_FULL_TRANSFER);\n            }\n        } else {\n            if (checkHoldUp(_services, _args.from, _args.value, false, isPlatformWalletFrom)) {\n                return (33, HOLD_UP);\n            }\n\n            if (\n                toRegion == US &&\n                !isPlatformWalletFrom &&\n                isBlockFlowbackEndTimeOk(IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getBlockFlowbackEndTime())\n            ) {\n                return (25, FLOWBACK);\n            }\n\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getWorldWideForceFullTransfer() &&\n                _args.fromInvestorBalance > _args.value\n            ) {\n                return (50, ONLY_FULL_TRANSFER);\n            }\n        }\n\n        uint256 toInvestorBalance = balanceOfInvestor(_services, _args.to);\n        string memory toCountry = getCountry(_services, _args.to);\n\n        if (_args.fromRegion == EU) {\n            if (_args.fromInvestorBalance - _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinEUTokens() &&\n                _args.fromInvestorBalance > _args.value) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n        }\n\n        bool isAccreditedTo = isAccredited(_services, _args.to);\n        if (\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceAccredited() && !isAccreditedTo\n        ) {\n            return (61, ONLY_ACCREDITED);\n        }\n\n        if (toRegion == JP) {\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getJPInvestorsLimit() != 0 &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getJPInvestorsCount() >=\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getJPInvestorsLimit() &&\n                isNewInvestor(toInvestorBalance) &&\n                (!CommonUtils.isEqualString(getCountry(_services, _args.from), toCountry) || (_args.fromInvestorBalance > _args.value))\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n        } else if (toRegion == EU) {\n            if (\n                isRetail(_services, _args.to) &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getEURetailInvestorsCount(toCountry) >=\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getEURetailInvestorsLimit() &&\n                isNewInvestor(toInvestorBalance) &&\n                (!CommonUtils.isEqualString(getCountry(_services, _args.from), toCountry) ||\n                (_args.fromInvestorBalance > _args.value && isRetail(_services, _args.from)))\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (\n                toInvestorBalance + _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinEUTokens()\n            ) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n        } else if (toRegion == US) {\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getForceAccreditedUS() &&\n                !isAccreditedTo\n            ) {\n                return (62, ONLY_US_ACCREDITED);\n            }\n\n            uint256 usInvestorsLimit = getUSInvestorsLimit(_services);\n            if (\n                usInvestorsLimit != 0 &&\n                (_args.fromRegion != US || _args.fromInvestorBalance > _args.value) &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getUSInvestorsCount() >= usInvestorsLimit &&\n                isNewInvestor(toInvestorBalance)\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getUSAccreditedInvestorsLimit() != 0 &&\n                isAccreditedTo &&\n                ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getUSAccreditedInvestorsCount() >=\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getUSAccreditedInvestorsLimit() &&\n                isNewInvestor(toInvestorBalance) &&\n                (_args.fromRegion != US || !isAccredited(_services, _args.from) || _args.fromInvestorBalance > _args.value)\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (\n                toInvestorBalance + _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinUSTokens()\n            ) {\n                return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n            }\n        }\n\n        if (!isAccreditedTo) {\n            if (maxInvestorsInCategoryForNonAccredited(_services, _args.from, _args.value, _args.fromInvestorBalance, toInvestorBalance)) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n        }\n\n        if (\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getTotalInvestorsLimit() != 0 &&\n            _args.fromInvestorBalance > _args.value &&\n            ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getTotalInvestorsCount() >=\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getTotalInvestorsLimit() &&\n            isNewInvestor(toInvestorBalance)\n        ) {\n            return (40, MAX_INVESTORS_IN_CATEGORY);\n        }\n\n        if (\n            _args.fromInvestorBalance == _args.value &&\n            !isNewInvestor(toInvestorBalance) &&\n            ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]).getTotalInvestorsCount() <=\n            IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinimumTotalInvestors()\n        ) {\n            return (71, NOT_ENOUGH_INVESTORS);\n        }\n\n        if (\n            !isPlatformWalletFrom &&\n        _args.fromInvestorBalance - _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinimumHoldingsPerInvestor() &&\n        _args.fromInvestorBalance > _args.value\n        ) {\n            return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n        }\n\n        if (\n            !_args.isPlatformWalletTo &&\n        toInvestorBalance + _args.value < IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMinimumHoldingsPerInvestor()\n        ) {\n            return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n        }\n\n        if (\n            !_args.isPlatformWalletTo &&\n            isMaximumHoldingsPerInvestorOk(\n                IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]).getMaximumHoldingsPerInvestor(),\n                toInvestorBalance, _args.value)\n        ) {\n            return (52, AMOUNT_OF_TOKENS_ABOVE_MAX);\n        }\n\n        return (0, VALID);\n    }\n\n\n    function preIssuanceCheck(\n        address[] calldata _services,\n        address _to,\n        uint256 _value\n    ) public view returns (uint256 code, string memory reason) {\n        ComplianceServiceRegulated complianceService = ComplianceServiceRegulated(_services[COMPLIANCE_SERVICE]);\n\n        if (!complianceService.checkWhitelisted(_to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        IDSComplianceConfigurationService complianceConfigurationService = IDSComplianceConfigurationService(_services[COMPLIANCE_CONFIGURATION_SERVICE]);\n        string memory toCountry = IDSRegistryService(_services[REGISTRY_SERVICE]).getCountry(IDSRegistryService(_services[REGISTRY_SERVICE]).getInvestor(_to));\n        uint256 toRegion = complianceConfigurationService.getCountryCompliance(toCountry);\n\n        if (toRegion == FORBIDDEN) {\n            return (26, DESTINATION_RESTRICTED);\n        }\n\n        if (IDSLockManager(_services[LOCK_MANAGER]).isInvestorLiquidateOnly(IDSRegistryService(_services[REGISTRY_SERVICE]).getInvestor(_to))) {\n            return (90, INVESTOR_LIQUIDATE_ONLY);\n        }\n\n        uint256 balanceOfInvestorTo = balanceOfInvestor(_services, _to);\n        bool isAccreditedTo = isAccredited(_services, _to);\n\n        if (\n            complianceConfigurationService.getForceAccredited() &&\n            !isAccreditedTo\n        ) {\n            return (61, ONLY_ACCREDITED);\n        }\n\n        if (isNewInvestor(balanceOfInvestorTo)) {\n            // verify global non accredited limit\n            if (!isAccreditedTo) {\n                if (\n                    complianceConfigurationService.getNonAccreditedInvestorsLimit() != 0 &&\n                    complianceService.getTotalInvestorsCount() - complianceService.getAccreditedInvestorsCount() >=\n                    complianceConfigurationService.getNonAccreditedInvestorsLimit()\n                ) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            }\n            // verify global investors limit\n            if (\n                complianceConfigurationService.getTotalInvestorsLimit() != 0 &&\n                complianceService.getTotalInvestorsCount() >= complianceConfigurationService.getTotalInvestorsLimit()\n            ) {\n                return (40, MAX_INVESTORS_IN_CATEGORY);\n            }\n\n            if (toRegion == US) {\n                // verify US investors limit is not exceeded\n                if (complianceConfigurationService.getUSInvestorsLimit() != 0 && complianceService.getUSInvestorsCount() >= complianceConfigurationService.getUSInvestorsLimit()) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n                // verify accredited US limit is not exceeded\n                if (\n                    complianceConfigurationService.getUSAccreditedInvestorsLimit() != 0 &&\n                    isAccreditedTo &&\n                    complianceService.getUSAccreditedInvestorsCount() >= complianceConfigurationService.getUSAccreditedInvestorsLimit()\n                ) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            } else if (toRegion == EU) {\n                if (\n                    isRetail(_services, _to) &&\n                    complianceService.getEURetailInvestorsCount(getCountry(_services, _to)) >= complianceConfigurationService.getEURetailInvestorsLimit()\n                ) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            } else if (toRegion == JP) {\n                if (complianceConfigurationService.getJPInvestorsLimit() != 0 && complianceService.getJPInvestorsCount() >= complianceConfigurationService.getJPInvestorsLimit()) {\n                    return (40, MAX_INVESTORS_IN_CATEGORY);\n                }\n            }\n        }\n\n        if (toRegion == US) {\n            if (\n                complianceConfigurationService.getForceAccreditedUS() &&\n                !isAccreditedTo\n            ) {\n                return (62, ONLY_US_ACCREDITED);\n            }\n        }\n\n        uint256 minimumHoldingsRequirement = complianceConfigurationService.getMinimumHoldingsPerInvestor();\n        if (toRegion == US) {\n            minimumHoldingsRequirement = complianceConfigurationService.getMinUSTokens();\n        }\n\n        if (\n            !IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_to) &&\n        balanceOfInvestorTo + _value < minimumHoldingsRequirement\n        ) {\n            return (51, AMOUNT_OF_TOKENS_UNDER_MIN);\n        }\n        // remains in tokens because maximun holdings per investor is set in tokens\n        if (\n            !IDSWalletManager(_services[WALLET_MANAGER]).isPlatformWallet(_to) &&\n            isMaximumHoldingsPerInvestorOk(\n                complianceConfigurationService.getMaximumHoldingsPerInvestor(),\n                balanceOfInvestorTo,\n                _value)\n        ) {\n            return (52, AMOUNT_OF_TOKENS_ABOVE_MAX);\n        }\n\n        return (0, VALID);\n    }\n\n    function isMaximumHoldingsPerInvestorOk(uint256 _maximumHoldingsPerInvestor, uint256 _balanceOfInvestorTo, uint256 _value) internal pure returns (bool) {\n        return _maximumHoldingsPerInvestor != 0 && _balanceOfInvestorTo + _value >= _maximumHoldingsPerInvestor;\n    }\n\n    function isBlockFlowbackEndTimeOk(uint256 _blockFlowBackEndTime) private view returns (bool){\n        return  (_blockFlowBackEndTime == 0 || _blockFlowBackEndTime > block.timestamp);\n    }\n}\n\n/**\n *   @title Concrete compliance service for tokens with regulation\n *\n */\n\ncontract ComplianceServiceRegulated is ComplianceServiceWhitelisted {\n\n    function initialize() public virtual override onlyProxy initializer {\n        _initialize();\n    }\n\n    function compareInvestorBalance(\n        string memory _investor,\n        uint256 _value,\n        uint256 _compareTo\n    ) internal view returns (bool) {\n        return (_value != 0 && getToken().balanceOfInvestor(_investor) == _compareTo);\n    }\n\n    function recordTransfer(\n        address _from,\n        address _to,\n        uint256 _value\n    ) internal override returns (bool) {\n        string memory investorFrom = getRegistryService().getInvestor(_from);\n        string memory investorTo = getRegistryService().getInvestor(_to);\n\n        if (compareInvestorBalance(investorTo, _value, 0)) {\n            adjustTotalInvestorsCounts(_to, CommonUtils.IncDec.Increase);\n        }\n\n        if(!CommonUtils.isEqualString(investorFrom, investorTo)) {\n            if (compareInvestorBalance(investorFrom, _value, _value)) {\n                adjustTotalInvestorsCounts(_from, CommonUtils.IncDec.Decrease);\n            }\n        }\n\n        cleanupInvestorIssuances(investorFrom);\n        cleanupInvestorIssuances(investorTo);\n        return true;\n    }\n\n    function recordIssuance(\n        address _to,\n        uint256 _value,\n        uint256 _issuanceTime\n    ) internal override returns (bool) {\n        string memory investorTo = getRegistryService().getInvestor(_to);\n        if (compareInvestorBalance(investorTo, _value, 0)) {\n            adjustTotalInvestorsCounts(_to, CommonUtils.IncDec.Increase);\n        }\n        uint256 shares = getRebasingProvider().convertTokensToShares(_value);\n\n        cleanupInvestorIssuances(investorTo);\n        return createIssuanceInformation(investorTo, shares, _issuanceTime);\n    }\n\n    function recordBurn(address _who, uint256 _value) internal override returns (bool) {\n        string memory investor = getRegistryService().getInvestor(_who);\n        if (compareInvestorBalance(investor, _value, _value)) {\n            adjustTotalInvestorsCounts(_who, CommonUtils.IncDec.Decrease);\n        }\n        return true;\n    }\n\n    function recordSeize(\n        address _from,\n        address, /*_to*/\n        uint256 _value\n    ) internal override returns (bool) {\n        return recordBurn(_from, _value);\n    }\n\n    function adjustInvestorCountsAfterCountryChange(\n        string memory _id,\n        string memory _country,\n        string memory _prevCountry\n    ) public override onlyRegistry returns (bool) {\n        if (getToken().balanceOfInvestor(_id) == 0) {\n            return false;\n        }\n\n        if (bytes(_prevCountry).length > 0) {\n            adjustInvestorsCountsByCountry(_prevCountry, _id, CommonUtils.IncDec.Decrease);\n        }\n\n        adjustInvestorsCountsByCountry(_country, _id, CommonUtils.IncDec.Increase);\n\n        return true;\n    }\n\n    function adjustTotalInvestorsCounts(address _wallet, CommonUtils.IncDec _increase) internal {\n        if (!getWalletManager().isSpecialWallet(_wallet)) {\n            if (_increase == CommonUtils.IncDec.Increase) {\n                totalInvestors++;\n            }\n            else {\n                totalInvestors--;\n            }\n\n            string memory id = getRegistryService().getInvestor(_wallet);\n            string memory country = getRegistryService().getCountry(id);\n\n            adjustInvestorsCountsByCountry(country, id, _increase);\n        }\n    }\n\n    function adjustInvestorsCountsByCountry(\n        string memory _country,\n        string memory _id,\n        CommonUtils.IncDec _increase\n    ) internal {\n        uint256 countryCompliance = getComplianceConfigurationService().getCountryCompliance(_country);\n\n        if (getRegistryService().isAccreditedInvestor(_id)) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                accreditedInvestorsCount++;\n            }\n            else {\n                accreditedInvestorsCount--;\n            }\n\n            if (countryCompliance == US) {\n                if(_increase == CommonUtils.IncDec.Increase) {\n                    usAccreditedInvestorsCount++;\n                }\n                else {\n                    usAccreditedInvestorsCount--;\n                }\n            }\n        }\n\n        if (countryCompliance == US) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                usInvestorsCount++;\n            }\n            else {\n                usInvestorsCount--;\n            }\n        } else if (countryCompliance == EU && !getRegistryService().isQualifiedInvestor(_id)) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                euRetailInvestorsCount[_country]++;\n            }\n            else {\n                euRetailInvestorsCount[_country]--;\n            }\n        } else if (countryCompliance == JP) {\n            if(_increase == CommonUtils.IncDec.Increase) {\n                jpInvestorsCount++;\n            }\n            else {\n                jpInvestorsCount--;\n            }\n        }\n    }\n\n    function createIssuanceInformation(\n        string memory _investor,\n        uint256 _shares,\n        uint256 _issuanceTime\n    ) internal returns (bool) {\n        uint256 issuancesCount = issuancesCounters[_investor];\n\n        issuancesValues[_investor][issuancesCount] = _shares;\n        issuancesTimestamps[_investor][issuancesCount] = _issuanceTime;\n        issuancesCounters[_investor] = issuancesCount + 1;\n\n        return true;\n    }\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.preTransferCheck(getServices(), _from, _to, _value);\n    }\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.newPreTransferCheck(getServices(), _from, _to, _value, _balanceFrom, _pausedToken);\n    }\n\n    function preInternalTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value)\n    public view override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.preTransferCheck(getServices(), _from, _to, _value);\n    }\n\n    /**\n     * @notice Calculates the number of transferable tokens for a given investor at a specific time,\n     *         taking into account issuance-level lockups (Investor Level Locks).\n     *\n     * @dev The calculation is performed as follows:\n     *      1. Retrieve the base transferable balance of the investor from the LockManager.\n     *      2. Determine the total amount of tokens from issuances that are still subject to a lockup period.\n     *      3. Subtract the locked tokens from the base transferable balance.\n     *\n     * @param _who Address of the investor being queried.\n     * @param _time Timestamp (in seconds) representing the evaluation moment. Must be greater than zero.\n     * @param _lockTime Duration of the lockup period in seconds.\n     *\n     * @return transferable The amount of transferable tokens\n     */\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        uint64 _lockTime\n    ) public view override returns (uint256) {\n        require(_time != 0, \"Time must be greater than zero\");\n        string memory investor = getRegistryService().getInvestor(_who);\n\n        uint256 balanceOfInvestor = getLockManager().getTransferableTokensForInvestor(investor, _time);\n\n        uint256 investorIssuancesCount = issuancesCounters[investor];\n\n        //No locks, go to base class implementation\n        if (investorIssuancesCount == 0) {\n            return balanceOfInvestor;\n        }\n\n        uint256 totalLockedTokens = 0;\n\n        for (uint256 i = 0; i < investorIssuancesCount; i++) {\n            uint256 issuanceTimestamp = issuancesTimestamps[investor][i];\n\n            if (uint256(_lockTime) > _time || issuanceTimestamp > (_time - uint256(_lockTime))) {\n                uint256 tokens = getRebasingProvider().convertSharesToTokens(issuancesValues[investor][i]);\n                totalLockedTokens = totalLockedTokens + tokens;\n            }\n        }\n\n        //there may be more locked tokens than actual tokens, so the minimum between the two\n        uint256 transferable = balanceOfInvestor - Math.min(totalLockedTokens, balanceOfInvestor);\n\n        return transferable;\n    }\n\n    function preIssuanceCheck(address _to, uint256 _value) public view override returns (uint256 code, string memory reason) {\n        return ComplianceServiceLibrary.preIssuanceCheck(getServices(), _to, _value);\n    }\n\n    function getTotalInvestorsCount() public view returns (uint256) {\n        return totalInvestors;\n    }\n\n    function getUSInvestorsCount() public view returns (uint256) {\n        return usInvestorsCount;\n    }\n\n    function getUSAccreditedInvestorsCount() public view returns (uint256) {\n        return usAccreditedInvestorsCount;\n    }\n\n    function getAccreditedInvestorsCount() public view returns (uint256) {\n        return accreditedInvestorsCount;\n    }\n\n    function getEURetailInvestorsCount(string calldata _country) public view returns (uint256) {\n        return euRetailInvestorsCount[_country];\n    }\n\n    function getJPInvestorsCount() public view returns (uint256) {\n        return jpInvestorsCount;\n    }\n\n    function setTotalInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        totalInvestors = _value;\n\n        return true;\n    }\n\n    function setUSInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        usInvestorsCount = _value;\n\n        return true;\n    }\n\n    function setUSAccreditedInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        usAccreditedInvestorsCount = _value;\n\n        return true;\n    }\n\n    function setAccreditedInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        accreditedInvestorsCount = _value;\n\n        return true;\n    }\n\n    function setEURetailInvestorsCount(string calldata _country, uint256 _value) public onlyMaster returns (bool) {\n        euRetailInvestorsCount[_country] = _value;\n\n        return true;\n    }\n\n    function setJPInvestorsCount(uint256 _value) public onlyMaster returns (bool) {\n        jpInvestorsCount = _value;\n\n        return true;\n    }\n\n    function cleanupInvestorIssuances(string memory investor) internal {\n        string memory country = getRegistryService().getCountry(investor);\n\n        uint256 region = getComplianceConfigurationService().getCountryCompliance(country);\n\n        uint256 lockTime;\n        if (region == ComplianceServiceLibrary.US) {\n            lockTime = getComplianceConfigurationService().getUSLockPeriod();\n        } else {\n            lockTime = getComplianceConfigurationService().getNonUSLockPeriod();\n        }\n\n        uint256 time = block.timestamp;\n\n        uint256 currentIssuancesCount = issuancesCounters[investor];\n        uint256 currentIndex = 0;\n\n        if (currentIssuancesCount == 0) {\n            return;\n        }\n\n        while (currentIndex < currentIssuancesCount) {\n            uint256 issuanceTimestamp = issuancesTimestamps[investor][currentIndex];\n\n            bool isNoLongerLocked = issuanceTimestamp <= (time - lockTime);\n\n            if (isNoLongerLocked) {\n                if (currentIndex != currentIssuancesCount - 1) {\n                    issuancesTimestamps[investor][currentIndex] = issuancesTimestamps[investor][currentIssuancesCount - 1];\n                    issuancesValues[investor][currentIndex] = issuancesValues[investor][currentIssuancesCount - 1];\n                }\n\n                delete issuancesTimestamps[investor][currentIssuancesCount - 1];\n                delete issuancesValues[investor][currentIssuancesCount - 1];\n\n                currentIssuancesCount--;\n            } else {\n                currentIndex++;\n            }\n        }\n\n        issuancesCounters[investor] = currentIssuancesCount;\n    }\n\n    function getServices() internal view returns (address[] memory services) {\n        services = new address[](6);\n        services[0] = getDSService(DS_TOKEN);\n        services[1] = getDSService(REGISTRY_SERVICE);\n        services[2] = getDSService(WALLET_MANAGER);\n        services[3] = getDSService(COMPLIANCE_CONFIGURATION_SERVICE);\n        services[4] = getDSService(LOCK_MANAGER);\n        services[5] = address(this);\n    }\n}\n"},"@openzeppelin/contracts/utils/cryptography/ECDSA.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.1.0) (utils/cryptography/ECDSA.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\n *\n * These functions can be used to verify that a message was signed by the holder\n * of the private keys of a given address.\n */\nlibrary ECDSA {\n    enum RecoverError {\n        NoError,\n        InvalidSignature,\n        InvalidSignatureLength,\n        InvalidSignatureS\n    }\n\n    /**\n     * @dev The signature derives the `address(0)`.\n     */\n    error ECDSAInvalidSignature();\n\n    /**\n     * @dev The signature has an invalid length.\n     */\n    error ECDSAInvalidSignatureLength(uint256 length);\n\n    /**\n     * @dev The signature has an S value that is in the upper half order.\n     */\n    error ECDSAInvalidSignatureS(bytes32 s);\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not\n     * return address(0) without also returning an error description. Errors are documented using an enum (error type)\n     * and a bytes32 providing additional information about the error.\n     *\n     * If no error is returned, then the address can be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     *\n     * Documentation for signature generation:\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes memory signature\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        if (signature.length == 65) {\n            bytes32 r;\n            bytes32 s;\n            uint8 v;\n            // ecrecover takes the signature parameters, and the only way to get them\n            // currently is to use assembly.\n            assembly (\"memory-safe\") {\n                r := mload(add(signature, 0x20))\n                s := mload(add(signature, 0x40))\n                v := byte(0, mload(add(signature, 0x60)))\n            }\n            return tryRecover(hash, v, r, s);\n        } else {\n            return (address(0), RecoverError.InvalidSignatureLength, bytes32(signature.length));\n        }\n    }\n\n    /**\n     * @dev Returns the address that signed a hashed message (`hash`) with\n     * `signature`. This address can then be used for verification purposes.\n     *\n     * The `ecrecover` EVM precompile allows for malleable (non-unique) signatures:\n     * this function rejects them by requiring the `s` value to be in the lower\n     * half order, and the `v` value to be either 27 or 28.\n     *\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\n     * verification to be secure: it is possible to craft signatures that\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\n     * this is by receiving a hash of the original message (which may otherwise\n     * be too long), and then calling {MessageHashUtils-toEthSignedMessageHash} on it.\n     */\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\n     *\n     * See https://eips.ethereum.org/EIPS/eip-2098[ERC-2098 short signatures]\n     */\n    function tryRecover(\n        bytes32 hash,\n        bytes32 r,\n        bytes32 vs\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        unchecked {\n            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\n            // We do not check for an overflow here since the shift operation results in 0 or 1.\n            uint8 v = uint8((uint256(vs) >> 255) + 27);\n            return tryRecover(hash, v, r, s);\n        }\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\n     */\n    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function tryRecover(\n        bytes32 hash,\n        uint8 v,\n        bytes32 r,\n        bytes32 s\n    ) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\n        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\n        //\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\n        // these malleable signatures as well.\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\n            return (address(0), RecoverError.InvalidSignatureS, s);\n        }\n\n        // If the signature is valid (and not malleable), return the signer address\n        address signer = ecrecover(hash, v, r, s);\n        if (signer == address(0)) {\n            return (address(0), RecoverError.InvalidSignature, bytes32(0));\n        }\n\n        return (signer, RecoverError.NoError, bytes32(0));\n    }\n\n    /**\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\n     * `r` and `s` signature fields separately.\n     */\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\n        (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, v, r, s);\n        _throwError(error, errorArg);\n        return recovered;\n    }\n\n    /**\n     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.\n     */\n    function _throwError(RecoverError error, bytes32 errorArg) private pure {\n        if (error == RecoverError.NoError) {\n            return; // no error: do nothing\n        } else if (error == RecoverError.InvalidSignature) {\n            revert ECDSAInvalidSignature();\n        } else if (error == RecoverError.InvalidSignatureLength) {\n            revert ECDSAInvalidSignatureLength(uint256(errorArg));\n        } else if (error == RecoverError.InvalidSignatureS) {\n            revert ECDSAInvalidSignatureS(errorArg);\n        }\n    }\n}\n"},"contracts/data-stores/ComplianceServiceDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract ComplianceServiceDataStore is ServiceConsumerDataStore {\n    uint256 internal totalInvestors;\n    uint256 internal accreditedInvestorsCount;\n    uint256 internal usAccreditedInvestorsCount;\n    uint256 internal usInvestorsCount;\n    uint256 internal jpInvestorsCount;\n    mapping(string country => uint256 count) internal euRetailInvestorsCount;\n    mapping(string tokenId => uint256 count) internal issuancesCounters;\n    mapping(string tokenId => mapping(uint256 issuanceId => uint256 value)) issuancesValues;\n    mapping(string tokenId => mapping(uint256 issuanceId => uint256 timestamp)) issuancesTimestamps;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[41] private __gap;\n}\n"},"@openzeppelin/contracts/interfaces/draft-IERC1822.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity >=0.4.16;\n\n/**\n * @dev ERC-1822: 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"},"@openzeppelin/contracts/interfaces/draft-IERC6093.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (interfaces/draft-IERC6093.sol)\npragma solidity >=0.8.4;\n\n/**\n * @dev Standard ERC-20 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.\n */\ninterface IERC20Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC20InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC20InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     * @param allowance Amount of tokens a `spender` is allowed to operate with.\n     * @param needed Minimum amount required to perform a transfer.\n     */\n    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC20InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.\n     * @param spender Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC20InvalidSpender(address spender);\n}\n\n/**\n * @dev Standard ERC-721 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.\n */\ninterface IERC721Errors {\n    /**\n     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.\n     * Used in balance queries.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721InvalidOwner(address owner);\n\n    /**\n     * @dev Indicates a `tokenId` whose `owner` is the zero address.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721NonexistentToken(uint256 tokenId);\n\n    /**\n     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param tokenId Identifier number of a token.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC721InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC721InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC721InsufficientApproval(address operator, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC721InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC721InvalidOperator(address operator);\n}\n\n/**\n * @dev Standard ERC-1155 Errors\n * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.\n */\ninterface IERC1155Errors {\n    /**\n     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     * @param balance Current balance for the interacting account.\n     * @param needed Minimum amount required to perform a transfer.\n     * @param tokenId Identifier number of a token.\n     */\n    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);\n\n    /**\n     * @dev Indicates a failure with the token `sender`. Used in transfers.\n     * @param sender Address whose tokens are being transferred.\n     */\n    error ERC1155InvalidSender(address sender);\n\n    /**\n     * @dev Indicates a failure with the token `receiver`. Used in transfers.\n     * @param receiver Address to which tokens are being transferred.\n     */\n    error ERC1155InvalidReceiver(address receiver);\n\n    /**\n     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     * @param owner Address of the current owner of a token.\n     */\n    error ERC1155MissingApprovalForAll(address operator, address owner);\n\n    /**\n     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.\n     * @param approver Address initiating an approval operation.\n     */\n    error ERC1155InvalidApprover(address approver);\n\n    /**\n     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.\n     * @param operator Address that may be allowed to operate on tokens without being their owner.\n     */\n    error ERC1155InvalidOperator(address operator);\n\n    /**\n     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.\n     * Used in batch transfers.\n     * @param idsLength Length of the array of token identifiers\n     * @param valuesLength Length of the array of token amounts\n     */\n    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);\n}\n"},"contracts/compliance/ComplianceServiceWhitelisted.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ComplianceService} from \"./ComplianceService.sol\";\nimport {CommonUtils} from \"../utils/CommonUtils.sol\";\n\n/**\n*   @title Concrete compliance service for tokens with whitelisted wallets.\n*\n*   This simple compliance service is meant to be used for tokens that only need to be validated against an investor registry.\n*/\n\ncontract ComplianceServiceWhitelisted is ComplianceService {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public virtual override onlyProxy initializer {\n        _initialize();\n    }\n\n    function _initialize() internal onlyInitializing {\n        ComplianceService.initialize();\n    }\n\n    function newPreTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return doPreTransferCheckWhitelisted(_from, _to, _value, _balanceFrom, _pausedToken);\n    }\n\n    function preTransferCheck(\n        address _from,\n        address _to,\n        uint256 _value\n    ) public view virtual override returns (uint256 code, string memory reason) {\n        return doPreTransferCheckWhitelisted(_from, _to, _value, getToken().balanceOf(_from), getToken().isPaused());\n    }\n\n    function checkWhitelisted(address _who) public view returns (bool) {\n        return getWalletManager().isPlatformWallet(_who) || !CommonUtils.isEmptyString(getRegistryService().getInvestor(_who));\n    }\n\n    function recordIssuance(address, uint256, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function recordTransfer(address, address, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function checkTransfer(address, address _to, uint256) internal view override returns (uint256, string memory) {\n        if (!checkWhitelisted(_to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        return (0, VALID);\n    }\n\n    function preIssuanceCheck(address _to, uint256) public view virtual override returns (uint256, string memory) {\n        if (!checkWhitelisted(_to)) {\n            return (20, WALLET_NOT_IN_REGISTRY_SERVICE);\n        }\n\n        return (0, VALID);\n    }\n\n    function recordBurn(address, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function recordSeize(address, address, uint256) internal virtual override returns (bool) {\n        return true;\n    }\n\n    function doPreTransferCheckWhitelisted(\n        address _from,\n        address _to,\n        uint256 _value,\n        uint256 _balanceFrom,\n        bool _pausedToken\n    ) internal view returns (uint256 code, string memory reason) {\n        if (_pausedToken) {\n            return (10, TOKEN_PAUSED);\n        }\n\n        if (_balanceFrom < _value) {\n            return (15, NOT_ENOUGH_TOKENS);\n        }\n\n        if (!getWalletManager().isPlatformWallet(_from) && getLockManager().getTransferableTokens(_from, block.timestamp) < _value) {\n            return (16, TOKENS_LOCKED);\n        }\n\n        return checkTransfer(_from, _to, _value);\n    }\n\n    function getComplianceTransferableTokens(\n        address _who,\n        uint256 _time,\n        uint64 /*_lockTime*/\n    ) public view virtual override returns (uint256) {\n        require(_time > 0, \"Time must be greater than zero\");\n        return getLockManager().getTransferableTokens(_who, _time);\n    }\n}\n"},"contracts/mocks/SecuritizeInternalNavProviderMock.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ISecuritizeNavProvider} from \"../nav/ISecuritizeNavProvider.sol\";\n\n\ncontract SecuritizeInternalNavProviderMock is ISecuritizeNavProvider {\n    /**\n     * @dev rate: NAV rate expressed with 6 decimals\n     */\n    uint256 public rate;\n\n    constructor(uint256 _rate) {\n        rate = _rate;\n    }\n\n    function initialize(uint256 _rate) public {\n        rate = _rate;\n    }\n\n    function setRate(uint256 _rate) external override {\n        rate = _rate;\n    }\n}\n"},"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (proxy/ERC1967/ERC1967Utils.sol)\n\npragma solidity ^0.8.21;\n\nimport {IBeacon} from \"../beacon/IBeacon.sol\";\nimport {IERC1967} from \"../../interfaces/IERC1967.sol\";\nimport {Address} from \"../../utils/Address.sol\";\nimport {StorageSlot} from \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This library provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[ERC-1967] slots.\n */\nlibrary ERC1967Utils {\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.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n    /**\n     * @dev The `implementation` of the proxy is invalid.\n     */\n    error ERC1967InvalidImplementation(address implementation);\n\n    /**\n     * @dev The `admin` of the proxy is invalid.\n     */\n    error ERC1967InvalidAdmin(address admin);\n\n    /**\n     * @dev The `beacon` of the proxy is invalid.\n     */\n    error ERC1967InvalidBeacon(address beacon);\n\n    /**\n     * @dev An upgrade function sees `msg.value > 0` that may be lost.\n     */\n    error ERC1967NonPayable();\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 ERC-1967 implementation slot.\n     */\n    function _setImplementation(address newImplementation) private {\n        if (newImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(newImplementation);\n        }\n        StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = newImplementation;\n    }\n\n    /**\n     * @dev Performs implementation upgrade with additional setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) internal {\n        _setImplementation(newImplementation);\n        emit IERC1967.Upgraded(newImplementation);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(newImplementation, data);\n        } else {\n            _checkNonPayable();\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.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\n    bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\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 ERC-1967) using\n     * the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n     * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\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 ERC-1967 admin slot.\n     */\n    function _setAdmin(address newAdmin) private {\n        if (newAdmin == address(0)) {\n            revert ERC1967InvalidAdmin(address(0));\n        }\n        StorageSlot.getAddressSlot(ADMIN_SLOT).value = newAdmin;\n    }\n\n    /**\n     * @dev Changes the admin of the proxy.\n     *\n     * Emits an {IERC1967-AdminChanged} event.\n     */\n    function changeAdmin(address newAdmin) internal {\n        emit IERC1967.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 the keccak-256 hash of \"eip1967.proxy.beacon\" subtracted by 1.\n     */\n    // solhint-disable-next-line private-vars-leading-underscore\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 ERC-1967 beacon slot.\n     */\n    function _setBeacon(address newBeacon) private {\n        if (newBeacon.code.length == 0) {\n            revert ERC1967InvalidBeacon(newBeacon);\n        }\n\n        StorageSlot.getAddressSlot(BEACON_SLOT).value = newBeacon;\n\n        address beaconImplementation = IBeacon(newBeacon).implementation();\n        if (beaconImplementation.code.length == 0) {\n            revert ERC1967InvalidImplementation(beaconImplementation);\n        }\n    }\n\n    /**\n     * @dev Change the beacon and trigger a setup call if data is nonempty.\n     * This function is payable only if the setup call is performed, otherwise `msg.value` is rejected\n     * to avoid stuck value in the contract.\n     *\n     * Emits an {IERC1967-BeaconUpgraded} event.\n     *\n     * CAUTION: Invoking this function has no effect on an instance of {BeaconProxy} since v5, since\n     * it uses an immutable beacon without looking at the value of the ERC-1967 beacon slot for\n     * efficiency.\n     */\n    function upgradeBeaconToAndCall(address newBeacon, bytes memory data) internal {\n        _setBeacon(newBeacon);\n        emit IERC1967.BeaconUpgraded(newBeacon);\n\n        if (data.length > 0) {\n            Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n        } else {\n            _checkNonPayable();\n        }\n    }\n\n    /**\n     * @dev Reverts if `msg.value` is not zero. It can be used to avoid `msg.value` stuck in the contract\n     * if an upgrade doesn't perform an initialization call.\n     */\n    function _checkNonPayable() private {\n        if (msg.value > 0) {\n            revert ERC1967NonPayable();\n        }\n    }\n}\n"},"contracts/data-stores/InvestorLockManagerDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {BaseLockManagerDataStore} from \"./BaseLockManagerDataStore.sol\";\n\ncontract InvestorLockManagerDataStore is BaseLockManagerDataStore {\n    mapping(string investorId => mapping(uint256 lockId => Lock lock)) internal investorsLocks;\n    mapping(string investorId => uint256 count) internal investorsLocksCounts;\n    mapping(string investorId => bool locked) internal investorsLocked;\n    mapping(string investorId => mapping(bytes32 partitionHash => mapping(uint256 lockId => Lock lock))) internal investorsPartitionsLocks;\n    mapping(string investorId => mapping(bytes32 partitionHash => uint256 count)) internal investorsPartitionsLocksCounts;\n    mapping(string investorId => bool liquidateOnly) internal investorsLiquidateOnly;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[44] private __gap;\n}\n"},"contracts/compliance/ComplianceConfigurationService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {IDSComplianceConfigurationService} from \"./IDSComplianceConfigurationService.sol\";\nimport {ComplianceConfigurationDataStore} from \"../data-stores/ComplianceConfigurationDataStore.sol\";\nimport {BaseDSContract} from \"../utils/BaseDSContract.sol\";\n\ncontract ComplianceConfigurationService is IDSComplianceConfigurationService, ComplianceConfigurationDataStore, BaseDSContract {\n\n    /// @custom:oz-upgrades-unsafe-allow constructor\n    constructor() {\n        _disableInitializers();\n    }\n\n    function initialize() public override onlyProxy initializer {\n        __BaseDSContract_init();\n    }\n\n    function setCountriesCompliance(string[] calldata _countries, uint256[] calldata _values) public override onlyTransferAgentOrAbove {\n        require(_countries.length <= 35, \"Exceeded the maximum number of countries\");\n        require(_countries.length == _values.length, \"Wrong length of parameters\");\n        for (uint8 i = 0; i < _countries.length; i++) {\n            setCountryCompliance(_countries[i], _values[i]);\n        }\n    }\n\n    function setCountryCompliance(string calldata _country, uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceStringToUIntMapRuleSet(\"countryCompliance\", _country, countriesCompliances[_country], _value);\n        countriesCompliances[_country] = _value;\n    }\n\n    function getCountryCompliance(string calldata _country) public view override returns (uint256) {\n        return countriesCompliances[_country];\n    }\n\n    function getTotalInvestorsLimit() public view override returns (uint256) {\n        return totalInvestorsLimit;\n    }\n\n    function setTotalInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"totalInvestorsLimit\", totalInvestorsLimit, _value);\n        totalInvestorsLimit = _value;\n    }\n\n    function getMinUSTokens() public view override returns (uint256) {\n        return minUSTokens;\n    }\n\n    function setMinUSTokens(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minUSTokens\", minUSTokens, _value);\n        minUSTokens = _value;\n    }\n\n    function getMinEUTokens() public view override returns (uint256) {\n        return minEUTokens;\n    }\n\n    function setMinEUTokens(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minEUTokens\", minEUTokens, _value);\n        minEUTokens = _value;\n    }\n\n    function getUSInvestorsLimit() public view override returns (uint256) {\n        return usInvestorsLimit;\n    }\n\n    function setUSInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"usInvestorsLimit\", usInvestorsLimit, _value);\n        usInvestorsLimit = _value;\n    }\n\n    function getJPInvestorsLimit() public view override returns (uint256) {\n        return jpInvestorsLimit;\n    }\n\n    function setJPInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"jpInvestorsLimit\", jpInvestorsLimit, _value);\n        jpInvestorsLimit = _value;\n    }\n\n    function getUSAccreditedInvestorsLimit() public view override returns (uint256) {\n        return usAccreditedInvestorsLimit;\n    }\n\n    function setUSAccreditedInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"usAccreditedInvestorsLimit\", usAccreditedInvestorsLimit, _value);\n        usAccreditedInvestorsLimit = _value;\n    }\n\n    function getNonAccreditedInvestorsLimit() public view override returns (uint256) {\n        return nonAccreditedInvestorsLimit;\n    }\n\n    function setNonAccreditedInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"nonAccreditedInvestorsLimit\", nonAccreditedInvestorsLimit, _value);\n        nonAccreditedInvestorsLimit = _value;\n    }\n\n    function getMaxUSInvestorsPercentage() public view override returns (uint256) {\n        return maxUSInvestorsPercentage;\n    }\n\n    function setMaxUSInvestorsPercentage(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"maxUSInvestorsPercentage\", maxUSInvestorsPercentage, _value);\n        maxUSInvestorsPercentage = _value;\n    }\n\n    function getBlockFlowbackEndTime() public view override returns (uint256) {\n        return blockFlowbackEndTime;\n    }\n\n    function setBlockFlowbackEndTime(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"blockFlowbackEndTime\", blockFlowbackEndTime, _value);\n        blockFlowbackEndTime = _value;\n    }\n\n    function getNonUSLockPeriod() public view override returns (uint256) {\n        return nonUSLockPeriod;\n    }\n\n    function setNonUSLockPeriod(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"nonUSLockPeriod\", nonUSLockPeriod, _value);\n        nonUSLockPeriod = _value;\n    }\n\n    function getMinimumTotalInvestors() public view override returns (uint256) {\n        return minimumTotalInvestors;\n    }\n\n    function setMinimumTotalInvestors(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minimumTotalInvestors\", minimumTotalInvestors, _value);\n        minimumTotalInvestors = _value;\n    }\n\n    function getMinimumHoldingsPerInvestor() public view override returns (uint256) {\n        return minimumHoldingsPerInvestor;\n    }\n\n    function setMinimumHoldingsPerInvestor(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"minimumHoldingsPerInvestor\", minimumHoldingsPerInvestor, _value);\n        minimumHoldingsPerInvestor = _value;\n    }\n\n    function getMaximumHoldingsPerInvestor() public view override returns (uint256) {\n        return maximumHoldingsPerInvestor;\n    }\n\n    function setMaximumHoldingsPerInvestor(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"maximumHoldingsPerInvestor\", maximumHoldingsPerInvestor, _value);\n        maximumHoldingsPerInvestor = _value;\n    }\n\n    function getEURetailInvestorsLimit() public view override returns (uint256) {\n        return euRetailInvestorsLimit;\n    }\n\n    function setEURetailInvestorsLimit(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"euRetailInvestorsLimit\", euRetailInvestorsLimit, _value);\n        euRetailInvestorsLimit = _value;\n    }\n\n    function getUSLockPeriod() public view override returns (uint256) {\n        return usLockPeriod;\n    }\n\n    function setUSLockPeriod(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"usLockPeriod\", usLockPeriod, _value);\n        usLockPeriod = _value;\n    }\n\n    function getForceFullTransfer() public view override returns (bool) {\n        return forceFullTransfer;\n    }\n\n    function setForceFullTransfer(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"forceFullTransfer\", forceFullTransfer, _value);\n        forceFullTransfer = _value;\n    }\n\n    function getForceAccreditedUS() public view override returns (bool) {\n        return forceAccreditedUS;\n    }\n\n    function setForceAccreditedUS(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"forceAccreditedUS\", forceAccreditedUS, _value);\n        forceAccreditedUS = _value;\n    }\n\n    function getForceAccredited() public view override returns (bool) {\n        return forceAccredited;\n    }\n\n    function setForceAccredited(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"forceAccredited\", forceAccredited, _value);\n        forceAccredited = _value;\n    }\n\n    function getWorldWideForceFullTransfer() public view override returns (bool) {\n        return worldWideForceFullTransfer;\n    }\n\n    function setWorldWideForceFullTransfer(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"worldWideForceFullTransfer\", worldWideForceFullTransfer, _value);\n        worldWideForceFullTransfer = _value;\n    }\n\n    function getAuthorizedSecurities() public view override returns (uint256) {\n        return authorizedSecurities;\n    }\n\n    function setAuthorizedSecurities(uint256 _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceUIntRuleSet(\"authorizedSecurities\", authorizedSecurities, _value);\n        authorizedSecurities = _value;\n    }\n\n    function getDisallowBackDating() public view override returns (bool) {\n        return disallowBackDating;\n    }\n\n    function setDisallowBackDating(bool _value) public override onlyTransferAgentOrAbove {\n        emit DSComplianceBoolRuleSet(\"disallowBackDating\", disallowBackDating, _value);\n        disallowBackDating = _value;\n    }\n\n    function setAll(uint256[] calldata _uint_values, bool[] calldata _bool_values) public override onlyTransferAgentOrAbove {\n        require(_uint_values.length == 16, \"Wrong length of parameters\");\n        require(_bool_values.length == 5, \"Wrong length of parameters\");\n        setTotalInvestorsLimit(_uint_values[0]);\n        setMinUSTokens(_uint_values[1]);\n        setMinEUTokens(_uint_values[2]);\n        setUSInvestorsLimit(_uint_values[3]);\n        setUSAccreditedInvestorsLimit(_uint_values[4]);\n        setNonAccreditedInvestorsLimit(_uint_values[5]);\n        setMaxUSInvestorsPercentage(_uint_values[6]);\n        setBlockFlowbackEndTime(_uint_values[7]);\n        setNonUSLockPeriod(_uint_values[8]);\n        setMinimumTotalInvestors(_uint_values[9]);\n        setMinimumHoldingsPerInvestor(_uint_values[10]);\n        setMaximumHoldingsPerInvestor(_uint_values[11]);\n        setEURetailInvestorsLimit(_uint_values[12]);\n        setUSLockPeriod(_uint_values[13]);\n        setJPInvestorsLimit(_uint_values[14]);\n        setAuthorizedSecurities(_uint_values[15]);\n        setForceFullTransfer(_bool_values[0]);\n        setForceAccredited(_bool_values[1]);\n        setForceAccreditedUS(_bool_values[2]);\n        setWorldWideForceFullTransfer(_bool_values[3]);\n        setDisallowBackDating(_bool_values[4]);\n    }\n\n    function getAll() public view override returns (uint256[] memory, bool[] memory) {\n        uint256[] memory uintValues = new uint256[](16);\n        bool[] memory boolValues = new bool[](5);\n\n        uintValues[0] = getTotalInvestorsLimit();\n        uintValues[1] = getMinUSTokens();\n        uintValues[2] = getMinEUTokens();\n        uintValues[3] = getUSInvestorsLimit();\n        uintValues[4] = getUSAccreditedInvestorsLimit();\n        uintValues[5] = getNonAccreditedInvestorsLimit();\n        uintValues[6] = getMaxUSInvestorsPercentage();\n        uintValues[7] = getBlockFlowbackEndTime();\n        uintValues[8] = getNonUSLockPeriod();\n        uintValues[9] = getMinimumTotalInvestors();\n        uintValues[10] = getMinimumHoldingsPerInvestor();\n        uintValues[11] = getMaximumHoldingsPerInvestor();\n        uintValues[12] = getEURetailInvestorsLimit();\n        uintValues[13] = getUSLockPeriod();\n        uintValues[14] = getJPInvestorsLimit();\n        uintValues[15] = getAuthorizedSecurities();\n        boolValues[0] = getForceFullTransfer();\n        boolValues[1] = getForceAccredited();\n        boolValues[2] = getForceAccreditedUS();\n        boolValues[3] = getWorldWideForceFullTransfer();\n        boolValues[4] = getDisallowBackDating();\n        return (uintValues, boolValues);\n    }\n}\n"},"contracts/compliance/IDSComplianceConfigurationService.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nabstract contract IDSComplianceConfigurationService {\n\n    function initialize() public virtual;\n\n    event DSComplianceUIntRuleSet(string ruleName, uint256 prevValue, uint256 newValue);\n    event DSComplianceBoolRuleSet(string ruleName, bool prevValue, bool newValue);\n    event DSComplianceStringToUIntMapRuleSet(string ruleName, string keyValue, uint256 prevValue, uint256 newValue);\n\n    function getCountryCompliance(string calldata _country) public view virtual returns (uint256);\n\n    function setCountriesCompliance(string[] calldata _countries, uint256[] calldata _values) public virtual;\n\n    function setCountryCompliance(\n        string calldata _country,\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getTotalInvestorsLimit() public view virtual returns (uint256);\n\n    function setTotalInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinUSTokens() public view virtual returns (uint256);\n\n    function setMinUSTokens(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinEUTokens() public view virtual returns (uint256);\n\n    function setMinEUTokens(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSInvestorsLimit() public view virtual returns (uint256);\n\n    function setUSInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getJPInvestorsLimit() public view virtual returns (uint256);\n\n    function setJPInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSAccreditedInvestorsLimit() public view virtual returns (uint256);\n\n    function setUSAccreditedInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getNonAccreditedInvestorsLimit() public view virtual returns (uint256);\n\n    function setNonAccreditedInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMaxUSInvestorsPercentage() public view virtual returns (uint256);\n\n    function setMaxUSInvestorsPercentage(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getBlockFlowbackEndTime() public view virtual returns (uint256);\n\n    function setBlockFlowbackEndTime(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getNonUSLockPeriod() public view virtual returns (uint256);\n\n    function setNonUSLockPeriod(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinimumTotalInvestors() public view virtual returns (uint256);\n\n    function setMinimumTotalInvestors(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMinimumHoldingsPerInvestor() public view virtual returns (uint256);\n\n    function setMinimumHoldingsPerInvestor(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getMaximumHoldingsPerInvestor() public view virtual returns (uint256);\n\n    function setMaximumHoldingsPerInvestor(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getEURetailInvestorsLimit() public view virtual returns (uint256);\n\n    function setEURetailInvestorsLimit(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getUSLockPeriod() public view virtual returns (uint256);\n\n    function setUSLockPeriod(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceFullTransfer() public view virtual returns (bool);\n\n    function setForceFullTransfer(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceAccredited() public view virtual returns (bool);\n\n    function setForceAccredited(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function setForceAccreditedUS(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getForceAccreditedUS() public view virtual returns (bool);\n\n    function setWorldWideForceFullTransfer(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getWorldWideForceFullTransfer() public view virtual returns (bool);\n\n    function getAuthorizedSecurities() public view virtual returns (uint256);\n\n    function setAuthorizedSecurities(\n        uint256 _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getDisallowBackDating() public view virtual returns (bool);\n\n    function setDisallowBackDating(\n        bool _value /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function setAll(\n        uint256[] calldata _uint_values,\n        bool[] calldata _bool_values /*onlyTransferAgentOrAbove*/\n    ) public virtual;\n\n    function getAll() public view virtual returns (uint256[] memory, bool[] memory);\n}\n"},"contracts/data-stores/ComplianceConfigurationDataStore.sol":{"content":"/**\n * Copyright 2025 Securitize Inc. All rights reserved.\n *\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npragma solidity 0.8.22;\n\nimport {ServiceConsumerDataStore} from \"./ServiceConsumerDataStore.sol\";\n\ncontract ComplianceConfigurationDataStore is ServiceConsumerDataStore {\n    mapping(string country => uint256 compliance) public countriesCompliances;\n    uint256 public totalInvestorsLimit;\n    uint256 public minUSTokens;\n    uint256 public minEUTokens;\n    uint256 public usInvestorsLimit;\n    uint256 public jpInvestorsLimit;\n    uint256 public usAccreditedInvestorsLimit;\n    uint256 public nonAccreditedInvestorsLimit;\n    uint256 public maxUSInvestorsPercentage;\n    uint256 public blockFlowbackEndTime;\n    uint256 public nonUSLockPeriod;\n    uint256 public minimumTotalInvestors;\n    uint256 public minimumHoldingsPerInvestor;\n    uint256 public maximumHoldingsPerInvestor;\n    uint256 public euRetailInvestorsLimit;\n    uint256 public usLockPeriod;\n    bool public forceFullTransfer;\n    bool public forceAccreditedUS;\n    bool public forceAccredited;\n    bool public worldWideForceFullTransfer;\n    uint256 public authorizedSecurities;\n    bool public disallowBackDating;\n\n    /**\n     * @dev This empty reserved space is put in place to allow future versions to add new\n     * variables without shifting down storage in the inheritance chain.\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\n     */\n    uint256[31] private __gap;\n}\n"},"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/cryptography/MessageHashUtils.sol)\n\npragma solidity ^0.8.20;\n\nimport {Strings} from \"../Strings.sol\";\n\n/**\n * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.\n *\n * The library provides methods for generating a hash of a message that conforms to the\n * https://eips.ethereum.org/EIPS/eip-191[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]\n * specifications.\n */\nlibrary MessageHashUtils {\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing a bytes32 `messageHash` with\n     * `\"\\x19Ethereum Signed Message:\\n32\"` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with\n     * keccak256, although any bytes32 value can be safely used because the final digest will\n     * be re-hashed.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, \"\\x19Ethereum Signed Message:\\n32\") // 32 is the bytes-length of messageHash\n            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix\n            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x45` (`personal_sign` messages).\n     *\n     * The digest is calculated by prefixing an arbitrary `message` with\n     * `\"\\x19Ethereum Signed Message:\\n\" + len(message)` and hashing the result. It corresponds with the\n     * hash signed when using the https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sign[`eth_sign`] JSON-RPC method.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {\n        return\n            keccak256(bytes.concat(\"\\x19Ethereum Signed Message:\\n\", bytes(Strings.toString(message.length)), message));\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an ERC-191 signed data with version\n     * `0x00` (data with intended validator).\n     *\n     * The digest is calculated by prefixing an arbitrary `data` with `\"\\x19\\x00\"` and the intended\n     * `validator` address. Then hashing the result.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {\n        return keccak256(abi.encodePacked(hex\"19_00\", validator, data));\n    }\n\n    /**\n     * @dev Variant of {toDataWithIntendedValidatorHash-address-bytes} optimized for cases where `data` is a bytes32.\n     */\n    function toDataWithIntendedValidatorHash(\n        address validator,\n        bytes32 messageHash\n    ) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            mstore(0x00, hex\"19_00\")\n            mstore(0x02, shl(96, validator))\n            mstore(0x16, messageHash)\n            digest := keccak256(0x00, 0x36)\n        }\n    }\n\n    /**\n     * @dev Returns the keccak256 digest of an EIP-712 typed data (ERC-191 version `0x01`).\n     *\n     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with\n     * `\\x19\\x01` and hashing the result. It corresponds to the hash signed by the\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.\n     *\n     * See {ECDSA-recover}.\n     */\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {\n        assembly (\"memory-safe\") {\n            let ptr := mload(0x40)\n            mstore(ptr, hex\"19_01\")\n            mstore(add(ptr, 0x02), domainSeparator)\n            mstore(add(ptr, 0x22), structHash)\n            digest := keccak256(ptr, 0x42)\n        }\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)\n\npragma solidity ^0.8.20;\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\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 ContextUpgradeable is Initializable {\n    function __Context_init() internal onlyInitializing {\n    }\n\n    function __Context_init_unchained() internal onlyInitializing {\n    }\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    function _contextSuffixLength() internal view virtual returns (uint256) {\n        return 0;\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.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 * The initial owner is set to the address provided by the deployer. This can\n * 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 OwnableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Ownable\n    struct OwnableStorage {\n        address _owner;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Ownable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;\n\n    function _getOwnableStorage() private pure returns (OwnableStorage storage $) {\n        assembly {\n            $.slot := OwnableStorageLocation\n        }\n    }\n\n    /**\n     * @dev The caller account is not authorized to perform an operation.\n     */\n    error OwnableUnauthorizedAccount(address account);\n\n    /**\n     * @dev The owner is not a valid owner account. (eg. `address(0)`)\n     */\n    error OwnableInvalidOwner(address owner);\n\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n    /**\n     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.\n     */\n    function __Ownable_init(address initialOwner) internal onlyInitializing {\n        __Ownable_init_unchained(initialOwner);\n    }\n\n    function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {\n        if (initialOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\n        _transferOwnership(initialOwner);\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        OwnableStorage storage $ = _getOwnableStorage();\n        return $._owner;\n    }\n\n    /**\n     * @dev Throws if the sender is not the owner.\n     */\n    function _checkOwner() internal view virtual {\n        if (owner() != _msgSender()) {\n            revert OwnableUnauthorizedAccount(_msgSender());\n        }\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        if (newOwner == address(0)) {\n            revert OwnableInvalidOwner(address(0));\n        }\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        OwnableStorage storage $ = _getOwnableStorage();\n        address oldOwner = $._owner;\n        $._owner = newOwner;\n        emit OwnershipTransferred(oldOwner, newOwner);\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```solidity\n * contract MyToken is ERC20Upgradeable {\n *     function initialize() initializer public {\n *         __ERC20_init(\"MyToken\", \"MTK\");\n *     }\n * }\n *\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n *     function initializeV2() reinitializer(2) public {\n *         __ERC20Permit_init(\"MyToken\");\n *     }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n *     _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n    /**\n     * @dev Storage of the initializable contract.\n     *\n     * It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions\n     * when using with upgradeable contracts.\n     *\n     * @custom:storage-location erc7201:openzeppelin.storage.Initializable\n     */\n    struct InitializableStorage {\n        /**\n         * @dev Indicates that the contract has been initialized.\n         */\n        uint64 _initialized;\n        /**\n         * @dev Indicates that the contract is in the process of being initialized.\n         */\n        bool _initializing;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Initializable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;\n\n    /**\n     * @dev The contract is already initialized.\n     */\n    error InvalidInitialization();\n\n    /**\n     * @dev The contract is not initializing.\n     */\n    error NotInitializing();\n\n    /**\n     * @dev Triggered when the contract has been initialized or reinitialized.\n     */\n    event Initialized(uint64 version);\n\n    /**\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n     * `onlyInitializing` functions can be used to initialize parent contracts.\n     *\n     * Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any\n     * number of times. This behavior in the constructor can be useful during testing and is not expected to be used in\n     * production.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier initializer() {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        // Cache values to avoid duplicated sloads\n        bool isTopLevelCall = !$._initializing;\n        uint64 initialized = $._initialized;\n\n        // Allowed calls:\n        // - initialSetup: the contract is not in the initializing state and no previous version was\n        //                 initialized\n        // - construction: the contract is initialized at version 1 (no reinitialization) and the\n        //                 current contract is just being deployed\n        bool initialSetup = initialized == 0 && isTopLevelCall;\n        bool construction = initialized == 1 && address(this).code.length == 0;\n\n        if (!initialSetup && !construction) {\n            revert InvalidInitialization();\n        }\n        $._initialized = 1;\n        if (isTopLevelCall) {\n            $._initializing = true;\n        }\n        _;\n        if (isTopLevelCall) {\n            $._initializing = false;\n            emit Initialized(1);\n        }\n    }\n\n    /**\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n     * used to initialize parent contracts.\n     *\n     * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n     * are added through upgrades and that require initialization.\n     *\n     * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n     * cannot be nested. If one is invoked in the context of another, execution will revert.\n     *\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n     * a contract, executing them in the right order is up to the developer or operator.\n     *\n     * WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.\n     *\n     * Emits an {Initialized} event.\n     */\n    modifier reinitializer(uint64 version) {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing || $._initialized >= version) {\n            revert InvalidInitialization();\n        }\n        $._initialized = version;\n        $._initializing = true;\n        _;\n        $._initializing = false;\n        emit Initialized(version);\n    }\n\n    /**\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\n     */\n    modifier onlyInitializing() {\n        _checkInitializing();\n        _;\n    }\n\n    /**\n     * @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.\n     */\n    function _checkInitializing() internal view virtual {\n        if (!_isInitializing()) {\n            revert NotInitializing();\n        }\n    }\n\n    /**\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n     * through proxies.\n     *\n     * Emits an {Initialized} event the first time it is successfully executed.\n     */\n    function _disableInitializers() internal virtual {\n        // solhint-disable-next-line var-name-mixedcase\n        InitializableStorage storage $ = _getInitializableStorage();\n\n        if ($._initializing) {\n            revert InvalidInitialization();\n        }\n        if ($._initialized != type(uint64).max) {\n            $._initialized = type(uint64).max;\n            emit Initialized(type(uint64).max);\n        }\n    }\n\n    /**\n     * @dev Returns the highest version that has been initialized. See {reinitializer}.\n     */\n    function _getInitializedVersion() internal view returns (uint64) {\n        return _getInitializableStorage()._initialized;\n    }\n\n    /**\n     * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.\n     */\n    function _isInitializing() internal view returns (bool) {\n        return _getInitializableStorage()._initializing;\n    }\n\n    /**\n     * @dev Pointer to storage slot. Allows integrators to override it with a custom storage location.\n     *\n     * NOTE: Consider following the ERC-7201 formula to derive storage locations.\n     */\n    function _initializableStorageSlot() internal pure virtual returns (bytes32) {\n        return INITIALIZABLE_STORAGE;\n    }\n\n    /**\n     * @dev Returns a pointer to the storage namespace.\n     */\n    // solhint-disable-next-line var-name-mixedcase\n    function _getInitializableStorage() private pure returns (InitializableStorage storage $) {\n        bytes32 slot = _initializableStorageSlot();\n        assembly {\n            $.slot := slot\n        }\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (utils/Pausable.sol)\n\npragma solidity ^0.8.20;\n\nimport {ContextUpgradeable} from \"../utils/ContextUpgradeable.sol\";\nimport {Initializable} from \"../proxy/utils/Initializable.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableUpgradeable is Initializable, ContextUpgradeable {\n    /// @custom:storage-location erc7201:openzeppelin.storage.Pausable\n    struct PausableStorage {\n        bool _paused;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.Pausable\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant PausableStorageLocation = 0xcd5ed15c6e187e77e9aee88184c21f4f2182ab5827cb3b7e07fbedcd63f03300;\n\n    function _getPausableStorage() private pure returns (PausableStorage storage $) {\n        assembly {\n            $.slot := PausableStorageLocation\n        }\n    }\n\n    /**\n     * @dev Emitted when the pause is triggered by `account`.\n     */\n    event Paused(address account);\n\n    /**\n     * @dev Emitted when the pause is lifted by `account`.\n     */\n    event Unpaused(address account);\n\n    /**\n     * @dev The operation failed because the contract is paused.\n     */\n    error EnforcedPause();\n\n    /**\n     * @dev The operation failed because the contract is not paused.\n     */\n    error ExpectedPause();\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is not paused.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    modifier whenNotPaused() {\n        _requireNotPaused();\n        _;\n    }\n\n    /**\n     * @dev Modifier to make a function callable only when the contract is paused.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    modifier whenPaused() {\n        _requirePaused();\n        _;\n    }\n\n    function __Pausable_init() internal onlyInitializing {\n    }\n\n    function __Pausable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Returns true if the contract is paused, and false otherwise.\n     */\n    function paused() public view virtual returns (bool) {\n        PausableStorage storage $ = _getPausableStorage();\n        return $._paused;\n    }\n\n    /**\n     * @dev Throws if the contract is paused.\n     */\n    function _requireNotPaused() internal view virtual {\n        if (paused()) {\n            revert EnforcedPause();\n        }\n    }\n\n    /**\n     * @dev Throws if the contract is not paused.\n     */\n    function _requirePaused() internal view virtual {\n        if (!paused()) {\n            revert ExpectedPause();\n        }\n    }\n\n    /**\n     * @dev Triggers stopped state.\n     *\n     * Requirements:\n     *\n     * - The contract must not be paused.\n     */\n    function _pause() internal virtual whenNotPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = true;\n        emit Paused(_msgSender());\n    }\n\n    /**\n     * @dev Returns to normal state.\n     *\n     * Requirements:\n     *\n     * - The contract must be paused.\n     */\n    function _unpause() internal virtual whenPaused {\n        PausableStorage storage $ = _getPausableStorage();\n        $._paused = false;\n        emit Unpaused(_msgSender());\n    }\n}\n"},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (token/ERC20/extensions/IERC20Metadata.sol)\n\npragma solidity >=0.6.2;\n\nimport {IERC20} from \"../IERC20.sol\";\n\n/**\n * @dev Interface for the optional metadata functions from the ERC-20 standard.\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"},"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.3.0) (proxy/utils/UUPSUpgradeable.sol)\n\npragma solidity ^0.8.22;\n\nimport {IERC1822Proxiable} from \"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\";\nimport {ERC1967Utils} from \"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol\";\nimport {Initializable} from \"./Initializable.sol\";\n\n/**\n * @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an\n * {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.\n *\n * A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is\n * reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing\n * `UUPSUpgradeable` with a custom implementation of upgrades.\n *\n * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.\n */\nabstract contract UUPSUpgradeable is Initializable, IERC1822Proxiable {\n    /// @custom:oz-upgrades-unsafe-allow state-variable-immutable\n    address private immutable __self = address(this);\n\n    /**\n     * @dev The version of the upgrade interface of the contract. If this getter is missing, both `upgradeTo(address)`\n     * and `upgradeToAndCall(address,bytes)` are present, and `upgradeTo` must be used if no function should be called,\n     * while `upgradeToAndCall` will invoke the `receive` function if the second argument is the empty byte string.\n     * If the getter returns `\"5.0.0\"`, only `upgradeToAndCall(address,bytes)` is present, and the second argument must\n     * be the empty byte string if no function should be called, making it impossible to invoke the `receive` function\n     * during an upgrade.\n     */\n    string public constant UPGRADE_INTERFACE_VERSION = \"5.0.0\";\n\n    /**\n     * @dev The call is from an unauthorized context.\n     */\n    error UUPSUnauthorizedCallContext();\n\n    /**\n     * @dev The storage `slot` is unsupported as a UUID.\n     */\n    error UUPSUnsupportedProxiableUUID(bytes32 slot);\n\n    /**\n     * @dev Check that the execution is being performed through a delegatecall call and that the execution context is\n     * a proxy contract with an implementation (as defined in ERC-1967) pointing to self. This should only be the case\n     * for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a\n     * function through ERC-1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to\n     * fail.\n     */\n    modifier onlyProxy() {\n        _checkProxy();\n        _;\n    }\n\n    /**\n     * @dev Check that the execution is not being performed through a delegate call. This allows a function to be\n     * callable on the implementing contract but not through proxies.\n     */\n    modifier notDelegated() {\n        _checkNotDelegated();\n        _;\n    }\n\n    function __UUPSUpgradeable_init() internal onlyInitializing {\n    }\n\n    function __UUPSUpgradeable_init_unchained() internal onlyInitializing {\n    }\n    /**\n     * @dev Implementation of the ERC-1822 {proxiableUUID} function. This returns the storage slot used by the\n     * implementation. It is used to validate the implementation's compatibility when performing an upgrade.\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. This is guaranteed by the `notDelegated` modifier.\n     */\n    function proxiableUUID() external view virtual notDelegated returns (bytes32) {\n        return ERC1967Utils.IMPLEMENTATION_SLOT;\n    }\n\n    /**\n     * @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call\n     * encoded in `data`.\n     *\n     * Calls {_authorizeUpgrade}.\n     *\n     * Emits an {Upgraded} event.\n     *\n     * @custom:oz-upgrades-unsafe-allow-reachable delegatecall\n     */\n    function upgradeToAndCall(address newImplementation, bytes memory data) public payable virtual onlyProxy {\n        _authorizeUpgrade(newImplementation);\n        _upgradeToAndCallUUPS(newImplementation, data);\n    }\n\n    /**\n     * @dev Reverts if the execution is not performed via delegatecall or the execution\n     * context is not of a proxy with an ERC-1967 compliant implementation pointing to self.\n     */\n    function _checkProxy() internal view virtual {\n        if (\n            address(this) == __self || // Must be called through delegatecall\n            ERC1967Utils.getImplementation() != __self // Must be called through an active proxy\n        ) {\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Reverts if the execution is performed via delegatecall.\n     * See {notDelegated}.\n     */\n    function _checkNotDelegated() internal view virtual {\n        if (address(this) != __self) {\n            // Must not be called through delegatecall\n            revert UUPSUnauthorizedCallContext();\n        }\n    }\n\n    /**\n     * @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by\n     * {upgradeToAndCall}.\n     *\n     * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.\n     *\n     * ```solidity\n     * function _authorizeUpgrade(address) internal onlyOwner {}\n     * ```\n     */\n    function _authorizeUpgrade(address newImplementation) internal virtual;\n\n    /**\n     * @dev Performs an implementation upgrade with a security check for UUPS proxies, and additional setup call.\n     *\n     * As a security check, {proxiableUUID} is invoked in the new implementation, and the return value\n     * is expected to be the implementation slot in ERC-1967.\n     *\n     * Emits an {IERC1967-Upgraded} event.\n     */\n    function _upgradeToAndCallUUPS(address newImplementation, bytes memory data) private {\n        try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n            if (slot != ERC1967Utils.IMPLEMENTATION_SLOT) {\n                revert UUPSUnsupportedProxiableUUID(slot);\n            }\n            ERC1967Utils.upgradeToAndCall(newImplementation, data);\n        } catch {\n            // The implementation is not UUPS\n            revert ERC1967Utils.ERC1967InvalidImplementation(newImplementation);\n        }\n    }\n}\n"},"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol":{"content":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.4.0) (utils/cryptography/EIP712.sol)\n\npragma solidity ^0.8.20;\n\nimport {MessageHashUtils} from \"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol\";\nimport {IERC5267} from \"@openzeppelin/contracts/interfaces/IERC5267.sol\";\nimport {Initializable} from \"../../proxy/utils/Initializable.sol\";\n\n/**\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP-712] is a standard for hashing and signing of typed structured data.\n *\n * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose\n * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract\n * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to\n * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.\n *\n * This contract implements the EIP-712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\n * ({_hashTypedDataV4}).\n *\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\n * the chain id to protect against replay attacks on an eventual fork of the chain.\n *\n * NOTE: This contract implements the version of the encoding known as \"v4\", as implemented by the JSON RPC method\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\n *\n * NOTE: The upgradeable version of this contract does not use an immutable cache and recomputes the domain separator\n * each time {_domainSeparatorV4} is called. That is cheaper than accessing a cached version in cold storage.\n */\nabstract contract EIP712Upgradeable is Initializable, IERC5267 {\n    bytes32 private constant TYPE_HASH =\n        keccak256(\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\");\n\n    /// @custom:storage-location erc7201:openzeppelin.storage.EIP712\n    struct EIP712Storage {\n        /// @custom:oz-renamed-from _HASHED_NAME\n        bytes32 _hashedName;\n        /// @custom:oz-renamed-from _HASHED_VERSION\n        bytes32 _hashedVersion;\n\n        string _name;\n        string _version;\n    }\n\n    // keccak256(abi.encode(uint256(keccak256(\"openzeppelin.storage.EIP712\")) - 1)) & ~bytes32(uint256(0xff))\n    bytes32 private constant EIP712StorageLocation = 0xa16a46d94261c7517cc8ff89f61c0ce93598e3c849801011dee649a6a557d100;\n\n    function _getEIP712Storage() private pure returns (EIP712Storage storage $) {\n        assembly {\n            $.slot := EIP712StorageLocation\n        }\n    }\n\n    /**\n     * @dev Initializes the domain separator and parameter caches.\n     *\n     * The meaning of `name` and `version` is specified in\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP-712]:\n     *\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\n     * - `version`: the current major version of the signing domain.\n     *\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\n     * contract upgrade].\n     */\n    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\n        __EIP712_init_unchained(name, version);\n    }\n\n    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\n        EIP712Storage storage $ = _getEIP712Storage();\n        $._name = name;\n        $._version = version;\n\n        // Reset prior values in storage if upgrading\n        $._hashedName = 0;\n        $._hashedVersion = 0;\n    }\n\n    /**\n     * @dev Returns the domain separator for the current chain.\n     */\n    function _domainSeparatorV4() internal view returns (bytes32) {\n        return _buildDomainSeparator();\n    }\n\n    function _buildDomainSeparator() private view returns (bytes32) {\n        return keccak256(abi.encode(TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash(), block.chainid, address(this)));\n    }\n\n    /**\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\n     * function returns the hash of the fully encoded EIP712 message for this domain.\n     *\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\n     *\n     * ```solidity\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\n     *     keccak256(\"Mail(address to,string contents)\"),\n     *     mailTo,\n     *     keccak256(bytes(mailContents))\n     * )));\n     * address signer = ECDSA.recover(digest, signature);\n     * ```\n     */\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\n        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);\n    }\n\n    /// @inheritdoc IERC5267\n    function eip712Domain()\n        public\n        view\n        virtual\n        returns (\n            bytes1 fields,\n            string memory name,\n            string memory version,\n            uint256 chainId,\n            address verifyingContract,\n            bytes32 salt,\n            uint256[] memory extensions\n        )\n    {\n        EIP712Storage storage $ = _getEIP712Storage();\n        // If the hashed name and version in storage are non-zero, the contract hasn't been properly initialized\n        // and the EIP712 domain is not reliable, as it will be missing name and version.\n        require($._hashedName == 0 && $._hashedVersion == 0, \"EIP712: Uninitialized\");\n\n        return (\n            hex\"0f\", // 01111\n            _EIP712Name(),\n            _EIP712Version(),\n            block.chainid,\n            address(this),\n            bytes32(0),\n            new uint256[](0)\n        );\n    }\n\n    /**\n     * @dev The name parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Name() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._name;\n    }\n\n    /**\n     * @dev The version parameter for the EIP712 domain.\n     *\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\n     * are a concern.\n     */\n    function _EIP712Version() internal view virtual returns (string memory) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        return $._version;\n    }\n\n    /**\n     * @dev The hash of the name parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Name` instead.\n     */\n    function _EIP712NameHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory name = _EIP712Name();\n        if (bytes(name).length > 0) {\n            return keccak256(bytes(name));\n        } else {\n            // If the name is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the name hash in storage if non-zero, otherwise we assume the name is empty by design.\n            bytes32 hashedName = $._hashedName;\n            if (hashedName != 0) {\n                return hashedName;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n\n    /**\n     * @dev The hash of the version parameter for the EIP712 domain.\n     *\n     * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead.\n     */\n    function _EIP712VersionHash() internal view returns (bytes32) {\n        EIP712Storage storage $ = _getEIP712Storage();\n        string memory version = _EIP712Version();\n        if (bytes(version).length > 0) {\n            return keccak256(bytes(version));\n        } else {\n            // If the version is empty, the contract may have been upgraded without initializing the new storage.\n            // We return the version hash in storage if non-zero, otherwise we assume the version is empty by design.\n            bytes32 hashedVersion = $._hashedVersion;\n            if (hashedVersion != 0) {\n                return hashedVersion;\n            } else {\n                return keccak256(\"\");\n            }\n        }\n    }\n}\n"}},"language":"Solidity","settings":{"optimizer":{"runs":200,"enabled":true},"evmVersion":"paris"}},"stdJsonOutput":{"sources":{"contracts/token/DSToken.sol":{"id":69},"contracts/token/IDSToken.sol":{"id":70},"contracts/mocks/TestCalls.sol":{"id":56},"contracts/mocks/TestToken.sol":{"id":57},"contracts/mocks/TokenERC20.sol":{"id":58},"contracts/bulk/BulkOperator.sol":{"id":27},"contracts/utils/CommonUtils.sol":{"id":77},"contracts/bulk/IBulkOperator.sol":{"id":28},"contracts/token/TokenLibrary.sol":{"id":72},"contracts/trust/TrustService.sol":{"id":74},"contracts/token/StandardToken.sol":{"id":71},"contracts/issuance/TokenIssuer.sol":{"id":51},"contracts/utils/BaseDSContract.sol":{"id":75},"contracts/trust/IDSTrustService.sol":{"id":73},"contracts/issuance/IDSTokenIssuer.sol":{"id":50},"contracts/mocks/StandardTokenMock.sol":{"id":55},"contracts/service/ServiceConsumer.sol":{"id":68},"contracts/compliance/WalletManager.sol":{"id":39},"contracts/rebasing/RebasingLibrary.sol":{"id":61},"contracts/registry/RegistryService.sol":{"id":65},"contracts/registry/WalletRegistrar.sol":{"id":66},"contracts/utils/BulkBalanceChecker.sol":{"id":76},"contracts/utils/TransactionRelayer.sol":{"id":78},"@openzeppelin/contracts/utils/Panic.sol":{"id":19},"contracts/compliance/IDSLockManager.sol":{"id":35},"contracts/mocks/RebasingLibraryMock.sol":{"id":53},"@openzeppelin/contracts/utils/Errors.sol":{"id":18},"contracts/data-stores/TokenDataStore.sol":{"id":47},"contracts/nav/ISecuritizeNavProvider.sol":{"id":59},"contracts/service/IDSServiceConsumer.sol":{"id":67},"@openzeppelin/contracts/utils/Address.sol":{"id":16},"@openzeppelin/contracts/utils/Context.sol":{"id":17},"@openzeppelin/contracts/utils/Strings.sol":{"id":21},"contracts/compliance/IDSWalletManager.sol":{"id":36},"contracts/registry/IDSRegistryService.sol":{"id":63},"contracts/registry/IDSWalletRegistrar.sol":{"id":64},"contracts/compliance/ComplianceService.sol":{"id":30},"@openzeppelin/contracts/utils/math/Math.sol":{"id":24},"contracts/compliance/InvestorLockManager.sol":{"id":37},"@openzeppelin/contracts/interfaces/IERC20.sol":{"id":7},"@openzeppelin/contracts/token/ERC20/ERC20.sol":{"id":13},"@openzeppelin/contracts/utils/StorageSlot.sol":{"id":20},"contracts/compliance/IDSComplianceService.sol":{"id":34},"@openzeppelin/contracts/token/ERC20/IERC20.sol":{"id":14},"contracts/data-stores/LockManagerDataStore.sol":{"id":44},"@openzeppelin/contracts/interfaces/IERC1967.sol":{"id":6},"@openzeppelin/contracts/interfaces/IERC5267.sol":{"id":8},"@openzeppelin/contracts/utils/math/SafeCast.sol":{"id":25},"contracts/data-stores/TrustServiceDataStore.sol":{"id":48},"@openzeppelin/contracts/proxy/beacon/IBeacon.sol":{"id":12},"contracts/compliance/InvestorLockManagerBase.sol":{"id":38},"contracts/data-stores/WalletManagerDataStore.sol":{"id":49},"@openzeppelin/contracts/utils/math/SignedMath.sol":{"id":26},"contracts/rebasing/SecuritizeRebasingProvider.sol":{"id":62},"contracts/data-stores/BaseLockManagerDataStore.sol":{"id":40},"contracts/data-stores/RegistryServiceDataStore.sol":{"id":45},"contracts/data-stores/ServiceConsumerDataStore.sol":{"id":46},"contracts/mocks/ComplianceServiceRegulatedMock.sol":{"id":52},"contracts/rebasing/ISecuritizeRebasingProvider.sol":{"id":60},"contracts/compliance/ComplianceServiceRegulated.sol":{"id":31},"@openzeppelin/contracts/utils/cryptography/ECDSA.sol":{"id":22},"contracts/data-stores/ComplianceServiceDataStore.sol":{"id":42},"@openzeppelin/contracts/interfaces/draft-IERC1822.sol":{"id":9},"@openzeppelin/contracts/interfaces/draft-IERC6093.sol":{"id":10},"contracts/compliance/ComplianceServiceWhitelisted.sol":{"id":32},"contracts/mocks/SecuritizeInternalNavProviderMock.sol":{"id":54},"@openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol":{"id":11},"contracts/data-stores/InvestorLockManagerDataStore.sol":{"id":43},"contracts/compliance/ComplianceConfigurationService.sol":{"id":29},"contracts/compliance/IDSComplianceConfigurationService.sol":{"id":33},"contracts/data-stores/ComplianceConfigurationDataStore.sol":{"id":41},"@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol":{"id":23},"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol":{"id":3},"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol":{"id":0},"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol":{"id":1},"@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol":{"id":4},"@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol":{"id":15},"@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol":{"id":2},"@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol":{"id":5}},"contracts":{"contracts/token/TokenLibrary.sol":{"TokenLibrary":{"abi":[{"name":"Issue","type":"event","inputs":[{"name":"to","type":"address","indexed":true,"internalType":"address"},{"name":"value","type":"uint256","indexed":false,"internalType":"uint256"},{"name":"valueLocked","type":"uint256","indexed":false,"internalType":"uint256"}],"anonymous":false}],"metadata":"{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"valueLocked\",\"type\":\"uint256\"}],\"name\":\"Issue\",\"type\":\"event\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/token/TokenLibrary.sol\":\"TokenLibrary\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/compliance/IDSComplianceService.sol\":{\"keccak256\":\"0x7ec87e6c3d9dbd0543c9a4ed311fc7f28d0f255085f354e2e66e0f59a925933d\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://eff19340b27ec907ca36db46c3b87188d8262319b9fcaa6a13c5aeb4cb7a9ac9\",\"dweb:/ipfs/QmYn4D2sNMwUh1L2qptXvpYVpwJoZbjfwnSVWAHEAhpU8a\"]},\"contracts/compliance/IDSLockManager.sol\":{\"keccak256\":\"0xb64ef40c572a0336f239b37dfc37a0c000aa5a95ed13e59e4ad93a98906b5ad5\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://a116afade793478786678d28a69102801e3b24cde5f4907bbd88d6f525471d38\",\"dweb:/ipfs/QmXmmMayfswQBQ81yZFjVzZvbmf88sK5i9L3PoEXWYMeaF\"]},\"contracts/rebasing/ISecuritizeRebasingProvider.sol\":{\"keccak256\":\"0x01beb0ca06b9c6d9509da8ff68ccaa6cdfe105110cec23f36ad5791241170d15\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://25405ad76355dbe489d1c6ec903ccc955f061fb07ac4e12ab61332ec3c1c121c\",\"dweb:/ipfs/QmPQq8D6VQXhxqA2zgcHbK9hABZL1c13wdid4yffBotZ88\"]},\"contracts/registry/IDSRegistryService.sol\":{\"keccak256\":\"0x31818dbfd6d1a10a5be4ef4add1228a71a9a3529f313e431259ce143be51ebcb\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://573381bf8fb270e236c717a061a02873035cc29d9eb7437e476d792c5586a2d0\",\"dweb:/ipfs/QmcB8RSwBZAEryTGMw4RtBgsuCi9V63tDZTXjXEuiVKBQ3\"]},\"contracts/token/TokenLibrary.sol\":{\"keccak256\":\"0x7d015fc4babdb22d776c94818df542294db14b69a75f8298a3b3cec123935c80\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://f39ee595db95e4ad92c426e70cdc8c2ead302a2e5bcc0697fb1473277f6b586f\",\"dweb:/ipfs/QmbELcaRsaum6ZfyRRoFifzjfUm3GrFjqLiaMHXSSgNDUu\"]},\"contracts/utils/CommonUtils.sol\":{\"keccak256\":\"0xb4e8316d25f76902ccd344f8336e22a15da939547b681a1193d6072a58ce9308\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://7aacf875230d1333848d63f73ddecf4d3fc8cc854f57ff842c836daf992e77bc\",\"dweb:/ipfs/QmXPhogwSYwELQ7DowjTJjpXX4AqGiLUX8REtQ4F7av7YY\"]}},\"version\":1}","userdoc":{"kind":"user","methods":{},"version":1},"devdoc":{"kind":"dev","methods":{},"version":1},"storageLayout":{"types":null,"storage":[]},"transientStorageLayout":null,"evm":{"bytecode":{"object":"61124c61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063037ac75b1461005b578063285674c11461007d57806376d8c33f146100af578063bd5f8572146100cf575b600080fd5b81801561006757600080fd5b5061007b610076366004610b75565b6100ef565b005b81801561008957600080fd5b5061009d610098366004610d41565b6102e3565b60405190815260200160405180910390f35b8180156100bb57600080fd5b5061009d6100ca366004610e6f565b610706565b8180156100db57600080fd5b5061007b6100ea366004610ef5565b6108e2565b858484836001600160a01b0383166101225760405162461bcd60e51b815260040161011990610f3d565b60405180910390fd5b6001600160a01b0382166101485760405162461bcd60e51b815260040161011990610f3d565b6001600160a01b0383166000908152602085905260409020548111156101a55760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b6000896001815181106101ba576101ba610f66565b60200260200101519050896000815181106101d7576101d7610f66565b6020908102919091010151604051632043f77360e01b81526001600160a01b038b811660048301528a81166024830152604482018a905290911690632043f773906064016020604051808303816000875af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610f7c565b506001600160a01b038916600090815260208c9052604081208054889290610287908490610fb6565b90915550506001600160a01b038816600090815260208c90526040812080548892906102b4908490610fcf565b909155506102c890508b828b896001610936565b6102d68b828a896000610936565b5050505050505050505050565b80516000906001600160a01b031661030d5760405162461bcd60e51b815260040161011990610f3d565b60008260200151116103515760405162461bcd60e51b815260206004820152600d60248201526c56616c7565206973207a65726f60981b6044820152606401610119565b816080015151826060015151146103aa5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206c656e677468206f6620706172616d65746572730000000000006044820152606401610119565b836000815181106103bd576103bd610f66565b6020908102919091018101518351918401516040808601519051632786ff6960e01b81526001600160a01b03948516600482015260248101929092526044820152911690632786ff69906064016020604051808303816000875af1158015610429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190610f7c565b5060c08201516020830151604051632a21b82b60e11b815260048101919091526000916001600160a01b031690635443705690602401602060405180830381865afa1580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610fe2565b9050808660020160008282546104da9190610fcf565b92505081905550808660030160008282546104f59190610fcf565b909155505082516001600160a01b031660009081526020879052604081208054839290610523908490610fcf565b92505081905550610556868660018151811061054157610541610f66565b60200260200101518560000151846000610936565b6000805b846060015151811015610644578460600151818151811061057d5761057d610f66565b6020026020010151826105909190610fcf565b9150856001600160a01b031663c0a0bde88660000151876060015184815181106105bc576105bc610f66565b60200260200101518860a00151896080015186815181106105df576105df610f66565b60200260200101516040518563ffffffff1660e01b8152600401610606949392919061101f565b600060405180830381600087803b15801561062057600080fd5b505af1158015610634573d6000803e3d6000fd5b50506001909201915061055a9050565b5083602001518111156106a85760405162461bcd60e51b815260206004820152602660248201527f76616c75654c6f636b6564206d75737420626520736d616c6c6572207468616e6044820152652076616c756560d01b6064820152608401610119565b83600001516001600160a01b03167f7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a8560200151836040516106f4929190918252602082015260400190565b60405180910390a25095945050505050565b604051632a21b82b60e11b81526004810183905260009081906001600160a01b03841690635443705690602401602060405180830381865afa158015610750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107749190610fe2565b6001600160a01b0386166000908152602089905260409020549091508111156107d45760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b856000815181106107e7576107e7610f66565b60209081029190910101516040516332ef868b60e11b81526001600160a01b03878116600483015260248201879052909116906365df0d16906044016020604051808303816000875af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190610f7c565b506001600160a01b0385166000908152602088905260408120805483929061088f908490610fb6565b925050819055506108be87876001815181106108ad576108ad610f66565b602002602001015187846001610936565b808760020160008282546108d29190610fb6565b9091555090979650505050505050565b600260006108f0848361115e565b9050828015610900575084548116155b156109105784548118855561092f565b8215801561092357508454600190821610155b1561092f578454811885555b5050505050565b60405163479ad3af60e11b81526001600160a01b03848116600483015260009190861690638f35a75e90602401600060405180830381865afa158015610980573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109a8919081019061116d565b90506109b381511590565b610a3957600086600101826040516109cb91906111e4565b90815260405190819003602001902054905060008360018111156109f1576109f1611200565b03610a0757610a008482610fcf565b9050610a14565b610a118482610fb6565b90505b808760010183604051610a2791906111e4565b90815260405190819003602001902055505b505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715610a7a57610a7a610a41565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a41565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a41565b5060051b60200190565b6001600160a01b0381168114610aea57600080fd5b50565b8035610af881610ad5565b919050565b600082601f830112610b0e57600080fd5b81356020610b23610b1e83610ab1565b610a80565b8083825260208201915060208460051b870101935086841115610b4557600080fd5b602086015b84811015610b6a578035610b5d81610ad5565b8352918301918301610b4a565b509695505050505050565b60008060008060008060c08789031215610b8e57600080fd5b86359550602087013567ffffffffffffffff811115610bac57600080fd5b610bb889828a01610afd565b9550506040870135610bc981610ad5565b93506060870135610bd981610ad5565b9598949750929560808101359460a0909101359350915050565b600082601f830112610c0457600080fd5b81356020610c14610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c3657600080fd5b602086015b84811015610b6a5780358352918301918301610c3b565b600082601f830112610c6357600080fd5b81356020610c73610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c9557600080fd5b602086015b84811015610b6a57803567ffffffffffffffff81168114610cbb5760008081fd5b8352918301918301610c9a565b600067ffffffffffffffff821115610ce257610ce2610a41565b50601f01601f191660200190565b600082601f830112610d0157600080fd5b8135610d0f610b1e82610cc8565b818152846020838601011115610d2457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610d5757600080fd5b84359350602085013567ffffffffffffffff80821115610d7657600080fd5b610d8288838901610afd565b945060408701359150610d9482610ad5565b90925060608601359080821115610daa57600080fd5b9086019060e08289031215610dbe57600080fd5b610dc6610a57565b610dcf83610aed565b81526020830135602082015260408301356040820152606083013582811115610df757600080fd5b610e038a828601610bf3565b606083015250608083013582811115610e1b57600080fd5b610e278a828601610c52565b60808301525060a083013582811115610e3f57600080fd5b610e4b8a828601610cf0565b60a083015250610e5d60c08401610aed565b60c08201529598949750929550505050565b600080600080600060a08688031215610e8757600080fd5b85359450602086013567ffffffffffffffff811115610ea557600080fd5b610eb188828901610afd565b9450506040860135610ec281610ad5565b9250606086013591506080860135610ed981610ad5565b809150509295509295909350565b8015158114610aea57600080fd5b600080600060608486031215610f0a57600080fd5b83359250602084013560ff81168114610f2257600080fd5b91506040840135610f3281610ee7565b809150509250925092565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8e57600080fd5b8151610f9981610ee7565b9392505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610fc957610fc9610fa0565b92915050565b80820180821115610fc957610fc9610fa0565b600060208284031215610ff457600080fd5b5051919050565b60005b83811015611016578181015183820152602001610ffe565b50506000910152565b60018060a01b038516815283602082015260806040820152600083518060808401526110528160a0850160208801610ffb565b67ffffffffffffffff93909316606083015250601f91909101601f19160160a0019392505050565b600181815b808511156110b557816000190482111561109b5761109b610fa0565b808516156110a857918102915b93841c939080029061107f565b509250929050565b6000826110cc57506001610fc9565b816110d957506000610fc9565b81600181146110ef57600281146110f957611115565b6001915050610fc9565b60ff84111561110a5761110a610fa0565b50506001821b610fc9565b5060208310610133831016604e8410600b8410161715611138575081810a610fc9565b611142838361107a565b806000190482111561115657611156610fa0565b029392505050565b6000610f9960ff8416836110bd565b60006020828403121561117f57600080fd5b815167ffffffffffffffff81111561119657600080fd5b8201601f810184136111a757600080fd5b80516111b5610b1e82610cc8565b8181528560208385010111156111ca57600080fd5b6111db826020830160208601610ffb565b95945050505050565b600082516111f6818460208701610ffb565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","sourceMap":"1047:5930:72:-:0;;;;;;;;;;;;;;;-1:-1:-1;;;1047:5930:72;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"73000000000000000000000000000000000000000030146080604052600436106100565760003560e01c8063037ac75b1461005b578063285674c11461007d57806376d8c33f146100af578063bd5f8572146100cf575b600080fd5b81801561006757600080fd5b5061007b610076366004610b75565b6100ef565b005b81801561008957600080fd5b5061009d610098366004610d41565b6102e3565b60405190815260200160405180910390f35b8180156100bb57600080fd5b5061009d6100ca366004610e6f565b610706565b8180156100db57600080fd5b5061007b6100ea366004610ef5565b6108e2565b858484836001600160a01b0383166101225760405162461bcd60e51b815260040161011990610f3d565b60405180910390fd5b6001600160a01b0382166101485760405162461bcd60e51b815260040161011990610f3d565b6001600160a01b0383166000908152602085905260409020548111156101a55760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b6000896001815181106101ba576101ba610f66565b60200260200101519050896000815181106101d7576101d7610f66565b6020908102919091010151604051632043f77360e01b81526001600160a01b038b811660048301528a81166024830152604482018a905290911690632043f773906064016020604051808303816000875af115801561023a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025e9190610f7c565b506001600160a01b038916600090815260208c9052604081208054889290610287908490610fb6565b90915550506001600160a01b038816600090815260208c90526040812080548892906102b4908490610fcf565b909155506102c890508b828b896001610936565b6102d68b828a896000610936565b5050505050505050505050565b80516000906001600160a01b031661030d5760405162461bcd60e51b815260040161011990610f3d565b60008260200151116103515760405162461bcd60e51b815260206004820152600d60248201526c56616c7565206973207a65726f60981b6044820152606401610119565b816080015151826060015151146103aa5760405162461bcd60e51b815260206004820152601a60248201527f57726f6e67206c656e677468206f6620706172616d65746572730000000000006044820152606401610119565b836000815181106103bd576103bd610f66565b6020908102919091018101518351918401516040808601519051632786ff6960e01b81526001600160a01b03948516600482015260248101929092526044820152911690632786ff69906064016020604051808303816000875af1158015610429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044d9190610f7c565b5060c08201516020830151604051632a21b82b60e11b815260048101919091526000916001600160a01b031690635443705690602401602060405180830381865afa1580156104a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c49190610fe2565b9050808660020160008282546104da9190610fcf565b92505081905550808660030160008282546104f59190610fcf565b909155505082516001600160a01b031660009081526020879052604081208054839290610523908490610fcf565b92505081905550610556868660018151811061054157610541610f66565b60200260200101518560000151846000610936565b6000805b846060015151811015610644578460600151818151811061057d5761057d610f66565b6020026020010151826105909190610fcf565b9150856001600160a01b031663c0a0bde88660000151876060015184815181106105bc576105bc610f66565b60200260200101518860a00151896080015186815181106105df576105df610f66565b60200260200101516040518563ffffffff1660e01b8152600401610606949392919061101f565b600060405180830381600087803b15801561062057600080fd5b505af1158015610634573d6000803e3d6000fd5b50506001909201915061055a9050565b5083602001518111156106a85760405162461bcd60e51b815260206004820152602660248201527f76616c75654c6f636b6564206d75737420626520736d616c6c6572207468616e6044820152652076616c756560d01b6064820152608401610119565b83600001516001600160a01b03167f7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a8560200151836040516106f4929190918252602082015260400190565b60405180910390a25095945050505050565b604051632a21b82b60e11b81526004810183905260009081906001600160a01b03841690635443705690602401602060405180830381865afa158015610750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107749190610fe2565b6001600160a01b0386166000908152602089905260409020549091508111156107d45760405162461bcd60e51b81526020600482015260126024820152714e6f7420656e6f7567682062616c616e636560701b6044820152606401610119565b856000815181106107e7576107e7610f66565b60209081029190910101516040516332ef868b60e11b81526001600160a01b03878116600483015260248201879052909116906365df0d16906044016020604051808303816000875af1158015610842573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108669190610f7c565b506001600160a01b0385166000908152602088905260408120805483929061088f908490610fb6565b925050819055506108be87876001815181106108ad576108ad610f66565b602002602001015187846001610936565b808760020160008282546108d29190610fb6565b9091555090979650505050505050565b600260006108f0848361115e565b9050828015610900575084548116155b156109105784548118855561092f565b8215801561092357508454600190821610155b1561092f578454811885555b5050505050565b60405163479ad3af60e11b81526001600160a01b03848116600483015260009190861690638f35a75e90602401600060405180830381865afa158015610980573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109a8919081019061116d565b90506109b381511590565b610a3957600086600101826040516109cb91906111e4565b90815260405190819003602001902054905060008360018111156109f1576109f1611200565b03610a0757610a008482610fcf565b9050610a14565b610a118482610fb6565b90505b808760010183604051610a2791906111e4565b90815260405190819003602001902055505b505050505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff81118282101715610a7a57610a7a610a41565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610aa957610aa9610a41565b604052919050565b600067ffffffffffffffff821115610acb57610acb610a41565b5060051b60200190565b6001600160a01b0381168114610aea57600080fd5b50565b8035610af881610ad5565b919050565b600082601f830112610b0e57600080fd5b81356020610b23610b1e83610ab1565b610a80565b8083825260208201915060208460051b870101935086841115610b4557600080fd5b602086015b84811015610b6a578035610b5d81610ad5565b8352918301918301610b4a565b509695505050505050565b60008060008060008060c08789031215610b8e57600080fd5b86359550602087013567ffffffffffffffff811115610bac57600080fd5b610bb889828a01610afd565b9550506040870135610bc981610ad5565b93506060870135610bd981610ad5565b9598949750929560808101359460a0909101359350915050565b600082601f830112610c0457600080fd5b81356020610c14610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c3657600080fd5b602086015b84811015610b6a5780358352918301918301610c3b565b600082601f830112610c6357600080fd5b81356020610c73610b1e83610ab1565b8083825260208201915060208460051b870101935086841115610c9557600080fd5b602086015b84811015610b6a57803567ffffffffffffffff81168114610cbb5760008081fd5b8352918301918301610c9a565b600067ffffffffffffffff821115610ce257610ce2610a41565b50601f01601f191660200190565b600082601f830112610d0157600080fd5b8135610d0f610b1e82610cc8565b818152846020838601011115610d2457600080fd5b816020850160208301376000918101602001919091529392505050565b60008060008060808587031215610d5757600080fd5b84359350602085013567ffffffffffffffff80821115610d7657600080fd5b610d8288838901610afd565b945060408701359150610d9482610ad5565b90925060608601359080821115610daa57600080fd5b9086019060e08289031215610dbe57600080fd5b610dc6610a57565b610dcf83610aed565b81526020830135602082015260408301356040820152606083013582811115610df757600080fd5b610e038a828601610bf3565b606083015250608083013582811115610e1b57600080fd5b610e278a828601610c52565b60808301525060a083013582811115610e3f57600080fd5b610e4b8a828601610cf0565b60a083015250610e5d60c08401610aed565b60c08201529598949750929550505050565b600080600080600060a08688031215610e8757600080fd5b85359450602086013567ffffffffffffffff811115610ea557600080fd5b610eb188828901610afd565b9450506040860135610ec281610ad5565b9250606086013591506080860135610ed981610ad5565b809150509295509295909350565b8015158114610aea57600080fd5b600080600060608486031215610f0a57600080fd5b83359250602084013560ff81168114610f2257600080fd5b91506040840135610f3281610ee7565b809150509250925092565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600060208284031215610f8e57600080fd5b8151610f9981610ee7565b9392505050565b634e487b7160e01b600052601160045260246000fd5b81810381811115610fc957610fc9610fa0565b92915050565b80820180821115610fc957610fc9610fa0565b600060208284031215610ff457600080fd5b5051919050565b60005b83811015611016578181015183820152602001610ffe565b50506000910152565b60018060a01b038516815283602082015260806040820152600083518060808401526110528160a0850160208801610ffb565b67ffffffffffffffff93909316606083015250601f91909101601f19160160a0019392505050565b600181815b808511156110b557816000190482111561109b5761109b610fa0565b808516156110a857918102915b93841c939080029061107f565b509250929050565b6000826110cc57506001610fc9565b816110d957506000610fc9565b81600181146110ef57600281146110f957611115565b6001915050610fc9565b60ff84111561110a5761110a610fa0565b50506001821b610fc9565b5060208310610133831016604e8410600b8410161715611138575081810a610fc9565b611142838361107a565b806000190482111561115657611156610fa0565b029392505050565b6000610f9960ff8416836110bd565b60006020828403121561117f57600080fd5b815167ffffffffffffffff81111561119657600080fd5b8201601f810184136111a757600080fd5b80516111b5610b1e82610cc8565b8181528560208385010111156111ca57600080fd5b6111db826020830160208601610ffb565b95945050505050565b600082516111f6818460208701610ffb565b9190910192915050565b634e487b7160e01b600052602160045260246000fdfea264697066735822122055868ded6bf87fa50111a228e922998dd6d5a87651e3643a940ba5735822efa364736f6c63430008160033","sourceMap":"1047:5930:72:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5590:768;;;;;;;;;;-1:-1:-1;5590:768:72;;;;;:::i;:::-;;:::i;:::-;;2697:1541;;;;;;;;;;-1:-1:-1;2697:1541:72;;;;;:::i;:::-;;:::i;:::-;;;6840:25:79;;;6828:2;6813:18;2697:1541:72;;;;;;;4571:1013;;;;;;;;;;-1:-1:-1;4571:1013:72;;;;;:::i;:::-;;:::i;2128:563::-;;;;;;;;;;-1:-1:-1;2128:563:72;;;;;:::i;:::-;;:::i;5590:768::-;5810:10;5822:5;5829:3;5834:7;-1:-1:-1;;;;;4367:19:72;;4359:47;;;;-1:-1:-1;;;4359:47:72;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;4424:17:72;;4416:45;;;;-1:-1:-1;;;4416:45:72;;;;;;;:::i;:::-;-1:-1:-1;;;;;4490:33:72;;:26;:33;;;;;;;;;;;4479:44;;;4471:75;;;;-1:-1:-1;;;4471:75:72;;8892:2:79;4471:75:72;;;8874:21:79;8931:2;8911:18;;;8904:30;-1:-1:-1;;;8950:18:79;;;8943:48;9008:18;;4471:75:72;8690:342:79;4471:75:72;5857:34:::1;5913:9;1247:1;5913:27;;;;;;;;:::i;:::-;;;;;;;5857:84;;5972:9;1195:1;5972:29;;;;;;;;:::i;:::-;;::::0;;::::1;::::0;;;;;;5951:85:::1;::::0;-1:-1:-1;;;5951:85:72;;-1:-1:-1;;;;;9427:15:79;;;5951:85:72::1;::::0;::::1;9409:34:79::0;9479:15;;;9459:18;;;9452:43;9511:18;;;9504:34;;;5951:65:72;;::::1;::::0;::::1;::::0;9344:18:79;;5951:85:72::1;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1::0;;;;;;6047:33:72;::::1;:26;:33:::0;;;::::1;::::0;;;;;;:44;;6084:7;;6047:26;:44:::1;::::0;6084:7;;6047:44:::1;:::i;:::-;::::0;;;-1:-1:-1;;;;;;;6101:31:72;::::1;:26;:31:::0;;;::::1;::::0;;;;;;:42;;6136:7;;6101:26;:42:::1;::::0;6136:7;;6101:42:::1;:::i;:::-;::::0;;;-1:-1:-1;6153:95:72::1;::::0;-1:-1:-1;6175:10:72;6187:15;6204:5;6211:7;6220:27:::1;6153:21;:95::i;:::-;6258:93;6280:10;6292:15;6309:3;6314:7;6323:27;6258:21;:93::i;:::-;5847:511;5590:768:::0;;;;;;;;;;:::o;2697:1541::-;2949:11;;2893:7;;-1:-1:-1;;;;;2949:25:72;2941:53;;;;-1:-1:-1;;;2941:53:72;;;;;;;:::i;:::-;3029:1;3012:7;:14;;;:18;3004:44;;;;-1:-1:-1;;;3004:44:72;;10396:2:79;3004:44:72;;;10378:21:79;10435:2;10415:18;;;10408:30;-1:-1:-1;;;10454:18:79;;;10447:43;10507:18;;3004:44:72;10194:337:79;3004:44:72;3098:7;:21;;;:28;3066:7;:21;;;:28;:60;3058:99;;;;-1:-1:-1;;;3058:99:72;;10738:2:79;3058:99:72;;;10720:21:79;10777:2;10757:18;;;10750:30;10816:28;10796:18;;;10789:56;10862:18;;3058:99:72;10536:350:79;3058:99:72;3284:9;1195:1;3284:29;;;;;;;;:::i;:::-;;;;;;;;;;;;3332:11;;3345:14;;;;3361:21;;;;;3263:120;;-1:-1:-1;;;3263:120:72;;-1:-1:-1;;;;;11111:32:79;;;3263:120:72;;;11093:51:79;11160:18;;;11153:34;;;;11203:18;;;11196:34;3263:68:72;;;;;11066:18:79;;3263:120:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;3412:25:72;;;;3460:14;;;;3412:63;;-1:-1:-1;;;3412:63:72;;;;;6840:25:79;;;;3394:14:72;;-1:-1:-1;;;;;3412:47:72;;;;6813:18:79;;3412:63:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;3394:81;;3512:6;3486:10;:22;;;:32;;;;;;;:::i;:::-;;;;;;;;3554:6;3528:10;:22;;;:32;;;;;;;:::i;:::-;;;;-1:-1:-1;;3597:11:72;;-1:-1:-1;;;;;3570:39:72;:26;:39;;;;;;;;;;:49;;3613:6;;3570:26;:49;;3613:6;;3570:49;:::i;:::-;;;;;;;;3630:132;3652:10;3683:9;1247:1;3683:27;;;;;;;;:::i;:::-;;;;;;;3713:7;:11;;;3726:6;3734:27;3630:21;:132::i;:::-;3773:19;3811:9;3806:251;3830:7;:21;;;:28;3826:1;:32;3806:251;;;3894:7;:21;;;3916:1;3894:24;;;;;;;;:::i;:::-;;;;;;;3879:39;;;;;:::i;:::-;;;3932:12;-1:-1:-1;;;;;3932:32:72;;3965:7;:11;;;3978:7;:21;;;4000:1;3978:24;;;;;;;;:::i;:::-;;;;;;;4004:7;:15;;;4021:7;:21;;;4043:1;4021:24;;;;;;;;:::i;:::-;;;;;;;3932:114;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;3860:3:72;;;;;-1:-1:-1;3806:251:72;;-1:-1:-1;3806:251:72;;;4089:7;:14;;;4074:11;:29;;4066:80;;;;-1:-1:-1;;;4066:80:72;;12737:2:79;4066:80:72;;;12719:21:79;12776:2;12756:18;;;12749:30;12815:34;12795:18;;;12788:62;-1:-1:-1;;;12866:18:79;;;12859:36;12912:19;;4066:80:72;12535:402:79;4066:80:72;4167:7;:11;;;-1:-1:-1;;;;;4161:47:72;;4180:7;:14;;;4196:11;4161:47;;;;;;13116:25:79;;;13172:2;13157:18;;13150:34;13104:2;13089:18;;12942:248;4161:47:72;;;;;;;;-1:-1:-1;4225:6:72;2697:1541;-1:-1:-1;;;;;2697:1541:72:o;4571:1013::-;4824:47;;-1:-1:-1;;;4824:47:72;;;;;6840:25:79;;;4782:7:72;;;;-1:-1:-1;;;;;4824:39:72;;;;;6813:18:79;;4824:47:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;4906:32:72;;:26;:32;;;;;;;;;;;4801:70;;-1:-1:-1;4890:48:72;;;4882:79;;;;-1:-1:-1;;;4882:79:72;;8892:2:79;4882:79:72;;;8874:21:79;8931:2;8911:18;;;8904:30;-1:-1:-1;;;8950:18:79;;;8943:48;9008:18;;4882:79:72;8690:342:79;4882:79:72;5172:9;1195:1;5172:29;;;;;;;;:::i;:::-;;;;;;;;;;;5151:78;;-1:-1:-1;;;5151:78:72;;-1:-1:-1;;;;;13387:32:79;;;5151:78:72;;;13369:51:79;13436:18;;;13429:34;;;5151:64:72;;;;;;13342:18:79;;5151:78:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;;5240:32:72;;:26;:32;;;;;;;;;;:48;;5276:12;;5240:26;:48;;5276:12;;5240:48;:::i;:::-;;;;;;;;5298:201;5333:10;5376:9;1247:1;5376:27;;;;;;;;:::i;:::-;;;;;;;5418:4;5436:12;5462:27;5298:21;:201::i;:::-;5536:12;5510:10;:22;;;:38;;;;;;;:::i;:::-;;;;-1:-1:-1;5565:12:72;;4571:1013;-1:-1:-1;;;;;;;4571:1013:72:o;2128:563::-;2258:1;2243:12;2284:18;2290:12;2258:1;2284:18;:::i;:::-;2269:33;;2414:6;:47;;;;-1:-1:-1;2425:23:72;;:30;;:35;2414:47;2410:275;;;2503:23;;:30;;2477:56;;2410:275;;;2555:6;2554:7;:48;;;;-1:-1:-1;2566:23:72;;2600:1;2566:30;;;:35;;2554:48;2550:135;;;2644:23;;:30;;2618:56;;2550:135;2233:458;;2128:563;;;:::o;6364:611::-;6570:37;;-1:-1:-1;;;6570:37:72;;-1:-1:-1;;;;;15015:32:79;;;6570:37:72;;;14997:51:79;6545:22:72;;6570:28;;;;;;14970:18:79;;6570:37:72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6570:37:72;;;;;;;;;;;;:::i;:::-;6545:62;;6622:35;6648:8;1123:18:77;:23;;1038:113;6622:35:72;6617:352;;6673:15;6691:10;:28;;6720:8;6691:38;;;;;;:::i;:::-;;;;;;;;;;;;;;;;-1:-1:-1;6760:27:72;6747:9;:40;;;;;;;;:::i;:::-;;6743:154;;6807:18;6818:7;6807:18;;:::i;:::-;;;6743:154;;;6864:18;6875:7;6864:18;;:::i;:::-;;;6743:154;6951:7;6910:10;:28;;6939:8;6910:38;;;;;;:::i;:::-;;;;;;;;;;;;;;:48;-1:-1:-1;6617:352:72;6535:440;6364:611;;;;;:::o;14:127:79:-;75:10;70:3;66:20;63:1;56:31;106:4;103:1;96:15;130:4;127:1;120:15;146:253;218:2;212:9;260:4;248:17;;295:18;280:34;;316:22;;;277:62;274:88;;;342:18;;:::i;:::-;378:2;371:22;146:253;:::o;404:275::-;475:2;469:9;540:2;521:13;;-1:-1:-1;;517:27:79;505:40;;575:18;560:34;;596:22;;;557:62;554:88;;;622:18;;:::i;:::-;658:2;651:22;404:275;;-1:-1:-1;404:275:79:o;684:183::-;744:4;777:18;769:6;766:30;763:56;;;799:18;;:::i;:::-;-1:-1:-1;844:1:79;840:14;856:4;836:25;;684:183::o;872:131::-;-1:-1:-1;;;;;947:31:79;;937:42;;927:70;;993:1;990;983:12;927:70;872:131;:::o;1008:134::-;1076:20;;1105:31;1076:20;1105:31;:::i;:::-;1008:134;;;:::o;1147:743::-;1201:5;1254:3;1247:4;1239:6;1235:17;1231:27;1221:55;;1272:1;1269;1262:12;1221:55;1308:6;1295:20;1334:4;1358:60;1374:43;1414:2;1374:43;:::i;:::-;1358:60;:::i;:::-;1440:3;1464:2;1459:3;1452:15;1492:4;1487:3;1483:14;1476:21;;1549:4;1543:2;1540:1;1536:10;1528:6;1524:23;1520:34;1506:48;;1577:3;1569:6;1566:15;1563:35;;;1594:1;1591;1584:12;1563:35;1630:4;1622:6;1618:17;1644:217;1660:6;1655:3;1652:15;1644:217;;;1740:3;1727:17;1757:31;1782:5;1757:31;:::i;:::-;1801:18;;1839:12;;;;1677;;1644:217;;;-1:-1:-1;1879:5:79;1147:743;-1:-1:-1;;;;;;1147:743:79:o;1895:860::-;2053:6;2061;2069;2077;2085;2093;2146:3;2134:9;2125:7;2121:23;2117:33;2114:53;;;2163:1;2160;2153:12;2114:53;2199:9;2186:23;2176:33;;2260:2;2249:9;2245:18;2232:32;2287:18;2279:6;2276:30;2273:50;;;2319:1;2316;2309:12;2273:50;2342:61;2395:7;2386:6;2375:9;2371:22;2342:61;:::i;:::-;2332:71;;;2453:2;2442:9;2438:18;2425:32;2466:31;2491:5;2466:31;:::i;:::-;2516:5;-1:-1:-1;2573:2:79;2558:18;;2545:32;2586:33;2545:32;2586:33;:::i;:::-;1895:860;;;;-1:-1:-1;1895:860:79;;2692:3;2677:19;;2664:33;;2744:3;2729:19;;;2716:33;;-1:-1:-1;1895:860:79;-1:-1:-1;;1895:860:79:o;2760:668::-;2814:5;2867:3;2860:4;2852:6;2848:17;2844:27;2834:55;;2885:1;2882;2875:12;2834:55;2921:6;2908:20;2947:4;2971:60;2987:43;3027:2;2987:43;:::i;2971:60::-;3053:3;3077:2;3072:3;3065:15;3105:4;3100:3;3096:14;3089:21;;3162:4;3156:2;3153:1;3149:10;3141:6;3137:23;3133:34;3119:48;;3190:3;3182:6;3179:15;3176:35;;;3207:1;3204;3197:12;3176:35;3243:4;3235:6;3231:17;3257:142;3273:6;3268:3;3265:15;3257:142;;;3339:17;;3327:30;;3377:12;;;;3290;;3257:142;;3433:850;3486:5;3539:3;3532:4;3524:6;3520:17;3516:27;3506:55;;3557:1;3554;3547:12;3506:55;3593:6;3580:20;3619:4;3643:60;3659:43;3699:2;3659:43;:::i;3643:60::-;3725:3;3749:2;3744:3;3737:15;3777:4;3772:3;3768:14;3761:21;;3834:4;3828:2;3825:1;3821:10;3813:6;3809:23;3805:34;3791:48;;3862:3;3854:6;3851:15;3848:35;;;3879:1;3876;3869:12;3848:35;3915:4;3907:6;3903:17;3929:325;3945:6;3940:3;3937:15;3929:325;;;4025:3;4012:17;4073:18;4066:5;4062:30;4055:5;4052:41;4042:139;;4135:1;4164:2;4160;4153:14;4042:139;4194:18;;4232:12;;;;3962;;3929:325;;4288:187;4337:4;4370:18;4362:6;4359:30;4356:56;;;4392:18;;:::i;:::-;-1:-1:-1;4458:2:79;4437:15;-1:-1:-1;;4433:29:79;4464:4;4429:40;;4288:187::o;4480:464::-;4523:5;4576:3;4569:4;4561:6;4557:17;4553:27;4543:55;;4594:1;4591;4584:12;4543:55;4630:6;4617:20;4661:49;4677:32;4706:2;4677:32;:::i;4661:49::-;4735:2;4726:7;4719:19;4781:3;4774:4;4769:2;4761:6;4757:15;4753:26;4750:35;4747:55;;;4798:1;4795;4788:12;4747:55;4863:2;4856:4;4848:6;4844:17;4837:4;4828:7;4824:18;4811:55;4911:1;4886:16;;;4904:4;4882:27;4875:38;;;;4890:7;4480:464;-1:-1:-1;;;4480:464:79:o;4949:1732::-;5143:6;5151;5159;5167;5220:3;5208:9;5199:7;5195:23;5191:33;5188:53;;;5237:1;5234;5227:12;5188:53;5273:9;5260:23;5250:33;;5334:2;5323:9;5319:18;5306:32;5357:18;5398:2;5390:6;5387:14;5384:34;;;5414:1;5411;5404:12;5384:34;5437:61;5490:7;5481:6;5470:9;5466:22;5437:61;:::i;:::-;5427:71;;5548:2;5537:9;5533:18;5520:32;5507:45;;5561:31;5586:5;5561:31;:::i;:::-;5611:5;;-1:-1:-1;5669:2:79;5654:18;;5641:32;;5685:16;;;5682:36;;;5714:1;5711;5704:12;5682:36;5737:24;;;;5795:4;5777:16;;;5773:27;5770:47;;;5813:1;5810;5803:12;5770:47;5841:22;;:::i;:::-;5888;5907:2;5888:22;:::i;:::-;5879:7;5872:39;5966:2;5962;5958:11;5945:25;5940:2;5931:7;5927:16;5920:51;6026:2;6022;6018:11;6005:25;6000:2;5991:7;5987:16;5980:51;6077:2;6073;6069:11;6056:25;6106:2;6096:8;6093:16;6090:36;;;6122:1;6119;6112:12;6090:36;6160:56;6208:7;6197:8;6193:2;6189:17;6160:56;:::i;:::-;6155:2;6146:7;6142:16;6135:82;;6263:3;6259:2;6255:12;6242:26;6293:2;6283:8;6280:16;6277:36;;;6309:1;6306;6299:12;6277:36;6348:55;6395:7;6384:8;6380:2;6376:17;6348:55;:::i;:::-;6342:3;6333:7;6329:17;6322:82;;6450:3;6446:2;6442:12;6429:26;6480:2;6470:8;6467:16;6464:36;;;6496:1;6493;6486:12;6464:36;6535:45;6572:7;6561:8;6557:2;6553:17;6535:45;:::i;:::-;6529:3;6520:7;6516:17;6509:72;;6616:32;6643:3;6639:2;6635:12;6616:32;:::i;:::-;6610:3;6597:17;;6590:59;4949:1732;;;;-1:-1:-1;4949:1732:79;;-1:-1:-1;;;;4949:1732:79:o;6876:828::-;7062:6;7070;7078;7086;7094;7147:3;7135:9;7126:7;7122:23;7118:33;7115:53;;;7164:1;7161;7154:12;7115:53;7200:9;7187:23;7177:33;;7261:2;7250:9;7246:18;7233:32;7288:18;7280:6;7277:30;7274:50;;;7320:1;7317;7310:12;7274:50;7343:61;7396:7;7387:6;7376:9;7372:22;7343:61;:::i;:::-;7333:71;;;7454:2;7443:9;7439:18;7426:32;7467:31;7492:5;7467:31;:::i;:::-;7517:5;-1:-1:-1;7569:2:79;7554:18;;7541:32;;-1:-1:-1;7625:3:79;7610:19;;7597:33;7639;7597;7639;:::i;:::-;7691:7;7681:17;;;6876:828;;;;;;;;:::o;7709:118::-;7795:5;7788:13;7781:21;7774:5;7771:32;7761:60;;7817:1;7814;7807:12;7832:509;7941:6;7949;7957;8010:2;7998:9;7989:7;7985:23;7981:32;7978:52;;;8026:1;8023;8016:12;7978:52;8062:9;8049:23;8039:33;;8122:2;8111:9;8107:18;8094:32;8166:4;8159:5;8155:16;8148:5;8145:27;8135:55;;8186:1;8183;8176:12;8135:55;8209:5;-1:-1:-1;8266:2:79;8251:18;;8238:32;8279:30;8238:32;8279:30;:::i;:::-;8328:7;8318:17;;;7832:509;;;;;:::o;8346:339::-;8548:2;8530:21;;;8587:2;8567:18;;;8560:30;-1:-1:-1;;;8621:2:79;8606:18;;8599:45;8676:2;8661:18;;8346:339::o;9037:127::-;9098:10;9093:3;9089:20;9086:1;9079:31;9129:4;9126:1;9119:15;9153:4;9150:1;9143:15;9549:245;9616:6;9669:2;9657:9;9648:7;9644:23;9640:32;9637:52;;;9685:1;9682;9675:12;9637:52;9717:9;9711:16;9736:28;9758:5;9736:28;:::i;:::-;9783:5;9549:245;-1:-1:-1;;;9549:245:79:o;9799:127::-;9860:10;9855:3;9851:20;9848:1;9841:31;9891:4;9888:1;9881:15;9915:4;9912:1;9905:15;9931:128;9998:9;;;10019:11;;;10016:37;;;10033:18;;:::i;:::-;9931:128;;;;:::o;10064:125::-;10129:9;;;10150:10;;;10147:36;;;10163:18;;:::i;11423:184::-;11493:6;11546:2;11534:9;11525:7;11521:23;11517:32;11514:52;;;11562:1;11559;11552:12;11514:52;-1:-1:-1;11585:16:79;;11423:184;-1:-1:-1;11423:184:79:o;11612:250::-;11697:1;11707:113;11721:6;11718:1;11715:13;11707:113;;;11797:11;;;11791:18;11778:11;;;11771:39;11743:2;11736:10;11707:113;;;-1:-1:-1;;11854:1:79;11836:16;;11829:27;11612:250::o;11867:663::-;12128:1;12124;12119:3;12115:11;12111:19;12103:6;12099:32;12088:9;12081:51;12168:6;12163:2;12152:9;12148:18;12141:34;12211:3;12206:2;12195:9;12191:18;12184:31;12062:4;12244:6;12238:13;12288:6;12282:3;12271:9;12267:19;12260:35;12304:80;12377:6;12371:3;12360:9;12356:19;12351:2;12343:6;12339:15;12304:80;:::i;:::-;12504:18;12492:31;;;;12487:2;12472:18;;12465:59;-1:-1:-1;12445:2:79;12424:15;;;;-1:-1:-1;;12420:29:79;12405:45;12452:3;12401:55;;11867:663;-1:-1:-1;;;11867:663:79:o;13474:416::-;13563:1;13600:5;13563:1;13614:270;13635:7;13625:8;13622:21;13614:270;;;13694:4;13690:1;13686:6;13682:17;13676:4;13673:27;13670:53;;;13703:18;;:::i;:::-;13753:7;13743:8;13739:22;13736:55;;;13773:16;;;;13736:55;13852:22;;;;13812:15;;;;13614:270;;;13618:3;13474:416;;;;;:::o;13895:806::-;13944:5;13974:8;13964:80;;-1:-1:-1;14015:1:79;14029:5;;13964:80;14063:4;14053:76;;-1:-1:-1;14100:1:79;14114:5;;14053:76;14145:4;14163:1;14158:59;;;;14231:1;14226:130;;;;14138:218;;14158:59;14188:1;14179:10;;14202:5;;;14226:130;14263:3;14253:8;14250:17;14247:43;;;14270:18;;:::i;:::-;-1:-1:-1;;14326:1:79;14312:16;;14341:5;;14138:218;;14440:2;14430:8;14427:16;14421:3;14415:4;14412:13;14408:36;14402:2;14392:8;14389:16;14384:2;14378:4;14375:12;14371:35;14368:77;14365:159;;;-1:-1:-1;14477:19:79;;;14509:5;;14365:159;14556:34;14581:8;14575:4;14556:34;:::i;:::-;14626:6;14622:1;14618:6;14614:19;14605:7;14602:32;14599:58;;;14637:18;;:::i;:::-;14675:20;;13895:806;-1:-1:-1;;;13895:806:79:o;14706:140::-;14764:5;14793:47;14834:4;14824:8;14820:19;14814:4;14793:47;:::i;15059:649::-;15139:6;15192:2;15180:9;15171:7;15167:23;15163:32;15160:52;;;15208:1;15205;15198:12;15160:52;15241:9;15235:16;15274:18;15266:6;15263:30;15260:50;;;15306:1;15303;15296:12;15260:50;15329:22;;15382:4;15374:13;;15370:27;-1:-1:-1;15360:55:79;;15411:1;15408;15401:12;15360:55;15440:2;15434:9;15465:49;15481:32;15510:2;15481:32;:::i;15465:49::-;15537:2;15530:5;15523:17;15577:7;15572:2;15567;15563;15559:11;15555:20;15552:33;15549:53;;;15598:1;15595;15588:12;15549:53;15611:67;15675:2;15670;15663:5;15659:14;15654:2;15650;15646:11;15611:67;:::i;:::-;15697:5;15059:649;-1:-1:-1;;;;;15059:649:79:o;15713:289::-;15844:3;15882:6;15876:13;15898:66;15957:6;15952:3;15945:4;15937:6;15933:17;15898:66;:::i;:::-;15980:16;;;;;15713:289;-1:-1:-1;;15713:289:79:o;16007:127::-;16068:10;16063:3;16059:20;16056:1;16049:31;16099:4;16096:1;16089:15;16123:4;16120:1;16113:15","linkReferences":{},"immutableReferences":{}}}}}}},"signatures":{"function":[],"event":[{"signature":"Issue(address,uint256,uint256)","signatureHash4":"0x7bbff60f","signatureHash32":"0x7bbff60f84adf6a9b6881c0bae9f63e6f324d55f6ddeb2cf3213414a2f058d4a"}],"error":[]},"proxyResolution":{"isProxy":false,"proxyType":null,"implementations":[]},"match":"exact_match","chainId":"1","address":"0xd9e2E5Bc54dcFF27cF219120eac4D4B11CA0b224"}