Skip to content

Commit 3ed71b5

Browse files
Apply suggestions from code review
Co-authored-by: Tanay Pant <[email protected]>
1 parent 2ec3428 commit 3ed71b5

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

pages/sdk-protocol-kit/reference/safe-factory.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const safeFactory = await SafeFactory.create({ ethAdapter })
1212

1313
- The `isL1SafeSingleton` flag
1414

15-
Two versions of the Safe contracts are available: [Safe.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/Safe.sol) that doesn't trigger events in order to save gas and [SafeL2.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/SafeL2.sol) that does, which is more appropriate for L2 networks.
15+
Two versions of the Safe contracts are available: [Safe.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/Safe.sol) that doesn't trigger events to save gas and [SafeL2.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/SafeL2.sol) that does, which is more appropriate for L2 networks.
1616

17-
By default `Safe.sol` will be only used on Ethereum Mainnet. For the rest of the networks where the Safe contracts are already deployed, the `SafeL2.sol` contract will be used unless you add the `isL1SafeSingleton` flag to force the use of the `Safe.sol` contract.
17+
By default, `Safe.sol` will only be used on Ethereum Mainnet. For the rest of the networks where the Safe contracts are already deployed, the `SafeL2.sol` contract will be used unless you add the `isL1SafeSingleton` flag to force using the `Safe.sol` contract.
1818

