From 93bb28abcaf506c1449755957c7772a2e4abc29a Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Tue, 2 May 2023 14:51:13 +0200 Subject: [PATCH 1/3] docs: small typ fix --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6958a3e..2e3933c 100644 --- a/README.md +++ b/README.md @@ -13,11 +13,11 @@ You can customize the RPC url used in [`foundry.tml`](./foundry.toml) under the 1. Put the transaction's raw data in `signatures/tx.json` 2. Hash the transaction's raw data: `make hash` 3. To sign the data with a Ledger, run: `make sign:ledger` -4. Share the content of `signatures.txt` with the signer who will execute the transaction on the Safe. +4. Share the content of `signatures.txt` with the signer who will execute the transaction on the Safe ### Batch signatures and execute transaction -1. Make at least `threshold` signatures are available in `/signatures/signatures.txt`, each one per line +1. Make sure at least `threshold` signatures are available in `/signatures/signatures.txt`, each one per line 2. To execute the transaction on the Safe with a Ledger, run: `make exec:ledger` ## Advanced options @@ -37,12 +37,12 @@ With `make sign` & `make exec`, one can also use any other wallet provider avail { "to": "0x0000000000000000000000000000000000000000", "value": 0, - "data": "0x", // the raw tx data + "data": "0x", // The raw tx data "operation": 0, // 0 for a call, 1 for a delegatecall "safeTxGas": 0, "baseGas": 0, "gasPrice": 0, - "gasToken": "0x0000000000000000000000000000000000000000", // indicates the tx will consume the chain's default gas token (ETH on mainnet) - "refundReceiver": "0x0000000000000000000000000000000000000000" // indicates the tx's refund receiver will be the address executing the tx + "gasToken": "0x0000000000000000000000000000000000000000", // Indicates the tx will consume the chain's default gas token (ETH on mainnet) + "refundReceiver": "0x0000000000000000000000000000000000000000" // Indicates the tx's refund receiver will be the address executing the tx } ``` From 55617d1b4d1de827584ffb683d662240f991baaf Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Tue, 2 May 2023 15:02:51 +0200 Subject: [PATCH 2/3] chore: clean a bit --- script/HashData.s.sol | 2 +- script/SafeTxDataBuilder.sol | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/script/HashData.s.sol b/script/HashData.s.sol index b8c6a98..4d1892c 100644 --- a/script/HashData.s.sol +++ b/script/HashData.s.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; -import {SafeTxDataBuilder, console2} from "./SafeTxDataBuilder.sol"; +import {SafeTxDataBuilder} from "./SafeTxDataBuilder.sol"; contract HashData is SafeTxDataBuilder { constructor() SafeTxDataBuilder(payable(vm.envAddress("SAFE"))) {} diff --git a/script/SafeTxDataBuilder.sol b/script/SafeTxDataBuilder.sol index 953e446..4d602f2 100644 --- a/script/SafeTxDataBuilder.sol +++ b/script/SafeTxDataBuilder.sol @@ -28,14 +28,14 @@ contract SafeTxDataBuilder is Script, SignatureDecoder { // "SafeTx(address to,uint256 value,bytes data,uint8 operation,uint256 safeTxGas,uint256 baseGas,uint256 gasPrice,address gasToken,address refundReceiver,uint256 nonce)" // ); bytes32 private constant SAFE_TX_TYPEHASH = 0xbb8310d486368db6bd6f849402fdd73ad53d316b5a4b2644ad6efe0f941286d8; - bytes NEWLINE_CHAR = bytes("\n"); + bytes private constant NEWLINE_CHAR = bytes("\n"); - string ROOT = vm.projectRoot(); - string SIGNATURES_DIR = string.concat(ROOT, "/signatures/"); + string internal ROOT = vm.projectRoot(); + string internal SIGNATURES_DIR = string.concat(ROOT, "/signatures/"); - string TX_FILE = string.concat(SIGNATURES_DIR, "tx.json"); - string HASH_DATA_FILE = string.concat(SIGNATURES_DIR, "hashData.txt"); - string SIGNATURES_FILE = string.concat(SIGNATURES_DIR, "signatures.txt"); + string internal TX_FILE = string.concat(SIGNATURES_DIR, "tx.json"); + string internal HASH_DATA_FILE = string.concat(SIGNATURES_DIR, "hashData.txt"); + string internal SIGNATURES_FILE = string.concat(SIGNATURES_DIR, "signatures.txt"); GnosisSafe immutable SAFE; From e952c4b4ef76465e11d3b2622ce46a0e13cdd3ed Mon Sep 17 00:00:00 2001 From: MerlinEgalite Date: Tue, 2 May 2023 15:04:56 +0200 Subject: [PATCH 3/3] chore: MIT license --- LICENSE.txt | 21 +++++++++++++++++++++ script/ExecTransaction.s.sol | 2 +- script/HashData.s.sol | 2 +- script/SafeTxDataBuilder.sol | 2 +- script/libraries/QuickSort.sol | 2 +- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..5172bab --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Merlin Egalite + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/script/ExecTransaction.s.sol b/script/ExecTransaction.s.sol index 2a92f37..98cb45c 100644 --- a/script/ExecTransaction.s.sol +++ b/script/ExecTransaction.s.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {QuickSort} from "./libraries/QuickSort.sol"; diff --git a/script/HashData.s.sol b/script/HashData.s.sol index 4d1892c..5454e1e 100644 --- a/script/HashData.s.sol +++ b/script/HashData.s.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {SafeTxDataBuilder} from "./SafeTxDataBuilder.sol"; diff --git a/script/SafeTxDataBuilder.sol b/script/SafeTxDataBuilder.sol index 4d602f2..3c82284 100644 --- a/script/SafeTxDataBuilder.sol +++ b/script/SafeTxDataBuilder.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {SignatureDecoder} from "safe/common/SignatureDecoder.sol"; diff --git a/script/libraries/QuickSort.sol b/script/libraries/QuickSort.sol index a3882f4..0efbbec 100644 --- a/script/libraries/QuickSort.sol +++ b/script/libraries/QuickSort.sol @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: UNLICENSED +// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; function quickSortAddress(address[] memory arr, int256 left, int256 right) pure {