Skip to content

Commit

Permalink
Merge 082764a into c04bb22
Browse files Browse the repository at this point in the history
  • Loading branch information
germartinez committed Jul 12, 2023
2 parents c04bb22 + 082764a commit 30353c6
Show file tree
Hide file tree
Showing 29 changed files with 449 additions and 53 deletions.
4 changes: 3 additions & 1 deletion guides/integrating-the-safe-core-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,15 @@ const contractNetworks: ContractNetworksConfig = {
fallbackHandlerAddress: '<FALLBACK_HANDLER_ADDRESS>',
signMessageLibAddress: '<SIGN_MESSAGE_LIB_ADDRESS>',
createCallAddress: '<CREATE_CALL_ADDRESS>',
simulateTxAccessorAddress: '<SIMULATE_TX_ACCESSOR_ADDRESS>',
safeMasterCopyAbi: '<MASTER_COPY_ABI>', // Optional. Only needed with web3.js
safeProxyFactoryAbi: '<PROXY_FACTORY_ABI>', // Optional. Only needed with web3.js
multiSendAbi: '<MULTI_SEND_ABI>', // Optional. Only needed with web3.js
multiSendCallOnlyAbi: '<MULTI_SEND_CALL_ONLY_ABI>', // Optional. Only needed with web3.js
fallbackHandlerAbi: '<FALLBACK_HANDLER_ABI>', // Optional. Only needed with web3.js
signMessageLibAbi: '<SIGN_MESSAGE_LIB_ABI>', // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>' // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>', // Optional. Only needed with web3.js
simulateTxAccessorAbi: '<SIMULATE_TX_ACCESSOR_ABI>' // Optional. Only needed with web3.js
}
}

Expand Down
12 changes: 9 additions & 3 deletions packages/protocol-kit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,15 @@ const safeFactory = await SafeFactory.create({ ethAdapter })
fallbackHandlerAddress: '<FALLBACK_HANDLER_ADDRESS>',
signMessageLibAddress: '<SIGN_MESSAGE_LIB_ADDRESS>',
createCallAddress: '<CREATE_CALL_ADDRESS>',
simulateTxAccessorAddress: '<SIMULATE_TX_ACCESSOR_ADDRESS>',
safeMasterCopyAbi: '<MASTER_COPY_ABI>', // Optional. Only needed with web3.js
safeProxyFactoryAbi: '<PROXY_FACTORY_ABI>', // Optional. Only needed with web3.js
multiSendAbi: '<MULTI_SEND_ABI>', // Optional. Only needed with web3.js
multiSendCallOnlyAbi: '<MULTI_SEND_CALL_ONLY_ABI>', // Optional. Only needed with web3.js
fallbackHandlerAbi: '<FALLBACK_HANDLER_ABI>', // Optional. Only needed with web3.js
signMessageLibAbi: '<SIGN_MESSAGE_LIB_ABI>', // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>' // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>', // Optional. Only needed with web3.js
simulateTxAccessorAbi: '<SIMULATE_TX_ACCESSOR_ABI>' // Optional. Only needed with web3.js
}
}

Expand Down Expand Up @@ -342,13 +344,15 @@ const safeSdk = await Safe.create({ ethAdapter, predictedSafe })
fallbackHandlerAddress: '<FALLBACK_HANDLER_ADDRESS>',
signMessageLibAddress: '<SIGN_MESSAGE_LIB_ADDRESS>',
createCallAddress: '<CREATE_CALL_ADDRESS>',
simulateTxAccessorAddress: '<SIMULATE_TX_ACCESSOR_ADDRESS>',
safeMasterCopyAbi: '<MASTER_COPY_ABI>', // Optional. Only needed with web3.js
safeProxyFactoryAbi: '<PROXY_FACTORY_ABI>', // Optional. Only needed with web3.js
multiSendAbi: '<MULTI_SEND_ABI>', // Optional. Only needed with web3.js
multiSendCallOnlyAbi: '<MULTI_SEND_CALL_ONLY_ABI>', // Optional. Only needed with web3.js
fallbackHandlerAbi: '<FALLBACK_HANDLER_ABI>', // Optional. Only needed with web3.js
signMessageLibAbi: '<SIGN_MESSAGE_LIB_ABI>', // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>' // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>', // Optional. Only needed with web3.js
simulateTxAccessorAbi: '<SIMULATE_TX_ACCESSOR_ABI>' // Optional. Only needed with web3.js
}
}