1919
```typescript
2020
const safeFactory = await SafeFactory.create({ ethAdapter, isL1SafeSingleton: true })
@@ -63,7 +63,7 @@ const safeFactory = await SafeFactory.create({ ethAdapter })
6363

6464
### `deploySafe`
6565

66-
Deploys a new Safe and returns an instance of the Protocol Kit connected to the deployed Safe. The address of the singleton, Safe contract version and the contract (`Safe.sol` or `SafeL2.sol`) of the deployed Safe will depend on the initialization of the `safeFactory` instance.
66+
Deploys a new Safe and returns an instance of the Protocol Kit connected to the deployed Safe. The address of the singleton, Safe contract version, and the contract (`Safe.sol` or `SafeL2.sol`) of the deployed Safe will depend on the initialization of the `safeFactory` instance.
6767

6868
```typescript
6969
const safeAccountConfig: SafeAccountConfig = {
@@ -127,7 +127,7 @@ const options: EthersTransactionOptions = {
127127
const protocolKit = await safeFactory.deploySafe({ safeAccountConfig, safeDeploymentConfig, options })
128128
```
129129

130-
It can also take an optional callback which receives the `txHash` of the Safe deployment transaction prior to returning a new instance of the Protocol Kit:
130+
It can also take an optional callback, which receives the `txHash` of the Safe deployment transaction before returning a new instance of the Protocol Kit:
131131

132132
```typescript
133133
const callback = (txHash: string): void => {

pages/sdk-protocol-kit/reference/safe.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let protocolKit = await Safe.create({ ethAdapter, safeAddress })
1313
protocolKit = await protocolKit.connect({ ethAdapter: anotherEthAdapter, safeAddress: anotherSafeAddress })
1414
```
1515

16-
Connection of a not deployed Safe using the `predictedSafe` property. Because Safes are deployed in a deterministic way, passing a `predictedSafe` will allow to connect a Safe to the SDK with the Safe configuration:
16+
Connection of an undeployed Safe using the `predictedSafe` property. Because Safes are deployed in a deterministic way, passing a `predictedSafe` will allow to connect a Safe to the SDK with the Safe configuration:
1717

1818
```typescript
1919
import { PredictedSafeProps } from '@safe-global/protocol-kit'
@@ -30,9 +30,9 @@ protocolKit = await protocolKit.connect({ predictedSafe })
3030

3131
- The `isL1SafeSingleton` flag
3232

33-
Two versions of the Safe contracts are available: [Safe.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/Safe.sol) that doesn't trigger events in order to save gas and [SafeL2.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/SafeL2.sol) that does, which is more appropriate for L2 networks.
33+
Two versions of the Safe contracts are available: [Safe.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/Safe.sol) that doesn't trigger events to save gas and [SafeL2.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/SafeL2.sol) that does, which is more appropriate for L2 networks.
3434

35-
By default `Safe.sol` will be only used on Ethereum Mainnet. For the rest of the networks where the Safe contracts are already deployed, the `SafeL2.sol` contract will be used unless you add the `isL1SafeSingleton` flag to force the use of the `Safe.sol` contract.
35+
By default `Safe.sol` will only be used on Ethereum Mainnet. For the rest of the networks where the Safe contracts are already deployed, the `SafeL2.sol` contract will be used unless you add the `isL1SafeSingleton` flag to force using the `Safe.sol` contract.
3636

3737
```typescript
3838
protocolKit = await protocolKit.connect({ ethAdapter, safeAddress, isL1SafeSingleton: true })
@@ -83,7 +83,7 @@ import Safe from '@safe-global/protocol-kit'
8383
const protocolKit = await Safe.create({ ethAdapter, safeAddress })
8484
```
8585

86-
Initialization of a not deployed Safe using the `predictedSafe` property. Because Safes are deployed in a deterministic way, passing a `predictedSafe` will allow to initialize the SDK with the Safe configuration and use it to some extent before it's deployed:
86+
Initialization of an undeployed Safe using the `predictedSafe` property. Because Safes are deployed in a deterministic way, passing a `predictedSafe` will allow to initialize the SDK with the Safe configuration and use it to some extent before it's deployed:
8787

8888
```typescript
8989
import Safe, { PredictedSafeProps } from '@safe-global/protocol-kit'
@@ -98,9 +98,9 @@ const protocolKit = await Safe.create({ ethAdapter, predictedSafe })
9898

9999
- The `isL1SafeSingleton` flag
100100

101-
Two versions of the Safe contracts are available: [Safe.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/Safe.sol) that doesn't trigger events in order to save gas and [SafeL2.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/SafeL2.sol) that does, which is more appropriate for L2 networks.
101+
Two versions of the Safe contracts are available: [Safe.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/Safe.sol) that doesn't trigger events to save gas and [SafeL2.sol](https://github.com/safe-global/safe-contracts/blob/v1.4.1/contracts/SafeL2.sol) that does, which is more appropriate for L2 networks.
102102

103-
By default `Safe.sol` will be only used on Ethereum Mainnet. For the rest of the networks where the Safe contracts are already deployed, the `SafeL2.sol` contract will be used unless you add the `isL1SafeSingleton` flag to force the use of the `Safe.sol` contract.
103+
By default `Safe.sol` will only be used on Ethereum Mainnet. For the rest of the networks where the Safe contracts are already deployed, the `SafeL2.sol` contract will be used unless you add the `isL1SafeSingleton` flag to force using the `Safe.sol` contract.
104104

105105
```typescript
106106
const protocolKit = await Safe.create({ ethAdapter, safeAddress, isL1SafeSingleton: true })
@@ -193,7 +193,7 @@ const safeTransaction2 = await copyTransaction(safeTransaction1)
193193

194194
### `createRejectionTransaction`
195195

196-
Returns a Safe transaction ready to be signed by the owners that invalidates the pending Safe transaction/s with a specific nonce.
196+
Returns a Safe transaction ready to be signed by the owners that invalidates the pending Safe transaction(s) with a specific nonce.
197197

198198
```typescript
199199
const transactions: MetaTransactionData[] = [{
@@ -207,7 +207,7 @@ const rejectionTransaction = await protocolKit.createRejectionTransaction(safeTr
207207

208208
Returns a Safe transaction ready to be signed by the owners and executed. The Protocol Kit supports the creation of single Safe transactions but also MultiSend transactions.
209209

210-
This method takes an array of `MetaTransactionData` objects that represent the individual transactions we want to include in our MultiSend transaction.
210+
This method takes an array of `MetaTransactionData` objects representing the individual transactions we want to include in our MultiSend transaction.
211211

212212
When the array contains only one transaction, it's not wrapped in the MultiSend.
213213

@@ -259,7 +259,7 @@ const options: SafeTransactionOptionalProps = {
259259
const safeTransaction = await protocolKit.createTransaction({ transactions, options })
260260
```
261261

262-
In addition, the optional `callsOnly` parameter, which is `false` by default, allows to force the use of the `MultiSendCallOnly` instead of the `MultiSend` contract when sending a batch transaction:
262+
In addition, the optional `callsOnly` parameter, which is `false` by default, allows forcing the use of the `MultiSendCallOnly` instead of the `MultiSend` contract when sending a batch transaction:
263263

264264
```typescript
265265
const callsOnly = true
@@ -442,7 +442,7 @@ You can use multiple signing methods, such as:
442442
- ETH_SIGN_TYPED_DATA `eth_signTypedData`: Typed data signature
443443
- SAFE_SIGNATURE: Signing with another Safe contract as signer
444444

445-
The third parameter (optional) is the preImageSafeAddress. If the preimage is required, this is the address of the Safe that will be used to calculate the preimage. It's mandatory parameter for 1.3.0 and 1.4.1 contract versions. This is because the safe uses the old EIP-1271 interface which uses `bytes` instead of `bytes32` for the message we need to use the pre-image of the message to calculate the message hash. This parameter is used in conjunction with the SAFE_SIGNATURE signing method.
445+
The third parameter (optional) is the preImageSafeAddress. If the preimage is required, this is the address of the Safe that will be used to calculate the preimage. It's a mandatory parameter for 1.3.0 and 1.4.1 contract versions. This is because the safe uses the old EIP-1271 interface, which uses `bytes` instead of `bytes32` for the message; we need to use the pre-image of the message to calculate the message hash. This parameter is used in conjunction with the SAFE_SIGNATURE signing method.
446446

447447
```typescript
448448
const transactions: MetaTransactionData[] = [{
@@ -752,7 +752,7 @@ const message = protocolKit.createMessage(rawMessage)
752752

753753
### `getSafeMessageHash`
754754

755-
Retrieve the Safe message hash of a string or EIP-712 typed data. It produces the identical hash as invoking the CompatibilityFallbackHandler's getMessageHash method.
755+
Retrieve the Safe message hash of a string, or EIP-712 typed data. It produces the identical hash as invoking the CompatibilityFallbackHandler's getMessageHash method.
756756

757757
```typescript
758758
const rawMessage = ... // String or EIP-712 typed data
@@ -765,10 +765,10 @@ const safeMessageHash = await protocolKit.getSafeMessageHash(messageHash)
765765

766766
Calls the CompatibilityFallbackHandler isValidSignature method (EIP-1271).
767767

768-
It requires 2 parameters:
768+
It requires two parameters:
769769

770-
- messageHash The hash of the message
771-
- signature The signature to be validated or '0x'. You can send as signature one of the following:
770+
- messageHash: The hash of the message
771+
- signature: The signature to be validated or '0x'. You can send as signature one of the following:
772772
1) An array of SafeSignature. In this case the signatures are concatenated for validation (buildSignatureBytes())
773773
2) The concatenated signatures as string
774774
3) '0x' if you want to validate an onchain message (Approved hash)
@@ -799,7 +799,7 @@ You can use multiple signing methods, such as:
799799
- ETH_SIGN_TYPED_DATA `eth_signTypedData`: Typed data signature
800800
- SAFE_SIGNATURE: Signing with another Safe contract as signer
801801

802-
The third parameter (optional) is the preImageSafeAddress. If the preimage is required, this is the address of the Safe that will be used to calculate the preimage. It's mandatory parameter for 1.3.0 and 1.4.1 contract versions. This is because the safe uses the old EIP-1271 interface which uses `bytes` instead of `bytes32` for the message we need to use the pre-image of the message to calculate the message hash. This parameter is used in conjunction with the SAFE_SIGNATURE signing method.
802+
The third parameter (optional) is the preImageSafeAddress. If the preimage is required, this is the address of the Safe that will be used to calculate the preimage. It's a mandatory parameter for 1.3.0 and 1.4.1 contract versions. This is because the safe uses the old EIP-1271 interface, which uses `bytes` instead of `bytes32` for the message; we need to use the pre-image of the message to calculate the message hash. This parameter is used in conjunction with the SAFE_SIGNATURE signing method.
803803

804804
```typescript
805805
const rawMessage: string | EIP712TypedData = "I am the owner of this Safe"

0 commit comments

Comments
 (0)