Add Reimbursement app #198

Merged
bumi merged 21 commits from feature/expenses into master 2021-06-02 12:25:34 +00:00
bumi commented 2020-05-29 08:47:54 +00:00 (Migrated from github.com)

refs #48, #195

To do

  • Create reimbursement contract
  • Fix txs failing in kredits-web expenses branch
  • Rename contributor to recipient
  • update kredits-web to use recipientId (instead of contributorId)
refs #48, #195 ## To do * [x] Create reimbursement contract * [x] Fix txs failing in kredits-web expenses branch * [x] Rename `contributor` to `recipient` * [ ] update kredits-web to use recipientId (instead of contributorId)
raucao (Migrated from github.com) reviewed 2020-05-29 09:15:16 +00:00
raucao (Migrated from github.com) left a comment

Nice! 👍

Left some comments/questions.

Nice! :+1: Left some comments/questions.
raucao (Migrated from github.com) commented 2020-05-29 08:54:04 +00:00
  event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount);

(Although I'm not sure if something like submittedBy isn't nicer for a name there.)

```suggestion event ReimbursementAdded(uint32 id, address indexed addedByAccount, uint256 amount); ``` (Although I'm not sure if something like `submittedBy` isn't nicer for a name there.)
raucao (Migrated from github.com) commented 2020-05-29 09:01:08 +00:00

Maybe we should just call this get, analog to add below?

Maybe we should just call this `get`, analog to `add` below?
raucao (Migrated from github.com) commented 2020-05-29 09:05:54 +00:00

I think until we actually have the financial code done, we should not add this function or the claimed property. Both because it will actually be out of sync with what we actually send around from the Gnosis safe, and also because we may want to adopt a different approach here as well (probably similar to the contributions, and maybe even combined with dividend payouts, so you only pay for a single tx when withdrawing everything at once).

I think until we actually have the financial code done, we should not add this function or the `claimed` property. Both because it will actually be out of sync with what we actually send around from the Gnosis safe, and also because we may want to adopt a different approach here as well (probably similar to the contributions, and maybe even combined with dividend payouts, so you only pay for a single tx when withdrawing everything at once).
@ -39,2 +35,3 @@
['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'claim', [1, { gasLimit: 300000 }]],
['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Add tests', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]],
raucao (Migrated from github.com) commented 2020-05-29 09:10:25 +00:00

This seems inconsistent with the expense schema. I don't see how it creates the array of expenses, separate from the WBTC reimbursement. Would also be good to add two expenses for an example reimbursement from the start (ideally just the same example as in the schemas repo) for UI development.

This seems inconsistent with the expense schema. I don't see how it creates the array of expenses, separate from the WBTC reimbursement. Would also be good to add two expenses for an example reimbursement from the start (ideally just the same example as in the schemas repo) for UI development.
raucao (Migrated from github.com) commented 2020-05-29 09:11:05 +00:00

Are these supposed to be committed?

Are these supposed to be committed?
bumi (Migrated from github.com) reviewed 2020-05-29 09:27:33 +00:00
bumi (Migrated from github.com) commented 2020-05-29 09:27:33 +00:00

arg, noo. of course not.

arg, noo. of course not.
bumi (Migrated from github.com) reviewed 2020-05-29 09:30:07 +00:00
@ -39,2 +35,3 @@
['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'claim', [1, { gasLimit: 300000 }]],
['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Add tests', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]],
bumi (Migrated from github.com) commented 2020-05-29 09:30:06 +00:00

the array here is not an array of expenses but just how it is passed to the add function. see above the seeds for contributions.

The data here is not correct yet. and yep, we can add more just by c&p this line.

the array here is not an array of expenses but just how it is passed to the `add` function. see above the seeds for contributions. The data here is not correct yet. and yep, we can add more just by c&p this line.
bumi (Migrated from github.com) reviewed 2020-05-29 09:31:35 +00:00
bumi (Migrated from github.com) commented 2020-05-29 09:31:35 +00:00

yeah, thought about that, too. but we had getContribution in the contribution contract.
do you think that's the best pattern? 👍

yeah, thought about that, too. but we had `getContribution` in the contribution contract. do you think that's the best pattern? :+1:
raucao (Migrated from github.com) reviewed 2020-05-29 09:34:07 +00:00
raucao (Migrated from github.com) commented 2020-05-29 09:34:07 +00:00