Expand Down Expand Up @@ -405,13 +409,15 @@ const safeSdk = await safeSdk.connect({ ethAdapter, predictedSafe })
fallbackHandlerAddress: '<FALLBACK_HANDLER_ADDRESS>',
signMessageLibAddress: '<SIGN_MESSAGE_LIB_ADDRESS>',
createCallAddress: '<CREATE_CALL_ADDRESS>',
simulateTxAccessorAddress: '<SIMULATE_TX_ACCESSOR_ADDRESS>',
safeMasterCopyAbi: '<MASTER_COPY_ABI>', // Optional. Only needed with web3.js
safeProxyFactoryAbi: '<PROXY_FACTORY_ABI>', // Optional. Only needed with web3.js
multiSendAbi: '<MULTI_SEND_ABI>', // Optional. Only needed with web3.js
multiSendCallOnlyAbi: '<MULTI_SEND_CALL_ONLY_ABI>', // Optional. Only needed with web3.js
fallbackHandlerAbi: '<FALLBACK_HANDLER_ABI>', // Optional. Only needed with web3.js
signMessageLibAbi: '<SIGN_MESSAGE_LIB_ABI>', // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>' // Optional. Only needed with web3.js
createCallAbi: '<CREATE_CALL_ABI>', // Optional. Only needed with web3.js
simulateTxAccessorAbi: '<SIMULATE_TX_ACCESSOR_ABI>' // Optional. Only needed with web3.js
}
}
const safeSdk = await Safe.connect({ ethAdapter, safeAddress, contractNetworks })
Expand Down
5 changes: 5 additions & 0 deletions packages/protocol-kit/contracts/Deps_V1_3_0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { MultiSendCallOnly } from "@gnosis.pm/safe-contracts-v1.3.0/contracts/li
import { SignMessageLib } from "@gnosis.pm/safe-contracts-v1.3.0/contracts/examples/libraries/SignMessage.sol";
import { CreateCall } from "@gnosis.pm/safe-contracts-v1.3.0/contracts/libraries/CreateCall.sol";
import { DefaultCallbackHandler } from "@gnosis.pm/safe-contracts-v1.3.0/contracts/handler/DefaultCallbackHandler.sol";
import { SimulateTxAccessor } from "@gnosis.pm/safe-contracts-v1.3.0/contracts/accessors/SimulateTxAccessor.sol";

// Testing contracts
import { DebugTransactionGuard } from "@gnosis.pm/safe-contracts-v1.3.0/contracts/examples/guards/DebugTransactionGuard.sol";
Expand All @@ -21,3 +22,7 @@ contract MultiSendCallOnly_SV1_3_0 is MultiSendCallOnly {}
contract SignMessageLib_SV1_3_0 is SignMessageLib {}
contract CreateCall_SV1_3_0 is CreateCall {}
contract DefaultCallbackHandler_SV1_3_0 is DefaultCallbackHandler {}
contract SimulateTxAccessor_SV1_3_0 is SimulateTxAccessor {}

// Testing contracts
contract DebugTransactionGuard_SV1_3_0 is DebugTransactionGuard {}
8 changes: 8 additions & 0 deletions packages/protocol-kit/contracts/Deps_V1_4_1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { MultiSendCallOnly } from "@safe-global/safe-contracts-v1.4.1/contracts/
import { SignMessageLib } from "@safe-global/safe-contracts-v1.4.1/contracts/libraries/SignMessageLib.sol";
import { CreateCall } from "@safe-global/safe-contracts-v1.4.1/contracts/libraries/CreateCall.sol";
import { TokenCallbackHandler } from "@safe-global/safe-contracts-v1.4.1/contracts/handler/TokenCallbackHandler.sol";
import { SimulateTxAccessor } from "@safe-global/safe-contracts-v1.4.1/contracts/accessors/SimulateTxAccessor.sol";

// Testing contracts
import { DebugTransactionGuard} from "@safe-global/safe-contracts-v1.4.1/contracts/examples/guards/DebugTransactionGuard.sol";

contract SafeProxyFactory_SV1_4_1 is SafeProxyFactory {}
contract Safe_SV1_4_1 is Safe {}
Expand All @@ -18,3 +22,7 @@ contract MultiSendCallOnly_SV1_4_1 is MultiSendCallOnly {}
contract SignMessageLib_SV1_4_1 is SignMessageLib {}
contract CreateCall_SV1_4_1 is CreateCall {}
contract TokenCallbackHandler_SV1_4_1 is TokenCallbackHandler {}
contract SimulateTxAccessor_SV1_4_1 is SimulateTxAccessor {}

// Testing contracts
contract DebugTransactionGuard_SV1_4_1 is DebugTransactionGuard {}
30 changes: 27 additions & 3 deletions packages/protocol-kit/hardhat/deploy/deploy-contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { HardhatRuntimeEnvironment } from 'hardhat/types'

export const safeVersionDeployed = process.env.SAFE_VERSION as SafeVersion

type SafeVersions = { [key: string]: { name: string} }
type SafeVersions = { [key: string]: { name: string } }

const safeContracts: SafeVersions = {
'1.4.1': { name: 'Safe_SV1_4_1' },
Expand Down Expand Up @@ -62,6 +62,14 @@ const createCallContracts: SafeVersions = {
'1.0.0': { name: 'CreateCall_SV1_3_0' }
}

const simulateTxAccessorContracts: SafeVersions = {
'1.4.1': { name: 'SimulateTxAccessor_SV1_4_1' },
'1.3.0': { name: 'SimulateTxAccessor_SV1_3_0' },
'1.2.0': { name: 'SimulateTxAccessor_SV1_3_0' },
'1.1.1': { name: 'SimulateTxAccessor_SV1_3_0' },
'1.0.0': { name: 'SimulateTxAccessor_SV1_3_0' }
}

export const safeDeployed = safeContracts[safeVersionDeployed]
export const proxyFactoryDeployed = proxyFactoryContracts[safeVersionDeployed]
export const multiSendDeployed = multiSendContracts[safeVersionDeployed]
Expand All @@ -70,6 +78,7 @@ export const compatibilityFallbackHandlerDeployed =
compatibilityFallbackHandlerContracts[safeVersionDeployed]
export const signMessageLibDeployed = signMessageLibContracts[safeVersionDeployed]
export const createCallDeployed = createCallContracts[safeVersionDeployed]
export const simulateTxAccessorDeployed = simulateTxAccessorContracts[safeVersionDeployed]

const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment): Promise<void> => {
const { deployments, getNamedAccounts } = hre
Expand Down Expand Up @@ -125,6 +134,13 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment): Promise<v
deterministicDeployment: true
})

await deploy(simulateTxAccessorDeployed.name, {
from: deployer,
args: [],
log: true,
deterministicDeployment: true
})

await deploy('DailyLimitModule', {
from: deployer,
args: [],
Expand All @@ -145,10 +161,11 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment): Promise<v
log: true
})

