Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🔗 Cross-Project Solidity Utilities

License

NotificationsYou must be signed in to change notification settings

sablier-labs/evm-utils

Repository files navigation

This repository contains a collection of utility smart contracts used across various Sablier Solidity projects. Themotivation behind this repository is to reduce code duplication.

The following projects imports this repo:

In-depth documentation is available atdocs.sablier.com.

Repository Structure

This repo contains the following subdirectories:

  • src/interfaces: Interfaces forAdminable andBatch contracts.
  • src/mocks: Mock contracts used by external projects in tests.
  • src/tests: Helper contracts used by external projects in tests and deployment scripts.

Install

Node.js

This is the recommended approach.

Install using your favorite package manager, e.g., with Bun:

bun add @sablier/evm-utils

Then, if you are using Foundry, you need to add these to yourremappings.txt file:

@sablier/evm-utils/=node_modules/@sablier/evm-utils/

Git Submodules

This installation method is not recommended, but it is available for those who prefer it.

First, install the submodule using Forge:

forge install --no-commit sablier-labs/evm-utils

Second, if you are using Foundry, you need to add these to yourremappings.txt file:

@sablier/evm-utils/=lib/evm-utils/

Usage

import { Adminable }from"@sablier/evm-utils/src/Adminable.sol";import { Batch }from"@sablier/evm-utils/src/Batch.sol";import { NoDelegateCall }from"@sablier/evm-utils/src/NoDelegateCall.sol";contractMyContractisAdminable,Batch,NoDelegateCall {constructor(addressinitialAdmin)Adminable(initialAdmin) { }// Use the `noDelegateCall` modifier to prevent delegate calls.function foo()public noDelegateCall { }// Use the `onlyAdmin` modifier to restrict access to the admin.function editFee(uint256newFee)public onlyAdmin { }}

License

This repo is licensed under theGNU General Public License.

About

🔗 Cross-Project Solidity Utilities

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp