-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Court accounting #67
Court accounting #67
Conversation
bce908b
to
ae8c556
Compare
40d63c9
to
c12b793
Compare
c12b793
to
f018770
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
contracts/CourtAccounting.sol
Outdated
owner = _owner; | ||
} | ||
|
||
function deposit(ERC20 _token, address _to, uint256 _amount) external onlyOwner { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function name is a bit strange given that the actual deposit of tokens in this contract must have already happened. I would rename it to assign
or debit
as what we are doing is just allowing the receiver to withdraw tokens in the future.
@@ -802,7 +808,8 @@ contract Court is IStakingOwner, ICRVotingOwner, ISubscriptionsOwner { | |||
terms[_draftTermId].dependingDrafts += 1; | |||
|
|||
if (_feeAmount > 0) { | |||
require(_feeToken.safeTransferFrom(msg.sender, address(staking), _feeAmount), ERROR_DEPOSIT_FAILED); | |||
// TODO: can we do the transfer-from from the accounting itself? the disputer must approve the accounting contract in that case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is cleaner to approve the same contract that you interact with as it is right now, but either way is fine with me.
f7d8516
to
85afe51
Compare
* disputes: handle agreement metadata * disputes: fix agreements metadata handler * disputes: fix agreements metadata handler * disputes: use app ID for agreement dispute metadata header * disputes: allow disputable org to be null * disputes: fix agreement content mapping
This PR introduces the concept of
CourtAccounting
, a new contract responsible for holding funds related to fees and handling withdraws to the corresponding holders.