TributeEscrow - HausDAO/daohaus-monorepo-deprecated GitHub Wiki

TributeEscrow is a helper contract for making tribute proposals

  • Provides contract to approve ERC-20 transfers
  • Provides simple function/interface to make single proposal type

Details

There is one TributeEscrow contract deployed to each supported network.

Create Tribute Proposal

  1. Make a submitTributeProposal function call to the TributeEscrow contract
function submitTributeProposal(
    Baal baal,
    address token,
    uint256 amount,
    uint256 shares,
    uint256 loot,
    uint32 expiration,
    string memory details
)
  • msg.sender is member tributing/requesting shares/loot
  • baal is the DAO we are tributing too
  • token - ERC-20 tokenAddress
  • amount of tribute, shares, loot in Wei
  • expiration is epoch time, same as in baal submitProposal
  • details - proposal details schema we use
  1. TributeEscrow contract encodes ERC-20 token transfers and makes the proposal against the baal contract
  2. Subgraph catches the normal submitProposal event to create proposal entity
  3. TributeEscrow emits additional event that we catch and add the following fields to the proposal entity:
    • tributeOffered
    • tributeToken
    • tributeTokenSymbol
    • tributeTokenDecimals
    • tributeEscrowRecipient

Takeaways

  • Nice to have these trusted proposal type contracts. We can be 100% sure of what this proposal is doing.
  • Our UI needs to enforce that the account making the tribute needs to approve TributeEscrow to spend the ERC-20.
  • If the account making the tribute were to transfer the tokens out before the proposal is processed, the proposal will fail on execution.

Resources