Rename AutoIncrementing to Counter (#1307)

This commit is contained in:
Leo Arias
2018-09-13 02:51:22 -06:00
committed by Nicolás Venturo
parent 225b492109
commit b4f87bb8fc
4 changed files with 34 additions and 33 deletions

View File

@ -0,0 +1,21 @@
pragma solidity ^0.4.24;
import "../utils/Counter.sol";
contract CounterImpl {
using Counter for Counter.Index;
uint256 public theId;
// use whatever key you want to track your counters
mapping(string => Counter.Index) private _counters;
function doThing(string key)
public
returns (uint256)
{
theId = _counters[key].next();
return theId;
}
}