Skip to content

Commit

Permalink
Properly migrate setupEtherRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
kronosapiens committed Dec 21, 2023
1 parent a777111 commit 4c0d195
Show file tree
Hide file tree
Showing 19 changed files with 305 additions and 158 deletions.
103 changes: 0 additions & 103 deletions contracts/testHelpers/TestExtensions.sol

This file was deleted.

32 changes: 32 additions & 0 deletions contracts/testHelpers/testExtensions/TestExtension0.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.8.23;
pragma experimental ABIEncoderV2;

import { TestExtensionBase } from "./TestExtensionBase.sol";

contract TestExtension0 is TestExtensionBase {
function identifier() public pure override returns (bytes32) {
return keccak256("TestExtension");
}

function version() public pure override returns (uint256) {
return 0;
}
}
36 changes: 36 additions & 0 deletions contracts/testHelpers/testExtensions/TestExtension1.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.8.23;
pragma experimental ABIEncoderV2;

import { TestExtensionBase } from "./TestExtensionBase.sol";

contract TestExtension1 is TestExtensionBase {
function identifier() public pure override returns (bytes32) {
return keccak256("TestExtension");
}

function version() public pure override returns (uint256) {
return 1;
}

function receiveEther() external payable {} // solhint-disable-line no-empty-blocks

function foo() public notDeprecated {} // solhint-disable-line no-empty-blocks
}
32 changes: 32 additions & 0 deletions contracts/testHelpers/testExtensions/TestExtension2.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.8.23;
pragma experimental ABIEncoderV2;

import { TestExtensionBase } from "./TestExtensionBase.sol";

contract TestExtension2 is TestExtensionBase {
function identifier() public pure override returns (bytes32) {
return keccak256("TestExtension");
}

function version() public pure override returns (uint256) {
return 2;
}
}
32 changes: 32 additions & 0 deletions contracts/testHelpers/testExtensions/TestExtension3.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.8.23;
pragma experimental ABIEncoderV2;

import { TestExtensionBase } from "./TestExtensionBase.sol";

contract TestExtension3 is TestExtensionBase {
function identifier() public pure override returns (bytes32) {
return keccak256("TestExtension");
}

function version() public pure override returns (uint256) {
return 3;
}
}
41 changes: 41 additions & 0 deletions contracts/testHelpers/testExtensions/TestExtensionBase.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.8.23;
pragma experimental ABIEncoderV2;

import { ColonyExtensionMeta } from "./../../extensions/ColonyExtensionMeta.sol";
import { IColony } from "./../../colony/IColony.sol";

abstract contract TestExtensionBase is ColonyExtensionMeta {
function install(address _colony) public override auth {
require(address(colony) == address(0x0), "extension-already-installed");

colony = IColony(_colony);
}

function finishUpgrade() public override auth {} // solhint-disable-line no-empty-blocks

function deprecate(bool _deprecated) public override auth {
deprecated = _deprecated;
}

function uninstall() public override auth {
selfdestruct(payable(address(colony)));
}
}
40 changes: 40 additions & 0 deletions contracts/testHelpers/testExtensions/TestVotingToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// SPDX-License-Identifier: GPL-3.0-or-later
/*
This file is part of The Colony Network.
The Colony Network is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The Colony Network is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with The Colony Network. If not, see <http://www.gnu.org/licenses/>.
*/

pragma solidity 0.8.23;
pragma experimental ABIEncoderV2;

import { TestExtensionBase } from "./TestExtensionBase.sol";

contract TestVotingToken is TestExtensionBase {
function identifier() public pure override returns (bytes32) {
return keccak256("VotingToken");
}

function version() public pure override returns (uint256) {
return 1;
}

function lockToken() public returns (uint256) {
return colony.lockToken();
}

function unlockTokenForUser(address _user, uint256 _lockId) public {
colony.unlockTokenForUser(_user, _lockId);
}
}
Loading

0 comments on commit 4c0d195

Please sign in to comment.