https://github.com/numtel/solidity-ordered-address-set
https://github.com/numtel/solidity-ordered-address-set
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/numtel/solidity-ordered-address-set
- Owner: numtel
- Created: 2022-09-30T18:35:01.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-30T18:38:33.000Z (over 3 years ago)
- Last Synced: 2025-02-15T04:42:34.646Z (about 1 year ago)
- Language: Solidity
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solidity Ordered Address Set
Inspired by [Rob Hitchens' SetTypes](https://github.com/rob-Hitchens/SetTypes) and [OpenZeppelin EnumerableSet](https://docs.openzeppelin.com/contracts/3.x/api/utils#EnumerableSet), the `OrderedAddressSet` maintains the order of elements during item removal, and items can be inserted at any index.
The downside is that determining the index of a key requires scanning the list.
Includes `concat`, `slice`, and `toAddress` functions from [Gonçalo Sá's `BytesLib.sol`](https://github.com/GNSPS/solidity-bytes-utils/blob/master/contracts/BytesLib.sol).
## Installation for Development
```
$ git clone https://github.com/numtel/solidity-ordered-address-set.git
$ cd solidity-ordered-address-set
$ npm install
```
Download the `solc` compiler. This is used instead of `solc-js` because it is much faster. Binaries for other systems can be found in the [Ethereum foundation repository](https://github.com/ethereum/solc-bin/).
```
$ curl -o solc https://binaries.soliditylang.org/linux-amd64/solc-linux-amd64-v0.8.13+commit.abaa5c0e
$ chmod +x solc
```
## Testing Contract
```
# Build contracts before running tests
$ npm run build-dev
$ npm test
```
## License
MIT