-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deploying executor and always true condition (#616)
* deploying executor and always true condition * condition restrictions (#617) * condition restrictions * fix isGranted (#618) --------- Co-authored-by: Rekard0 <[email protected]> * remove alwaystruecondition deployment * remove .only * fix broken imports (#620) * uncomment --------- Co-authored-by: Rekard0 <[email protected]>
- Loading branch information
Showing
21 changed files
with
189 additions
and
46 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import {DAOFactory} from '../../types/framework/dao/DAOFactory'; | ||
import {DAOFactory} from '../../types/src/framework/dao/DAOFactory'; | ||
|
||
export type DAOSettingsStruct = DAOFactory.DAOSettingsStruct; | ||
export type PluginSettingsStruct = DAOFactory.PluginSettingsStruct; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import {PluginRepo} from '../../types/framework/plugin/repo/PluginRepo'; | ||
import {PluginRepo} from '../../types/src/framework/plugin/repo/PluginRepo'; | ||
|
||
export type TagStruct = PluginRepo.TagStruct; | ||
export type VersionStruct = PluginRepo.VersionStruct; |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * as DAOStructs from './DAO'; | ||
// export * as DAOStructs from './DAO'; | ||
export * as DAOFactoryStructs from './DAOFactory'; | ||
export * as PluginRepoStructs from './PluginRepo'; | ||
export * as PluginSetupProcessorStructs from './PluginSetupProcessor'; |
22 changes: 22 additions & 0 deletions
22
packages/contracts/deploy/new/10_framework/52_global_executor.ts
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,22 @@ | ||
import executorArtifact from '../../../artifacts/@aragon/osx-commons-contracts/src/executors/Executor.sol/Executor.json'; | ||
import {DeployFunction} from 'hardhat-deploy/types'; | ||
import {HardhatRuntimeEnvironment} from 'hardhat/types'; | ||
|
||
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { | ||
const {deployments, ethers} = hre; | ||
const {deploy} = deployments; | ||
const [deployer] = await ethers.getSigners(); | ||
|
||
await deploy('GlobalExecutor', { | ||
contract: executorArtifact, | ||
from: deployer.address, | ||
args: [], | ||
log: true, | ||
}); | ||
|
||
hre.aragonToVerifyContracts.push({ | ||
...(await deployments.get('GlobalExecutor')), | ||
}); | ||
}; | ||
export default func; | ||
func.tags = ['New', 'GlobalExecutor']; |
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
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
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 |
---|---|---|
|
@@ -17,14 +17,16 @@ import {IProtocolVersion} from "@aragon/osx-commons-contracts/src/utils/versioni | |
import {ProtocolVersion} from "@aragon/osx-commons-contracts/src/utils/versioning/ProtocolVersion.sol"; | ||
import {VersionComparisonLib} from "@aragon/osx-commons-contracts/src/utils/versioning/VersionComparisonLib.sol"; | ||
import {hasBit, flipBit} from "@aragon/osx-commons-contracts/src/utils/math/BitMap.sol"; | ||
import {Action} from "@aragon/osx-commons-contracts/src/executors/Executor.sol"; | ||
import {IExecutor} from "@aragon/osx-commons-contracts/src/executors/IExecutor.sol"; | ||
import {IDAO} from "@aragon/osx-commons-contracts/src/dao/IDAO.sol"; | ||
|
||
import {PermissionManager} from "../permission/PermissionManager.sol"; | ||
import {CallbackHandler} from "../utils/CallbackHandler.sol"; | ||
import {IEIP4824} from "./IEIP4824.sol"; | ||
|
||
/// @title DAO | ||
/// @author Aragon X - 2021-2023 | ||
/// @author Aragon X - 2021-2024 | ||
/// @notice This contract is the entry point to the Aragon DAO framework and provides our users a simple and easy to use public interface. | ||
/// @dev Public API of the Aragon DAO framework. | ||
/// @custom:security-contact [email protected] | ||
|
@@ -34,6 +36,7 @@ contract DAO is | |
IERC1271, | ||
ERC165StorageUpgradeable, | ||
IDAO, | ||
IExecutor, | ||
UUPSUpgradeable, | ||
ProtocolVersion, | ||
PermissionManager, | ||
|
@@ -117,6 +120,9 @@ contract DAO is | |
/// @notice Thrown when a function is removed but left to not corrupt the interface ID. | ||
error FunctionRemoved(); | ||
|
||
/// @notice Thrown when initialize is called after it has already been executed. | ||
error AlreadyInitialized(); | ||
|
||
/// @notice Emitted when a new DAO URI is set. | ||
/// @param daoURI The new URI. | ||
event NewURI(string daoURI); | ||
|
@@ -134,6 +140,15 @@ contract DAO is | |
_reentrancyStatus = _NOT_ENTERED; | ||
} | ||
|
||
/// @notice This ensures that the initialize function cannot be called during the upgrade process. | ||
modifier onlyCallAtInitialization() { | ||
if (_getInitializedVersion() != 0) { | ||
revert AlreadyInitialized(); | ||
} | ||
|
||
_; | ||
} | ||
|
||
/// @notice Disables the initializers on the implementation contract to prevent it from being left uninitialized. | ||
/// @custom:oz-upgrades-unsafe-allow constructor | ||
constructor() { | ||
|
@@ -155,10 +170,14 @@ contract DAO is | |
address _initialOwner, | ||
address _trustedForwarder, | ||
string calldata daoURI_ | ||
) external reinitializer(3) { | ||
) external onlyCallAtInitialization reinitializer(3) { | ||
_reentrancyStatus = _NOT_ENTERED; // added in v1.3.0 | ||
|
||
// In addition to the current interfaceId, also support previous version of the interfaceId. | ||
_registerInterface(type(IDAO).interfaceId ^ IExecutor.execute.selector); | ||
|
||
_registerInterface(type(IDAO).interfaceId); | ||
_registerInterface(type(IExecutor).interfaceId); | ||
_registerInterface(type(IERC1271).interfaceId); | ||
_registerInterface(type(IEIP4824).interfaceId); | ||
_registerInterface(type(IProtocolVersion).interfaceId); // added in v1.3.0 | ||
|
@@ -198,6 +217,9 @@ contract DAO is | |
_who: address(this), | ||
_permissionId: keccak256("SET_SIGNATURE_VALIDATOR_PERMISSION") | ||
}); | ||
|
||
_registerInterface(type(IDAO).interfaceId); | ||
_registerInterface(type(IExecutor).interfaceId); | ||
} | ||
} | ||
|
||
|
@@ -246,7 +268,7 @@ contract DAO is | |
_setMetadata(_metadata); | ||
} | ||
|
||
/// @inheritdoc IDAO | ||
/// @inheritdoc IExecutor | ||
function execute( | ||
bytes32 _callId, | ||
Action[] calldata _actions, | ||
|
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
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
Oops, something went wrong.