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
- Make a
submitTributeProposalfunction call to the TributeEscrow contract
function submitTributeProposal(
Baal baal,
address token,
uint256 amount,
uint256 shares,
uint256 loot,
uint32 expiration,
string memory details
)
msg.senderis member tributing/requesting shares/lootbaalis the DAO we are tributing tootoken- ERC-20tokenAddressamountof tribute,shares,lootin Weiexpirationis epoch time, same as in baalsubmitProposaldetails- proposal details schema we use
TributeEscrowcontract encodes ERC-20 token transfers and makes the proposal against the baal contract- Subgraph catches the normal
submitProposalevent to create proposal entity - TributeEscrow emits additional event that we catch and add the following fields to the proposal entity:
tributeOfferedtributeTokentributeTokenSymboltributeTokenDecimalstributeEscrowRecipient
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
TributeEscrowto 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.