Discuss: Use a grant's payee
address as it's ID
#54
Unanswered
mds1
asked this question in
Architecture & Design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
As described in #40, every contribution requires, at a minimum:
GrantRegistry
(2600 gas the first time, 100 gas subsequent times)payee
address fo the specified grant ID (2100 gas each time)This adds up quite a bit, and is very inefficient. To contribute to 100 grants at once, you're looking at
(2600 + 100 * 99) + (2100 * 100) = 222,500 gas
, or about $16 at current prices just to read allpayee
addresses. This is not counting token transfers, swaps, and other contract calls made as part of the donation transaction, and checkouts will likely become prohibitively expensive for many users.I'd like to propose an alternate approach, which instead use the the
payee
address itself as the grant's ID. There's two initial problems with this idea:payee
address for multiple grantspayee
to block you from creating a grantSolution
The solution proposed here is as follows:
id
owner
, and only theowner
of that contract can withdraw the funds (the owner can be anything, e.g. an EOA, a multisig, a timelock, a DAO, etc.)payee
address, which saves gasThis makes creating grants more expensive for grant owners, but makes contributions cheaper for donors
Implementation Ideas
Maker's DSProxy and Gnosis Safe have both been around for a long time and are sufficiently battle-tested that they can be used as a drop-in solution for the contract wallets we need to deploy. This gives us 3 options for using the grant's
payee
address as it's ID (using current gas prices for dollar amounts):We don't need to pick one of those 3 options in this issue—this issue is focused on whether or not we should make this change—and if so we can finalize implementation as part of a separate issue
Tradeoffs
Here are the pros/cons of the two approaches that I can currently think of:
Using an explicit ID and
payee
address as we currently do:Using a contract wallet as the
grantId
, where the wallet's owner can be whatever the user wants:"Worst case" estimated cost savings of contract wallet:
222,5000 / 100 = 2,225
gas per contribution600,000 / 2,225 = 270
contributionsEven though the proposed idea has two X's and the current approach has 1, I think that:
Beta Was this translation helpful? Give feedback.
All reactions