Skip to content

Commit 5a220d2

Browse files
authored
Merge pull request #972 from JoinColony/maint/post-7-release
Bumps / cleanups / updates for next release
2 parents fffe3ab + ce91549 commit 5a220d2

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

contracts/colony/Colony.sol

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ import "./ColonyStorage.sol";
2626

2727
contract Colony is ColonyStorage, PatriciaTreeProofs, MultiChain {
2828

29-
// V6: Cerulean Lightweight Spaceship
29+
// V8: Ebony Lightweight Spaceship
3030
// This function, exactly as defined, is used in build scripts. Take care when updating.
3131
// Version number should be upped with every change in Colony or its dependency contracts or libraries.
32-
function version() public pure returns (uint256 colonyVersion) { return 7; }
32+
function version() public pure returns (uint256 colonyVersion) { return 8; }
3333

3434
function getColonyNetwork() public view returns (address) {
3535
return colonyNetworkAddress;
@@ -460,17 +460,10 @@ contract Colony is ColonyStorage, PatriciaTreeProofs, MultiChain {
460460
emit ColonyUpgraded(msg.sender, currentVersion, _newVersion);
461461
}
462462

463-
// v5 to v6
463+
// v7 to v8
464464
function finishUpgrade() public always {
465465
ColonyAuthority colonyAuthority = ColonyAuthority(address(authority));
466466
bytes4 sig;
467-
468-
sig = bytes4(keccak256("setUserRoles(uint256,uint256,address,uint256,bytes32)"));
469-
colonyAuthority.setRoleCapability(uint8(ColonyRole.Root), address(this), sig, true);
470-
471-
sig = bytes4(keccak256("moveFundsBetweenPots(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address)"));
472-
colonyAuthority.setRoleCapability(uint8(ColonyRole.Funding), address(this), sig, true);
473-
474467
}
475468

476469
function checkNotAdditionalProtectedVariable(uint256 _slot) public view recovery {

contracts/colony/ColonyAuthority.sol

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,10 @@ contract ColonyAuthority is CommonAuthority {
111111
addRoleCapability(ROOT_ROLE, "burnTokens(address,uint256)");
112112
addRoleCapability(ROOT_ROLE, "unlockToken()");
113113

114-
// Added in colony v6 (d-lwss)
114+
// Added in colony v7 (d-lwss)
115115
addRoleCapability(FUNDING_ROLE, "moveFundsBetweenPots(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,address)");
116+
117+
// Added in colony v8 (e-lwss)
116118
}
117119

118120
function addRoleCapability(uint8 role, bytes memory sig) private {

helpers/constants.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const INT256_MIN = new BN(2).pow(new BN(255)).mul(new BN(-1));
99
const INT128_MAX = new BN(2).pow(new BN(127)).sub(new BN(1));
1010
const INT128_MIN = new BN(2).pow(new BN(127)).mul(new BN(-1));
1111

12-
const CURR_VERSION = 7;
12+
const CURR_VERSION = 8;
1313

1414
const RECOVERY_ROLE = 0;
1515
const ROOT_ROLE = 1;

scripts/deployUnmockedColonyVersions.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = async (callback) => {
2424
let v4ResolverAddress;
2525
let v5ResolverAddress;
2626
let v6ResolverAddress;
27+
let v7ResolverAddress;
2728
const colonyNetwork = await IColonyNetwork.at(cnAddress);
2829
const metaColonyAddress = await colonyNetwork.getMetaColony();
2930
const metaColony = await IMetaColony.at(metaColonyAddress);
@@ -96,6 +97,23 @@ module.exports = async (callback) => {
9697
index = res.indexOf("Colony version 6 set to Resolver");
9798
v6ResolverAddress = res.substring(index + RESOLVER_LOG_OFFSET, index + RESOLVER_LOG_OFFSET + ADDRESS_LENGTH);
9899
await metaColony.addNetworkColonyVersion(6, v6ResolverAddress);
100+
101+
await exec("git checkout -f dlwss && git submodule update");
102+
103+
// Comment out uneeded parts of file
104+
await exec("sed -i'' -e '29,30 s|^|//|' ./migrations/4_setup_colony_version_resolver.js");
105+
await exec("sed -i'' -e '34 s|^|//|' ./migrations/4_setup_colony_version_resolver.js");
106+
await exec("sed -i'' -e 's|await ContractRecovery.deployed()|await ContractRecovery.new()|' ./migrations/4_setup_colony_version_resolver.js");
107+
await exec("rm -rf ./build");
108+
res = await exec("yarn run truffle migrate --reset -f 4 --to 4");
109+
110+
if (res.stdout) {
111+
// How this response looks changes node 10->12
112+
res = res.stdout;
113+
}
114+
index = res.indexOf("Colony version 7 set to Resolver");
115+
v7ResolverAddress = res.substring(index + RESOLVER_LOG_OFFSET, index + RESOLVER_LOG_OFFSET + ADDRESS_LENGTH);
116+
await metaColony.addNetworkColonyVersion(7, v7ResolverAddress);
99117
} catch (err) {
100118
console.log(err);
101119
}

test-smoke/colony-storage-consistent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ contract("Contract Storage", (accounts) => {
154154
console.log("miningCycleStateHash:", miningCycleAccount.stateRoot.toString("hex"));
155155
console.log("tokenLockingStateHash:", tokenLockingAccount.stateRoot.toString("hex"));
156156

157-
expect(colonyNetworkAccount.stateRoot.toString("hex")).to.equal("2d8b407a3d5d1a48b07a00c968942ee7cb384961a5f166035a194cf7f8bd3245");
157+
expect(colonyNetworkAccount.stateRoot.toString("hex")).to.equal("ae7b69103eaaa0555222e8f2e4e9a66e002f27e9cffbb8952e12701725d63ef2");
158158
expect(colonyAccount.stateRoot.toString("hex")).to.equal("36096952d464e6c70a0a3aa2ecf068dff7bc6af70ffe022d57d8e2342d39f989");
159159
expect(metaColonyAccount.stateRoot.toString("hex")).to.equal("6bee0085d000fc929e06c1281c162eaa7ac22ff9e2dcc520066e5e7720de6394");
160160
expect(miningCycleAccount.stateRoot.toString("hex")).to.equal("bcfee6939c375d042704e338652a1e2d1e6f7b0e69587b79e72bde08ca777927");

0 commit comments

Comments
 (0)