Skip to content

Commit

Permalink
printWidth: 120
Browse files Browse the repository at this point in the history
  • Loading branch information
anajuliabit committed Dec 18, 2023
1 parent 25dfd08 commit 6797b97
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"files": "*.sol",
"options": {
"parser": "solidity-parse",
"printWidth": 140,
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
Expand All @@ -14,7 +14,7 @@
}
],
"tabWidth": 4,
"printWidth": 140,
"printWidth": 120,
"trailingComma": "all",
"singleQuote": false,
"semi": true
Expand Down
15 changes: 12 additions & 3 deletions addresses/Addresses.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ contract Addresses is IAddresses, Test {
SavedAddresses[] memory savedAddresses = abi.decode(parsedJson, (SavedAddresses[]));

for (uint256 i = 0; i < savedAddresses.length; i++) {
require(getAddress(savedAddresses[i].name, savedAddresses[i].chainId) == address(0), "Addresses: duplicate address in json");
require(
getAddress(savedAddresses[i].name, savedAddresses[i].chainId) == address(0),
"Addresses: duplicate address in json"
);

_addAddress(savedAddresses[i].name, savedAddresses[i].chainId, savedAddresses[i].addr);
}
Expand All @@ -56,7 +59,10 @@ contract Addresses is IAddresses, Test {
function _addAddress(string memory name, uint256 _chainId, address addr) private {
address currentAddress = _addresses[name][_chainId];

require(currentAddress == address(0), string(abi.encodePacked("Address:", name, "already set on chain:", _chainId.toString())));
require(
currentAddress == address(0),
string(abi.encodePacked("Address:", name, "already set on chain:", _chainId.toString()))
);

_addresses[name][_chainId] = addr;
vm.label(addr, name);
Expand All @@ -69,7 +75,10 @@ contract Addresses is IAddresses, Test {

addr = _addresses[name][_chainId];

require(addr != address(0), string(abi.encodePacked("Address:", name, "not set on chain:", _chainId.toString())));
require(
addr != address(0),
string(abi.encodePacked("Address:", name, "not set on chain:", _chainId.toString()))
);
}

/// @notice get an address for the current chainId
Expand Down
25 changes: 22 additions & 3 deletions proposals/proposalTypes/ITimelockController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ interface ITimelockController {
*
* - the caller must have the 'proposer' role.
*/
function schedule(address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt, uint256 delay) external;
function schedule(
address target,
uint256 value,
bytes calldata data,
bytes32 predecessor,
bytes32 salt,
uint256 delay
) external;

/**
* @dev Schedule an operation containing a batch of transactions.
Expand Down Expand Up @@ -176,7 +183,13 @@ interface ITimelockController {
// This function can reenter, but it doesn't pose a risk because _afterCall checks that the proposal is pending,
// thus any modifications to the operation during reentrancy should be caught.
// slither-disable-next-line reentrancy-eth
function execute(address target, uint256 value, bytes calldata data, bytes32 predecessor, bytes32 salt) external payable;
function execute(
address target,
uint256 value,
bytes calldata data,
bytes32 predecessor,
bytes32 salt
) external payable;

/**
* @dev Execute an (ready) operation containing a batch of transactions.
Expand Down Expand Up @@ -220,5 +233,11 @@ interface ITimelockController {
/**
* @dev See {IERC1155Receiver-onERC1155BatchReceived}.
*/
function onERC1155BatchReceived(address, address, uint256[] memory, uint256[] memory, bytes memory) external returns (bytes4);
function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) external returns (bytes4);
}
12 changes: 10 additions & 2 deletions proposals/proposalTypes/TimelockProposal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ abstract contract TimelockProposal is Proposal {
/// @param timelockAddress to execute the proposal against
/// @param proposerAddress account to propose the proposal to the timelock
/// @param executorAddress account to execute the proposal on the timelock
function _simulateTimelockActions(address timelockAddress, address proposerAddress, address executorAddress) internal {
function _simulateTimelockActions(
address timelockAddress,
address proposerAddress,
address executorAddress
) internal {
require(actions.length > 0, "Empty timelock operation");

ITimelockController timelock = ITimelockController(payable(timelockAddress));
Expand Down Expand Up @@ -52,7 +56,11 @@ abstract contract TimelockProposal is Proposal {
timelock.scheduleBatch(targets, values, payloads, predecessor, salt, delay);

if (DEBUG) {
console.log("schedule batch calldata with ", actions.length, (actions.length > 1 ? " actions" : " action"));
console.log(
"schedule batch calldata with ",
actions.length,
(actions.length > 1 ? " actions" : " action")
);
emit log_bytes(
abi.encodeWithSignature(
"scheduleBatch(address[],uint256[],bytes[],bytes32,bytes32,uint256)",
Expand Down

0 comments on commit 6797b97

Please sign in to comment.