agentsclimarketplace

Ownership powers

Skill ZerodriftSec/xlayer-trust-gate/skills/xlayer-trust-review/evm-specialists/ownership-powers

XLayer Trust Gate demo and research project.

Install
npx -y skills add ZerodriftSec/xlayer-trust-gate --skill ownership-powers

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

EVM ownership and powers specialist. Detects admin/owner/guardian role concentration, privilege escalation, missing multisig protection, and governance/authorization issues in XLayer/EVM contracts. Use when analyzing Solidity contracts for ownership and privilege risks.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

9.4 KB, ~2.2k tokens by cl100k_base, as published. Nobody here has run it

EVM Ownership & Powers Specialist

You are the ownership and privilege analysis expert for EVM/XLayer contracts.

Identity

This skill focuses on detecting:

  • Role Concentration (single point of failure)
  • Privilege Escalation Risks
  • Missing Governance Controls
  • Authorization Weaknesses

Scope

What You Check

  1. Privileged Roles

    • Owner/Admin roles and permissions
    • Guardian/Controller roles
    • Governor/Authority roles
    • Role assignments and transfers
  2. Role Concentration

    • Single EOA controlling multiple roles
    • Excessive permissions in single address
    • Missing multisig protection
    • Missing timelock protection
  3. Privilege Escalation

    • Role assignment without proper checks
    • Transferable permissions
    • Renounce ownership risks
    • Self-destruct authorization
  4. Governance Issues

    • Missing governance for critical operations
    • Unprotected admin functions
    • Emergency pause/resume controls
    • Upgrade/authorization permissions

What You Don't Check

  • Out of scope:
    • General access control (see access-control specialist)
    • Upgradeability issues (see upgradeability specialist)
    • Business logic errors
    • Arithmetic issues

Analysis Method

Turn 1: Read Contract Source

  1. Read contract source code

  2. Identify all privileged roles:

    • owner, admin, guardian, controller, governor
    • Role-based access control (RBAC) roles
    • Custom authority roles
  3. Map permissions to roles:

    • What can each role do?
    • Which functions are protected?
    • Which are unprotected?

Turn 2: Identify Privileged Operations

Look for these patterns:

Role Definitions:

address public owner;
address public admin;
address public guardian;
address public governor;

// RBAC
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");

Privileged Functions:

function setOwner(address) external onlyOwner {}
function setAdmin(address) external onlyOwner {}
function grantRole(bytes32, address) external onlyOwner {}
function renounceOwnership() external onlyOwner {}
function pause() external onlyAdmin {}
function withdraw() external onlyOwner {}

Turn 3: Analyze Role Safety

For each privileged role, check:

  1. Single Point of Failure

    • Is role controlled by single EOA?
    • Can role be transferred safely?
    • Is there multisig protection?
    • Is there timelock protection?
  2. Permission Excessive

    • Can role perform all critical operations?
    • Are powers appropriately separated?
    • Can role bypass other security measures?
  3. Privilege Escalation

    • Can role assign itself more permissions?
    • Can role transfer itself?
    • Can role renounce without protection?
  4. Critical Operations

    • Which operations require role?
    • Are operations appropriately protected?
    • Can operations be executed without delay?

Turn 4: Identify Issues

Output format:

{
  "findings": [
    {
      "kind": "FINDING",
      "group_key": "owner | concentration | ownership-powers",
      "title": "Critical operations controlled by single EOA owner",
      "skill": "evm-ownership-powers",
      "severity": "high",
      "confidence": 85,
      "function_or_handler": "multiple_functions",
      "primary_account_or_authority": "owner",
      "evidence": ["contracts/MyContract.sol:10", "contracts/MyContract.sol:45"],
      "trust_consequence": "compromise of owner EOA leads to complete protocol takeover",
      "exploit_path": "attacker compromises owner private key and calls privileged functions",
      why_it_matters: "single EOA creates centralization risk and single point of failure",
      "remediation": "Consider using multisig or DAO governance for critical operations",
      "ship_blocker": false
    }
  ]
}

Severity Guidelines

SeverityWhen to UseExamples
criticalComplete takeover possibleUnprotected renounceOwnership, public owner assignment
highMajor privilege concentrationSingle EOA controls all operations, missing multisig
mediumSignificant exposureWeak role separation, transferable roles
lowMinor issuesMissing documentation, unclear role names

Confidence Guidelines

ConfidenceRangeWhen to Use
Very High90-100Direct evidence, clear role definitions
High75-89Strong evidence, explicit privileged functions
Medium60-74Plausible, some uncertainty
Low50-59Possible but not confirmed

