Skip to content

Commit

Permalink
feat(protocol-kit): Migrate Safe Contract v1.1.1 to Abitype (#643)
Browse files Browse the repository at this point in the history
* Rename old 1.1.1 Safe contract implementations (for Ethers.js + Web3.js)

* Create Types for the v1.1.1 Safe contract

* Implement `SafeContract_v1_1_1_Web3` class

* Implement `SafeContract_v1_1_1_Ethers` class

* Various fixes in Safe contract v1.1.1 implementations

* Update `contractInstancesEthers.ts` to use the new class

* Update `contractInstancesWeb3.ts` to use the new class

* Remove contract 1.1.1 from typechain generation script

* Remove old SafeContract v1.1.1 implementations

* Fix `getModulesPaginated` function in 1.1.1 contract implementations

* Fix binding issues in `mapToTypechainContract` function for contract v1.1.1 implementations
  • Loading branch information
tmjssz authored Jan 11, 2024
1 parent 42f6535 commit 61c7520
Show file tree
Hide file tree
Showing 11 changed files with 1,735 additions and 143 deletions.
2 changes: 1 addition & 1 deletion packages/protocol-kit/scripts/generateTypechainFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const safeContracts_V1_3_0 = [
].join(' ')
const safeContracts_V1_2_0 = [`${safeContractsPath}/v1.2.0/gnosis_safe.json`].join(' ')
const safeContracts_V1_1_1 = [
`${safeContractsPath}/v1.1.1/gnosis_safe.json`,
// `${safeContractsPath}/v1.1.1/gnosis_safe.json`, // Remove contract 1.1.1 from typechain as it's migrated to Abitype,
`${safeContractsPath}/v1.1.1/proxy_factory.json`,
`${safeContractsPath}/v1.1.1/multi_send.json`
].join(' ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
} from '@safe-global/protocol-kit/adapters/ethers/types'
import { toTxResult } from '@safe-global/protocol-kit/adapters/ethers/utils'
import { Gnosis_safe as Safe_V1_0_0 } from '@safe-global/protocol-kit/typechain/src/ethers-v6/v1.0.0/Gnosis_safe'
import { Gnosis_safe as Safe_V1_1_1 } from '@safe-global/protocol-kit/typechain/src/ethers-v6/v1.1.1/Gnosis_safe'
import { Gnosis_safe as Safe_V1_2_0 } from '@safe-global/protocol-kit/typechain/src/ethers-v6/v1.2.0/Gnosis_safe'
import {
SafeContract,
Expand All @@ -15,7 +14,7 @@ import {
} from '@safe-global/safe-core-sdk-types'

abstract class SafeContractEthers implements SafeContract {
constructor(public contract: Safe_V1_2_0 | Safe_V1_1_1 | Safe_V1_0_0) {}
constructor(public contract: Safe_V1_2_0 | Safe_V1_0_0) {}

abstract setup(
setupConfig: SafeSetupConfig,
Expand Down

This file was deleted.

Loading

0 comments on commit 61c7520

Please sign in to comment.