diff --git a/contracts/access/IAccessControl.sol b/contracts/access/IAccessControl.sol index dbcd3957bf8..67ea537ed8d 100644 --- a/contracts/access/IAccessControl.sol +++ b/contracts/access/IAccessControl.sol @@ -30,8 +30,8 @@ interface IAccessControl { /** * @dev Emitted when `account` is granted `role`. * - * `sender` is the account that originated the contract call, an admin role - * bearer except when using {AccessControl-_setupRole}. + * `sender` is the account that originated the contract call. This account bears the admin role (for the granted role). + * Expected in cases where the role was granted using the internal {AccessControl-_grantRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 830c9d83c1d..3edc71a4069 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -286,10 +286,12 @@ abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC72 } // check proposal threshold - uint256 proposerVotes = getVotes(proposer, clock() - 1); uint256 votesThreshold = proposalThreshold(); - if (proposerVotes < votesThreshold) { - revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold); + if (votesThreshold > 0) { + uint256 proposerVotes = getVotes(proposer, clock() - 1); + if (proposerVotes < votesThreshold) { + revert GovernorInsufficientProposerVotes(proposer, proposerVotes, votesThreshold); + } } return _propose(targets, values, calldatas, description, proposer); diff --git a/contracts/proxy/Clones.sol b/contracts/proxy/Clones.sol index d49c0ab1bf2..1cfdc40494c 100644 --- a/contracts/proxy/Clones.sol +++ b/contracts/proxy/Clones.sol @@ -39,12 +39,13 @@ library Clones { } /// @solidity memory-safe-assembly assembly { - // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes - // of the `implementation` address with the bytecode before the address. - mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) - // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. - mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) - instance := create(value, 0x09, 0x37) + // Stores the bytecode after address + mstore(0x20, 0x5af43d82803e903d91602b57fd5bf3) + // implementation address + mstore(0x11, implementation) + // Packs the first 3 bytes of the `implementation` address with the bytecode before the address. + mstore(0x00, or(shr(0x88, implementation), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) + instance := create(0, 0x09, 0x37) } if (instance == address(0)) { revert Errors.FailedDeployment(); @@ -79,12 +80,13 @@ library Clones { } /// @solidity memory-safe-assembly assembly { - // Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes - // of the `implementation` address with the bytecode before the address. - mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) - // Packs the remaining 17 bytes of `implementation` with the bytecode after the address. - mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3)) - instance := create2(value, 0x09, 0x37, salt) + // Stores the bytecode after address + mstore(0x20, 0x5af43d82803e903d91602b57fd5bf3) + // implementation address + mstore(0x11, implementation) + // Packs the first 3 bytes of the `implementation` address with the bytecode before the address. + mstore(0x00, or(shr(0x88, implementation), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000)) + instance := create2(0, 0x09, 0x37, salt) } if (instance == address(0)) { revert Errors.FailedDeployment();