diff --git a/packages/hardhat/deployments/optimism/AIC2.json b/packages/hardhat/deployments/optimism/AIC2.json index c8a341e..36f962d 100644 --- a/packages/hardhat/deployments/optimism/AIC2.json +++ b/packages/hardhat/deployments/optimism/AIC2.json @@ -1,5 +1,5 @@ { - "address": "0x9fB375a62ACfC6b30199092283A8eea996138c1a", + "address": "0xb13b7A60C88e1Ba2a204423aB420C60ACBA62c53", "abi": [ { "inputs": [], @@ -168,6 +168,11 @@ }, { "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, { "internalType": "address", "name": "tokenA", @@ -189,6 +194,29 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approveToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -471,22 +499,22 @@ "type": "receive" } ], - "transactionHash": "0x291eaf5e6feacc0437a8f6be5844831646f4f733365e16051ce20a46f33ad6a2", + "transactionHash": "0xac55a63a7603b588d9125db0d0792c631a477d463145667134229bef7422b45a", "receipt": { "to": null, "from": "0x99AF2c3Af94a83a8b6290dFbc7313ef73B3690eb", - "contractAddress": "0x9fB375a62ACfC6b30199092283A8eea996138c1a", - "transactionIndex": 11, - "gasUsed": "1106872", - "logsBloom": "0x00000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000020000000000000000000800000000000000010000000000000000000000000000000000000000000002000100000000000000000000000000000000800000000000000000000001000000000000000004000000001400000000000000000000000000000000000000000000000000008000000100000000000020000000000000000000000000000000000000400000000000000000800000000000", - "blockHash": "0x4eda907e34e9409c217e6826b3b184ed1e16c55b0e98b874d2d8e70559bd6987", - "transactionHash": "0x291eaf5e6feacc0437a8f6be5844831646f4f733365e16051ce20a46f33ad6a2", + "contractAddress": "0xb13b7A60C88e1Ba2a204423aB420C60ACBA62c53", + "transactionIndex": 10, + "gasUsed": "1197059", + "logsBloom": "0x00000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800000000000000010000000000000000000000000000000000000000008002000100000000000000000000000000000000800000000000000000000001000000000000000100000000001400200000000000000000000000000000000000000000000000008000000100000000000020000000000000000000000000000000000000000000000000000000800000000000", + "blockHash": "0x5cf5ebe2618b8682f8e07c383de7f54cd4ef27ec43001a3dc5de3323813dff6c", + "transactionHash": "0xac55a63a7603b588d9125db0d0792c631a477d463145667134229bef7422b45a", "logs": [ { - "transactionIndex": 11, - "blockNumber": 129316873, - "transactionHash": "0x291eaf5e6feacc0437a8f6be5844831646f4f733365e16051ce20a46f33ad6a2", - "address": "0x9fB375a62ACfC6b30199092283A8eea996138c1a", + "transactionIndex": 10, + "blockNumber": 129321749, + "transactionHash": "0xac55a63a7603b588d9125db0d0792c631a477d463145667134229bef7422b45a", + "address": "0xb13b7A60C88e1Ba2a204423aB420C60ACBA62c53", "topics": [ "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", "0x0000000000000000000000000000000000000000000000000000000000000000", @@ -494,14 +522,14 @@ "0x00000000000000000000000099af2c3af94a83a8b6290dfbc7313ef73b3690eb" ], "data": "0x", - "logIndex": 30, - "blockHash": "0x4eda907e34e9409c217e6826b3b184ed1e16c55b0e98b874d2d8e70559bd6987" + "logIndex": 62, + "blockHash": "0x5cf5ebe2618b8682f8e07c383de7f54cd4ef27ec43001a3dc5de3323813dff6c" }, { - "transactionIndex": 11, - "blockNumber": 129316873, - "transactionHash": "0x291eaf5e6feacc0437a8f6be5844831646f4f733365e16051ce20a46f33ad6a2", - "address": "0x9fB375a62ACfC6b30199092283A8eea996138c1a", + "transactionIndex": 10, + "blockNumber": 129321749, + "transactionHash": "0xac55a63a7603b588d9125db0d0792c631a477d463145667134229bef7422b45a", + "address": "0xb13b7A60C88e1Ba2a204423aB420C60ACBA62c53", "topics": [ "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", "0xa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc77", @@ -509,14 +537,14 @@ "0x00000000000000000000000099af2c3af94a83a8b6290dfbc7313ef73b3690eb" ], "data": "0x", - "logIndex": 31, - "blockHash": "0x4eda907e34e9409c217e6826b3b184ed1e16c55b0e98b874d2d8e70559bd6987" + "logIndex": 63, + "blockHash": "0x5cf5ebe2618b8682f8e07c383de7f54cd4ef27ec43001a3dc5de3323813dff6c" }, { - "transactionIndex": 11, - "blockNumber": 129316873, - "transactionHash": "0x291eaf5e6feacc0437a8f6be5844831646f4f733365e16051ce20a46f33ad6a2", - "address": "0x9fB375a62ACfC6b30199092283A8eea996138c1a", + "transactionIndex": 10, + "blockNumber": 129321749, + "transactionHash": "0xac55a63a7603b588d9125db0d0792c631a477d463145667134229bef7422b45a", + "address": "0xb13b7A60C88e1Ba2a204423aB420C60ACBA62c53", "topics": [ "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", "0x067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a", @@ -524,21 +552,21 @@ "0x00000000000000000000000099af2c3af94a83a8b6290dfbc7313ef73b3690eb" ], "data": "0x", - "logIndex": 32, - "blockHash": "0x4eda907e34e9409c217e6826b3b184ed1e16c55b0e98b874d2d8e70559bd6987" + "logIndex": 64, + "blockHash": "0x5cf5ebe2618b8682f8e07c383de7f54cd4ef27ec43001a3dc5de3323813dff6c" } ], - "blockNumber": 129316873, - "cumulativeGasUsed": "4171754", + "blockNumber": 129321749, + "cumulativeGasUsed": "4295928", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 2, - "solcInputHash": "427208738bacd80d773384c56023ffc5", - "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Approved\",\"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\":\"SERVER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TREASURE_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"percent\",\"type\":\"uint256\"}],\"name\":\"_swapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"decWhitelist\",\"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\":\"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\":[],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOP\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceZK\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"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\":[],\"name\":\"server\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_price\",\"type\":\"uint256\"}],\"name\":\"setPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_server\",\"type\":\"address\"}],\"name\":\"setServer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"_uniswapRouter\",\"type\":\"address\"}],\"name\":\"setUniswapRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapRouter\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"whitelist\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"_swapTokens(address,address,uint256)\":{\"details\":\"This function checks the balance of tokenA, approves the Uniswap router to spend it, and executes the swap for tokenB.\",\"params\":{\"percent\":\"The amount of tokenA to swap.\",\"tokenA\":\"The address of the token being swapped from.\",\"tokenB\":\"The address of the token being swapped to.\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setPrice(uint256)\":{\"params\":{\"_price\":\"The new price to set.\"}},\"setUniswapRouter(address)\":{\"params\":{\"_uniswapRouter\":\"The new Uniswap router address.\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"withdrawTokens(address,uint256)\":{\"params\":{\"amount\":\"The amount of tokens to withdraw\",\"token\":\"The address of the token to withdraw (USDT or USDC)\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"_swapTokens(address,address,uint256)\":{\"notice\":\"Performs a token swap between two ERC20 tokens.\"},\"setPrice(uint256)\":{\"notice\":\"Sets the price.\"},\"setUniswapRouter(address)\":{\"notice\":\"Sets the Uniswap router address.\"},\"withdrawTokens(address,uint256)\":{\"notice\":\"Withdraws USDT or USDC from the contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/AIC2.sol\":\"AIC2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAccessControl} from \\\"./IAccessControl.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```solidity\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```solidity\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\\n * to enforce additional security measures for this role.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address account => bool) hasRole;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 role => 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 an {AccessControlUnauthorizedAccount} error including the required role.\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\\n return _roles[role].hasRole[account];\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\\n * is missing `role`.\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert AccessControlUnauthorizedAccount(account, role);\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\\n if (callerConfirmation != _msgSender()) {\\n revert AccessControlBadConfirmation();\\n }\\n\\n _revokeRole(role, callerConfirmation);\\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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (!hasRole(role, account)) {\\n _roles[role].hasRole[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (hasRole(role, account)) {\\n _roles[role].hasRole[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev The `account` is missing a role.\\n */\\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\\n\\n /**\\n * @dev The caller of a function is not the expected one.\\n *\\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\\n */\\n error AccessControlBadConfirmation();\\n\\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 event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) external;\\n}\\n\",\"keccak256\":\"0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/Ownable.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 {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * 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 Ownable is Context {\\n address private _owner;\\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 constructor(address initialOwner) {\\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 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 address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the 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\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./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 */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\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\",\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol\":{\"content\":\"pragma solidity >=0.6.2;\\n\\ninterface IUniswapV2Router01 {\\n function factory() external pure returns (address);\\n function WETH() external pure returns (address);\\n\\n function addLiquidity(\\n address tokenA,\\n address tokenB,\\n uint amountADesired,\\n uint amountBDesired,\\n uint amountAMin,\\n uint amountBMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountA, uint amountB, uint liquidity);\\n function addLiquidityETH(\\n address token,\\n uint amountTokenDesired,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline\\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\\n function removeLiquidity(\\n address tokenA,\\n address tokenB,\\n uint liquidity,\\n uint amountAMin,\\n uint amountBMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountA, uint amountB);\\n function removeLiquidityETH(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountToken, uint amountETH);\\n function removeLiquidityWithPermit(\\n address tokenA,\\n address tokenB,\\n uint liquidity,\\n uint amountAMin,\\n uint amountBMin,\\n address to,\\n uint deadline,\\n bool approveMax, uint8 v, bytes32 r, bytes32 s\\n ) external returns (uint amountA, uint amountB);\\n function removeLiquidityETHWithPermit(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline,\\n bool approveMax, uint8 v, bytes32 r, bytes32 s\\n ) external returns (uint amountToken, uint amountETH);\\n function swapExactTokensForTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n function swapTokensForExactTokens(\\n uint amountOut,\\n uint amountInMax,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\\n external\\n payable\\n returns (uint[] memory amounts);\\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\\n external\\n returns (uint[] memory amounts);\\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\\n external\\n returns (uint[] memory amounts);\\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\\n external\\n payable\\n returns (uint[] memory amounts);\\n\\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\\n}\\n\",\"keccak256\":\"0x8a3c5c449d4b7cd76513ed6995f4b86e4a86f222c770f8442f5fc128ce29b4d2\"},\"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\":{\"content\":\"pragma solidity >=0.6.2;\\n\\nimport './IUniswapV2Router01.sol';\\n\\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\\n function removeLiquidityETHSupportingFeeOnTransferTokens(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountETH);\\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline,\\n bool approveMax, uint8 v, bytes32 r, bytes32 s\\n ) external returns (uint amountETH);\\n\\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external;\\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external payable;\\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external;\\n}\\n\",\"keccak256\":\"0x744e30c133bd0f7ca9e7163433cf6d72f45c6bb1508c2c9c02f1a6db796ae59d\"},\"contracts/AIC2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AccessControl } from \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\\\";\\n\\n//https://youtu.be/TLsy8Hjt_JY\\n// Polygon Deployment = 0x8163E0022C8f4b94afBDacB16398d47aAaEF0653\\n// https://polygonscan.com/address/0x8163E0022C8f4b94afBDacB16398d47aAaEF0653#code => verified\\n//video = https://www.youtube.com/watch?v=TLsy8Hjt_JY\\n/*\\n // Token addresses on Polygon mainnet\\n address public constant USDT = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F; //ok\\n address public constant USDC = 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359;//ok\\n*/\\ncontract AIC2 is AccessControl {\\n mapping(address => uint8) public whitelist;\\n bytes32 public constant SERVER_ROLE = keccak256(\\\"SERVER_ROLE\\\");\\n bytes32 public constant TREASURE_ROLE = keccak256(\\\"TREASURE_ROLE\\\");\\n uint256 public constant priceZK = 0.05 ether; // change prices\\n uint256 public constant priceOP = 0.0001 ether; // change prices\\n uint256 public price;\\n address public server;\\n\\n address private constant UNISWAP_V2_ROUTER = 0xedf6066a2b290C185783862C7F4776A2C8077AD1;\\n IUniswapV2Router02 public uniswapRouter;\\n\\n event Approved(address indexed token, address indexed spender, uint256 amount);\\n\\n constructor() {\\n uniswapRouter = IUniswapV2Router02(UNISWAP_V2_ROUTER);\\n if (block.chainid == 324) {\\n price = priceZK;\\n } else {\\n price = priceOP;\\n }\\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\\n _grantRole(SERVER_ROLE, msg.sender);\\n _grantRole(TREASURE_ROLE, msg.sender);\\n }\\n\\n function decWhitelist(address user) external onlyRole(SERVER_ROLE) {\\n require(whitelist[user] > 0, \\\"User not in whitelist\\\");\\n whitelist[user]--;\\n }\\n\\n function withdraw() external onlyRole(TREASURE_ROLE) {\\n uint256 amount = address(this).balance;\\n require(amount > 0, \\\"Insufficient MATIC balance\\\");\\n payable(msg.sender).transfer(amount);\\n }\\n\\n function setServer(address _server) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n server = _server;\\n }\\n\\n ///@notice Performs a token swap between two ERC20 tokens.\\n ///@dev This function checks the balance of tokenA, approves the Uniswap router to spend it,\\n /// and executes the swap for tokenB.\\n ///@param tokenA The address of the token being swapped from.\\n ///@param tokenB The address of the token being swapped to.\\n ///@param percent The amount of tokenA to swap.\\n function _swapTokens(address tokenA, address tokenB, uint256 percent) public onlyRole(SERVER_ROLE) {\\n uint256 amountIn = (IERC20(tokenA).balanceOf(address(this)) * percent) / 100;\\n require(amountIn > 0, \\\"Insufficient token balance\\\");\\n require(IERC20(tokenA).approve(UNISWAP_V2_ROUTER, amountIn), \\\"Token approval failed\\\");\\n\\n address[] memory path = new address[](2);\\n path[0] = tokenA;\\n path[1] = tokenB;\\n\\n uniswapRouter.swapExactTokensForTokens(amountIn, 0, path, address(this), block.timestamp);\\n }\\n\\n ///@notice Withdraws USDT or USDC from the contract\\n ///@param token The address of the token to withdraw (USDT or USDC)\\n ///@param amount The amount of tokens to withdraw\\n function withdrawTokens(address token, uint256 amount) external onlyRole(TREASURE_ROLE) {\\n require(IERC20(token).balanceOf(address(this)) >= amount, \\\"Insufficient token balance\\\");\\n IERC20(token).transfer(msg.sender, amount);\\n }\\n\\n /// @notice Sets the price.\\n /// @param _price The new price to set.\\n function setPrice(uint256 _price) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n price = _price;\\n }\\n\\n /// @notice Sets the Uniswap router address.\\n /// @param _uniswapRouter The new Uniswap router address.\\n function setUniswapRouter(IUniswapV2Router02 _uniswapRouter) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n uniswapRouter = _uniswapRouter;\\n }\\n\\n receive() external payable {\\n require(msg.value == price, \\\"not the price\\\");\\n payable(server).transfer((7 * address(this).balance) / 10);\\n whitelist[msg.sender]++;\\n }\\n}\\n\",\"keccak256\":\"0x4ce8c96f06cd612e4795afc88c6b94887c6631dbab240a4023e5ffd4cecf3180\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50600480546001600160a01b03191673edf6066a2b290c185783862c7f4776a2c8077ad117905546610144036100505766b1a2bc2ec5000060025561005b565b655af3107a40006002555b6100666000336100c2565b506100917fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc77336100c2565b506100bc7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a336100c2565b5061016e565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610164576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561011c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610168565b5060005b92915050565b6110d48061017d6000396000f3fe6080604052600436106101395760003560e01c80637fb72bd9116100ab578063a217fddf1161006f578063a217fddf1461048b578063bea9849e146104a0578063d547741f146104c0578063f19a0b54146104e0578063fc6a76cd14610500578063fd922a421461051b57600080fd5b80637fb72bd9146103d357806391b7f5ed146103f357806391d14854146104135780639b19251a14610433578063a035b1fe1461047557600080fd5b80632f2ff15d116100fd5780632f2ff15d146102f257806336568abe146103125780633ccfd60b14610332578063735de9f7146103475780637d0e1cbb1461037f5780637f8340971461039f57600080fd5b806301ffc9a71461020f57806306b091f9146102445780630c0ed0a11461026657806318cf28341461028e578063248a9ca3146102c257600080fd5b3661020a5760025434146101845760405162461bcd60e51b815260206004820152600d60248201526c6e6f742074686520707269636560981b60448201526064015b60405180910390fd5b6003546001600160a01b03166108fc600a6101a0476007610d7a565b6101aa9190610d91565b6040518115909202916000818181858888f193505050501580156101d2573d6000803e3d6000fd5b50336000908152600160205260408120805460ff16916101f183610db3565b91906101000a81548160ff021916908360ff1602179055005b600080fd5b34801561021b57600080fd5b5061022f61022a366004610dd2565b61053b565b60405190151581526020015b60405180910390f35b34801561025057600080fd5b5061026461025f366004610e18565b610572565b005b34801561027257600080fd5b50610280655af3107a400081565b60405190815260200161023b565b34801561029a57600080fd5b506102807fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc7781565b3480156102ce57600080fd5b506102806102dd366004610e44565b60009081526020819052604090206001015490565b3480156102fe57600080fd5b5061026461030d366004610e5d565b6106cb565b34801561031e57600080fd5b5061026461032d366004610e5d565b6106f0565b34801561033e57600080fd5b50610264610728565b34801561035357600080fd5b50600454610367906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b34801561038b57600080fd5b5061026461039a366004610e8d565b6107cd565b3480156103ab57600080fd5b506102807f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a81565b3480156103df57600080fd5b506102646103ee366004610eaa565b61089b565b3480156103ff57600080fd5b5061026461040e366004610e44565b610b62565b34801561041f57600080fd5b5061022f61042e366004610e5d565b610b73565b34801561043f57600080fd5b5061046361044e366004610e8d565b60016020526000908152604090205460ff1681565b60405160ff909116815260200161023b565b34801561048157600080fd5b5061028060025481565b34801561049757600080fd5b50610280600081565b3480156104ac57600080fd5b506102646104bb366004610e8d565b610b9c565b3480156104cc57600080fd5b506102646104db366004610e5d565b610bca565b3480156104ec57600080fd5b506102646104fb366004610e8d565b610bef565b34801561050c57600080fd5b5061028066b1a2bc2ec5000081565b34801561052757600080fd5b50600354610367906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061056c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a61059c81610c1d565b6040516370a0823160e01b815230600482015282906001600160a01b038516906370a0823190602401602060405180830381865afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190610eeb565b10156106545760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e6365000000000000604482015260640161017b565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af11580156106a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c59190610f04565b50505050565b6000828152602081905260409020600101546106e681610c1d565b6106c58383610c2a565b6001600160a01b03811633146107195760405163334bd91960e11b815260040160405180910390fd5b6107238282610cbc565b505050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a61075281610c1d565b47806107a05760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74204d415449432062616c616e6365000000000000604482015260640161017b565b604051339082156108fc029083906000818181858888f19350505050158015610723573d6000803e3d6000fd5b7fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc776107f781610c1d565b6001600160a01b03821660009081526001602052604090205460ff166108575760405162461bcd60e51b8152602060048201526015602482015274155cd95c881b9bdd081a5b881dda1a5d195b1a5cdd605a1b604482015260640161017b565b6001600160a01b0382166000908152600160205260408120805460ff169161087e83610f26565b91906101000a81548160ff021916908360ff160217905550505050565b7fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc776108c581610c1d565b6040516370a0823160e01b815230600482015260009060649084906001600160a01b038816906370a0823190602401602060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109359190610eeb565b61093f9190610d7a565b6109499190610d91565b90506000811161099b5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e6365000000000000604482015260640161017b565b60405163095ea7b360e01b815273edf6066a2b290c185783862c7f4776a2c8077ad16004820152602481018290526001600160a01b0386169063095ea7b3906044016020604051808303816000875af11580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a209190610f04565b610a645760405162461bcd60e51b8152602060048201526015602482015274151bdad95b88185c1c1c9bdd985b0819985a5b1959605a1b604482015260640161017b565b6040805160028082526060820183526000926020830190803683370190505090508581600081518110610a9957610a99610f59565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600181518110610acd57610acd610f59565b6001600160a01b039283166020918202929092010152600480546040516338ed173960e01b81529216916338ed173991610b1291869160009187913091429101610f6f565b6000604051808303816000875af1158015610b31573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b599190810190610fe0565b50505050505050565b6000610b6d81610c1d565b50600255565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610ba781610c1d565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154610be581610c1d565b6106c58383610cbc565b6000610bfa81610c1d565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b610c278133610d27565b50565b6000610c368383610b73565b610cb4576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610c6c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161056c565b50600061056c565b6000610cc88383610b73565b15610cb4576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161056c565b610d318282610b73565b610d605760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161017b565b5050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761056c5761056c610d64565b600082610dae57634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff8103610dc957610dc9610d64565b60010192915050565b600060208284031215610de457600080fd5b81356001600160e01b031981168114610dfc57600080fd5b9392505050565b6001600160a01b0381168114610c2757600080fd5b60008060408385031215610e2b57600080fd5b8235610e3681610e03565b946020939093013593505050565b600060208284031215610e5657600080fd5b5035919050565b60008060408385031215610e7057600080fd5b823591506020830135610e8281610e03565b809150509250929050565b600060208284031215610e9f57600080fd5b8135610dfc81610e03565b600080600060608486031215610ebf57600080fd5b8335610eca81610e03565b92506020840135610eda81610e03565b929592945050506040919091013590565b600060208284031215610efd57600080fd5b5051919050565b600060208284031215610f1657600080fd5b81518015158114610dfc57600080fd5b600060ff821680610f3957610f39610d64565b6000190192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015610fbf5784516001600160a01b031683529383019391830191600101610f9a565b50506001600160a01b03969096166060850152505050608001529392505050565b60006020808385031215610ff357600080fd5b825167ffffffffffffffff8082111561100b57600080fd5b818501915085601f83011261101f57600080fd5b81518181111561103157611031610f43565b8060051b604051601f19603f8301168101818110858211171561105657611056610f43565b60405291825284820192508381018501918883111561107457600080fd5b938501935b8285101561109257845184529385019392850192611079565b9897505050505050505056fea26469706673582212209a9f10aeec1e82d8693e4a94ca4efac2fb6abce810df273e3c8a95cb6819ee2d64736f6c63430008140033", - "deployedBytecode": "0x6080604052600436106101395760003560e01c80637fb72bd9116100ab578063a217fddf1161006f578063a217fddf1461048b578063bea9849e146104a0578063d547741f146104c0578063f19a0b54146104e0578063fc6a76cd14610500578063fd922a421461051b57600080fd5b80637fb72bd9146103d357806391b7f5ed146103f357806391d14854146104135780639b19251a14610433578063a035b1fe1461047557600080fd5b80632f2ff15d116100fd5780632f2ff15d146102f257806336568abe146103125780633ccfd60b14610332578063735de9f7146103475780637d0e1cbb1461037f5780637f8340971461039f57600080fd5b806301ffc9a71461020f57806306b091f9146102445780630c0ed0a11461026657806318cf28341461028e578063248a9ca3146102c257600080fd5b3661020a5760025434146101845760405162461bcd60e51b815260206004820152600d60248201526c6e6f742074686520707269636560981b60448201526064015b60405180910390fd5b6003546001600160a01b03166108fc600a6101a0476007610d7a565b6101aa9190610d91565b6040518115909202916000818181858888f193505050501580156101d2573d6000803e3d6000fd5b50336000908152600160205260408120805460ff16916101f183610db3565b91906101000a81548160ff021916908360ff1602179055005b600080fd5b34801561021b57600080fd5b5061022f61022a366004610dd2565b61053b565b60405190151581526020015b60405180910390f35b34801561025057600080fd5b5061026461025f366004610e18565b610572565b005b34801561027257600080fd5b50610280655af3107a400081565b60405190815260200161023b565b34801561029a57600080fd5b506102807fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc7781565b3480156102ce57600080fd5b506102806102dd366004610e44565b60009081526020819052604090206001015490565b3480156102fe57600080fd5b5061026461030d366004610e5d565b6106cb565b34801561031e57600080fd5b5061026461032d366004610e5d565b6106f0565b34801561033e57600080fd5b50610264610728565b34801561035357600080fd5b50600454610367906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b34801561038b57600080fd5b5061026461039a366004610e8d565b6107cd565b3480156103ab57600080fd5b506102807f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a81565b3480156103df57600080fd5b506102646103ee366004610eaa565b61089b565b3480156103ff57600080fd5b5061026461040e366004610e44565b610b62565b34801561041f57600080fd5b5061022f61042e366004610e5d565b610b73565b34801561043f57600080fd5b5061046361044e366004610e8d565b60016020526000908152604090205460ff1681565b60405160ff909116815260200161023b565b34801561048157600080fd5b5061028060025481565b34801561049757600080fd5b50610280600081565b3480156104ac57600080fd5b506102646104bb366004610e8d565b610b9c565b3480156104cc57600080fd5b506102646104db366004610e5d565b610bca565b3480156104ec57600080fd5b506102646104fb366004610e8d565b610bef565b34801561050c57600080fd5b5061028066b1a2bc2ec5000081565b34801561052757600080fd5b50600354610367906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061056c57506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a61059c81610c1d565b6040516370a0823160e01b815230600482015282906001600160a01b038516906370a0823190602401602060405180830381865afa1580156105e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106069190610eeb565b10156106545760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e6365000000000000604482015260640161017b565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af11580156106a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106c59190610f04565b50505050565b6000828152602081905260409020600101546106e681610c1d565b6106c58383610c2a565b6001600160a01b03811633146107195760405163334bd91960e11b815260040160405180910390fd5b6107238282610cbc565b505050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a61075281610c1d565b47806107a05760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74204d415449432062616c616e6365000000000000604482015260640161017b565b604051339082156108fc029083906000818181858888f19350505050158015610723573d6000803e3d6000fd5b7fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc776107f781610c1d565b6001600160a01b03821660009081526001602052604090205460ff166108575760405162461bcd60e51b8152602060048201526015602482015274155cd95c881b9bdd081a5b881dda1a5d195b1a5cdd605a1b604482015260640161017b565b6001600160a01b0382166000908152600160205260408120805460ff169161087e83610f26565b91906101000a81548160ff021916908360ff160217905550505050565b7fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc776108c581610c1d565b6040516370a0823160e01b815230600482015260009060649084906001600160a01b038816906370a0823190602401602060405180830381865afa158015610911573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109359190610eeb565b61093f9190610d7a565b6109499190610d91565b90506000811161099b5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e6365000000000000604482015260640161017b565b60405163095ea7b360e01b815273edf6066a2b290c185783862c7f4776a2c8077ad16004820152602481018290526001600160a01b0386169063095ea7b3906044016020604051808303816000875af11580156109fc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a209190610f04565b610a645760405162461bcd60e51b8152602060048201526015602482015274151bdad95b88185c1c1c9bdd985b0819985a5b1959605a1b604482015260640161017b565b6040805160028082526060820183526000926020830190803683370190505090508581600081518110610a9957610a99610f59565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600181518110610acd57610acd610f59565b6001600160a01b039283166020918202929092010152600480546040516338ed173960e01b81529216916338ed173991610b1291869160009187913091429101610f6f565b6000604051808303816000875af1158015610b31573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b599190810190610fe0565b50505050505050565b6000610b6d81610c1d565b50600255565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610ba781610c1d565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154610be581610c1d565b6106c58383610cbc565b6000610bfa81610c1d565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b610c278133610d27565b50565b6000610c368383610b73565b610cb4576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610c6c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a450600161056c565b50600061056c565b6000610cc88383610b73565b15610cb4576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a450600161056c565b610d318282610b73565b610d605760405163e2517d3f60e01b81526001600160a01b03821660048201526024810183905260440161017b565b5050565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761056c5761056c610d64565b600082610dae57634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff8103610dc957610dc9610d64565b60010192915050565b600060208284031215610de457600080fd5b81356001600160e01b031981168114610dfc57600080fd5b9392505050565b6001600160a01b0381168114610c2757600080fd5b60008060408385031215610e2b57600080fd5b8235610e3681610e03565b946020939093013593505050565b600060208284031215610e5657600080fd5b5035919050565b60008060408385031215610e7057600080fd5b823591506020830135610e8281610e03565b809150509250929050565b600060208284031215610e9f57600080fd5b8135610dfc81610e03565b600080600060608486031215610ebf57600080fd5b8335610eca81610e03565b92506020840135610eda81610e03565b929592945050506040919091013590565b600060208284031215610efd57600080fd5b5051919050565b600060208284031215610f1657600080fd5b81518015158114610dfc57600080fd5b600060ff821680610f3957610f39610d64565b6000190192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015610fbf5784516001600160a01b031683529383019391830191600101610f9a565b50506001600160a01b03969096166060850152505050608001529392505050565b60006020808385031215610ff357600080fd5b825167ffffffffffffffff8082111561100b57600080fd5b818501915085601f83011261101f57600080fd5b81518181111561103157611031610f43565b8060051b604051601f19603f8301168101818110858211171561105657611056610f43565b60405291825284820192508381018501918883111561107457600080fd5b938501935b8285101561109257845184529385019392850192611079565b9897505050505050505056fea26469706673582212209a9f10aeec1e82d8693e4a94ca4efac2fb6abce810df273e3c8a95cb6819ee2d64736f6c63430008140033", + "numDeployments": 3, + "solcInputHash": "7709e522efdbc4a6c4a31d07a818c8c5", + "metadata": "{\"compiler\":{\"version\":\"0.8.20+commit.a1b79de6\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AccessControlBadConfirmation\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"neededRole\",\"type\":\"bytes32\"}],\"name\":\"AccessControlUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"Approved\",\"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\":\"SERVER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"TREASURE_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenB\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"percent\",\"type\":\"uint256\"}],\"name\":\"_swapTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approveToken\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"decWhitelist\",\"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\":\"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\":[],\"name\":\"price\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceOP\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"priceZK\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"callerConfirmation\",\"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\":[],\"name\":\"server\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_price\",\"type\":\"uint256\"}],\"name\":\"setPrice\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_server\",\"type\":\"address\"}],\"name\":\"setServer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"_uniswapRouter\",\"type\":\"address\"}],\"name\":\"setUniswapRouter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"uniswapRouter\",\"outputs\":[{\"internalType\":\"contract IUniswapV2Router02\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"whitelist\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawTokens\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"AccessControlBadConfirmation()\":[{\"details\":\"The caller of a function is not the expected one. NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\"}],\"AccessControlUnauthorizedAccount(address,bytes32)\":[{\"details\":\"The `account` is missing a role.\"}]},\"events\":{\"RoleAdminChanged(bytes32,bytes32,bytes32)\":{\"details\":\"Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite {RoleAdminChanged} not being emitted signaling this.\"},\"RoleGranted(bytes32,address,address)\":{\"details\":\"Emitted when `account` is granted `role`. `sender` is the account that originated the contract call, an admin role bearer except when using {AccessControl-_setupRole}.\"},\"RoleRevoked(bytes32,address,address)\":{\"details\":\"Emitted when `account` is revoked `role`. `sender` is the account that originated the contract call: - if using `revokeRole`, it is the admin role bearer - if using `renounceRole`, it is the role bearer (i.e. `account`)\"}},\"kind\":\"dev\",\"methods\":{\"_swapTokens(address,address,address,uint256)\":{\"details\":\"This function checks the balance of tokenA, approves the Uniswap router to spend it, and executes the swap for tokenB.\",\"params\":{\"percent\":\"The amount of tokenA to swap.\",\"tokenA\":\"The address of the token being swapped from.\",\"tokenB\":\"The address of the token being swapped to.\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `callerConfirmation`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"setPrice(uint256)\":{\"params\":{\"_price\":\"The new price to set.\"}},\"setUniswapRouter(address)\":{\"params\":{\"_uniswapRouter\":\"The new Uniswap router address.\"}},\"supportsInterface(bytes4)\":{\"details\":\"See {IERC165-supportsInterface}.\"},\"withdrawTokens(address,uint256)\":{\"params\":{\"amount\":\"The amount of tokens to withdraw\",\"token\":\"The address of the token to withdraw (USDT or USDC)\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"_swapTokens(address,address,address,uint256)\":{\"notice\":\"Performs a token swap between two ERC20 tokens.\"},\"setPrice(uint256)\":{\"notice\":\"Sets the price.\"},\"setUniswapRouter(address)\":{\"notice\":\"Sets the Uniswap router address.\"},\"withdrawTokens(address,uint256)\":{\"notice\":\"Withdraws USDT or USDC from the contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/AIC2.sol\":\"AIC2\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IAccessControl} from \\\"./IAccessControl.sol\\\";\\nimport {Context} from \\\"../utils/Context.sol\\\";\\nimport {ERC165} from \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```solidity\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```solidity\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\\n * to enforce additional security measures for this role.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address account => bool) hasRole;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 role => 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 an {AccessControlUnauthorizedAccount} error including the required role.\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\\n return _roles[role].hasRole[account];\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\\n * is missing `role`.\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert AccessControlUnauthorizedAccount(account, role);\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\\n if (callerConfirmation != _msgSender()) {\\n revert AccessControlBadConfirmation();\\n }\\n\\n _revokeRole(role, callerConfirmation);\\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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (!hasRole(role, account)) {\\n _roles[role].hasRole[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\\n if (hasRole(role, account)) {\\n _roles[role].hasRole[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa0e92d42942f4f57c5be50568dac11e9d00c93efcb458026e18d2d9b9b2e7308\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev The `account` is missing a role.\\n */\\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\\n\\n /**\\n * @dev The caller of a function is not the expected one.\\n *\\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\\n */\\n error AccessControlBadConfirmation();\\n\\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 event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `callerConfirmation`.\\n */\\n function renounceRole(bytes32 role, address callerConfirmation) external;\\n}\\n\",\"keccak256\":\"0xb6b36edd6a2999fd243ff226d6cbf84bd71af2432bbd0dfe19392996a1d9cb41\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/Ownable.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 {Context} from \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * 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 Ownable is Context {\\n address private _owner;\\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 constructor(address initialOwner) {\\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 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 address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xff6d0bb2e285473e5311d9d3caacb525ae3538a80758c10649a4d61029b017bb\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.20;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the 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\",\"keccak256\":\"0xc6a8ff0ea489379b61faa647490411b80102578440ab9d84e9a957cc12164e70\",\"license\":\"MIT\"},\"@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\",\"keccak256\":\"0x493033a8d1b176a037b2cc6a04dad01a5c157722049bbecf632ca876224dd4b2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.20;\\n\\nimport {IERC165} from \\\"./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 */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0x9e8778b14317ba9e256c30a76fd6c32b960af621987f56069e1e819c77c6a133\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.20;\\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\",\"keccak256\":\"0x4296879f55019b23e135000eb36896057e7101fb7fb859c5ef690cf14643757b\",\"license\":\"MIT\"},\"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol\":{\"content\":\"pragma solidity >=0.6.2;\\n\\ninterface IUniswapV2Router01 {\\n function factory() external pure returns (address);\\n function WETH() external pure returns (address);\\n\\n function addLiquidity(\\n address tokenA,\\n address tokenB,\\n uint amountADesired,\\n uint amountBDesired,\\n uint amountAMin,\\n uint amountBMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountA, uint amountB, uint liquidity);\\n function addLiquidityETH(\\n address token,\\n uint amountTokenDesired,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline\\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\\n function removeLiquidity(\\n address tokenA,\\n address tokenB,\\n uint liquidity,\\n uint amountAMin,\\n uint amountBMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountA, uint amountB);\\n function removeLiquidityETH(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountToken, uint amountETH);\\n function removeLiquidityWithPermit(\\n address tokenA,\\n address tokenB,\\n uint liquidity,\\n uint amountAMin,\\n uint amountBMin,\\n address to,\\n uint deadline,\\n bool approveMax, uint8 v, bytes32 r, bytes32 s\\n ) external returns (uint amountA, uint amountB);\\n function removeLiquidityETHWithPermit(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline,\\n bool approveMax, uint8 v, bytes32 r, bytes32 s\\n ) external returns (uint amountToken, uint amountETH);\\n function swapExactTokensForTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n function swapTokensForExactTokens(\\n uint amountOut,\\n uint amountInMax,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external returns (uint[] memory amounts);\\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\\n external\\n payable\\n returns (uint[] memory amounts);\\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\\n external\\n returns (uint[] memory amounts);\\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\\n external\\n returns (uint[] memory amounts);\\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\\n external\\n payable\\n returns (uint[] memory amounts);\\n\\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\\n}\\n\",\"keccak256\":\"0x8a3c5c449d4b7cd76513ed6995f4b86e4a86f222c770f8442f5fc128ce29b4d2\"},\"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\":{\"content\":\"pragma solidity >=0.6.2;\\n\\nimport './IUniswapV2Router01.sol';\\n\\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\\n function removeLiquidityETHSupportingFeeOnTransferTokens(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline\\n ) external returns (uint amountETH);\\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\\n address token,\\n uint liquidity,\\n uint amountTokenMin,\\n uint amountETHMin,\\n address to,\\n uint deadline,\\n bool approveMax, uint8 v, bytes32 r, bytes32 s\\n ) external returns (uint amountETH);\\n\\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external;\\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external payable;\\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\\n uint amountIn,\\n uint amountOutMin,\\n address[] calldata path,\\n address to,\\n uint deadline\\n ) external;\\n}\\n\",\"keccak256\":\"0x744e30c133bd0f7ca9e7163433cf6d72f45c6bb1508c2c9c02f1a6db796ae59d\"},\"contracts/AIC2.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\nimport { AccessControl } from \\\"@openzeppelin/contracts/access/AccessControl.sol\\\";\\nimport \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\nimport \\\"@openzeppelin/contracts/access/Ownable.sol\\\";\\nimport \\\"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\\\";\\n\\n//https://youtu.be/TLsy8Hjt_JY\\n// Polygon Deployment = 0x8163E0022C8f4b94afBDacB16398d47aAaEF0653\\n// https://polygonscan.com/address/0x8163E0022C8f4b94afBDacB16398d47aAaEF0653#code => verified\\n//video = https://www.youtube.com/watch?v=TLsy8Hjt_JY\\n/*\\n // Token addresses on Polygon mainnet\\n address public constant USDT = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F; //ok\\n address public constant USDC = 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359;//ok\\n*/\\ncontract AIC2 is AccessControl {\\n mapping(address => uint8) public whitelist;\\n bytes32 public constant SERVER_ROLE = keccak256(\\\"SERVER_ROLE\\\");\\n bytes32 public constant TREASURE_ROLE = keccak256(\\\"TREASURE_ROLE\\\");\\n uint256 public constant priceZK = 0.05 ether; // change prices\\n uint256 public constant priceOP = 0.0001 ether; // change prices\\n uint256 public price;\\n address public server;\\n\\n address private constant UNISWAP_V2_ROUTER = 0xedf6066a2b290C185783862C7F4776A2C8077AD1;\\n IUniswapV2Router02 public uniswapRouter;\\n\\n event Approved(address indexed token, address indexed spender, uint256 amount);\\n\\n constructor() {\\n uniswapRouter = IUniswapV2Router02(UNISWAP_V2_ROUTER);\\n if (block.chainid == 324) {\\n price = priceZK;\\n } else {\\n price = priceOP;\\n }\\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\\n _grantRole(SERVER_ROLE, msg.sender);\\n _grantRole(TREASURE_ROLE, msg.sender);\\n }\\n\\n function decWhitelist(address user) external onlyRole(SERVER_ROLE) {}\\n\\n function withdraw() external onlyRole(TREASURE_ROLE) {\\n uint256 amount = address(this).balance;\\n require(amount > 0, \\\"Insufficient MATIC balance\\\");\\n payable(msg.sender).transfer(amount);\\n }\\n\\n function setServer(address _server) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n server = _server;\\n }\\n\\n ///@notice Performs a token swap between two ERC20 tokens.\\n ///@dev This function checks the balance of tokenA, approves the Uniswap router to spend it,\\n /// and executes the swap for tokenB.\\n ///@param tokenA The address of the token being swapped from.\\n ///@param tokenB The address of the token being swapped to.\\n ///@param percent The amount of tokenA to swap.\\n function _swapTokens(address sender, address tokenA, address tokenB, uint256 percent) public onlyRole(SERVER_ROLE) {\\n require(whitelist[sender] > 0, \\\"sender not in whitelist\\\");\\n whitelist[sender]--;\\n uint256 amountIn = (IERC20(tokenA).balanceOf(address(this)) * percent) / 100;\\n require(amountIn > 0, \\\"Insufficient token balance\\\");\\n require(IERC20(tokenA).approve(UNISWAP_V2_ROUTER, amountIn), \\\"Token approval failed\\\");\\n emit Approved(tokenA, UNISWAP_V2_ROUTER, amountIn);\\n\\n address[] memory path = new address[](2);\\n path[0] = tokenA;\\n path[1] = tokenB;\\n\\n uniswapRouter.swapExactTokensForTokens(amountIn, 0, path, address(this), block.timestamp);\\n }\\n\\n function approveToken(address token, address spender, uint256 amount) external onlyRole(SERVER_ROLE) {\\n IERC20(token).approve(spender, amount);\\n emit Approved(token, spender, amount);\\n }\\n\\n ///@notice Withdraws USDT or USDC from the contract\\n ///@param token The address of the token to withdraw (USDT or USDC)\\n ///@param amount The amount of tokens to withdraw\\n function withdrawTokens(address token, uint256 amount) external onlyRole(TREASURE_ROLE) {\\n require(IERC20(token).balanceOf(address(this)) >= amount, \\\"Insufficient token balance\\\");\\n IERC20(token).transfer(msg.sender, amount);\\n }\\n\\n /// @notice Sets the price.\\n /// @param _price The new price to set.\\n function setPrice(uint256 _price) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n price = _price;\\n }\\n\\n /// @notice Sets the Uniswap router address.\\n /// @param _uniswapRouter The new Uniswap router address.\\n function setUniswapRouter(IUniswapV2Router02 _uniswapRouter) external onlyRole(DEFAULT_ADMIN_ROLE) {\\n uniswapRouter = _uniswapRouter;\\n }\\n\\n receive() external payable {\\n require(msg.value == price, \\\"not the price\\\");\\n payable(server).transfer((7 * address(this).balance) / 10);\\n whitelist[msg.sender]++;\\n }\\n}\\n\",\"keccak256\":\"0x8db73c480cc66ce83074692683974fbe75f667b1038bd9a97c35a2d1bca18d0a\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50600480546001600160a01b03191673edf6066a2b290c185783862c7f4776a2c8077ad117905546610144036100505766b1a2bc2ec5000060025561005b565b655af3107a40006002555b6100666000336100c2565b506100917fa8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc77336100c2565b506100bc7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a336100c2565b5061016e565b6000828152602081815260408083206001600160a01b038516845290915281205460ff16610164576000838152602081815260408083206001600160a01b03861684529091529020805460ff1916600117905561011c3390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610168565b5060005b92915050565b611276806200017e6000396000f3fe6080604052600436106101445760003560e01c80637f834097116100b6578063bea9849e1161006f578063bea9849e14610499578063d547741f146104b9578063da3e3397146104d9578063f19a0b54146104f9578063fc6a76cd14610519578063fd922a421461053457600080fd5b80637f834097146103b857806391b7f5ed146103ec57806391d148541461040c5780639b19251a1461042c578063a035b1fe1461046e578063a217fddf1461048457600080fd5b8063248a9ca311610108578063248a9ca3146102db5780632f2ff15d1461030b57806336568abe1461032b5780633ccfd60b1461034b578063735de9f7146103605780637d0e1cbb1461039857600080fd5b806301ffc9a71461021a57806306b091f91461024f5780630c0ed0a11461027157806318cf28341461029957806322ba5d57146102bb57600080fd5b3661021557600254341461018f5760405162461bcd60e51b815260206004820152600d60248201526c6e6f742074686520707269636560981b60448201526064015b60405180910390fd5b6003546001600160a01b03166108fc600a6101ab476007610eab565b6101b59190610ec2565b6040518115909202916000818181858888f193505050501580156101dd573d6000803e3d6000fd5b50336000908152600160205260408120805460ff16916101fc83610ee4565b91906101000a81548160ff021916908360ff1602179055005b600080fd5b34801561022657600080fd5b5061023a610235366004610f03565b610554565b60405190151581526020015b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004610f49565b61058b565b005b34801561027d57600080fd5b5061028b655af3107a400081565b604051908152602001610246565b3480156102a557600080fd5b5061028b60008051602061122183398151915281565b3480156102c757600080fd5b5061026f6102d6366004610f75565b6106e4565b3480156102e757600080fd5b5061028b6102f6366004610fc6565b60009081526020819052604090206001015490565b34801561031757600080fd5b5061026f610326366004610fdf565b610a9a565b34801561033757600080fd5b5061026f610346366004610fdf565b610abf565b34801561035757600080fd5b5061026f610af7565b34801561036c57600080fd5b50600454610380906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156103a457600080fd5b5061026f6103b336600461100f565b610b9c565b3480156103c457600080fd5b5061028b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a81565b3480156103f857600080fd5b5061026f610407366004610fc6565b610bb8565b34801561041857600080fd5b5061023a610427366004610fdf565b610bc9565b34801561043857600080fd5b5061045c61044736600461100f565b60016020526000908152604090205460ff1681565b60405160ff9091168152602001610246565b34801561047a57600080fd5b5061028b60025481565b34801561049057600080fd5b5061028b600081565b3480156104a557600080fd5b5061026f6104b436600461100f565b610bf2565b3480156104c557600080fd5b5061026f6104d4366004610fdf565b610c20565b3480156104e557600080fd5b5061026f6104f436600461102c565b610c45565b34801561050557600080fd5b5061026f61051436600461100f565b610d24565b34801561052557600080fd5b5061028b66b1a2bc2ec5000081565b34801561054057600080fd5b50600354610380906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061058557506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a6105b581610d52565b6040516370a0823160e01b815230600482015282906001600160a01b038516906370a0823190602401602060405180830381865afa1580156105fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061f919061106d565b101561066d5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e63650000000000006044820152606401610186565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af11580156106ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106de9190611086565b50505050565b6000805160206112218339815191526106fc81610d52565b6001600160a01b03851660009081526001602052604090205460ff166107645760405162461bcd60e51b815260206004820152601760248201527f73656e646572206e6f7420696e2077686974656c6973740000000000000000006044820152606401610186565b6001600160a01b0385166000908152600160205260408120805460ff169161078b836110a8565b825460ff9182166101009390930a9283029190920219909116179055506040516370a0823160e01b815230600482015260009060649084906001600160a01b038816906370a0823190602401602060405180830381865afa1580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610818919061106d565b6108229190610eab565b61082c9190610ec2565b90506000811161087e5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e63650000000000006044820152606401610186565b60405163095ea7b360e01b815273edf6066a2b290c185783862c7f4776a2c8077ad16004820152602481018290526001600160a01b0386169063095ea7b3906044016020604051808303816000875af11580156108df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109039190611086565b6109475760405162461bcd60e51b8152602060048201526015602482015274151bdad95b88185c1c1c9bdd985b0819985a5b1959605a1b6044820152606401610186565b60405181815273edf6066a2b290c185783862c7f4776a2c8077ad1906001600160a01b038716907f80da462ebfbe41cfc9bc015e7a9a3c7a2a73dbccede72d8ceb583606c27f8f909060200160405180910390a360408051600280825260608201835260009260208301908036833701905050905085816000815181106109d0576109d06110db565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600181518110610a0457610a046110db565b6001600160a01b039283166020918202929092010152600480546040516338ed173960e01b81529216916338ed173991610a49918691600091879130914291016110f1565b6000604051808303816000875af1158015610a68573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a909190810190611162565b5050505050505050565b600082815260208190526040902060010154610ab581610d52565b6106de8383610d5f565b6001600160a01b0381163314610ae85760405163334bd91960e11b815260040160405180910390fd5b610af28282610df1565b505050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a610b2181610d52565b4780610b6f5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74204d415449432062616c616e63650000000000006044820152606401610186565b604051339082156108fc029083906000818181858888f19350505050158015610af2573d6000803e3d6000fd5b600080516020611221833981519152610bb481610d52565b5050565b6000610bc381610d52565b50600255565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610bfd81610d52565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154610c3b81610d52565b6106de8383610df1565b600080516020611221833981519152610c5d81610d52565b60405163095ea7b360e01b81526001600160a01b0384811660048301526024820184905285169063095ea7b3906044016020604051808303816000875af1158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190611086565b50826001600160a01b0316846001600160a01b03167f80da462ebfbe41cfc9bc015e7a9a3c7a2a73dbccede72d8ceb583606c27f8f9084604051610d1691815260200190565b60405180910390a350505050565b6000610d2f81610d52565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b610d5c8133610e5c565b50565b6000610d6b8383610bc9565b610de9576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610da13390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610585565b506000610585565b6000610dfd8383610bc9565b15610de9576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610585565b610e668282610bc9565b610bb45760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610186565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761058557610585610e95565b600082610edf57634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff8103610efa57610efa610e95565b60010192915050565b600060208284031215610f1557600080fd5b81356001600160e01b031981168114610f2d57600080fd5b9392505050565b6001600160a01b0381168114610d5c57600080fd5b60008060408385031215610f5c57600080fd5b8235610f6781610f34565b946020939093013593505050565b60008060008060808587031215610f8b57600080fd5b8435610f9681610f34565b93506020850135610fa681610f34565b92506040850135610fb681610f34565b9396929550929360600135925050565b600060208284031215610fd857600080fd5b5035919050565b60008060408385031215610ff257600080fd5b82359150602083013561100481610f34565b809150509250929050565b60006020828403121561102157600080fd5b8135610f2d81610f34565b60008060006060848603121561104157600080fd5b833561104c81610f34565b9250602084013561105c81610f34565b929592945050506040919091013590565b60006020828403121561107f57600080fd5b5051919050565b60006020828403121561109857600080fd5b81518015158114610f2d57600080fd5b600060ff8216806110bb576110bb610e95565b6000190192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156111415784516001600160a01b03168352938301939183019160010161111c565b50506001600160a01b03969096166060850152505050608001529392505050565b6000602080838503121561117557600080fd5b825167ffffffffffffffff8082111561118d57600080fd5b818501915085601f8301126111a157600080fd5b8151818111156111b3576111b36110c5565b8060051b604051601f19603f830116810181811085821117156111d8576111d86110c5565b6040529182528482019250838101850191888311156111f657600080fd5b938501935b82851015611214578451845293850193928501926111fb565b9897505050505050505056fea8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc77a26469706673582212201c03cbe8d8d238283d0973ff13931c9cbfaee0c75e9194155de6c20a72d9d4cb64736f6c63430008140033", + "deployedBytecode": "0x6080604052600436106101445760003560e01c80637f834097116100b6578063bea9849e1161006f578063bea9849e14610499578063d547741f146104b9578063da3e3397146104d9578063f19a0b54146104f9578063fc6a76cd14610519578063fd922a421461053457600080fd5b80637f834097146103b857806391b7f5ed146103ec57806391d148541461040c5780639b19251a1461042c578063a035b1fe1461046e578063a217fddf1461048457600080fd5b8063248a9ca311610108578063248a9ca3146102db5780632f2ff15d1461030b57806336568abe1461032b5780633ccfd60b1461034b578063735de9f7146103605780637d0e1cbb1461039857600080fd5b806301ffc9a71461021a57806306b091f91461024f5780630c0ed0a11461027157806318cf28341461029957806322ba5d57146102bb57600080fd5b3661021557600254341461018f5760405162461bcd60e51b815260206004820152600d60248201526c6e6f742074686520707269636560981b60448201526064015b60405180910390fd5b6003546001600160a01b03166108fc600a6101ab476007610eab565b6101b59190610ec2565b6040518115909202916000818181858888f193505050501580156101dd573d6000803e3d6000fd5b50336000908152600160205260408120805460ff16916101fc83610ee4565b91906101000a81548160ff021916908360ff1602179055005b600080fd5b34801561022657600080fd5b5061023a610235366004610f03565b610554565b60405190151581526020015b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004610f49565b61058b565b005b34801561027d57600080fd5b5061028b655af3107a400081565b604051908152602001610246565b3480156102a557600080fd5b5061028b60008051602061122183398151915281565b3480156102c757600080fd5b5061026f6102d6366004610f75565b6106e4565b3480156102e757600080fd5b5061028b6102f6366004610fc6565b60009081526020819052604090206001015490565b34801561031757600080fd5b5061026f610326366004610fdf565b610a9a565b34801561033757600080fd5b5061026f610346366004610fdf565b610abf565b34801561035757600080fd5b5061026f610af7565b34801561036c57600080fd5b50600454610380906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156103a457600080fd5b5061026f6103b336600461100f565b610b9c565b3480156103c457600080fd5b5061028b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a81565b3480156103f857600080fd5b5061026f610407366004610fc6565b610bb8565b34801561041857600080fd5b5061023a610427366004610fdf565b610bc9565b34801561043857600080fd5b5061045c61044736600461100f565b60016020526000908152604090205460ff1681565b60405160ff9091168152602001610246565b34801561047a57600080fd5b5061028b60025481565b34801561049057600080fd5b5061028b600081565b3480156104a557600080fd5b5061026f6104b436600461100f565b610bf2565b3480156104c557600080fd5b5061026f6104d4366004610fdf565b610c20565b3480156104e557600080fd5b5061026f6104f436600461102c565b610c45565b34801561050557600080fd5b5061026f61051436600461100f565b610d24565b34801561052557600080fd5b5061028b66b1a2bc2ec5000081565b34801561054057600080fd5b50600354610380906001600160a01b031681565b60006001600160e01b03198216637965db0b60e01b148061058557506301ffc9a760e01b6001600160e01b03198316145b92915050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a6105b581610d52565b6040516370a0823160e01b815230600482015282906001600160a01b038516906370a0823190602401602060405180830381865afa1580156105fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061f919061106d565b101561066d5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e63650000000000006044820152606401610186565b60405163a9059cbb60e01b8152336004820152602481018390526001600160a01b0384169063a9059cbb906044016020604051808303816000875af11580156106ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106de9190611086565b50505050565b6000805160206112218339815191526106fc81610d52565b6001600160a01b03851660009081526001602052604090205460ff166107645760405162461bcd60e51b815260206004820152601760248201527f73656e646572206e6f7420696e2077686974656c6973740000000000000000006044820152606401610186565b6001600160a01b0385166000908152600160205260408120805460ff169161078b836110a8565b825460ff9182166101009390930a9283029190920219909116179055506040516370a0823160e01b815230600482015260009060649084906001600160a01b038816906370a0823190602401602060405180830381865afa1580156107f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610818919061106d565b6108229190610eab565b61082c9190610ec2565b90506000811161087e5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e7420746f6b656e2062616c616e63650000000000006044820152606401610186565b60405163095ea7b360e01b815273edf6066a2b290c185783862c7f4776a2c8077ad16004820152602481018290526001600160a01b0386169063095ea7b3906044016020604051808303816000875af11580156108df573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109039190611086565b6109475760405162461bcd60e51b8152602060048201526015602482015274151bdad95b88185c1c1c9bdd985b0819985a5b1959605a1b6044820152606401610186565b60405181815273edf6066a2b290c185783862c7f4776a2c8077ad1906001600160a01b038716907f80da462ebfbe41cfc9bc015e7a9a3c7a2a73dbccede72d8ceb583606c27f8f909060200160405180910390a360408051600280825260608201835260009260208301908036833701905050905085816000815181106109d0576109d06110db565b60200260200101906001600160a01b031690816001600160a01b0316815250508481600181518110610a0457610a046110db565b6001600160a01b039283166020918202929092010152600480546040516338ed173960e01b81529216916338ed173991610a49918691600091879130914291016110f1565b6000604051808303816000875af1158015610a68573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a909190810190611162565b5050505050505050565b600082815260208190526040902060010154610ab581610d52565b6106de8383610d5f565b6001600160a01b0381163314610ae85760405163334bd91960e11b815260040160405180910390fd5b610af28282610df1565b505050565b7f067480c53f9603ecfd957b375116b3dc33a34aeb0454caeb7e1e40e1dbd9997a610b2181610d52565b4780610b6f5760405162461bcd60e51b815260206004820152601a60248201527f496e73756666696369656e74204d415449432062616c616e63650000000000006044820152606401610186565b604051339082156108fc029083906000818181858888f19350505050158015610af2573d6000803e3d6000fd5b600080516020611221833981519152610bb481610d52565b5050565b6000610bc381610d52565b50600255565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610bfd81610d52565b50600480546001600160a01b0319166001600160a01b0392909216919091179055565b600082815260208190526040902060010154610c3b81610d52565b6106de8383610df1565b600080516020611221833981519152610c5d81610d52565b60405163095ea7b360e01b81526001600160a01b0384811660048301526024820184905285169063095ea7b3906044016020604051808303816000875af1158015610cac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd09190611086565b50826001600160a01b0316846001600160a01b03167f80da462ebfbe41cfc9bc015e7a9a3c7a2a73dbccede72d8ceb583606c27f8f9084604051610d1691815260200190565b60405180910390a350505050565b6000610d2f81610d52565b50600380546001600160a01b0319166001600160a01b0392909216919091179055565b610d5c8133610e5c565b50565b6000610d6b8383610bc9565b610de9576000838152602081815260408083206001600160a01b03861684529091529020805460ff19166001179055610da13390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a4506001610585565b506000610585565b6000610dfd8383610bc9565b15610de9576000838152602081815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a4506001610585565b610e668282610bc9565b610bb45760405163e2517d3f60e01b81526001600160a01b038216600482015260248101839052604401610186565b634e487b7160e01b600052601160045260246000fd5b808202811582820484141761058557610585610e95565b600082610edf57634e487b7160e01b600052601260045260246000fd5b500490565b600060ff821660ff8103610efa57610efa610e95565b60010192915050565b600060208284031215610f1557600080fd5b81356001600160e01b031981168114610f2d57600080fd5b9392505050565b6001600160a01b0381168114610d5c57600080fd5b60008060408385031215610f5c57600080fd5b8235610f6781610f34565b946020939093013593505050565b60008060008060808587031215610f8b57600080fd5b8435610f9681610f34565b93506020850135610fa681610f34565b92506040850135610fb681610f34565b9396929550929360600135925050565b600060208284031215610fd857600080fd5b5035919050565b60008060408385031215610ff257600080fd5b82359150602083013561100481610f34565b809150509250929050565b60006020828403121561102157600080fd5b8135610f2d81610f34565b60008060006060848603121561104157600080fd5b833561104c81610f34565b9250602084013561105c81610f34565b929592945050506040919091013590565b60006020828403121561107f57600080fd5b5051919050565b60006020828403121561109857600080fd5b81518015158114610f2d57600080fd5b600060ff8216806110bb576110bb610e95565b6000190192915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156111415784516001600160a01b03168352938301939183019160010161111c565b50506001600160a01b03969096166060850152505050608001529392505050565b6000602080838503121561117557600080fd5b825167ffffffffffffffff8082111561118d57600080fd5b818501915085601f8301126111a157600080fd5b8151818111156111b3576111b36110c5565b8060051b604051601f19603f830116810181811085821117156111d8576111d86110c5565b6040529182528482019250838101850191888311156111f657600080fd5b938501935b82851015611214578451845293850193928501926111fb565b9897505050505050505056fea8a7bc421f721cb936ea99efdad79237e6ee0b871a2a08cf648691f9584cdc77a26469706673582212201c03cbe8d8d238283d0973ff13931c9cbfaee0c75e9194155de6c20a72d9d4cb64736f6c63430008140033", "devdoc": { "errors": { "AccessControlBadConfirmation()": [ @@ -565,7 +593,7 @@ }, "kind": "dev", "methods": { - "_swapTokens(address,address,uint256)": { + "_swapTokens(address,address,address,uint256)": { "details": "This function checks the balance of tokenA, approves the Uniswap router to spend it, and executes the swap for tokenB.", "params": { "percent": "The amount of tokenA to swap.", @@ -613,7 +641,7 @@ "userdoc": { "kind": "user", "methods": { - "_swapTokens(address,address,uint256)": { + "_swapTokens(address,address,address,uint256)": { "notice": "Performs a token swap between two ERC20 tokens." }, "setPrice(uint256)": { diff --git a/packages/hardhat/deployments/optimism/solcInputs/7709e522efdbc4a6c4a31d07a818c8c5.json b/packages/hardhat/deployments/optimism/solcInputs/7709e522efdbc4a6c4a31d07a818c8c5.json new file mode 100644 index 0000000..50a0cd6 --- /dev/null +++ b/packages/hardhat/deployments/optimism/solcInputs/7709e522efdbc4a6c4a31d07a818c8c5.json @@ -0,0 +1,63 @@ +{ + "language": "Solidity", + "sources": { + "@openzeppelin/contracts/access/AccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.20;\n\nimport {IAccessControl} from \"./IAccessControl.sol\";\nimport {Context} from \"../utils/Context.sol\";\nimport {ERC165} from \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```solidity\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```solidity\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}\n * to enforce additional security measures for this role.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address account => bool) hasRole;\n bytes32 adminRole;\n }\n\n mapping(bytes32 role => 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 an {AccessControlUnauthorizedAccount} error including the required role.\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual returns (bool) {\n return _roles[role].hasRole[account];\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`\n * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`\n * is missing `role`.\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert AccessControlUnauthorizedAccount(account, role);\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address callerConfirmation) public virtual {\n if (callerConfirmation != _msgSender()) {\n revert AccessControlBadConfirmation();\n }\n\n _revokeRole(role, callerConfirmation);\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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual returns (bool) {\n if (!hasRole(role, account)) {\n _roles[role].hasRole[account] = true;\n emit RoleGranted(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {\n if (hasRole(role, account)) {\n _roles[role].hasRole[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n return true;\n } else {\n return false;\n }\n }\n}\n" + }, + "@openzeppelin/contracts/access/IAccessControl.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev The `account` is missing a role.\n */\n error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);\n\n /**\n * @dev The caller of a function is not the expected one.\n *\n * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.\n */\n error AccessControlBadConfirmation();\n\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 event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `callerConfirmation`.\n */\n function renounceRole(bytes32 role, address callerConfirmation) external;\n}\n" + }, + "@openzeppelin/contracts/access/Ownable.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 {Context} from \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * 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 Ownable is Context {\n address private _owner;\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 constructor(address initialOwner) {\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 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 address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" + }, + "@openzeppelin/contracts/token/ERC20/IERC20.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)\n\npragma solidity ^0.8.20;\n\n/**\n * @dev Interface of the ERC20 standard as defined in the EIP.\n */\ninterface IERC20 {\n /**\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\n * another (`to`).\n *\n * Note that `value` may be zero.\n */\n event Transfer(address indexed from, address indexed to, uint256 value);\n\n /**\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\n * a call to {approve}. `value` is the new allowance.\n */\n event Approval(address indexed owner, address indexed spender, uint256 value);\n\n /**\n * @dev Returns the 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/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/introspection/ERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.20;\n\nimport {IERC165} from \"./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 */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" + }, + "@openzeppelin/contracts/utils/introspection/IERC165.sol": { + "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.20;\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" + }, + "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol": { + "content": "pragma solidity >=0.6.2;\n\ninterface IUniswapV2Router01 {\n function factory() external pure returns (address);\n function WETH() external pure returns (address);\n\n function addLiquidity(\n address tokenA,\n address tokenB,\n uint amountADesired,\n uint amountBDesired,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB, uint liquidity);\n function addLiquidityETH(\n address token,\n uint amountTokenDesired,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external payable returns (uint amountToken, uint amountETH, uint liquidity);\n function removeLiquidity(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETH(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountToken, uint amountETH);\n function removeLiquidityWithPermit(\n address tokenA,\n address tokenB,\n uint liquidity,\n uint amountAMin,\n uint amountBMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountA, uint amountB);\n function removeLiquidityETHWithPermit(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountToken, uint amountETH);\n function swapExactTokensForTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapTokensForExactTokens(\n uint amountOut,\n uint amountInMax,\n address[] calldata path,\n address to,\n uint deadline\n ) external returns (uint[] memory amounts);\n function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)\n external\n returns (uint[] memory amounts);\n function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)\n external\n payable\n returns (uint[] memory amounts);\n\n function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);\n function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);\n function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);\n function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);\n function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);\n}\n" + }, + "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol": { + "content": "pragma solidity >=0.6.2;\n\nimport './IUniswapV2Router01.sol';\n\ninterface IUniswapV2Router02 is IUniswapV2Router01 {\n function removeLiquidityETHSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline\n ) external returns (uint amountETH);\n function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(\n address token,\n uint liquidity,\n uint amountTokenMin,\n uint amountETHMin,\n address to,\n uint deadline,\n bool approveMax, uint8 v, bytes32 r, bytes32 s\n ) external returns (uint amountETH);\n\n function swapExactTokensForTokensSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n function swapExactETHForTokensSupportingFeeOnTransferTokens(\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external payable;\n function swapExactTokensForETHSupportingFeeOnTransferTokens(\n uint amountIn,\n uint amountOutMin,\n address[] calldata path,\n address to,\n uint deadline\n ) external;\n}\n" + }, + "contracts/AIC2.sol": { + "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\nimport { AccessControl } from \"@openzeppelin/contracts/access/AccessControl.sol\";\nimport \"@openzeppelin/contracts/token/ERC20/IERC20.sol\";\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol\";\n\n//https://youtu.be/TLsy8Hjt_JY\n// Polygon Deployment = 0x8163E0022C8f4b94afBDacB16398d47aAaEF0653\n// https://polygonscan.com/address/0x8163E0022C8f4b94afBDacB16398d47aAaEF0653#code => verified\n//video = https://www.youtube.com/watch?v=TLsy8Hjt_JY\n/*\n // Token addresses on Polygon mainnet\n address public constant USDT = 0xc2132D05D31c914a87C6611C10748AEb04B58e8F; //ok\n address public constant USDC = 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359;//ok\n*/\ncontract AIC2 is AccessControl {\n mapping(address => uint8) public whitelist;\n bytes32 public constant SERVER_ROLE = keccak256(\"SERVER_ROLE\");\n bytes32 public constant TREASURE_ROLE = keccak256(\"TREASURE_ROLE\");\n uint256 public constant priceZK = 0.05 ether; // change prices\n uint256 public constant priceOP = 0.0001 ether; // change prices\n uint256 public price;\n address public server;\n\n address private constant UNISWAP_V2_ROUTER = 0xedf6066a2b290C185783862C7F4776A2C8077AD1;\n IUniswapV2Router02 public uniswapRouter;\n\n event Approved(address indexed token, address indexed spender, uint256 amount);\n\n constructor() {\n uniswapRouter = IUniswapV2Router02(UNISWAP_V2_ROUTER);\n if (block.chainid == 324) {\n price = priceZK;\n } else {\n price = priceOP;\n }\n _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);\n _grantRole(SERVER_ROLE, msg.sender);\n _grantRole(TREASURE_ROLE, msg.sender);\n }\n\n function decWhitelist(address user) external onlyRole(SERVER_ROLE) {}\n\n function withdraw() external onlyRole(TREASURE_ROLE) {\n uint256 amount = address(this).balance;\n require(amount > 0, \"Insufficient MATIC balance\");\n payable(msg.sender).transfer(amount);\n }\n\n function setServer(address _server) external onlyRole(DEFAULT_ADMIN_ROLE) {\n server = _server;\n }\n\n ///@notice Performs a token swap between two ERC20 tokens.\n ///@dev This function checks the balance of tokenA, approves the Uniswap router to spend it,\n /// and executes the swap for tokenB.\n ///@param tokenA The address of the token being swapped from.\n ///@param tokenB The address of the token being swapped to.\n ///@param percent The amount of tokenA to swap.\n function _swapTokens(address sender, address tokenA, address tokenB, uint256 percent) public onlyRole(SERVER_ROLE) {\n require(whitelist[sender] > 0, \"sender not in whitelist\");\n whitelist[sender]--;\n uint256 amountIn = (IERC20(tokenA).balanceOf(address(this)) * percent) / 100;\n require(amountIn > 0, \"Insufficient token balance\");\n require(IERC20(tokenA).approve(UNISWAP_V2_ROUTER, amountIn), \"Token approval failed\");\n emit Approved(tokenA, UNISWAP_V2_ROUTER, amountIn);\n\n address[] memory path = new address[](2);\n path[0] = tokenA;\n path[1] = tokenB;\n\n uniswapRouter.swapExactTokensForTokens(amountIn, 0, path, address(this), block.timestamp);\n }\n\n function approveToken(address token, address spender, uint256 amount) external onlyRole(SERVER_ROLE) {\n IERC20(token).approve(spender, amount);\n emit Approved(token, spender, amount);\n }\n\n ///@notice Withdraws USDT or USDC from the contract\n ///@param token The address of the token to withdraw (USDT or USDC)\n ///@param amount The amount of tokens to withdraw\n function withdrawTokens(address token, uint256 amount) external onlyRole(TREASURE_ROLE) {\n require(IERC20(token).balanceOf(address(this)) >= amount, \"Insufficient token balance\");\n IERC20(token).transfer(msg.sender, amount);\n }\n\n /// @notice Sets the price.\n /// @param _price The new price to set.\n function setPrice(uint256 _price) external onlyRole(DEFAULT_ADMIN_ROLE) {\n price = _price;\n }\n\n /// @notice Sets the Uniswap router address.\n /// @param _uniswapRouter The new Uniswap router address.\n function setUniswapRouter(IUniswapV2Router02 _uniswapRouter) external onlyRole(DEFAULT_ADMIN_ROLE) {\n uniswapRouter = _uniswapRouter;\n }\n\n receive() external payable {\n require(msg.value == price, \"not the price\");\n payable(server).transfer((7 * address(this).balance) / 10);\n whitelist[msg.sender]++;\n }\n}\n" + } + }, + "settings": { + "optimizer": { + "enabled": true, + "runs": 200 + }, + "evmVersion": "paris", + "outputSelection": { + "*": { + "*": [ + "abi", + "evm.bytecode", + "evm.deployedBytecode", + "evm.methodIdentifiers", + "metadata", + "devdoc", + "userdoc", + "storageLayout", + "evm.gasEstimates" + ], + "": [ + "ast" + ] + } + }, + "metadata": { + "useLiteralContent": true + } + } +} \ No newline at end of file diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 1840c36..2c30fbb 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { 10: { AIC2: { - address: "0x9fB375a62ACfC6b30199092283A8eea996138c1a", + address: "0xb13b7A60C88e1Ba2a204423aB420C60ACBA62c53", abi: [ { inputs: [], @@ -176,6 +176,11 @@ const deployedContracts = { }, { inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, { internalType: "address", name: "tokenA", @@ -197,6 +202,29 @@ const deployedContracts = { stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "approveToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ {