Skip to content

Commit

Permalink
Remove deprecated moveFundsBetweenPots transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
kronosapiens committed Oct 14, 2024
1 parent 427dbf3 commit f2a8604
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 47 deletions.
5 changes: 1 addition & 4 deletions test/contracts-network/colony-expenditure.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,7 @@ contract("Colony Expenditure", (accounts) => {
it("should error if the expenditure does not exist", async () => {
await checkErrorRevert(colony.setExpenditureSkills(100, [SLOT0], [localSkillId]), "colony-expenditure-does-not-exist");
await checkErrorRevert(colony.transferExpenditure(100, USER), "colony-expenditure-does-not-exist");
await checkErrorRevert(
colony.transferExpenditureViaArbitration(0, UINT256_MAX, 100, USER, { from: ARBITRATOR }),
"colony-expenditure-does-not-exist",
);
await checkErrorRevert(colony.cancelExpenditureViaArbitration(0, UINT256_MAX, 100, { from: ARBITRATOR }), "colony-expenditure-does-not-exist");
await checkErrorRevert(colony.cancelExpenditure(100), "colony-expenditure-does-not-exist");
await checkErrorRevert(colony.lockExpenditure(100), "colony-expenditure-does-not-exist");
await checkErrorRevert(colony.finalizeExpenditure(100), "colony-expenditure-does-not-exist");
Expand Down
7 changes: 1 addition & 6 deletions test/extensions/multisig-permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ contract("Multisig Permissions", (accounts) => {
);
});

it("can't propose an action that summarises to a forbidden action", async () => {
const action = await encodeTxData(colony, "moveFundsBetweenPots", [1, 2, 3, 4, 5, 6, ADDRESS_ZERO]);
await checkErrorRevert(multisigPermissions.createMotion(1, UINT256_MAX, [ADDRESS_ZERO], [action]), "colony-action-summary-forbidden-sig");
});

it("can propose an action requiring the same permissions for multiple actions in the same domain", async () => {
await setRootRoles(multisigPermissions, USER2, rolesToBytes32([ARCHITECTURE_ROLE]));

Expand Down Expand Up @@ -865,7 +860,7 @@ contract("Multisig Permissions", (accounts) => {
const d1 = await colony.getDomain(1);
const d2 = await colony.getDomain(2);

await colony.moveFundsBetweenPots(1, UINT256_MAX, 0, d1.fundingPotId, d2.fundingPotId, WAD, token.address);
await colony.moveFundsBetweenPots(1, UINT256_MAX, 1, UINT256_MAX, 0, d1.fundingPotId, d2.fundingPotId, WAD, token.address);

await colony.installExtension(ONE_TX_PAYMENT, oneTxPaymentVersion);
const oneTxPaymentAddress = await colonyNetwork.getExtensionInstallation(ONE_TX_PAYMENT, colony.address);
Expand Down
37 changes: 0 additions & 37 deletions test/extensions/voting-rep.js
Original file line number Diff line number Diff line change
Expand Up @@ -1822,9 +1822,6 @@ contract("Voting Reputation", (accounts) => {
});

it("can correctly summarize a multicall action", async () => {
const OLD_MOVE_FUNDS_SIG = soliditySha3("moveFundsBetweenPots(uint256,uint256,uint256,uint256,uint256,uint256,address)").slice(0, 10);
// NB This is still not a full call, but it's long enough that it has a permissions signature
const OLD_MOVE_FUNDS_CALL = `${OLD_MOVE_FUNDS_SIG}${"0".repeat(63)}1${bn2bytes32(UINT256_MAX).slice(2)}`;
const SET_EXPENDITURE_STATE = soliditySha3("setExpenditureState(uint256,uint256,uint256,uint256,bool[],bytes32[],bytes32)").slice(0, 10);
const SET_EXPENDITURE_PAYOUT = soliditySha3("setExpenditurePayout(uint256,uint256,uint256,uint256,address,uint256)").slice(0, 10);

Expand Down Expand Up @@ -1857,8 +1854,6 @@ contract("Voting Reputation", (accounts) => {
const action12 = await encodeTxData(tokenLocking, "obligateStake", [USER0, WAD, token.address]);
const action13 = await encodeTxData(tokenLocking, "obligateStake", [USER1, WAD, token.address]);

const action14 = await encodeTxData(colony, "moveFundsBetweenPots", [1, UINT256_MAX, 1, 1, 1, 1, 1, UINT256_MAX, token.address]);

let multicall;
let summary;

Expand All @@ -1869,11 +1864,6 @@ contract("Voting Reputation", (accounts) => {
expect(summary.expenditureId).to.eq.BN(expenditure2Id);
expect(summary.domainSkillId).to.eq.BN(domain3.skillId);

// Blacklisted function
multicall = await encodeTxData(colony, "multicall", [[OLD_MOVE_FUNDS_CALL, action14]]);
summary = await voting.getActionSummary(multicall, ADDRESS_ZERO);
await checkErrorRevertEstimateGas(voting.getActionSummary.estimateGas(multicall, ADDRESS_ZERO), "colony-action-summary-forbidden-sig");

// Special NO_ACTION
multicall = await encodeTxData(colony, "multicall", [[action9, NO_ACTION]]);
summary = await voting.getActionSummary(multicall, ADDRESS_ZERO);
Expand Down Expand Up @@ -3121,33 +3111,6 @@ contract("Voting Reputation", (accounts) => {
expect(await voting.getMotionState(motionId)).to.eq.BN(FINALIZED);
});

it("cannot let an invalid motion involving multicalling OLD_MOVE_FUNDS be finalized", async () => {
const action1 = await encodeTxData(colony, "moveFundsBetweenPots(uint256,uint256,uint256,uint256,uint256,uint256,address)", [
1,
0,
2,
0,
0,
0,
ADDRESS_ZERO,
]);
const multicall = await encodeTxData(colony, "multicall", [[action1]]);

await voting.createMotion(1, UINT256_MAX, ADDRESS_ZERO, multicall, domain1Key, domain1Value, domain1Mask, domain1Siblings);
const motionId = await voting.getMotionCount();

await colony.approveStake(voting.address, 1, WAD, { from: USER0 });
await voting.stakeMotion(motionId, 1, UINT256_MAX, YAY, REQUIRED_STAKE, user0Key, user0Value, user0Mask, user0Siblings, { from: USER0 });

await forwardTime(STAKE_PERIOD, this);

expect(await voting.getMotionState(motionId)).to.eq.BN(FINALIZABLE);

await upgradeFromV9ToLatest(colony);

expect(await voting.getMotionState(motionId)).to.eq.BN(FINALIZED);
});

it("cannot let an invalid motion involving multicalling NO_ACTION be finalized", async () => {
const multicall = await encodeTxData(colony, "multicall", [[NO_ACTION]]);

Expand Down

0 comments on commit f2a8604

Please sign in to comment.