Update Prettier Solidity (#3898)
This commit is contained in:
@ -314,7 +314,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
|
||||
* @dev Internal execution mechanism. Can be overridden to implement different execution mechanism
|
||||
*/
|
||||
function _execute(
|
||||
uint256, /* proposalId */
|
||||
uint256 /* proposalId */,
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
@ -331,9 +331,9 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
|
||||
* @dev Hook before execution is triggered.
|
||||
*/
|
||||
function _beforeExecute(
|
||||
uint256, /* proposalId */
|
||||
uint256 /* proposalId */,
|
||||
address[] memory targets,
|
||||
uint256[] memory, /* values */
|
||||
uint256[] memory /* values */,
|
||||
bytes[] memory calldatas,
|
||||
bytes32 /*descriptionHash*/
|
||||
) internal virtual {
|
||||
@ -350,10 +350,10 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
|
||||
* @dev Hook after execution is triggered.
|
||||
*/
|
||||
function _afterExecute(
|
||||
uint256, /* proposalId */
|
||||
address[] memory, /* targets */
|
||||
uint256[] memory, /* values */
|
||||
bytes[] memory, /* calldatas */
|
||||
uint256 /* proposalId */,
|
||||
address[] memory /* targets */,
|
||||
uint256[] memory /* values */,
|
||||
bytes[] memory /* calldatas */,
|
||||
bytes32 /*descriptionHash*/
|
||||
) internal virtual {
|
||||
if (_executor() != address(this)) {
|
||||
@ -540,11 +540,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
|
||||
* in a governance proposal to recover tokens or Ether that was sent to the governor contract by mistake.
|
||||
* Note that if the executor is simply the governor itself, use of `relay` is redundant.
|
||||
*/
|
||||
function relay(
|
||||
address target,
|
||||
uint256 value,
|
||||
bytes calldata data
|
||||
) external payable virtual onlyGovernance {
|
||||
function relay(address target, uint256 value, bytes calldata data) external payable virtual onlyGovernance {
|
||||
(bool success, bytes memory returndata) = target.call{value: value}(data);
|
||||
Address.verifyCallResult(success, returndata, "Governor: relay reverted without message");
|
||||
}
|
||||
@ -560,12 +556,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive
|
||||
/**
|
||||
* @dev See {IERC721Receiver-onERC721Received}.
|
||||
*/
|
||||
function onERC721Received(
|
||||
address,
|
||||
address,
|
||||
uint256,
|
||||
bytes memory
|
||||
) public virtual override returns (bytes4) {
|
||||
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
|
||||
return this.onERC721Received.selector;
|
||||
}
|
||||
|
||||
|
||||
@ -74,12 +74,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
|
||||
* administration through timelocked proposals. Previous versions of this contract would assign
|
||||
* this admin to the deployer automatically and should be renounced as well.
|
||||
*/
|
||||
constructor(
|
||||
uint256 minDelay,
|
||||
address[] memory proposers,
|
||||
address[] memory executors,
|
||||
address admin
|
||||
) {
|
||||
constructor(uint256 minDelay, address[] memory proposers, address[] memory executors, address admin) {
|
||||
_setRoleAdmin(TIMELOCK_ADMIN_ROLE, TIMELOCK_ADMIN_ROLE);
|
||||
_setRoleAdmin(PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE);
|
||||
_setRoleAdmin(EXECUTOR_ROLE, TIMELOCK_ADMIN_ROLE);
|
||||
@ -342,11 +337,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
|
||||
/**
|
||||
* @dev Execute an operation's call.
|
||||
*/
|
||||
function _execute(
|
||||
address target,
|
||||
uint256 value,
|
||||
bytes calldata data
|
||||
) internal virtual {
|
||||
function _execute(address target, uint256 value, bytes calldata data) internal virtual {
|
||||
(bool success, ) = target.call{value: value}(data);
|
||||
require(success, "TimelockController: underlying transaction reverted");
|
||||
}
|
||||
@ -386,12 +377,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver
|
||||
/**
|
||||
* @dev See {IERC721Receiver-onERC721Received}.
|
||||
*/
|
||||
function onERC721Received(
|
||||
address,
|
||||
address,
|
||||
uint256,
|
||||
bytes memory
|
||||
) public virtual override returns (bytes4) {
|
||||
function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) {
|
||||
return this.onERC721Received.selector;
|
||||
}
|
||||
|
||||
|
||||
@ -118,11 +118,10 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
|
||||
/**
|
||||
* @dev Encodes calldatas with optional function signature.
|
||||
*/
|
||||
function _encodeCalldata(string[] memory signatures, bytes[] memory calldatas)
|
||||
private
|
||||
pure
|
||||
returns (bytes[] memory)
|
||||
{
|
||||
function _encodeCalldata(
|
||||
string[] memory signatures,
|
||||
bytes[] memory calldatas
|
||||
) private pure returns (bytes[] memory) {
|
||||
bytes[] memory fullcalldatas = new bytes[](calldatas.length);
|
||||
|
||||
for (uint256 i = 0; i < signatures.length; ++i) {
|
||||
@ -163,7 +162,9 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
|
||||
/**
|
||||
* @dev See {IGovernorCompatibilityBravo-proposals}.
|
||||
*/
|
||||
function proposals(uint256 proposalId)
|
||||
function proposals(
|
||||
uint256 proposalId
|
||||
)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
@ -200,7 +201,9 @@ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorComp
|
||||
/**
|
||||
* @dev See {IGovernorCompatibilityBravo-getActions}.
|
||||
*/
|
||||
function getActions(uint256 proposalId)
|
||||
function getActions(
|
||||
uint256 proposalId
|
||||
)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
|
||||
@ -50,7 +50,9 @@ abstract contract IGovernorCompatibilityBravo is IGovernor {
|
||||
/**
|
||||
* @dev Part of the Governor Bravo's interface: _"The official record of all proposals ever proposed"_.
|
||||
*/
|
||||
function proposals(uint256)
|
||||
function proposals(
|
||||
uint256
|
||||
)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
@ -96,7 +98,9 @@ abstract contract IGovernorCompatibilityBravo is IGovernor {
|
||||
/**
|
||||
* @dev Part of the Governor Bravo's interface: _"Gets actions of a proposal"_.
|
||||
*/
|
||||
function getActions(uint256 proposalId)
|
||||
function getActions(
|
||||
uint256 proposalId
|
||||
)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
|
||||
@ -47,16 +47,9 @@ abstract contract GovernorCountingSimple is Governor {
|
||||
/**
|
||||
* @dev Accessor to the internal vote counts.
|
||||
*/
|
||||
function proposalVotes(uint256 proposalId)
|
||||
public
|
||||
view
|
||||
virtual
|
||||
returns (
|
||||
uint256 againstVotes,
|
||||
uint256 forVotes,
|
||||
uint256 abstainVotes
|
||||
)
|
||||
{
|
||||
function proposalVotes(
|
||||
uint256 proposalId
|
||||
) public view virtual returns (uint256 againstVotes, uint256 forVotes, uint256 abstainVotes) {
|
||||
ProposalVote storage proposalVote = _proposalVotes[proposalId];
|
||||
return (proposalVote.againstVotes, proposalVote.forVotes, proposalVote.abstainVotes);
|
||||
}
|
||||
|
||||
@ -22,11 +22,7 @@ abstract contract GovernorSettings is Governor {
|
||||
/**
|
||||
* @dev Initialize the governance parameters.
|
||||
*/
|
||||
constructor(
|
||||
uint256 initialVotingDelay,
|
||||
uint256 initialVotingPeriod,
|
||||
uint256 initialProposalThreshold
|
||||
) {
|
||||
constructor(uint256 initialVotingDelay, uint256 initialVotingPeriod, uint256 initialProposalThreshold) {
|
||||
_setVotingDelay(initialVotingDelay);
|
||||
_setVotingPeriod(initialVotingPeriod);
|
||||
_setProposalThreshold(initialProposalThreshold);
|
||||
|
||||
@ -110,7 +110,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
|
||||
* @dev Overridden execute function that run the already queued proposal through the timelock.
|
||||
*/
|
||||
function _execute(
|
||||
uint256, /* proposalId */
|
||||
uint256 /* proposalId */,
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
bytes[] memory calldatas,
|
||||
|
||||
@ -50,12 +50,5 @@ interface IVotes {
|
||||
/**
|
||||
* @dev Delegates votes from signer to `delegatee`.
|
||||
*/
|
||||
function delegateBySig(
|
||||
address delegatee,
|
||||
uint256 nonce,
|
||||
uint256 expiry,
|
||||
uint8 v,
|
||||
bytes32 r,
|
||||
bytes32 s
|
||||
) external;
|
||||
function delegateBySig(address delegatee, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s) external;
|
||||
}
|
||||
|
||||
@ -136,11 +136,7 @@ abstract contract Votes is IVotes, Context, EIP712 {
|
||||
* @dev Transfers, mints, or burns voting units. To register a mint, `from` should be zero. To register a burn, `to`
|
||||
* should be zero. Total supply of voting units will be adjusted with mints and burns.
|
||||
*/
|
||||
function _transferVotingUnits(
|
||||
address from,
|
||||
address to,
|
||||
uint256 amount
|
||||
) internal virtual {
|
||||
function _transferVotingUnits(address from, address to, uint256 amount) internal virtual {
|
||||
if (from == address(0)) {
|
||||
_totalCheckpoints.push(_add, amount);
|
||||
}
|
||||
@ -153,11 +149,7 @@ abstract contract Votes is IVotes, Context, EIP712 {
|
||||
/**
|
||||
* @dev Moves delegated votes from one delegate to another.
|
||||
*/
|
||||
function _moveDelegateVotes(
|
||||
address from,
|
||||
address to,
|
||||
uint256 amount
|
||||
) private {
|
||||
function _moveDelegateVotes(address from, address to, uint256 amount) private {
|
||||
if (from != to && amount > 0) {
|
||||
if (from != address(0)) {
|
||||
(uint256 oldValue, uint256 newValue) = _delegateCheckpoints[from].push(_subtract, amount);
|
||||
|
||||
Reference in New Issue
Block a user