{"file_path":"contracts/xManager/rwaManagers/AdminSubscriptionChecker.sol","creation_status":"success","source_code":"// SPDX-License-Identifier: BUSL-1.1\n/*\n      ▄▄█████████▄\n   ╓██▀└ ,╓▄▄▄, '▀██▄\n  ██▀ ▄██▀▀╙╙▀▀██▄ └██µ           ,,       ,,      ,     ,,,            ,,,\n ██ ,██¬ ▄████▄  ▀█▄ ╙█▄      ▄███▀▀███▄   ███▄    ██  ███▀▀▀███▄    ▄███▀▀███,\n██  ██ ╒█▀'   ╙█▌ ╙█▌ ██     ▐██      ███  █████,  ██  ██▌    └██▌  ██▌     └██▌\n██ ▐█▌ ██      ╟█  █▌ ╟█     ██▌      ▐██  ██ └███ ██  ██▌     ╟██ j██       ╟██\n╟█  ██ ╙██    ▄█▀ ▐█▌ ██     ╙██      ██▌  ██   ╙████  ██▌    ▄██▀  ██▌     ,██▀\n ██ \"██, ╙▀▀███████████⌐      ╙████████▀   ██     ╙██  ███████▀▀     ╙███████▀`\n  ██▄ ╙▀██▄▄▄▄▄,,,                ¬─                                    '─¬\n   ╙▀██▄ '╙╙╙▀▀▀▀▀▀▀▀\n      ╙▀▀██████R⌐\n */\npragma solidity 0.8.16;\nimport \"contracts/external/openzeppelin/contracts/access/AccessControlEnumerable.sol\";\nimport \"contracts/xManager/interfaces/IAdminSubscriptionChecker.sol\";\n\n/**\n * @title  AdminSubscriptionChecker\n * @author Ondo Finance\n * @notice This contract tracks and enforces individual subscription allowances for permissioned\n *         admins.\n */\ncontract AdminSubscriptionChecker is\n  IAdminSubscriptionChecker,\n  AccessControlEnumerable\n{\n  /// Role that allows an address to configure the subscription allowance\n  bytes32 public constant SUBSCRIPTION_ALLOWANCE_CONFIGURER =\n    keccak256(\"SUBSCRIPTION_ALLOWANCE_CONFIGURER\");\n\n  /// Role that allows the RWA manager to check and update the subscription allowance\n  bytes32 public constant RWA_MANAGER = keccak256(\"RWA_MANAGER\");\n\n  /**\n   * @notice Mapping of addresses to their admin subscription allowance.\n   *         Allowances are denominated in USD with 18 decimals.\n   */\n  mapping(address => uint256) public adminSubscriptionAllowance;\n\n  /**\n   * @notice Event emitted when an admin's subscription allowance is set\n   * @param  admin The address of the admin for which the allowance was set\n   * @param  limit The subscription allowance for the admin, denonimated in USD with 18 decimals\n   */\n  event AdminSubscriptionAllowanceSet(address indexed admin, uint256 limit);\n\n  /**\n   * @notice Event emitted when an admin's subscription allowance is used to mint an RWA\n   * @param  admin          The address of the admin for which the allowance was updated\n   * @param  remainingLimit The remaining subscription allowance for the admin, denominated in USD\n   *                        with 18 decimals\n   * @param  amountUsed     The amount by which the allowance was reduced, denominated in USD with\n   *                        18 decimals\n   */\n  event AdminSubscriptionAllowanceUsed(\n    address indexed admin,\n    uint256 remainingLimit,\n    uint256 amountUsed\n  );\n\n  /// Error emitted when an admin's subscription allowance is exceeded\n  error SubscriptionAllowanceExceeded();\n\n  /**\n   * @param  admin The address that will be the default admin.\n   */\n  constructor(address admin) {\n    _grantRole(DEFAULT_ADMIN_ROLE, admin);\n  }\n\n  /**\n   * @notice Sets the USD subscription allowance for an admin\n   * @param  admin     The address of the admin\n   * @param  usdAmount The amount of USD that the admin is subscribing for, denoted with 18 decimals\n   */\n  function checkAndUpdateAdminSubscriptionAllowance(\n    address admin,\n    uint256 usdAmount\n  ) external override onlyRole(RWA_MANAGER) {\n    if (adminSubscriptionAllowance[admin] < usdAmount)\n      revert SubscriptionAllowanceExceeded();\n    adminSubscriptionAllowance[admin] -= usdAmount;\n    emit AdminSubscriptionAllowanceUsed(\n      admin,\n      adminSubscriptionAllowance[admin],\n      usdAmount\n    );\n  }\n\n  /**\n   * @notice Sets the subscription allowance for an admin.\n   * @param  admin          The address of the admin.\n   * @param  usdAllowance   The maximum amount of USD that the admin can subscribe, in 18 decimals\n   */\n  function setAdminSubscriptionAllowance(\n    address admin,\n    uint256 usdAllowance\n  ) public onlyRole(SUBSCRIPTION_ALLOWANCE_CONFIGURER) {\n    adminSubscriptionAllowance[admin] = usdAllowance;\n    emit AdminSubscriptionAllowanceSet(admin, usdAllowance);\n  }\n}\n","deployed_bytecode":"0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806391d148541161008c578063c3f5a7e411610066578063c3f5a7e414610217578063ca15c8731461022a578063cb7bab401461023d578063d547741f1461025d57600080fd5b806391d14854146101d5578063a217fddf146101e8578063aa54604e146101f057600080fd5b80632f2ff15d116100c85780632f2ff15d1461016f57806336568abe14610184578063780eeae4146101975780639010d07c146101aa57600080fd5b806301ffc9a7146100ef5780630597f80414610117578063248a9ca31461014c575b600080fd5b6101026100fd366004610a3e565b610270565b60405190151581526020015b60405180910390f35b61013e7f3e37448d69f9102181c2435a9a910ab51311c180fc96802d923b9ebbd691d29181565b60405190815260200161010e565b61013e61015a366004610a68565b60009081526020819052604090206001015490565b61018261017d366004610a9d565b61029b565b005b610182610192366004610a9d565b6102c6565b6101826101a5366004610ac9565b610349565b6101bd6101b8366004610af3565b610433565b6040516001600160a01b03909116815260200161010e565b6101026101e3366004610a9d565b610452565b61013e600081565b61013e7f4096771e8f6ae83427f0c4961440f9268805b8010cc2195f1a430162ad365f4d81565b610182610225366004610ac9565b61047b565b61013e610238366004610a68565b6104f3565b61013e61024b366004610b15565b60026020526000908152604090205481565b61018261026b366004610a9d565b61050a565b60006001600160e01b03198216635a05180f60e01b14806102955750610295826105c9565b92915050565b6000828152602081905260409020600101546102b781336105fe565b6102c18383610662565b505050565b6001600160a01b038116331461033b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103458282610684565b5050565b7f4096771e8f6ae83427f0c4961440f9268805b8010cc2195f1a430162ad365f4d61037481336105fe565b6001600160a01b0383166000908152600260205260409020548211156103ad576040516339774c9760e21b815260040160405180910390fd5b6001600160a01b038316600090815260026020526040812080548492906103d5908490610b46565b90915550506001600160a01b0383166000818152600260209081526040918290205482519081529081018590527f501b34fefad180f4ec29b80bb55c95050b8197fb1263d0edc36dfc4fa47214ba91015b60405180910390a2505050565b600082815260016020526040812061044b90836106a6565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7f3e37448d69f9102181c2435a9a910ab51311c180fc96802d923b9ebbd691d2916104a681336105fe565b6001600160a01b03831660008181526002602052604090819020849055517f489c0190b9c6129fd202c5de81b417e1ad74804295ca386c8b51dbd9302bc01b906104269085815260200190565b6000818152600160205260408120610295906106b2565b60008281526020819052604090206001015461052681336105fe565b6102c18383610684565b61053a8282610452565b610345576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556105703390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061044b836001600160a01b0384166106bc565b60006001600160e01b03198216637965db0b60e01b148061029557506301ffc9a760e01b6001600160e01b0319831614610295565b6106088282610452565b61034557610620816001600160a01b0316601461070b565b61062b83602061070b565b60405160200161063c929190610b7d565b60408051601f198184030181529082905262461bcd60e51b825261033291600401610bf2565b61066c8282610530565b60008281526001602052604090206102c190826105b4565b61068e82826108a7565b60008281526001602052604090206102c1908261090c565b600061044b8383610921565b6000610295825490565b600081815260018301602052604081205461070357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610295565b506000610295565b6060600061071a836002610c25565b610725906002610c44565b67ffffffffffffffff81111561073d5761073d610c57565b6040519080825280601f01601f191660200182016040528015610767576020820181803683370190505b509050600360fc1b8160008151811061078257610782610c6d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106107b1576107b1610c6d565b60200101906001600160f81b031916908160001a90535060006107d5846002610c25565b6107e0906001610c44565b90505b6001811115610858576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061081457610814610c6d565b1a60f81b82828151811061082a5761082a610c6d565b60200101906001600160f81b031916908160001a90535060049490941c9361085181610c83565b90506107e3565b50831561044b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610332565b6108b18282610452565b15610345576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061044b836001600160a01b03841661094b565b600082600001828154811061093857610938610c6d565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610a3457600061096f600183610b46565b855490915060009061098390600190610b46565b90508181146109e85760008660000182815481106109a3576109a3610c6d565b90600052602060002001549050808760000184815481106109c6576109c6610c6d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806109f9576109f9610c9a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610295565b6000915050610295565b600060208284031215610a5057600080fd5b81356001600160e01b03198116811461044b57600080fd5b600060208284031215610a7a57600080fd5b5035919050565b80356001600160a01b0381168114610a9857600080fd5b919050565b60008060408385031215610ab057600080fd5b82359150610ac060208401610a81565b90509250929050565b60008060408385031215610adc57600080fd5b610ae583610a81565b946020939093013593505050565b60008060408385031215610b0657600080fd5b50508035926020909101359150565b600060208284031215610b2757600080fd5b61044b82610a81565b634e487b7160e01b600052601160045260246000fd5b8181038181111561029557610295610b30565b60005b83811015610b74578181015183820152602001610b5c565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610bb5816017850160208801610b59565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610be6816028840160208801610b59565b01602801949350505050565b6020815260008251806020840152610c11816040850160208701610b59565b601f01601f19169190910160400192915050565b6000816000190483118215151615610c3f57610c3f610b30565b500290565b8082018082111561029557610295610b30565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610c9257610c92610b30565b506000190190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220dc0660eb6c05d8abcf58a7977dda2e53c61b03d86fad7685da89d64ad56f781d64736f6c63430008100033","optimization_enabled":true,"verified_twin_address_hash":null,"is_verified":true,"compiler_settings":{"evmVersion":"london","libraries":{},"metadata":{"bytecodeHash":"ipfs"},"optimizer":{"enabled":true,"runs":200},"remappings":[":@aragon/=node_modules/@aragon/",":@ensdomains/=node_modules/@ensdomains/",":@openzeppelin/=node_modules/@openzeppelin/",":@uniswap/=node_modules/@uniswap/",":eth-gas-reporter/=node_modules/eth-gas-reporter/",":forge-std/=lib/forge-std/src/",":forge-tests/=forge-tests/",":hardhat-deploy/=node_modules/hardhat-deploy/",":hardhat/=node_modules/hardhat/",":lib/=lib/",":math/=node_modules/@aragon/os/contracts/lib/math/",":misc/=node_modules/@aragon/os/contracts/lib/misc/",":solidity-bytes-utils/=node_modules/solidity-bytes-utils/",":standards/=node_modules/@aragon/os/contracts/lib/standards/",":token/=node_modules/@aragon/os/contracts/lib/token/",":truffle/=node_modules/truffle/"]},"optimization_runs":200,"sourcify_repo_url":"https://repo.sourcify.dev/contracts/partial_match/1/0x1cb2Dcc325615d02ae384941149d1dA6521fa018/","decoded_constructor_args":[["0x094Bee6b74Ec29D32869ae3140A659cAc0482882",{"internalType":"address","name":"admin","type":"address"}]],"compiler_version":"0.8.16+commit.07a7930e","is_verified_via_verifier_alliance":false,"verified_at":"2025-04-14T05:32:06.441052Z","implementations":[],"proxy_type":null,"external_libraries":[],"creation_bytecode":"0x60806040523480156200001157600080fd5b5060405162000ec638038062000ec683398101604081905262000034916200019e565b6200004160008262000048565b50620001d0565b6200005f82826200008b60201b620005301760201c565b600082815260016020908152604090912062000086918390620005b46200012c821b17901c565b505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000128576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620000e73390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000143836001600160a01b0384166200014c565b90505b92915050565b6000818152600183016020526040812054620001955750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000146565b50600062000146565b600060208284031215620001b157600080fd5b81516001600160a01b0381168114620001c957600080fd5b9392505050565b610ce680620001e06000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806391d148541161008c578063c3f5a7e411610066578063c3f5a7e414610217578063ca15c8731461022a578063cb7bab401461023d578063d547741f1461025d57600080fd5b806391d14854146101d5578063a217fddf146101e8578063aa54604e146101f057600080fd5b80632f2ff15d116100c85780632f2ff15d1461016f57806336568abe14610184578063780eeae4146101975780639010d07c146101aa57600080fd5b806301ffc9a7146100ef5780630597f80414610117578063248a9ca31461014c575b600080fd5b6101026100fd366004610a3e565b610270565b60405190151581526020015b60405180910390f35b61013e7f3e37448d69f9102181c2435a9a910ab51311c180fc96802d923b9ebbd691d29181565b60405190815260200161010e565b61013e61015a366004610a68565b60009081526020819052604090206001015490565b61018261017d366004610a9d565b61029b565b005b610182610192366004610a9d565b6102c6565b6101826101a5366004610ac9565b610349565b6101bd6101b8366004610af3565b610433565b6040516001600160a01b03909116815260200161010e565b6101026101e3366004610a9d565b610452565b61013e600081565b61013e7f4096771e8f6ae83427f0c4961440f9268805b8010cc2195f1a430162ad365f4d81565b610182610225366004610ac9565b61047b565b61013e610238366004610a68565b6104f3565b61013e61024b366004610b15565b60026020526000908152604090205481565b61018261026b366004610a9d565b61050a565b60006001600160e01b03198216635a05180f60e01b14806102955750610295826105c9565b92915050565b6000828152602081905260409020600101546102b781336105fe565b6102c18383610662565b505050565b6001600160a01b038116331461033b5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6103458282610684565b5050565b7f4096771e8f6ae83427f0c4961440f9268805b8010cc2195f1a430162ad365f4d61037481336105fe565b6001600160a01b0383166000908152600260205260409020548211156103ad576040516339774c9760e21b815260040160405180910390fd5b6001600160a01b038316600090815260026020526040812080548492906103d5908490610b46565b90915550506001600160a01b0383166000818152600260209081526040918290205482519081529081018590527f501b34fefad180f4ec29b80bb55c95050b8197fb1263d0edc36dfc4fa47214ba91015b60405180910390a2505050565b600082815260016020526040812061044b90836106a6565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b7f3e37448d69f9102181c2435a9a910ab51311c180fc96802d923b9ebbd691d2916104a681336105fe565b6001600160a01b03831660008181526002602052604090819020849055517f489c0190b9c6129fd202c5de81b417e1ad74804295ca386c8b51dbd9302bc01b906104269085815260200190565b6000818152600160205260408120610295906106b2565b60008281526020819052604090206001015461052681336105fe565b6102c18383610684565b61053a8282610452565b610345576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556105703390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061044b836001600160a01b0384166106bc565b60006001600160e01b03198216637965db0b60e01b148061029557506301ffc9a760e01b6001600160e01b0319831614610295565b6106088282610452565b61034557610620816001600160a01b0316601461070b565b61062b83602061070b565b60405160200161063c929190610b7d565b60408051601f198184030181529082905262461bcd60e51b825261033291600401610bf2565b61066c8282610530565b60008281526001602052604090206102c190826105b4565b61068e82826108a7565b60008281526001602052604090206102c1908261090c565b600061044b8383610921565b6000610295825490565b600081815260018301602052604081205461070357508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610295565b506000610295565b6060600061071a836002610c25565b610725906002610c44565b67ffffffffffffffff81111561073d5761073d610c57565b6040519080825280601f01601f191660200182016040528015610767576020820181803683370190505b509050600360fc1b8160008151811061078257610782610c6d565b60200101906001600160f81b031916908160001a905350600f60fb1b816001815181106107b1576107b1610c6d565b60200101906001600160f81b031916908160001a90535060006107d5846002610c25565b6107e0906001610c44565b90505b6001811115610858576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061081457610814610c6d565b1a60f81b82828151811061082a5761082a610c6d565b60200101906001600160f81b031916908160001a90535060049490941c9361085181610c83565b90506107e3565b50831561044b5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610332565b6108b18282610452565b15610345576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b600061044b836001600160a01b03841661094b565b600082600001828154811061093857610938610c6d565b9060005260206000200154905092915050565b60008181526001830160205260408120548015610a3457600061096f600183610b46565b855490915060009061098390600190610b46565b90508181146109e85760008660000182815481106109a3576109a3610c6d565b90600052602060002001549050808760000184815481106109c6576109c6610c6d565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806109f9576109f9610c9a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610295565b6000915050610295565b600060208284031215610a5057600080fd5b81356001600160e01b03198116811461044b57600080fd5b600060208284031215610a7a57600080fd5b5035919050565b80356001600160a01b0381168114610a9857600080fd5b919050565b60008060408385031215610ab057600080fd5b82359150610ac060208401610a81565b90509250929050565b60008060408385031215610adc57600080fd5b610ae583610a81565b946020939093013593505050565b60008060408385031215610b0657600080fd5b50508035926020909101359150565b600060208284031215610b2757600080fd5b61044b82610a81565b634e487b7160e01b600052601160045260246000fd5b8181038181111561029557610295610b30565b60005b83811015610b74578181015183820152602001610b5c565b50506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351610bb5816017850160208801610b59565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351610be6816028840160208801610b59565b01602801949350505050565b6020815260008251806020840152610c11816040850160208701610b59565b601f01601f19169190910160400192915050565b6000816000190483118215151615610c3f57610c3f610b30565b500290565b8082018082111561029557610295610b30565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600081610c9257610c92610b30565b506000190190565b634e487b7160e01b600052603160045260246000fdfea2646970667358221220dc0660eb6c05d8abcf58a7977dda2e53c61b03d86fad7685da89d64ad56f781d64736f6c63430008100033000000000000000000000000094bee6b74ec29d32869ae3140a659cac0482882","name":"AdminSubscriptionChecker","is_blueprint":false,"license_type":"none","is_fully_verified":false,"is_verified_via_eth_bytecode_db":true,"language":"solidity","evm_version":"london","can_be_visualized_via_sol2uml":true,"is_verified_via_sourcify":true,"additional_sources":[{"file_path":"contracts/external/openzeppelin/contracts/access/AccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"contracts/external/openzeppelin/contracts/access/IAccessControl.sol\";\nimport \"contracts/external/openzeppelin/contracts/utils/Context.sol\";\nimport \"contracts/external/openzeppelin/contracts/utils/Strings.sol\";\nimport \"contracts/external/openzeppelin/contracts/utils/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n *     require(hasRole(MY_ROLE, msg.sender));\n *     ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n  struct RoleData {\n    mapping(address => bool) members;\n    bytes32 adminRole;\n  }\n\n  mapping(bytes32 => RoleData) private _roles;\n\n  bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n  /**\n   * @dev Modifier that checks that an account has a specific role. Reverts\n   * with a standardized message including the required role.\n   *\n   * The format of the revert reason is given by the following regular expression:\n   *\n   *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n   *\n   * _Available since v4.1._\n   */\n  modifier onlyRole(bytes32 role) {\n    _checkRole(role, _msgSender());\n    _;\n  }\n\n  /**\n   * @dev See {IERC165-supportsInterface}.\n   */\n  function supportsInterface(bytes4 interfaceId)\n    public\n    view\n    virtual\n    override\n    returns (bool)\n  {\n    return\n      interfaceId == type(IAccessControl).interfaceId ||\n      super.supportsInterface(interfaceId);\n  }\n\n  /**\n   * @dev Returns `true` if `account` has been granted `role`.\n   */\n  function hasRole(bytes32 role, address account)\n    public\n    view\n    virtual\n    override\n    returns (bool)\n  {\n    return _roles[role].members[account];\n  }\n\n  /**\n   * @dev Revert with a standard message if `account` is missing `role`.\n   *\n   * The format of the revert reason is given by the following regular expression:\n   *\n   *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n   */\n  function _checkRole(bytes32 role, address account) internal view virtual {\n    if (!hasRole(role, account)) {\n      revert(\n        string(\n          abi.encodePacked(\n            \"AccessControl: account \",\n            Strings.toHexString(uint160(account), 20),\n            \" is missing role \",\n            Strings.toHexString(uint256(role), 32)\n          )\n        )\n      );\n    }\n  }\n\n  /**\n   * @dev Returns the admin role that controls `role`. See {grantRole} and\n   * {revokeRole}.\n   *\n   * To change a role's admin, use {_setRoleAdmin}.\n   */\n  function getRoleAdmin(bytes32 role)\n    public\n    view\n    virtual\n    override\n    returns (bytes32)\n  {\n    return _roles[role].adminRole;\n  }\n\n  /**\n   * @dev Grants `role` to `account`.\n   *\n   * If `account` had not been already granted `role`, emits a {RoleGranted}\n   * event.\n   *\n   * Requirements:\n   *\n   * - the caller must have ``role``'s admin role.\n   */\n  function grantRole(bytes32 role, address account)\n    public\n    virtual\n    override\n    onlyRole(getRoleAdmin(role))\n  {\n    _grantRole(role, account);\n  }\n\n  /**\n   * @dev Revokes `role` from `account`.\n   *\n   * If `account` had been granted `role`, emits a {RoleRevoked} event.\n   *\n   * Requirements:\n   *\n   * - the caller must have ``role``'s admin role.\n   */\n  function revokeRole(bytes32 role, address account)\n    public\n    virtual\n    override\n    onlyRole(getRoleAdmin(role))\n  {\n    _revokeRole(role, account);\n  }\n\n  /**\n   * @dev Revokes `role` from the calling account.\n   *\n   * Roles are often managed via {grantRole} and {revokeRole}: this function's\n   * purpose is to provide a mechanism for accounts to lose their privileges\n   * if they are compromised (such as when a trusted device is misplaced).\n   *\n   * If the calling account had been revoked `role`, emits a {RoleRevoked}\n   * event.\n   *\n   * Requirements:\n   *\n   * - the caller must be `account`.\n   */\n  function renounceRole(bytes32 role, address account) public virtual override {\n    require(\n      account == _msgSender(),\n      \"AccessControl: can only renounce roles for self\"\n    );\n\n    _revokeRole(role, account);\n  }\n\n  /**\n   * @dev Grants `role` to `account`.\n   *\n   * If `account` had not been already granted `role`, emits a {RoleGranted}\n   * event. Note that unlike {grantRole}, this function doesn't perform any\n   * checks on the calling account.\n   *\n   * [WARNING]\n   * ====\n   * This function should only be called from the constructor when setting\n   * up the initial roles for the system.\n   *\n   * Using this function in any other way is effectively circumventing the admin\n   * system imposed by {AccessControl}.\n   * ====\n   *\n   * NOTE: This function is deprecated in favor of {_grantRole}.\n   */\n  function _setupRole(bytes32 role, address account) internal virtual {\n    _grantRole(role, account);\n  }\n\n  /**\n   * @dev Sets `adminRole` as ``role``'s admin role.\n   *\n   * Emits a {RoleAdminChanged} event.\n   */\n  function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n    bytes32 previousAdminRole = getRoleAdmin(role);\n    _roles[role].adminRole = adminRole;\n    emit RoleAdminChanged(role, previousAdminRole, adminRole);\n  }\n\n  /**\n   * @dev Grants `role` to `account`.\n   *\n   * Internal function without access restriction.\n   */\n  function _grantRole(bytes32 role, address account) internal virtual {\n    if (!hasRole(role, account)) {\n      _roles[role].members[account] = true;\n      emit RoleGranted(role, account, _msgSender());\n    }\n  }\n\n  /**\n   * @dev Revokes `role` from `account`.\n   *\n   * Internal function without access restriction.\n   */\n  function _revokeRole(bytes32 role, address account) internal virtual {\n    if (hasRole(role, account)) {\n      _roles[role].members[account] = false;\n      emit RoleRevoked(role, account, _msgSender());\n    }\n  }\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/access/AccessControlEnumerable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"contracts/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol\";\nimport \"contracts/external/openzeppelin/contracts/access/AccessControl.sol\";\nimport \"contracts/external/openzeppelin/contracts/utils/EnumerableSet.sol\";\n\n/**\n * @dev Extension of {AccessControl} that allows enumerating the members of each role.\n */\nabstract contract AccessControlEnumerable is\n  IAccessControlEnumerable,\n  AccessControl\n{\n  using EnumerableSet for EnumerableSet.AddressSet;\n\n  mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;\n\n  /**\n   * @dev See {IERC165-supportsInterface}.\n   */\n  function supportsInterface(bytes4 interfaceId)\n    public\n    view\n    virtual\n    override\n    returns (bool)\n  {\n    return\n      interfaceId == type(IAccessControlEnumerable).interfaceId ||\n      super.supportsInterface(interfaceId);\n  }\n\n  /**\n   * @dev Returns one of the accounts that have `role`. `index` must be a\n   * value between 0 and {getRoleMemberCount}, non-inclusive.\n   *\n   * Role bearers are not sorted in any particular way, and their ordering may\n   * change at any point.\n   *\n   * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n   * you perform all queries on the same block. See the following\n   * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n   * for more information.\n   */\n  function getRoleMember(bytes32 role, uint256 index)\n    public\n    view\n    virtual\n    override\n    returns (address)\n  {\n    return _roleMembers[role].at(index);\n  }\n\n  /**\n   * @dev Returns the number of accounts that have `role`. Can be used\n   * together with {getRoleMember} to enumerate all bearers of a role.\n   */\n  function getRoleMemberCount(bytes32 role)\n    public\n    view\n    virtual\n    override\n    returns (uint256)\n  {\n    return _roleMembers[role].length();\n  }\n\n  /**\n   * @dev Overload {_grantRole} to track enumerable memberships\n   */\n  function _grantRole(bytes32 role, address account) internal virtual override {\n    super._grantRole(role, account);\n    _roleMembers[role].add(account);\n  }\n\n  /**\n   * @dev Overload {_revokeRole} to track enumerable memberships\n   */\n  function _revokeRole(bytes32 role, address account)\n    internal\n    virtual\n    override\n  {\n    super._revokeRole(role, account);\n    _roleMembers[role].remove(account);\n  }\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/access/IAccessControl.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n  /**\n   * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n   *\n   * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n   * {RoleAdminChanged} not being emitted signaling this.\n   *\n   * _Available since v3.1._\n   */\n  event RoleAdminChanged(\n    bytes32 indexed role,\n    bytes32 indexed previousAdminRole,\n    bytes32 indexed newAdminRole\n  );\n\n  /**\n   * @dev Emitted when `account` is granted `role`.\n   *\n   * `sender` is the account that originated the contract call, an admin role\n   * bearer except when using {AccessControl-_setupRole}.\n   */\n  event RoleGranted(\n    bytes32 indexed role,\n    address indexed account,\n    address indexed sender\n  );\n\n  /**\n   * @dev Emitted when `account` is revoked `role`.\n   *\n   * `sender` is the account that originated the contract call:\n   *   - if using `revokeRole`, it is the admin role bearer\n   *   - if using `renounceRole`, it is the role bearer (i.e. `account`)\n   */\n  event RoleRevoked(\n    bytes32 indexed role,\n    address indexed account,\n    address indexed sender\n  );\n\n  /**\n   * @dev Returns `true` if `account` has been granted `role`.\n   */\n  function hasRole(bytes32 role, address account) external view returns (bool);\n\n  /**\n   * @dev Returns the admin role that controls `role`. See {grantRole} and\n   * {revokeRole}.\n   *\n   * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n   */\n  function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n  /**\n   * @dev Grants `role` to `account`.\n   *\n   * If `account` had not been already granted `role`, emits a {RoleGranted}\n   * event.\n   *\n   * Requirements:\n   *\n   * - the caller must have ``role``'s admin role.\n   */\n  function grantRole(bytes32 role, address account) external;\n\n  /**\n   * @dev Revokes `role` from `account`.\n   *\n   * If `account` had been granted `role`, emits a {RoleRevoked} event.\n   *\n   * Requirements:\n   *\n   * - the caller must have ``role``'s admin role.\n   */\n  function revokeRole(bytes32 role, address account) external;\n\n  /**\n   * @dev Revokes `role` from the calling account.\n   *\n   * Roles are often managed via {grantRole} and {revokeRole}: this function's\n   * purpose is to provide a mechanism for accounts to lose their privileges\n   * if they are compromised (such as when a trusted device is misplaced).\n   *\n   * If the calling account had been granted `role`, emits a {RoleRevoked}\n   * event.\n   *\n   * Requirements:\n   *\n   * - the caller must be `account`.\n   */\n  function renounceRole(bytes32 role, address account) external;\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/access/IAccessControlEnumerable.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"contracts/external/openzeppelin/contracts/access/IAccessControl.sol\";\n\n/**\n * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.\n */\ninterface IAccessControlEnumerable is IAccessControl {\n  /**\n   * @dev Returns one of the accounts that have `role`. `index` must be a\n   * value between 0 and {getRoleMemberCount}, non-inclusive.\n   *\n   * Role bearers are not sorted in any particular way, and their ordering may\n   * change at any point.\n   *\n   * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure\n   * you perform all queries on the same block. See the following\n   * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]\n   * for more information.\n   */\n  function getRoleMember(bytes32 role, uint256 index)\n    external\n    view\n    returns (address);\n\n  /**\n   * @dev Returns the number of accounts that have `role`. Can be used\n   * together with {getRoleMember} to enumerate all bearers of a role.\n   */\n  function getRoleMemberCount(bytes32 role) external view returns (uint256);\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/utils/Context.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n  function _msgSender() internal view virtual returns (address) {\n    return msg.sender;\n  }\n\n  function _msgData() internal view virtual returns (bytes calldata) {\n    return msg.data;\n  }\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/utils/ERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"contracts/external/openzeppelin/contracts/utils/IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n  /**\n   * @dev See {IERC165-supportsInterface}.\n   */\n  function supportsInterface(bytes4 interfaceId)\n    public\n    view\n    virtual\n    override\n    returns (bool)\n  {\n    return interfaceId == type(IERC165).interfaceId;\n  }\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/utils/EnumerableSet.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for managing\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\n * types.\n *\n * Sets have the following properties:\n *\n * - Elements are added, removed, and checked for existence in constant time\n * (O(1)).\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\n *\n * ```\n * contract Example {\n *     // Add the library methods\n *     using EnumerableSet for EnumerableSet.AddressSet;\n *\n *     // Declare a set state variable\n *     EnumerableSet.AddressSet private mySet;\n * }\n * ```\n *\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\n * and `uint256` (`UintSet`) are supported.\n */\nlibrary EnumerableSet {\n  // To implement this library for multiple types with as little code\n  // repetition as possible, we write it in terms of a generic Set type with\n  // bytes32 values.\n  // The Set implementation uses private functions, and user-facing\n  // implementations (such as AddressSet) are just wrappers around the\n  // underlying Set.\n  // This means that we can only create new EnumerableSets for types that fit\n  // in bytes32.\n\n  struct Set {\n    // Storage of set values\n    bytes32[] _values;\n    // Position of the value in the `values` array, plus 1 because index 0\n    // means a value is not in the set.\n    mapping(bytes32 => uint256) _indexes;\n  }\n\n  /**\n   * @dev Add a value to a set. O(1).\n   *\n   * Returns true if the value was added to the set, that is if it was not\n   * already present.\n   */\n  function _add(Set storage set, bytes32 value) private returns (bool) {\n    if (!_contains(set, value)) {\n      set._values.push(value);\n      // The value is stored at length-1, but we add 1 to all indexes\n      // and use 0 as a sentinel value\n      set._indexes[value] = set._values.length;\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  /**\n   * @dev Removes a value from a set. O(1).\n   *\n   * Returns true if the value was removed from the set, that is if it was\n   * present.\n   */\n  function _remove(Set storage set, bytes32 value) private returns (bool) {\n    // We read and store the value's index to prevent multiple reads from the same storage slot\n    uint256 valueIndex = set._indexes[value];\n\n    if (valueIndex != 0) {\n      // Equivalent to contains(set, value)\n      // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\n      // the array, and then remove the last element (sometimes called as 'swap and pop').\n      // This modifies the order of the array, as noted in {at}.\n\n      uint256 toDeleteIndex = valueIndex - 1;\n      uint256 lastIndex = set._values.length - 1;\n\n      if (lastIndex != toDeleteIndex) {\n        bytes32 lastvalue = set._values[lastIndex];\n\n        // Move the last value to the index where the value to delete is\n        set._values[toDeleteIndex] = lastvalue;\n        // Update the index for the moved value\n        set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex\n      }\n\n      // Delete the slot where the moved value was stored\n      set._values.pop();\n\n      // Delete the index for the deleted slot\n      delete set._indexes[value];\n\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  /**\n   * @dev Returns true if the value is in the set. O(1).\n   */\n  function _contains(Set storage set, bytes32 value)\n    private\n    view\n    returns (bool)\n  {\n    return set._indexes[value] != 0;\n  }\n\n  /**\n   * @dev Returns the number of values on the set. O(1).\n   */\n  function _length(Set storage set) private view returns (uint256) {\n    return set._values.length;\n  }\n\n  /**\n   * @dev Returns the value stored at position `index` in the set. O(1).\n   *\n   * Note that there are no guarantees on the ordering of values inside the\n   * array, and it may change when more values are added or removed.\n   *\n   * Requirements:\n   *\n   * - `index` must be strictly less than {length}.\n   */\n  function _at(Set storage set, uint256 index) private view returns (bytes32) {\n    return set._values[index];\n  }\n\n  /**\n   * @dev Return the entire set in an array\n   *\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n   */\n  function _values(Set storage set) private view returns (bytes32[] memory) {\n    return set._values;\n  }\n\n  // Bytes32Set\n\n  struct Bytes32Set {\n    Set _inner;\n  }\n\n  /**\n   * @dev Add a value to a set. O(1).\n   *\n   * Returns true if the value was added to the set, that is if it was not\n   * already present.\n   */\n  function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\n    return _add(set._inner, value);\n  }\n\n  /**\n   * @dev Removes a value from a set. O(1).\n   *\n   * Returns true if the value was removed from the set, that is if it was\n   * present.\n   */\n  function remove(Bytes32Set storage set, bytes32 value)\n    internal\n    returns (bool)\n  {\n    return _remove(set._inner, value);\n  }\n\n  /**\n   * @dev Returns true if the value is in the set. O(1).\n   */\n  function contains(Bytes32Set storage set, bytes32 value)\n    internal\n    view\n    returns (bool)\n  {\n    return _contains(set._inner, value);\n  }\n\n  /**\n   * @dev Returns the number of values in the set. O(1).\n   */\n  function length(Bytes32Set storage set) internal view returns (uint256) {\n    return _length(set._inner);\n  }\n\n  /**\n   * @dev Returns the value stored at position `index` in the set. O(1).\n   *\n   * Note that there are no guarantees on the ordering of values inside the\n   * array, and it may change when more values are added or removed.\n   *\n   * Requirements:\n   *\n   * - `index` must be strictly less than {length}.\n   */\n  function at(Bytes32Set storage set, uint256 index)\n    internal\n    view\n    returns (bytes32)\n  {\n    return _at(set._inner, index);\n  }\n\n  /**\n   * @dev Return the entire set in an array\n   *\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n   */\n  function values(Bytes32Set storage set)\n    internal\n    view\n    returns (bytes32[] memory)\n  {\n    return _values(set._inner);\n  }\n\n  // AddressSet\n\n  struct AddressSet {\n    Set _inner;\n  }\n\n  /**\n   * @dev Add a value to a set. O(1).\n   *\n   * Returns true if the value was added to the set, that is if it was not\n   * already present.\n   */\n  function add(AddressSet storage set, address value) internal returns (bool) {\n    return _add(set._inner, bytes32(uint256(uint160(value))));\n  }\n\n  /**\n   * @dev Removes a value from a set. O(1).\n   *\n   * Returns true if the value was removed from the set, that is if it was\n   * present.\n   */\n  function remove(AddressSet storage set, address value)\n    internal\n    returns (bool)\n  {\n    return _remove(set._inner, bytes32(uint256(uint160(value))));\n  }\n\n  /**\n   * @dev Returns true if the value is in the set. O(1).\n   */\n  function contains(AddressSet storage set, address value)\n    internal\n    view\n    returns (bool)\n  {\n    return _contains(set._inner, bytes32(uint256(uint160(value))));\n  }\n\n  /**\n   * @dev Returns the number of values in the set. O(1).\n   */\n  function length(AddressSet storage set) internal view returns (uint256) {\n    return _length(set._inner);\n  }\n\n  /**\n   * @dev Returns the value stored at position `index` in the set. O(1).\n   *\n   * Note that there are no guarantees on the ordering of values inside the\n   * array, and it may change when more values are added or removed.\n   *\n   * Requirements:\n   *\n   * - `index` must be strictly less than {length}.\n   */\n  function at(AddressSet storage set, uint256 index)\n    internal\n    view\n    returns (address)\n  {\n    return address(uint160(uint256(_at(set._inner, index))));\n  }\n\n  /**\n   * @dev Return the entire set in an array\n   *\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n   */\n  function values(AddressSet storage set)\n    internal\n    view\n    returns (address[] memory)\n  {\n    bytes32[] memory store = _values(set._inner);\n    address[] memory result;\n\n    assembly {\n      result := store\n    }\n\n    return result;\n  }\n\n  // UintSet\n\n  struct UintSet {\n    Set _inner;\n  }\n\n  /**\n   * @dev Add a value to a set. O(1).\n   *\n   * Returns true if the value was added to the set, that is if it was not\n   * already present.\n   */\n  function add(UintSet storage set, uint256 value) internal returns (bool) {\n    return _add(set._inner, bytes32(value));\n  }\n\n  /**\n   * @dev Removes a value from a set. O(1).\n   *\n   * Returns true if the value was removed from the set, that is if it was\n   * present.\n   */\n  function remove(UintSet storage set, uint256 value) internal returns (bool) {\n    return _remove(set._inner, bytes32(value));\n  }\n\n  /**\n   * @dev Returns true if the value is in the set. O(1).\n   */\n  function contains(UintSet storage set, uint256 value)\n    internal\n    view\n    returns (bool)\n  {\n    return _contains(set._inner, bytes32(value));\n  }\n\n  /**\n   * @dev Returns the number of values on the set. O(1).\n   */\n  function length(UintSet storage set) internal view returns (uint256) {\n    return _length(set._inner);\n  }\n\n  /**\n   * @dev Returns the value stored at position `index` in the set. O(1).\n   *\n   * Note that there are no guarantees on the ordering of values inside the\n   * array, and it may change when more values are added or removed.\n   *\n   * Requirements:\n   *\n   * - `index` must be strictly less than {length}.\n   */\n  function at(UintSet storage set, uint256 index)\n    internal\n    view\n    returns (uint256)\n  {\n    return uint256(_at(set._inner, index));\n  }\n\n  /**\n   * @dev Return the entire set in an array\n   *\n   * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\n   * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\n   * this function has an unbounded cost, and using it as part of a state-changing function may render the function\n   * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\n   */\n  function values(UintSet storage set)\n    internal\n    view\n    returns (uint256[] memory)\n  {\n    bytes32[] memory store = _values(set._inner);\n    uint256[] memory result;\n\n    assembly {\n      result := store\n    }\n\n    return result;\n  }\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/utils/IERC165.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n  /**\n   * @dev Returns true if this contract implements the interface defined by\n   * `interfaceId`. See the corresponding\n   * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n   * to learn more about how these ids are created.\n   *\n   * This function call must use less than 30 000 gas.\n   */\n  function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n"},{"file_path":"contracts/external/openzeppelin/contracts/utils/Strings.sol","source_code":"// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n  bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\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    // Inspired by OraclizeAPI's implementation - MIT licence\n    // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n    if (value == 0) {\n      return \"0\";\n    }\n    uint256 temp = value;\n    uint256 digits;\n    while (temp != 0) {\n      digits++;\n      temp /= 10;\n    }\n    bytes memory buffer = new bytes(digits);\n    while (value != 0) {\n      digits -= 1;\n      buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n      value /= 10;\n    }\n    return string(buffer);\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    if (value == 0) {\n      return \"0x00\";\n    }\n    uint256 temp = value;\n    uint256 length = 0;\n    while (temp != 0) {\n      length++;\n      temp >>= 8;\n    }\n    return toHexString(value, length);\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)\n    internal\n    pure\n    returns (string memory)\n  {\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_SYMBOLS[value & 0xf];\n      value >>= 4;\n    }\n    require(value == 0, \"Strings: hex length insufficient\");\n    return string(buffer);\n  }\n}\n"},{"file_path":"contracts/xManager/interfaces/IAdminSubscriptionChecker.sol","source_code":"// SPDX-License-Identifier: BUSL-1.1\n/*\n      ▄▄█████████▄\n   ╓██▀└ ,╓▄▄▄, '▀██▄\n  ██▀ ▄██▀▀╙╙▀▀██▄ └██µ           ,,       ,,      ,     ,,,            ,,,\n ██ ,██¬ ▄████▄  ▀█▄ ╙█▄      ▄███▀▀███▄   ███▄    ██  ███▀▀▀███▄    ▄███▀▀███,\n██  ██ ╒█▀'   ╙█▌ ╙█▌ ██     ▐██      ███  █████,  ██  ██▌    └██▌  ██▌     └██▌\n██ ▐█▌ ██      ╟█  █▌ ╟█     ██▌      ▐██  ██ └███ ██  ██▌     ╟██ j██       ╟██\n╟█  ██ ╙██    ▄█▀ ▐█▌ ██     ╙██      ██▌  ██   ╙████  ██▌    ▄██▀  ██▌     ,██▀\n ██ \"██, ╙▀▀███████████⌐      ╙████████▀   ██     ╙██  ███████▀▀     ╙███████▀`\n  ██▄ ╙▀██▄▄▄▄▄,,,                ¬─                                    '─¬\n   ╙▀██▄ '╙╙╙▀▀▀▀▀▀▀▀\n      ╙▀▀██████R⌐\n */\npragma solidity 0.8.16;\n\ninterface IAdminSubscriptionChecker {\n  function checkAndUpdateAdminSubscriptionAllowance(\n    address admin,\n    uint256 usdAmount\n  ) external;\n}\n"}],"certified":false,"conflicting_implementations":null,"abi":[{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"SubscriptionAllowanceExceeded","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"AdminSubscriptionAllowanceSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"uint256","name":"remainingLimit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountUsed","type":"uint256"}],"name":"AdminSubscriptionAllowanceUsed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RWA_MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SUBSCRIPTION_ALLOWANCE_CONFIGURER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"adminSubscriptionAllowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"uint256","name":"usdAmount","type":"uint256"}],"name":"checkAndUpdateAdminSubscriptionAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"},{"internalType":"uint256","name":"usdAllowance","type":"uint256"}],"name":"setAdminSubscriptionAllowance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}],"is_changed_bytecode":false,"is_partially_verified":true,"constructor_args":"0x000000000000000000000000094bee6b74ec29d32869ae3140a659cac0482882"}