Skip to content

jtriley2p/safe-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SafeCounter

A counter library for the 21st century.

We implement OFAC compliant address blocking, checked arithmetic, hook integrations, method chaining for a rust-like application programming interface, event logging optimized for indexing software, and both incrementing and decrementing the count.

Installation

forge install jtriley-eth/safe-counter

Usage

contract MyContract {
    Counter counter;

    function blockAndSafeIncrementTwice(address sanctionedEntity) public {
        counter.requireNotBlocked()
            .sanction(sanctionedEntity)
            .safeIncrement(msg.sender)
            .safeIncrement(msg.sender);
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published