-
Notifications
You must be signed in to change notification settings - Fork 9
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
[Governance] Add governance functions in Octobay main contract. #7
Comments
@mktcode - hmmm, I can't see any bounty claim implementation in any of the contracts... am I missing something? |
As discussed on Discord, the existing code for this was outdated and removed. New implementation might look something like this: mapping(bytes32 => string) public issueWithdrawRequests;
function withdrawIssueDeposit(
address _oracle,
string calldata _issueId
) public oracleHandlesJob(_oracle, 'claim') returns(bytes32 requestId) {
(bytes32 jobId, uint256 jobFee) = oracleStorage.getOracleJob(_oracle, 'claim');
Chainlink.Request memory request =
buildChainlinkRequest(
jobId,
address(this),
this.confirmWithdrawIssueDeposit.selector
);
request.add('githubUserId', userAddressStorage.userIdsByAddress(msg.sender));
request.add('issueId', _issueId);
requestId = sendChainlinkRequestTo(_oracle, request, jobFee);
issueWithdrawRequests[requestId] = _issueId;
}
function confirmWithdrawIssueDeposit(bytes32 _requestId)
public
recordChainlinkFulfillment(_requestId)
{
require(
issueDepositsAmountByIssueId[issueWithdrawRequests[_requestId]] > 0,
'This bounty has been withdrawn already.'
);
payable(msg.sender).transfer(issueDepositsAmountByIssueId[issueWithdrawRequests[_requestId]]);
issueDepositsAmountByIssueId[issueWithdrawRequests[_requestId]] = 0;
// delete issueDeposits[_depositId]; ??? loop through issueDepositIdsByIssueId ???
} The last line here ( A bounty can actually consist of multiple deposits from multiple users, e.g. a main deposit by the project and then some additional funds from the community. Looping through these deposits ( Skipping that and simply setting Alternatively we could restrict a bounty to a single deposit but a little tear would run down my face then. 😢 |
For the record: A problem with the gov token distribution when a bounty is withdrawn is that there's currently no connection between Another way of solving this could be to work with hashes (md5 -> 32bytes) instead of the actual data. For now the most reasonable solution is the following: The maintainer needs to choose which governance token ( Since everybody can deposit funds on an issue, we need some additional checks in the deposit function. Could become: If Easypeasy... 😅 |
for the record: |
@octobay release to @mktcode
Concept: https://octobay.github.io/docs/GOVERNANCE.html
UI Mockups: https://www.figma.com/proto/AzJ6BbBetEwtD6h6p8q1uM/Octobay-Governance-UI?scaling=scale-down
The main Octobay contract needs functions to use the token factory (#5), to launch new governance tokens and the proposal storage (#6), to add new proposals and votes on them.
Creating new tokens and proposals requires oracle checks (OctobayArchive/chainlink-adapters#9, OctobayArchive/chainlink-adapters#10), to make sure only the owner of the respective repository/org is allowed to do that.
When releasing a bounty (either by a user withdrawing funds from a smart bounty or by manual transfer through Octobay's send feature in case of a bounty promise that was never upgraded to a smart bounty but solved anyway) we need to issue governance tokens, based on the USD value of the bounty. As long as we didn't implement ERC20 for bounties, a simple ETH-USD chainlink price feed call will be sufficient. Once ERC20 is implemented, things will become a bit more cumbersome and maybe require a custom chainlink adapter.
The text was updated successfully, but these errors were encountered: