Ethereum Settlers

1. Overview

An ERC20 token called Ethereum Settler (SETTLER) and an ERC721 NFT token called Ethereum Settlement (SETTLEMENT).

Minting a Settlement NFT is free and can be done by anyone. The only cost is the gas fee for the transaction.

Holding a Settlement NFT gives the holder a newly minted SETTLER tokens every second.

Invariant: A Settlement NFT can only be held by one address at a time.

There is nothing stopping multiple addresses from each holding different Settlement NFTs. E.g. Mint ➜ Send ➜ Mint ➜ Send, etc. This means that the SETTLER token can have no monetary value, as it is not a scarce resource and an unlimited amount can be created simply by minting more Settlement NFTs.

The ViewAggregator contract is used to perform batch queries on the Settlement contract to get sequential or random data. This is a view only helper contract that is deployed separately from the Settlement contract.

Live on https://settlers.eridian.xyz

2. Clone repository

git clone https://github.com/EridianAlpha/ethereum-settlers.git

2.1. Install Dependencies

This should happen automatically when first running a command, but the installation can be manually triggered with the following commands:

git submodule init
git submodule update
make install

2.2. Create the .env file

Use the .env.example file as a template to create a .env file.

3. Testing

3.1. Tests

make test
make test-fork

make test-v
make test-v-fork

make test-summary
make test-summary-fork

3.2. Coverage

make coverage
make coverage-fork

make coverage-report
make coverage-report-fork

4. Deployment

4.1. Deploy NFT and Token Contract

Deploy the SettlementNft contract which deploys the SettlerTokens contract.

ChainCommand
Anvilmake deploy anvil
Holeskymake deploy holesky
Mainnetmake deploy mainnet
Base Sepoliamake deploy base-sepolia
Base Mainnetmake deploy base-mainnet

4.2. Deploy View Aggregator Contract

Deploy the ViewAggregator contract. Input value as a the Settlement contract deployment address e.g. 0x123....

ChainCommand
Anvilmake deployViewAggregator anvil
Holeskymake deployViewAggregator holesky
Mainnetmake deployViewAggregator mainnet
Base Sepoliamake deployViewAggregator base-sepolia
Base Mainnetmake deployViewAggregator base-mainnet

5. Interactions

Interactions are defined in ./script/Interactions.s.sol

5.1. Mint Settlement NFT

Call the mint() function on the SettlementNft contract.

ChainCommand
Anvilmake mintNft anvil
Holeskymake mintNft holesky
Mainnetmake mintNft mainnet
Base Sepoliamake mintNft base-sepolia
Base Mainnetmake mintNft base-mainnet

5.2. Get NFT Mint Timestamp

Call the getMintTimestamp() function on the SettlementNft contract. Input value as a token ID e.g. 1.

ChainCommand
Anvilmake getMintTimestamp anvil
Holeskymake getMintTimestamp holesky
Mainnetmake getMintTimestamp mainnet
Base Sepoliamake getMintTimestamp base-sepolia
Base Mainnetmake getMintTimestamp base-mainnet

5.3. Get Settler Balance

Call the getSettlerBalance() function on the SettlementNft contract. Input value as an address e.g. 0x123....

ChainCommand
Anvilmake getSettlerBalance anvil
Holeskymake getSettlerBalance holesky
Mainnetmake getSettlerBalance mainnet
Base Sepoliamake getSettlerBalance base-sepolia
Base Mainnetmake getSettlerBalance base-mainnet

5.4. Get Sequential Data

Call the getSequentialData() function on the ViewAggregator contract. Input value 1 as the starting token ID e.g. 1. Input value 2 as the ending token ID e.g. 10.

ChainCommand
Anvilmake getSequentialData anvil
Holeskymake getSequentialData holesky
Mainnetmake getSequentialData mainnet
Base Sepoliamake getSequentialData base-sepolia
Base Mainnetmake getSequentialData base-mainnet

5.5. Get Random Data

Call the getRandomData() function on the ViewAggregator contract. Input value as a number of NFTs to return e.g. 20.

ChainCommand
Anvilmake getRandomData anvil
Holeskymake getRandomData holesky
Mainnetmake getRandomData mainnet
Base Sepoliamake getRandomData base-sepolia
Base Mainnetmake getRandomData base-mainnet

6. License

MIT