# Client Incentives V1 (1/2): DAO logic & Auction House contract upgrades

## TLDR

* This proposal upgrades the DAO logic & auction house contracts to support Client Incentives.
* We completed an audit with Sherlock covering all the changes.
* Once this proposal executes, there will be a follow up proposal to configure and initiate the Client Incentives contracts.


## Context

We recently finished an audit with Sherlock (funded by proposal [505](https://www.nouns.camp/proposals/505)). We are now ready to move forward with deploying the first version of the Client Incentives [contracts](https://github.com/nounsDAO/nouns-monorepo/pull/826).

For more background on what Client Incentives are, as well as the contract changes, please see proposal [505](https://www.nouns.camp/proposals/505).


## Audit summary

No significant issues were found with the new DAO logic auction house contracts. A few issues were found in the Client Incentives rewards contract which could allow a malicious client to accrue more rewards than they should. All the issues were fixed and reviewed by the lead auditor.

The full audit report can be reviewed [here](https://github.com/nounsDAO/nouns-monorepo/blob/verbs-poc-client-incentives-noracle/packages/nouns-contracts/audits/2024-04-23_client_incentives_sherlock_audit_report.pdf).


## Deployment plan

This proposal will upgrade the DAO logic and auction house contracts. It will not yet activate the client incentives program.


### Changes in the DAO logic contract



* Propose and vote functions now accept an optional client ID parameter that Nouns frontends can populate with their ID.
* The DAO records which client ID contributed which interaction; this data is used in the Rewards contract to allocate financial rewards to clients.
* A small cleanup by zeroing out a no longer used storage variable (`voteSnapshotBlockSwitchProposalId`). This will allow us to reuse this storage in the future.


### Changes in the Auction House contract:



* The bidding function (`createBid`) accepts an optional client ID parameter, and winning bids’ client IDs are captured in the AuctionHouse state, to be used by the Client Incentives Rewards contract.
* We’re now capturing settlement history onchain, i.e. who won each auction and the winning bid ETH value.
* If needed, historic settlement history can be added by the DAO via proposal.
* The above changes will serve the Rewards contract with essential information for calculating client rewards, which are all configured as percentages of auction revenue in the relevant timeframe.


#### Auction house storage slots warm up

TLDR: We are asking the DAO for 6 ETH to “warm up” storage slots to reduce the gas cost of settling auctions in the future. Feel free to skip the details.

Details:

As part of the auction house upgrade, it now stores more data in storage upon auction settlement. Specifically, it saves a record with the price, timestamp and winner address. These additional storage writes cost more gas when settling an auction. In order to reduce the gas cost, we want to “warm up” many storage slots so that writing to them costs less gas (it costs less gas to write into a non-zero storage slot).

We will do this warm up while gas prices are relatively low. We are asking the DAO for 6 ETH to warm up the auction storage slots for the next ~5-10 years of auctions (exact amount depends on gas prices).

Any unused ETH will be sent back to the treasury.


### Rewards contract deployment

Once the contracts are upgraded, we’ll deploy the `Rewards` contract which will allow clients to register themselves.

We will create a followup proposal in which the DAO will configure the rewards parameters and fund the contract.


## Proposal actions

The first 3 actions upgrade the NounsAuctionHouse. This includes an interim contract which performs a migration of the auction storage layout.

1. auctionHouseProxyAdmin.upgrade(auctionHouseProxy, NounsAuctionHousePreV2Migration)
2. auctionHouseProxy.migrate()
3. auctionHouseProxyAdmin.upgrade(auctionHouseProxy, NounsAuctionHouseV2)

Actions 4 & 5 upgrade the DAO contract. Action 5 is a cleanup which removes a storage variable used temporarily in a previous upgrade.

4. nounsDao._setImplementation(NounsDAOLogicV4)
5. nounsDao._zeroOutVoteSnapshotBlockSwitchProposalId()

Action 6 sends 6 ETH to the verbs safe wallet. It will be used to warm up the auction house storage slots.

6. verbsMultisig.transfer(6 eth)

Outcome: EXECUTED