// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "forge-std/Test.sol";
import "../../contracts/registry/UniversalAssetRegistry.sol";
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

contract AccessControlSecurityTest is Test {
    UniversalAssetRegistry public registry;
    address public admin;
    address public attacker;
    
    function setUp() public {
        admin = makeAddr("admin");
        attacker = makeAddr("attacker");
        
        vm.startPrank(admin);
        UniversalAssetRegistry impl = new UniversalAssetRegistry();
        bytes memory initData = abi.encodeWithSelector(UniversalAssetRegistry.initialize.selector, admin);
        ERC1967Proxy proxy = new ERC1967Proxy(address(impl), initData);
        registry = UniversalAssetRegistry(address(proxy));
        vm.stopPrank();
    }

    function testCannotProposeWithoutRole() public {
        vm.startPrank(attacker);
        vm.expectRevert();
        registry.proposeAsset(
            makeAddr("token"),
            UniversalAssetRegistry.AssetType.ERC20Standard,
            UniversalAssetRegistry.ComplianceLevel.Public,
            "Test", "TST", 18, "US", 50, 1e15, 1000000e18
        );
        vm.stopPrank();
    }
}
