---
# System prepended metadata

title: 'Spam Prevention Boost: Proposal Deposit Contract'
tags: [Product]

---

---
tags: Product
---

# Spam Prevention Boost: Proposal Deposit Contract

Wrapper contract to add a proposal deposit requirement to all proposals. UI update to only fetch/display these unsponsored proposals.

### Contract

Single contract per network
- See Escrow minion

Allow DAOS to activate/deactivate wrapper

Wrap the proposal function
- Make payable to accept network token
    - Using custom erc probably introduces too much complexity?
- How do we determine the amount? DAO specified or static for the network?
    - I vote for simplicity

> [name=spengrah]
> Unfortunately I think this needs to be configurable by each DAO, both the amount as well as the token. Perhaps the default (or maybe only option for the DAO?) token can be the DAO's primary token. But the amount needs to be configurable, since different DAOs will have different sized honey pots and will need different levels of spam protection.

Track deposit amount, dao, proposal id, sender

Withdraw function
- sender can call to withdraw on certain conditions
    - maybe just sponsored?

> [name=spengrah]
> The risk with the minimal return condition of sponsored is that a current member could spam their own DAO at no cost to themselves, since they can sponsor their own proposals. A couple alternatives:
> 1. Return condition is the proposal passing. This feels pretty harsh, but may be necessary if we feel like permissioned membership is not enough.
> 2. Put some kind of cap on the number of proposals an address can make per period. But this doesn't hold up under a sybil attack, so its useless.

Events
- activate, deactivate, deposit, withdraw
- DAO claim (see below)?

Admin
- who, if anybody, owns the contract?
- where do the lost deposits go? Should a DAO be able to withdraw/claim the ones related to itself?

### Subgraph

Watch deposit contract
- Activate Deposit/Deactivate
    - flag on moloch entity

- Proposal mapping update
    - look for proposals coming from this contract
    - flag if deposit is there

- Might need to track deposits by user to easily display on profile pages and support withdraw
    - need events on deposit and withdraw
    - maybe in the boost subgraph

> [name=spengrah]
> Ideally, this boost would have its own subgraph and our front end could read off that, similar to what we discussed with Plaza's boosts. But that might require too much front end plumming for now?

### UI

Proposal forms
- notify users of the fee if boost is active

DAO context
- Change query to pull proposals with the flag if boost is active
    - another multiquery for the OR condition
    - unsponsored AND hasFlag OR sponsored
    - handle cancelled to or filter?

How does this change the TX lego?
- conditionally include value
- any issue with all types of minion or escrow proposals?
- conditionally change the contract address from the moloch to the wrapper

Custom boost settings
- Show unfiltered proposals
- Allow deactivation

UI to withdraw deposit
- on proposal itself
- or on profile page with other withdraw

> [name=spengrah]
> I like on profile page

Boost launch lego


## Alt Approach: 

#### What are all the potential downsides of the current filter?
- Filters out Signal and whitelist proposals


#### What would the perfect filter look like? 

- Extreme filter
    - all proposals must have some tribute
        - sponsored &&
        - unsponsored && 
            - tribute >= ${dao data}
            - OR whitelist
            - OR guildkick
                - new flag for whitelist OR guildkick in subgraph
    - queries
        - all sponsored
        - unsponsored && tribute over whatever
            - i guess if this was locked per network we could add to computed field
        - unsponsored && guildkickOrWhitelist

 - SPAM Page
    - slow page
    - all unsponsored proposals


- light filter
    - only if proposals asks for funds or shares
    - then proposal must have some tribute


notes: tribute can be very small like 1 wxdai, this would filter 99% of spam


try alias


## SIMPLE SPAM FILTER UI
- boost launch
- setting page to turn off (set inactive)
- proposal list page
    - indicate these are filtered
    - access to spam page (really is all unsponsored/potential spam)
- spam page
    - repurpose the hardcore mode page
    - 'remove from spam'/sponsor button
    - cancel button

- other explainer ui?
    - proposal forms always need tribute fields (how to handle with minion?)
    - indicate required tribute on these forms due to spam
        - legos might not allow that right out of the box
        - start with messaging


- how to cancel
    - just in spam page?


#### ISSUES
- This will break direct links to proposals
    - Might need a fetch on the proposal page itself
- this adds an api call right before the activities calls
- what is happening with cancelled
    - not in main query because not sponsored
    - in spam
    - maybe move those


### dev todo
- boost launch need custom field
    - hardcode tribute token and do amount to wei
