---
# System prepended metadata

title: Arcoíris

---

# Arcoíris

Wealth redistribution contract based on traditions of hippie forest gathering

## Terminology
 - Siblings, externally owned account addresses
 - Gathering, a set of redistribution conditions.
 - A1, an account address that creates a Gathering and sets common Conditions.
 - Conditions include valid Collection tokens, MC address, redistribution algorithm.
 - Ceremony, single event, collects and redistributes wealth between Siblings according to conditions of a Gathering. Creation -> Collection -> Redistribution. 
 - Collection, a pool of tokens contributed by siblings to the Ceremony.
 - Redistribution, algorithm that redistributes Collection according to Missions.
 - Mission, a set of metadata including a Sibling address, Sibling's priority in the Ceremony and redistribution-specific information.
 - Master of ceremonies, MC, an account address allowed to start a ceremony and redistribute a collection.

## Flow
 - Anyone creates a new Gathering and becomes A1
 - MC creates ceremony
 - Siblings contribute wealth 
 - MC ends collection
 - MC redistributes wealth
 - Siblings receive redistributed wealth
 - NOTE: if MC doesn't redistribute wealth after timeout, siblings can retrieve back their contributions

## Spec
 - Collection contract, an ERC1155 token, maybe also ERC20
 - Gathering contract, interface createGathering(collection, redistribution, mc), setA1(address), setMC(address), setCollection(address), createCeremony()
 - Ceremony contract, interface cbontribute(token, amount), endCollection()
 - Redistribution contract, interface redistribute(Mission[] missions), Mission is a struct { address, priority, ...metadata }

## multitoken
You'd need to add a contract to contracts/mcs first. Convert osm data to player ratings there, and redistribute erc721 shittoken. Then figure out how to redistribute erc20 fairly
 
don't make eoa an mc, it's too ruggy. If you commit osm data to chain redistribution becomes fair
 
I think it's okay to integrate only erc20 traded on uniswap v2 and get that exchange rates
 
And i will just integrate sudoswap later
 
So you would add conversion to Arcoiris:redistribute
 
If you need tests for amm, there's setup in fetsorn/calibrator, take it
 
It still has waffle and ethersv5, but if you just copy fixtures and contract calls it's gonna be okay
 
You can just add a flag to gathering settings, that says if collection is erc721 or erc20
 
And do everything needed for erc20

## trophies
How do we track some achievements?
There's an element of rating accrual missing
 
Well, erc1155 or erc721, yeah
 
I want extension of those, that has some data on comparative rating
 
Like, try to think if you can think of smth cool that you'd like

Arcoiris:redistribute should call promote() from one of plugin contracts in contracts/elders. Options for elders - one erc721 per member, adding erc1155 value on each redistribution, random achievement with vrf.