Yeah, I think it should be consistent, and contribution.add is nicer for clients than contribution.addContribution. May as well imply the scope for all functions then. (We actually throw a deprecation warning for addContribution still. :))

Yeah, I think it should be consistent, and `contribution.add` is nicer for clients than `contribution.addContribution`. May as well imply the scope for all functions then. (We actually throw a deprecation warning for `addContribution` still. :))
raucao (Migrated from github.com) reviewed 2020-05-29 09:36:52 +00:00
@ -39,2 +35,3 @@
['Contribution', 'add', [{ contributorId: 2, contributorIpfsHash: 'QmcHzEeAM26HV2zHTf5HnZrCtCtGdEccL5kUtDakAB7ozB', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-web] Reviewed stuff', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'claim', [1, { gasLimit: 300000 }]],
['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Add tests', url: '' }, { gasLimit: 350000 }]],
['Contribution', 'add', [{ contributorId: 1, contributorIpfsHash: 'QmWKCYGr2rSf6abUPaTYqf98urvoZxGrb7dbspFZA6oyVF', date: '2019-04-11', amount: 1500, kind: 'dev', description: '[67P/kredits-contracts] Introduce contribution token', url: '' }, { gasLimit: 350000 }]],
raucao (Migrated from github.com) commented 2020-05-29 09:36:52 +00:00

the array here is not an array of expenses but just how it is passed to the add function. see above the seeds for contributions.

Yes, that's not what I meant. I meant that a reimbursement contains an array of expenses, so it needs be an array for the add function and the examples and seeds as well.

> the array here is not an array of expenses but just how it is passed to the `add` function. see above the seeds for contributions. Yes, that's not what I meant. I meant that a reimbursement contains an array of expenses, so it needs be an array for the `add` function and the examples and seeds as well.
raucao commented 2020-06-04 07:23:08 +00:00 (Migrated from github.com)

@bumi Any news on this PR?

@bumi Any news on this PR?
raucao commented 2020-06-13 09:43:56 +00:00 (Migrated from github.com)

I think I'm running into the same issue as Travis: the deployment artifacts seem to be undefined (according to the error messages on Travis), resulting in the contract not being able to deployed during bootstrap on my machine:

Screenshot from 2020-06-13 11-42-00

I think I'm running into the same issue as Travis: the deployment artifacts seem to be undefined (according to the error messages on Travis), resulting in the contract not being able to deployed during bootstrap on my machine: ![Screenshot from 2020-06-13 11-42-00](https://user-images.githubusercontent.com/842/84565691-227dd800-ad6b-11ea-9bf6-135e605fdce3.png)
bumi (Migrated from github.com) reviewed 2020-06-27 22:09:52 +00:00
bumi (Migrated from github.com) commented 2020-06-27 22:09:47 +00:00
  "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4"
```suggestion "4": "0x76e069b47b79442657eaf0555a32c6b16fa1b8b4" ```
bumi (Migrated from github.com) commented 2020-06-27 22:09:00 +00:00
  "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14"
```suggestion "4": "0xc34edf7d11b7f8433d597f0bb0697acdff55ef14" ```
raucao commented 2020-10-30 12:37:47 +00:00 (Migrated from github.com)

FYI: I have updated the PR description with remaining tasks from the original issue as well as the Summit notes.

I am currently finishing up the Web UI for this.

FYI: I have updated the PR description with remaining tasks from the original issue as well as the Summit notes. I am currently finishing up the Web UI for this.
raucao commented 2020-10-31 12:45:03 +00:00 (Migrated from github.com)

67P/kredits-web/pull/195 is finished and ready for review/testing now. It will only need very small adjustments after finishing this PR.

67P/kredits-web/pull/195 is finished and ready for review/testing now. It will only need very small adjustments after finishing this PR.
bumi commented 2020-12-01 09:36:10 +00:00 (Migrated from github.com)

do we need to save who added the reimbursement?
with the permissions it must be a contributor, but I had removed that we store who it is (mainly to avoid the lookup)

do we need to save who added the reimbursement? with the permissions it must be a contributor, but I had removed that we store who it is (mainly to avoid the lookup)
raucao commented 2020-12-01 12:02:27 +00:00 (Migrated from github.com)

do we need to save who added the reimbursement?

If we have the tx sender available in clients already, then we wouldn't need an additional attribute I guess. We just need that piece information in general. (Same for proposing kredits actually.)

