OpenViSTAI · Agents · Blockchain · Crypto
Menu
Smart Contracts

DSAuth

DSAuth is a Solidity library pattern that protects contract functions with an authorization modifier. It permits the owner or the contract itself by default and can delegate finer-grained permission decisions to a configured DSAuthority contract.

Independent OpenViST project profile, based on linked sources.

DSAuth — OpenViST project profile in Smart Contracts.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use DSAuth when implementing Solidity contracts that need reusable authorization checks and an owner or authority configuration that can be updated by an authorized caller.

Who it is for

  • Solidity developers adding access checks to smart-contract functions.
  • Contract teams that need an authority contract to define fine-grained permissions.

Documented uses

  • Restrict a function to the contract owner or the contract itself.
  • Delegate function-level permission decisions to a DSAuthority implementation.
  • Change the contract owner or configured authority through authorized methods.
Before you choose

Requirements & limits

  • The default authorization rules allow the owner and the contract itself; other callers require permission through a configured authority.
  • Custom fine-grained rules require a contract implementing the DSAuthority interface.
  • The README identifies ds-guard and ds-roles as ready-made authority contracts.
  • The repository declares the GPL-3.0 license.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Protect a Solidity function with DSAuth

Require an authorized caller for a contract function using the DSAuth `auth` modifier.

Before you start

  • A Solidity contract using DSAuth.

Steps

  1. Add the auth modifier to the function that should be protected, following the documented pattern: function myProtectedFunction() auth {}.

  2. Use the authorization behavior supplied by DSAuth: the caller must be the contract owner, the contract itself, or be permitted by a configured authority.

Expected outcome

The function is restricted to callers authorized by DSAuth.

Guide limitations

  • The source describes the modifier’s authorization rule but does not document installation, compilation, deployment, or testing steps.
  • Fine-grained permissions require a configured authority contract implementing DSAuthority; its setup is not covered here.
Source-based practical guide

Update a contract’s DSAuth owner or authority

Change the owner or configured authority through DSAuth’s authorized methods.

Before you start

  • A contract using DSAuth.
  • A caller authorized by the contract’s current authorization rules.

Steps

  1. Call setOwner(address owner_) to set a new owner, or setAuthority(DSAuthority authority_) to set a new authority.

  2. Ensure the call is authorized; both methods require authorization.

Expected outcome

The contract’s owner or authority is updated, subject to authorization.

Guide limitations

  • The source does not document how to initialize DSAuth or deploy an authority contract.
  • The source does not specify the permission policy of a custom authority.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 October 2026
Original website title
dapphub/ds-auth · Official homepage title · retained in its source language