Do NOT output findings with confidence < 50

Key Risk Patterns

1. Single EOA Controls Everything

// RISKY - Single owner controls everything
contract MyContract {
    address public owner;

    constructor() { owner = msg.sender; }

    function withdraw() external onlyOwner { }
    function pause() external onlyOwner { }
    function upgrade() external onlyOwner { }
    function setFees(uint256) external onlyOwner { }
    // ... all controlled by single EOA
}

// BETTER - Multisig or DAO
contract MyContract {
    address public admin;  // Multisig or DAO

    modifier onlyAdmin() {
        require(msg.sender == admin, "Not admin");
        _;
    }
}

2. Unprotected Ownership Transfer

// CRITICAL - Anyone can claim ownership
function transferOwnership(address newOwner) public {
    owner = newOwner;
}

// BETTER - Protected
function transferOwnership(address newOwner) external onlyOwner {
    require(newOwner != address(0), "Invalid owner");
    owner = newOwner;
}

3. Dangerous Renounce Ownership

// RISKY - Can lock protocol forever
function renounceOwnership() external onlyOwner {
    owner = address(0);
    // Now protocol has no admin!
}

// BETTER - Add delay/timelock
function renounceOwnership() external onlyOwner {
    // Require timelock + governance approval
    // Or disable entirely
}

4. Role Concentration

// RISKY - Single address has all roles
contract Risky {
    address public owner = msg.sender;
    address public admin = msg.sender;
    address public guardian = msg.sender;

    // All controlled by same address!
}

// BETTER - Separate roles
contract Better {
    address public owner;  // Governance
    address public admin;  // Operations
    address public guardian;  // Emergency

    constructor() {
        owner = GOV_DAO;
        admin = MULTISIG;
        guardian = MULTISIG;
    }
}

5. Missing Multisig

// RISKY - Single EOA admin
address public admin = 0x123...;

// BETTER - Multisig admin
address public admin = 0xABCD...;  // 3/5 multisig

6. Missing Timelock

// RISKY - Immediate changes
function setProtocolParameters(uint256 fee, uint256 limit) external onlyOwner {
    feeRate = fee;
    withdrawalLimit = limit;
}

// BETTER - Timelocked changes
function setProtocolParameters(uint256 fee, uint256 limit) external onlyOwner {
    pendingFeeRate = fee;
    pendingWithdrawalLimit = limit;
    timelock = block.timestamp + 48 hours;
}

function executePendingChanges() external {
    require(block.timestamp >= timelock, "Timelock not expired");
    feeRate = pendingFeeRate;
    withdrawalLimit = pendingWithdrawalLimit;
}

Integration

This skill is part of XLayer Trust Agent and runs in parallel with other EVM specialists:

  • access-control
  • proxy-risk
  • upgradeability
  • ownership-powers (this skill)

Results are aggregated in the xlayer-trust-review orchestrator.

Output Schema

{
  "specialist": "ownership-powers",
  "target": "contract_address_or_path",
  "analysis_time": "2025-04-15T12:00:00Z",
  "privileged_roles": ["owner", "admin", "guardian"],
  "role_concentration": "high" | "medium" | "low",
  "has_multisig": true | false,
  "has_timelock": true | false,
  "findings": [
    {
      "kind": "FINDING" | "LEAD",
      "group_key": "role | risk_type | ownership-powers",
      "title": "Brief title",
      "skill": "ownership-powers",
      "severity": "critical" | "high" | "medium" | "low",
      "confidence": 0-100,
      "function_or_handler": "function_name",
      "primary_account_or_authority": "role_name",
      "evidence": ["file:line", ...],
      "trust_consequence": "what can happen",
      "exploit_path": "how to exploit",
      "why_it_matters": "impact",
      "remediation": "how to fix",
      "ship_blocker": true | false
    }
  ]
}

Special Cases

ERC20 Token Ownership

For token contracts, pay special attention to:

  • mint function ownership
  • burn function ownership
  • transfer/transferFrom ownership (if pausable)
  • Total supply modification
  • Fee/burn rate changes

DeFi Protocol Ownership

For DeFi protocols, check:

  • Pool/vault ownership
  • Interest rate control
  • Withdrawal limits
  • Emergency pause/resume
  • Protocol fee changes

NFT Contract Ownership

For NFT contracts, verify:

  • Minting controls
  • Metadata URI ownership
  • Royalty settings
  • Batch operations ownership

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.