Skip to content

Latest commit

 

History

History
154 lines (141 loc) · 5.13 KB

Counter.md

File metadata and controls

154 lines (141 loc) · 5.13 KB

Counter (Counter.sol)

View Source: contracts/drafts/Counter.sol

Counter

Does not allow an Id of 0, which is popularly used to signify a null state in solidity. Does not protect from overflows, but if you have 2^256 ids, you have other problems. (But actually, it's generally impossible to increment a counter this many times, energy wise so it's not something you have to worry about.)

Structs

Counter

struct Counter {
 uint256 current
}

Functions

next

function next(struct Counter.Counter index) internal undefined
returns(uint256)

Arguments

Name Type Description
index struct Counter.Counter

Contracts