> do we need to save who added the reimbursement? If we have the tx sender available in clients already, then we wouldn't need an additional attribute I guess. We just need that piece information in general. (Same for proposing kredits actually.)
bumi commented 2020-12-01 12:05:53 +00:00 (Migrated from github.com)

I am not completely sure how to understand and explain the problem with deploying this aragon app.
When I try to deploy this app locally and install it into our DAO it seems to work but somehow it does not show up when I do aragon dao apps .. and the JS also can not find the contract address.
So far I failed to debug this issue.

Steps to do this:

  1. aragon apm publish major --propagate-content=false --build=false --prepublish=false --skip-confirmation
  2. aragon dao install 0xbBc85e5dE36826e7fD52a871dB7e1735992e3AD4 kredits-reimbursement.open.aragonpm.eth
  3. aragon dao apps 0xbBc85e5dE36826e7fD52a871dB7e1735992e3AD4

I am not sure if that is related to #199

I am not completely sure how to understand and explain the problem with deploying this aragon app. When I try to deploy this app locally and install it into our DAO it seems to work but somehow it does not show up when I do `aragon dao apps ..` and the JS also can not find the contract address. So far I failed to debug this issue. Steps to do this: 1. `aragon apm publish major --propagate-content=false --build=false --prepublish=false --skip-confirmation` 2. `aragon dao install 0xbBc85e5dE36826e7fD52a871dB7e1735992e3AD4 kredits-reimbursement.open.aragonpm.eth` 3. `aragon dao apps 0xbBc85e5dE36826e7fD52a871dB7e1735992e3AD4` I am not sure if that is related to #199
bumi commented 2020-12-01 12:10:03 +00:00 (Migrated from github.com)

If we have the tx sender available in clients already, then we wouldn't need an additional attribute I guess. We just need that piece information in general. (Same for proposing kredits actually.)

I don't fully understand. what do you want to store?

when adding an entry we have the msg.sender which is the address. to lookup the contributor for that address we need to somehow talk to the contributor contract. This so far has always been a pain and I am not sure how to best connect the contracts to each other. (which is basically also the blocker still for deploying this)

> If we have the tx sender available in clients already, then we wouldn't need an additional attribute I guess. We just need that piece information in general. (Same for proposing kredits actually.) I don't fully understand. what do you want to store? when adding an entry we have the `msg.sender` which is the address. to lookup the contributor for that address we need to somehow talk to the contributor contract. This so far has always been a pain and I am not sure how to best connect the contracts to each other. (which is basically also the blocker still for deploying this)
raucao commented 2020-12-01 13:04:56 +00:00 (Migrated from github.com)

OK. But why is deploying the contract preventing the PR from being finished feature-wise and then merged? I think that should be done in a whole different PR, as that work is not about feature development for reimbursements.

OK. But why is deploying the contract preventing the PR from being finished feature-wise and then merged? I think that should be done in a whole different PR, as that work is not about feature development for reimbursements.
raucao commented 2020-12-01 13:05:33 +00:00 (Migrated from github.com)

I don't fully understand. what do you want to store?

I don't want to store anything that's not necessary. I simply mean that we need to be able to show who proposed a reimbursement later.

> I don't fully understand. what do you want to store? I don't want to store anything that's not necessary. I simply mean that we need to be able to show who proposed a reimbursement later.
raucao commented 2021-02-22 14:49:31 +00:00 (Migrated from github.com)

I just tried doing the last kredits-web task for this, but as this branch is now, I get exceptions from ethers when trying get a reimbursement, no matter from where. I wasn't able to fix it so far. Seeds run OK, but then it complains about insufficient data for assigning a boolean value to vetoed when loading a reimbursement in JS via the "native" contract function.

I just tried doing the last `kredits-web` task for this, but as this branch is now, I get exceptions from ethers when trying `get` a reimbursement, no matter from where. I wasn't able to fix it so far. Seeds run OK, but then it complains about insufficient data for assigning a boolean value to `vetoed` when loading a reimbursement in JS via the "native" contract function.
raucao (Migrated from github.com) approved these changes 2021-06-02 12:25:04 +00:00
raucao (Migrated from github.com) left a comment

Let's merge this, as it's working fine in dev, and we have to adapt everything for the production deployment and migration.

Let's merge this, as it's working fine in dev, and we have to adapt everything for the production deployment and migration.
Sign in to join this conversation.
No description provided.