Skip to content

Commit 905caa5

Browse files
committed
Deprecate makeArbitraryTransactions
1 parent d981b4b commit 905caa5

File tree

11 files changed

+59
-183
lines changed

11 files changed

+59
-183
lines changed

contracts/colony/ColonyArbitraryTransaction.sol

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,6 @@ contract ColonyArbitraryTransaction is ColonyStorage {
3838
address _to,
3939
bytes memory _action
4040
) public stoppable auth returns (bool) {
41-
bool res = this.makeSingleArbitraryTransaction(_to, _action);
42-
43-
emit ArbitraryTransaction(msgSender(), _to, _action, res);
44-
return res;
45-
}
46-
47-
function makeArbitraryTransactions(
48-
address[] memory _targets,
49-
bytes[] memory _actions,
50-
bool _strict
51-
) public stoppable auth returns (bool) {
52-
require(_targets.length == _actions.length, "colony-targets-and-actions-length-mismatch");
53-
for (uint256 i; i < _targets.length; i += 1) {
54-
bool success = true;
55-
// slither-disable-next-line unused-return
56-
try this.makeSingleArbitraryTransaction(_targets[i], _actions[i]) returns (bool ret) {
57-
if (_strict) {
58-
success = ret;
59-
}
60-
61-
emit ArbitraryTransaction(msgSender(), _targets[i], _actions[i], ret);
62-
} catch Error(string memory _err) {
63-
// We failed in a require, which is only okay if we're not in strict mode
64-
if (_strict) {
65-
success = false;
66-
}
67-
68-
emit ArbitraryTransaction(msgSender(), _targets[i], _actions[i], false);
69-
}
70-
require(success, "colony-arbitrary-transaction-failed");
71-
}
72-
return true;
73-
}
74-
75-
function makeSingleArbitraryTransaction(
76-
address _to,
77-
bytes memory _action
78-
) external stoppable self returns (bool) {
7941
// Prevent transactions to network contracts
8042
require(_to != address(this), "colony-cannot-target-self");
8143
require(_to != colonyNetworkAddress, "colony-cannot-target-network");

contracts/colony/ColonyAuthority.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ contract ColonyAuthority is CommonAuthority {
9898
addRoleCapability(ROOT_ROLE, "upgradeExtension(bytes32,uint256)");
9999
addRoleCapability(ROOT_ROLE, "deprecateExtension(bytes32,bool)");
100100
addRoleCapability(ROOT_ROLE, "uninstallExtension(bytes32)");
101-
addRoleCapability(ROOT_ROLE, "makeArbitraryTransaction(address,bytes)"); // Deprecated
101+
addRoleCapability(ROOT_ROLE, "makeArbitraryTransaction(address,bytes)");
102102
addRoleCapability(ROOT_ROLE, "emitDomainReputationReward(uint256,address,int256)");
103103
addRoleCapability(ROOT_ROLE, "emitSkillReputationReward(uint256,address,int256)");
104104
addRoleCapability(ARBITRATION_ROLE, "transferStake(uint256,uint256,address,address,uint256,uint256,address)");
@@ -116,7 +116,7 @@ contract ColonyAuthority is CommonAuthority {
116116
addRoleCapability(FUNDING_ROLE, "moveFundsBetweenPots(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address)");
117117

118118
// Added in colony v8 (ebony-lwss)
119-
addRoleCapability(ROOT_ROLE, "makeArbitraryTransactions(address[],bytes[],bool)");
119+
addRoleCapability(ROOT_ROLE, "makeArbitraryTransactions(address[],bytes[],bool)"); // Deprecated
120120
addRoleCapability(ROOT_ROLE, "setDefaultGlobalClaimDelay(uint256)");
121121
addRoleCapability(ARBITRATION_ROLE, "setExpenditureMetadata(uint256,uint256,uint256,string)");
122122

contracts/colony/IColony.sol

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,11 @@ interface IColony is IDSAuth, ColonyDataTypes, IRecovery, IBasicMetaTransaction,
5151
/// @return tokenAddress Address of the token contract
5252
function getToken() external view returns (address tokenAddress);
5353

54-
/// @notice Execute arbitrary transactions on behalf of the Colony in series
55-
/// @param _targets Array of addressed to be targeted
56-
/// @param _actions Array of Bytes arrays encoding the function calls and arguments
57-
/// @param _strict Boolean indicating whether if one transaction fails, the whole call to this function should fail.
58-
/// @return success Boolean indicating whether the transactions succeeded
59-
function makeArbitraryTransactions(
60-
address[] memory _targets,
61-
bytes[] memory _actions,
62-
bool _strict
63-
) external returns (bool success);
64-
65-
/// @notice Executes a single arbitrary transaction
66-
/// @dev Only callable by the colony itself. If you wish to use this functionality, you should
67-
/// use the makeAbitraryTransactions function
54+
/// @notice Executes an arbitrary transaction
6855
/// @param _target Contract to receive the function call
6956
/// @param _action Bytes array encoding the function call and arguments
7057
/// @return success Boolean indicating whether the transactions succeeded
71-
function makeSingleArbitraryTransaction(
58+
function makeArbitraryTransaction(
7259
address _target,
7360
bytes memory _action
7461
) external returns (bool success);

docs/interfaces/icolony.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,18 +1049,17 @@ Lock the colony's token. Can only be called by a network-managed extension.
10491049
|---|---|---|
10501050
|timesLocked|uint256|The amount of times the token was locked
10511051

1052-
### `makeArbitraryTransactions(address[] memory _targets, bytes[] memory _actions, bool _strict):bool success`
1052+
### `makeArbitraryTransaction(address _target, bytes memory _action):bool success`
10531053

1054-
Execute arbitrary transactions on behalf of the Colony in series
1054+
Executes an arbitrary transaction
10551055

10561056

10571057
**Parameters**
10581058

10591059
|Name|Type|Description|
10601060
|---|---|---|
1061-
|_targets|address[]|Array of addressed to be targeted
1062-
|_actions|bytes[]|Array of Bytes arrays encoding the function calls and arguments
1063-
|_strict|bool|Boolean indicating whether if one transaction fails, the whole call to this function should fail.
1061+
|_target|address|Contract to receive the function call
1062+
|_action|bytes|Bytes array encoding the function call and arguments
10641063

10651064
**Return Parameters**
10661065

@@ -1087,25 +1086,6 @@ Add a new expenditure in the colony. Secured function to authorised members.
10871086
|---|---|---|
10881087
|expenditureId|uint256|Identifier of the newly created expenditure
10891088

1090-
### `makeSingleArbitraryTransaction(address _target, bytes memory _action):bool success`
1091-
1092-
Executes a single arbitrary transaction
1093-
1094-
*Note: Only callable by the colony itself. If you wish to use this functionality, you should use the makeAbitraryTransactions function*
1095-
1096-
**Parameters**
1097-
1098-
|Name|Type|Description|
1099-
|---|---|---|
1100-
|_target|address|Contract to receive the function call
1101-
|_action|bytes|Bytes array encoding the function call and arguments
1102-
1103-
**Return Parameters**
1104-
1105-
|Name|Type|Description|
1106-
|---|---|---|
1107-
|success|bool|Boolean indicating whether the transactions succeeded
1108-
11091089
### `mintTokens(uint256 _wad)`
11101090

11111091
Mint `_wad` amount of colony tokens. Secured function to authorised members.

docs/interfaces/imetacolony.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,18 +1087,17 @@ Lock the colony's token. Can only be called by a network-managed extension.
10871087
|---|---|---|
10881088
|timesLocked|uint256|The amount of times the token was locked
10891089

1090-
### `makeArbitraryTransactions(address[] memory _targets, bytes[] memory _actions, bool _strict):bool success`
1090+
### `makeArbitraryTransaction(address _target, bytes memory _action):bool success`
10911091

1092-
Execute arbitrary transactions on behalf of the Colony in series
1092+
Executes an arbitrary transaction
10931093

10941094

10951095
**Parameters**
10961096

10971097
|Name|Type|Description|
10981098
|---|---|---|
1099-
|_targets|address[]|Array of addressed to be targeted
1100-
|_actions|bytes[]|Array of Bytes arrays encoding the function calls and arguments
1101-
|_strict|bool|Boolean indicating whether if one transaction fails, the whole call to this function should fail.
1099+
|_target|address|Contract to receive the function call
1100+
|_action|bytes|Bytes array encoding the function call and arguments
11021101

11031102
**Return Parameters**
11041103

@@ -1125,25 +1124,6 @@ Add a new expenditure in the colony. Secured function to authorised members.
11251124
|---|---|---|
11261125
|expenditureId|uint256|Identifier of the newly created expenditure
11271126

1128-
### `makeSingleArbitraryTransaction(address _target, bytes memory _action):bool success`
1129-
1130-
Executes a single arbitrary transaction
1131-
1132-
*Note: Only callable by the colony itself. If you wish to use this functionality, you should use the makeAbitraryTransactions function*
1133-
1134-
**Parameters**
1135-
1136-
|Name|Type|Description|
1137-
|---|---|---|
1138-
|_target|address|Contract to receive the function call
1139-
|_action|bytes|Bytes array encoding the function call and arguments
1140-
1141-
**Return Parameters**
1142-
1143-
|Name|Type|Description|
1144-
|---|---|---|
1145-
|success|bool|Boolean indicating whether the transactions succeeded
1146-
11471127
### `mintTokens(uint256 _wad)`
11481128

11491129
Mint `_wad` amount of colony tokens. Secured function to authorised members.

packages/metatransaction-broadcaster/MetatransactionBroadcaster.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,12 @@ class MetatransactionBroadcaster {
206206
async isColonyFamilyTransactionAllowed(target, txData, userAddress) {
207207
const colonyDef = await this.loader.load({ contractDir: "colony", contractName: "IColony" });
208208

209-
// Add the old makeArbitraryTransaction to the abi
210-
const iface = new ethers.utils.Interface(["function makeArbitraryTransaction(address,bytes)"]);
209+
// Add the old makeSingleArbitraryTransaction and makeArbitraryTransactions to the abi
210+
const iface = new ethers.utils.Interface([
211+
"function makeSingleArbitraryTransaction(address,bytes)",
212+
"function makeArbitraryTransactions(address[],bytes[],bool)",
213+
]);
214+
211215
const oldJsonAbi = JSON.parse(iface.format(ethers.utils.FormatTypes.json));
212216
oldJsonAbi[0].inputs = oldJsonAbi[0].inputs.map((x) => {
213217
return { ...x, internalType: x.type };

0 commit comments

Comments
 (0)