await deploy('DebugTransactionGuard', {
await deploy('DebugTransactionGuard_SV1_3_0', {
from: deployer,
args: [],
log: true
log: true,
deterministicDeployment: true
})

await deploy('DefaultCallbackHandler_SV1_3_0', {
Expand All @@ -158,6 +175,13 @@ const deploy: DeployFunction = async (hre: HardhatRuntimeEnvironment): Promise<v
deterministicDeployment: true
})

await deploy('DebugTransactionGuard_SV1_4_1', {
from: deployer,
args: [],
log: true,
deterministicDeployment: true
})

await deploy('TokenCallbackHandler_SV1_4_1', {
from: deployer,
args: [],
Expand Down
13 changes: 12 additions & 1 deletion packages/protocol-kit/scripts/generateTypechainFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const safeContracts_V1_3_0 = [
`${safeContractsPath}/v1.3.0/multi_send_call_only.json`,
`${safeContractsPath}/v1.3.0/compatibility_fallback_handler.json`,
`${safeContractsPath}/v1.3.0/sign_message_lib.json`,
`${safeContractsPath}/v1.3.0/create_call.json`
`${safeContractsPath}/v1.3.0/create_call.json`,
`${safeContractsPath}/v1.3.0/simulate_tx_accessor.json`
].join(' ')
const safeContracts_V1_2_0 = [`${safeContractsPath}/v1.2.0/gnosis_safe.json`].join(' ')
const safeContracts_V1_1_1 = [
Expand All @@ -46,6 +47,11 @@ const safeContracts_V1_0_0 = [
].join(' ')

// Won't be included in dist/ folder
const safeContractsTestV1_4_1Path =
'../../node_modules/@safe-global/safe-contracts-v1.4.1/build/artifacts/contracts'
const testContracts_V1_4_1 = [
`${safeContractsTestV1_4_1Path}/examples/guards/DebugTransactionGuard.sol/DebugTransactionGuard.json`
].join(' ')
const safeContractsTestV1_3_0Path =
'../../node_modules/@gnosis.pm/safe-contracts-v1.3.0/build/artifacts/contracts'
const testContracts_V1_3_0 = [
Expand Down Expand Up @@ -142,6 +148,11 @@ function generateTypes(typechainTarget: string) {
)

// Tests
generateTypechainFiles(
typechainTarget,
`${outDirTests}${typechainTarget}/v1.4.1`,
testContracts_V1_4_1
)
generateTypechainFiles(
typechainTarget,
`${outDirTests}${typechainTarget}/v1.3.0`,
Expand Down
6 changes: 4 additions & 2 deletions packages/protocol-kit/src/Safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ class Safe {
await standardizeSafeTransactionData({
predictedSafe: this.#predictedSafe,
ethAdapter: this.#ethAdapter,
tx: newTransaction
tx: newTransaction,
contractNetworks: this.#contractManager.contractNetworks
})
)
}
Expand All @@ -430,7 +431,8 @@ class Safe {
await standardizeSafeTransactionData({
safeContract: this.#contractManager.safeContract,
ethAdapter: this.#ethAdapter,
tx: newTransaction
tx: newTransaction,
contractNetworks: this.#contractManager.contractNetworks
})
)
}
Expand Down
18 changes: 17 additions & 1 deletion packages/protocol-kit/src/adapters/ethers/EthersAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ import MultiSendCallOnlyEthersContract from './contracts/MultiSendCallOnly/Multi
import SafeContractEthers from './contracts/Safe/SafeContractEthers'
import SafeProxyFactoryEthersContract from './contracts/SafeProxyFactory/SafeProxyFactoryEthersContract'
import SignMessageLibEthersContract from './contracts/SignMessageLib/SignMessageLibEthersContract'
import SimulateTxAccessorEthersContract from './contracts/SimulateTxAccessor/SimulateTxAccessorEthersContract'
import {
getCompatibilityFallbackHandlerContractInstance,
getCreateCallContractInstance,
getMultiSendCallOnlyContractInstance,
getMultiSendContractInstance,
getSafeContractInstance,
getSafeProxyFactoryContractInstance,
getSignMessageLibContractInstance
getSignMessageLibContractInstance,
getSimulateTxAccessorContractInstance
} from './contracts/contractInstancesEthers'
import { isSignerCompatible, isTypedDataSigner } from './utils'

Expand Down Expand Up @@ -196,6 +198,20 @@ class EthersAdapter implements EthAdapter {
return getCreateCallContractInstance(safeVersion, contractAddress, signerOrProvider)
}

async getSimulateTxAccessorContract({
safeVersion,
singletonDeployment,
customContractAddress
}: GetContractProps): Promise<SimulateTxAccessorEthersContract> {
const chainId = await this.getChainId()
const contractAddress = customContractAddress ?? singletonDeployment?.networkAddresses[chainId]
if (!contractAddress) {
throw new Error('Invalid SimulateTxAccessor contract address')
}
const signerOrProvider = this.#signer || this.#provider
return getSimulateTxAccessorContractInstance(safeVersion, contractAddress, signerOrProvider)
}

async getContractCode(address: string, blockTag?: string | number): Promise<string> {
return this.#provider.getCode(address, blockTag)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ abstract class SafeContractEthers implements SafeContract {
params: any[],
options: EthersTransactionOptions
): Promise<string> {
return (await (this.contract.estimateGas as any)[methodName](...params, options)).toString()
const a = (await (this.contract.estimateGas as any)[methodName](...params, options)).toString()
return a
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import {
Simulate_tx_accessor as SimulateTxAccessor_V1_3_0,
Simulate_tx_accessorInterface as SimulateTxAccessorInterface
} from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.3.0/Simulate_tx_accessor'
import { Simulate_tx_accessor as SimulateTxAccessor_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/Simulate_tx_accessor'
import { SimulateTxAccessorContract } from '@safe-global/safe-core-sdk-types'

abstract class SimulateTxAccessorEthersContract implements SimulateTxAccessorContract {
constructor(public contract: SimulateTxAccessor_V1_4_1 | SimulateTxAccessor_V1_3_0) {}

getAddress(): string {
return this.contract.address
}

encode: SimulateTxAccessorInterface['encodeFunctionData'] = (
methodName: any,
params: any
): string => {
return this.contract.interface.encodeFunctionData(methodName, params)
}
}

export default SimulateTxAccessorEthersContract
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Simulate_tx_accessor as SimulateTxAccessor } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.3.0/Simulate_tx_accessor'
import SimulateTxAccessorEthersContract from '../SimulateTxAccessorEthersContract'

class SimulateTxAccessorContract_V1_3_0_Ethers extends SimulateTxAccessorEthersContract {
constructor(public contract: SimulateTxAccessor) {
super(contract)
}
}

export default SimulateTxAccessorContract_V1_3_0_Ethers
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Simulate_tx_accessor as SimulateTxAccessor } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/Simulate_tx_accessor'
import SimulateTxAccessorEthersContract from '../SimulateTxAccessorEthersContract'

class SimulateTxAccessorContract_V1_4_1_Ethers extends SimulateTxAccessorEthersContract {
constructor(public contract: SimulateTxAccessor) {
super(contract)
}
}

export default SimulateTxAccessorContract_V1_4_1_Ethers
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import { Multi_send__factory as MultiSend_V1_3_0 } from '@safe-global/protocol-k
import { Multi_send_call_only__factory as MultiSendCallOnly_V1_3_0 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.3.0/factories/Multi_send_call_only__factory'
import { Proxy_factory__factory as SafeProxyFactory_V1_3_0 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.3.0/factories/Proxy_factory__factory'
import { Sign_message_lib__factory as SignMessageLib_V1_3_0 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.3.0/factories/Sign_message_lib__factory'
import { Simulate_tx_accessor__factory as SimulateTxAccessor_V1_3_0 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.3.0/factories/Simulate_tx_accessor__factory'
import { Compatibility_fallback_handler__factory as CompatibilityFallbackHandler_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Compatibility_fallback_handler__factory'
import { Create_call__factory as CreateCall_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Create_call__factory'
import { Multi_send__factory as MultiSend_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Multi_send__factory'
import { Multi_send_call_only__factory as MultiSendCallOnly_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Multi_send_call_only__factory'
import { Safe__factory as SafeMasterCopy_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Safe__factory'
import { Safe_proxy_factory__factory as SafeProxyFactory_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Safe_proxy_factory__factory'
import { Sign_message_lib__factory as SignMessageLib_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Sign_message_lib__factory'
import { Simulate_tx_accessor__factory as SimulateTxAccessor_V1_4_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v5/v1.4.1/factories/Simulate_tx_accessor__factory'
import { SafeVersion } from '@safe-global/safe-core-sdk-types'
import CompatibilityFallbackHandler_V1_3_0_Ethers from './CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandler_V1_3_0_Ethers'
import CompatibilityFallbackHandler_V1_4_1_Ethers from './CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandler_V1_4_1_Ethers'
Expand All @@ -41,6 +43,8 @@ import SafeProxyFactoryContract_V1_3_0_Ethers from './SafeProxyFactory/v1.3.0/Sa
import SafeProxyFactoryContract_V1_4_1_Ethers from './SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_V1_4_1_Ethers'
import SignMessageLibContract_V1_3_0_Ethers from './SignMessageLib/v1.3.0/SignMessageLibContract_V1_3_0_Ethers'
import SignMessageLibContract_V1_4_1_Ethers from './SignMessageLib/v1.4.1/SignMessageLibContract_V1_4_1_Ethers'
import SimulateTxAccessorContract_V1_3_0_Ethers from './SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_V1_3_0_Ethers'
import SimulateTxAccessorContract_V1_4_1_Ethers from './SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_V1_4_1_Ethers'

export function getSafeContractInstance(
safeVersion: SafeVersion,
Expand Down Expand Up @@ -220,3 +224,27 @@ export function getCreateCallContractInstance(
throw new Error('Invalid Safe version')
}
}

export function getSimulateTxAccessorContractInstance(
safeVersion: SafeVersion,
contractAddress: string,
signerOrProvider: Signer | Provider
): SimulateTxAccessorContract_V1_4_1_Ethers | SimulateTxAccessorContract_V1_3_0_Ethers {
let simulateTxAccessorContract
switch (safeVersion) {
case '1.4.1':
simulateTxAccessorContract = SimulateTxAccessor_V1_4_1.connect(
contractAddress,
signerOrProvider
)
return new SimulateTxAccessorContract_V1_4_1_Ethers(simulateTxAccessorContract)
case '1.3.0':
simulateTxAccessorContract = SimulateTxAccessor_V1_3_0.connect(
contractAddress,
signerOrProvider
)
return new SimulateTxAccessorContract_V1_3_0_Ethers(simulateTxAccessorContract)
default:
throw new Error('Invalid Safe version')
}
}
Loading

0 comments on commit 30353c6

Please sign in to comment.