Skip to content
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

Remove Tasks and Payments #1150

Merged
merged 20 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 68 additions & 4 deletions contracts/colony/Colony.sol
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,11 @@ contract Colony is BasicMetaTransaction, Multicall, ColonyStorage, PatriciaTreeP
emit ColonyMetadataDelta(msgSender(), _metadataDelta);
}

function bootstrapColony(
address[] memory _users,
int[] memory _amounts
) public stoppable auth isInBootstrapPhase {
function bootstrapColony(address[] memory _users, int[] memory _amounts) public stoppable auth {
require(
DEPRECATED_taskCount == 0 && DEPRECATED_paymentCount == 0 && expenditureCount == 0,
"colony-not-in-bootstrap-mode"
);
require(_users.length == _amounts.length, "colony-bootstrap-bad-inputs");

for (uint256 i = 0; i < _users.length; i++) {
Expand Down Expand Up @@ -323,6 +324,19 @@ contract Colony is BasicMetaTransaction, Multicall, ColonyStorage, PatriciaTreeP

sig = bytes4(keccak256("setExpenditureMetadata(uint256,uint256,uint256,string)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Arbitration), address(this), sig, true);

// Remove Task & Payment functions
sig = bytes4(keccak256("makeTask(uint256,uint256,bytes32,uint256,uint256,uint256)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Administration), address(this), sig, false);
sig = bytes4(keccak256("addPayment(uint256,uint256,address,address,uint256,uint256,uint256)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Administration), address(this), sig, false);
sig = bytes4(keccak256("setPaymentRecipient(uint256,uint256,uint256,address)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Administration), address(this), sig, false);
sig = bytes4(keccak256("setPaymentSkill(uint256,uint256,uint256,uint256)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Administration), address(this), sig, false);
sig = bytes4(keccak256("setPaymentPayout(uint256,uint256,uint256,address,uint256)"));
colonyAuthority.setRoleCapability(uint8(ColonyRole.Administration), address(this), sig, false);
sig = bytes4(keccak256("finalizePayment(uint256,uint256,uint256)"));
}

function getMetatransactionNonce(address _user) public view override returns (uint256 nonce) {
Expand Down Expand Up @@ -408,4 +422,54 @@ contract Colony is BasicMetaTransaction, Multicall, ColonyStorage, PatriciaTreeP
function getTotalTokenApproval(address _token) public view returns (uint256) {
return tokenApprovalTotals[_token];
}

// Deprecated view functions for Tasks and Payments
kronosapiens marked this conversation as resolved.
Show resolved Hide resolved

function getTaskCount() public view returns (uint256) {
return DEPRECATED_taskCount;
}

function getTaskChangeNonce(uint256 _id) public view returns (uint256) {
return DEPRECATED_taskChangeNonces[_id];
}

function getTaskWorkRatingSecretsInfo(uint256 _id) public view returns (uint256, uint256) {
return (DEPRECATED_taskWorkRatings[_id].count, DEPRECATED_taskWorkRatings[_id].timestamp);
}

function getTaskWorkRatingSecret(uint256 _id, uint8 _role) public view returns (bytes32) {
return DEPRECATED_taskWorkRatings[_id].secret[_role];
}

function getTaskRole(uint256 _id, uint8 _role) public view returns (Role memory role) {
role = DEPRECATED_tasks[_id].roles[_role];
}

function getTask(
uint256 _id
)
public
view
returns (bytes32, bytes32, TaskStatus, uint256, uint256, uint256, uint256, uint256[] memory)
{
Task storage t = DEPRECATED_tasks[_id];
return (
t.specificationHash,
t.deliverableHash,
t.status,
t.dueDate,
t.fundingPotId,
t.completionTimestamp,
t.domainId,
t.skills
);
}

function getPayment(uint256 _id) public view returns (Payment memory) {
return DEPRECATED_payments[_id];
}

function getPaymentCount() public view returns (uint256) {
return DEPRECATED_paymentCount;
}
}
7 changes: 1 addition & 6 deletions contracts/colony/ColonyAuthority.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ contract ColonyAuthority is CommonAuthority {
colony = _colony;

// Add permissions for the Administration role
addRoleCapability(ADMINISTRATION_ROLE, "makeTask(uint256,uint256,bytes32,uint256,uint256,uint256)");
addRoleCapability(ADMINISTRATION_ROLE, "addPayment(uint256,uint256,address,address,uint256,uint256,uint256)");
addRoleCapability(ADMINISTRATION_ROLE, "setPaymentRecipient(uint256,uint256,uint256,address)");
addRoleCapability(ADMINISTRATION_ROLE, "setPaymentSkill(uint256,uint256,uint256,uint256)");
addRoleCapability(ADMINISTRATION_ROLE, "setPaymentPayout(uint256,uint256,uint256,address,uint256)");
addRoleCapability(ADMINISTRATION_ROLE, "finalizePayment(uint256,uint256,uint256)");
// Task and Payments have been deprecated (see #1150)

// Add permissions for the Funding role
addRoleCapability(FUNDING_ROLE, "moveFundsBetweenPots(uint256,uint256,uint256,uint256,uint256,uint256,address)");
Expand Down
Loading