Skip to content

LightArtists/area-ethereum-contracts

Repository files navigation

Area Ethereum Contracts

💰 ACTIVE BUG BOUNTY, SEE THE FILE BUG-BOUNTY.md.

Introduction

Area NFT contract

The main NFT contract assigns and tracks ownership of Plus Codes on a distributed ledger. Some features are new, a brief and approximate explanation:

  • The drop: Tokens are assigned randomly from a list of available tokens using a commit-reveal mechanism. Your purchase is revealed by the next purchaser or the contract owner. The security of this system depends on the next purchaser coming along within about 60 minutes (256 blocks), but it can degrade gracefully if that is not the case. A benevolence setting of 2 is customary.
  • Ghost minting: A mechanism is used to generate up to 400 NFT tokens in one transaction without updating 400 storage locations. This technique is named "ghost minting".
  • Splitting: Each NFT may be split geographically into 20 or 400 small pieces. The drop geographic areas are large, there's plenty of room to split down.

Area marketplace contract

This is an on-chain bid/offer marketplace inspired by CryptoPunks. Plans have been made to carbon-offset transactions made on the marketplace, but a timeline and details have not been announced yet.

The marketplace supports direct Ether payment and safe withdrawals. Rather than "accepting" bids or offers, each side of the transaction simply makes bids and offers and any intersection results in an immediate trade.

Deploy

  1. Deploy the NFT contract
  2. Deploy the marketplace contract, referencing the NFT contract

Run test suite

Setup

nvm install 16
nvm use 16
npm install

Now run this each time you change contracts or test scripts:

npm run prepare
npm run lint # note, we do not use Prettier style for Solidity
FORCE_COLOR=1 ENABLE_GAS_REPORT=true npm run test
npm run test:inheritance
npm run coverage

Contributing

When the Area contracts are deployed, this repository will stay to provide documentation and context for the code. Test cases and documentation may be updated, but the code will be fixed.

Please send pull requests to improve documentation and test cases. Please send issues for anything that might be improved.

References