-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a777111
commit 4c0d195
Showing
19 changed files
with
305 additions
and
158 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
41
contracts/testHelpers/testExtensions/TestExtensionBase.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
Oops, something went wrong.