Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Safe contracts from safe-deployments #91

Merged
merged 36 commits into from
Nov 16, 2021
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
cdcb138
Update README file
germartinez Oct 15, 2021
2f1bdec
Update script that generates typechain files
germartinez Oct 15, 2021
3201af5
Update Safe contracts with new generated types
germartinez Oct 15, 2021
477b985
Remove old contract networks configuration
germartinez Oct 15, 2021
e87d217
Use new contract types in ContractManager and EthAdapters
germartinez Oct 15, 2021
535f354
Use new contract types in SafeFactory
germartinez Oct 15, 2021
58554fc
Update contract types in tests
germartinez Oct 15, 2021
2e934e0
Merge branch 'development' into safe-deployments
germartinez Oct 27, 2021
33872c1
handle different Safe versions in EthAdapters
germartinez Oct 27, 2021
ef70053
Use types from last version of the Safe contracts (backwards compatible)
germartinez Oct 27, 2021
5cbb203
Allow deployment of multiple Safe versions
germartinez Oct 27, 2021
32c2591
Rename SafeContract classes
germartinez Oct 27, 2021
69363c9
Update properties of SafeFactory in README file
germartinez Oct 27, 2021
7a55d37
Set default Safe contracts version
germartinez Oct 27, 2021
23b42eb
Remove unused ABI files
germartinez Nov 1, 2021
8ee4765
Add more properties to SafeAccountConfig in README
germartinez Nov 1, 2021
530333d
Add all GnosisSafeContract classes depending on the version
germartinez Nov 1, 2021
6f8ce4a
Add all SafeProxyFactory classes depending on the version
germartinez Nov 1, 2021
975fefe
Add all MultiSendContract classes depending on the version
germartinez Nov 1, 2021
68cffd3
Remove typechain files generation for v1.0.0
germartinez Nov 1, 2021
57ccb42
Rename SAFE_LAST_VERSION constant
germartinez Nov 1, 2021
0053184
Get Safe contracts typed instances depending on the version
germartinez Nov 1, 2021
3f54e61
Stop using defaultAddress from safe-deployments
germartinez Nov 1, 2021
d9da697
Compile and generate types for Safe versions
germartinez Nov 3, 2021
8cdde74
Fix typechain script for contracts in tests
germartinez Nov 4, 2021
60ed6a1
Setup contracts deployment in tests
germartinez Nov 4, 2021
4f0f05f
Fix implementation of GnosisSafeContract classes
germartinez Nov 4, 2021
853ffa9
Remove "v" from Safe version numbers
germartinez Nov 5, 2021
e3d7dec
Add support to L2 Safe contracts
germartinez Nov 5, 2021
8194cc3
Fix tests when handling multiple versions
germartinez Nov 5, 2021
3f52d51
Update CI tests
germartinez Nov 5, 2021
59dcb93
Adjust test scripts
germartinez Nov 8, 2021
688d29e
Small fixes regarding types
germartinez Nov 8, 2021
4bbea3b
Add isL1SafeMasterCopy flag
germartinez Nov 9, 2021
3621889
Add tests for getting the contracts from the ethAdapter
germartinez Nov 9, 2021
33267d5
Update typechain script
germartinez Nov 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Safe contracts with new generated types
germartinez committed Oct 15, 2021
commit 3201af5cd8aed762d6b86ae82403871d6261c87a
3 changes: 2 additions & 1 deletion packages/safe-core-sdk/package.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"test:ganache:ethers": "export TEST_NETWORK=ganache && export ETH_LIB=ethers && hardhat --network localhost deploy && nyc hardhat --network localhost test",
"test:hardhat:web3": "export TEST_NETWORK=hardhat && export ETH_LIB=web3 && hardhat deploy && nyc hardhat test",
"test:hardhat:ethers": "export TEST_NETWORK=hardhat && export ETH_LIB=ethers && hardhat deploy && nyc hardhat test",
"test": "yarn test:hardhat:web3 && yarn test:hardhat:ethers",
"test": "yarn test:hardhat:ethers",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"format": "prettier --write \"{src,tests,hardhat}/**/*.ts\"",
"lint": "tslint -p tsconfig.json"
@@ -87,6 +87,7 @@
},
"dependencies": {
"@gnosis.pm/safe-core-sdk-types": "^0.1.1",
"@gnosis.pm/safe-deployments": "^1.4.0",
"ethereumjs-util": "^7.0.10"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BigNumber } from '@ethersproject/bignumber'
import { ContractTransaction } from '@ethersproject/contracts'
import { SafeTransaction, SafeTransactionData } from '@gnosis.pm/safe-core-sdk-types'
import { GnosisSafe, GnosisSafeInterface } from '../../../typechain/src/ethers-v5/GnosisSafe'
import { GnosisSafe, GnosisSafeInterface } from '../../../typechain/src/ethers-v5/v1.2.0/GnosisSafe'
import { EthersTransactionResult, TransactionOptions } from '../../utils/transactions/types'
import GnosisSafeContract from './GnosisSafeContract'

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BigNumber } from '@ethersproject/bignumber'
import { SafeTransaction, SafeTransactionData } from '@gnosis.pm/safe-core-sdk-types'
import { PromiEvent, TransactionReceipt } from 'web3-core/types'
import { GnosisSafe } from '../../../typechain/src/web3-v1/GnosisSafe'
import { GnosisSafe } from '../../../typechain/src/web3-v1/v1.2.0/gnosis_safe'
import { TransactionOptions, Web3TransactionResult } from '../../utils/transactions/types'
import GnosisSafeContract from './GnosisSafeContract'

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ContractTransaction, Event } from '@ethersproject/contracts'
import { GnosisSafeProxyFactory } from '../../../typechain/src/ethers-v5/GnosisSafeProxyFactory'
import { ProxyFactory } from '../../../typechain/src/ethers-v5/v1.1.1/ProxyFactory'
import GnosisSafeProxyFactoryContract, { CreateProxyProps } from './GnosisSafeProxyFactoryContract'

class GnosisSafeProxyFactoryEthersV5Contract implements GnosisSafeProxyFactoryContract {
constructor(public contract: GnosisSafeProxyFactory) {}
constructor(public contract: ProxyFactory) {}

getAddress(): string {
return this.contract.address
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { PromiEvent, TransactionReceipt } from 'web3-core/types'
import { GnosisSafeProxyFactory } from '../../../typechain/src/web3-v1/GnosisSafeProxyFactory'
import { ProxyFactory } from '../../../typechain/src/web3-v1/v1.1.1/proxy_factory'
import GnosisSafeProxyFactoryContract, { CreateProxyProps } from './GnosisSafeProxyFactoryContract'

class GnosisSafeProxyFactoryWeb3Contract implements GnosisSafeProxyFactoryContract {
constructor(public contract: GnosisSafeProxyFactory) {}
constructor(public contract: ProxyFactory) {}

getAddress(): string {
return this.contract.options.address
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MultiSend, MultiSendInterface } from '../../../typechain/src/ethers-v5/MultiSend'
import { MultiSend, MultiSendInterface } from '../../../typechain/src/ethers-v5/v1.1.1/MultiSend'
import MultiSendContract from './MultiSendContract'

class MultiSendEthersV5Contract implements MultiSendContract {
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { MultiSend } from '../../../typechain/src/web3-v1/MultiSend'
import { MultiSend } from '../../../typechain/src/web3-v1/v1.1.1/multi_send'
import MultiSendContract from './MultiSendContract'

class MultiSendWeb3Contract implements MultiSendContract {
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -1151,6 +1151,11 @@
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-deployments/-/safe-deployments-1.1.0.tgz#63133f4576c5d5f2779f61d322e1e449fb701b1c"
integrity sha512-eIH4gvBQLEksQXFN2vOG+JZpdSCR+q6uoZD7n8Jx/PF2nIaWVYV1CWo6kbWDwfwzgAQkDddM+8WBjnc84fbB+Q==

"@gnosis.pm/safe-deployments@^1.4.0":
version "1.4.0"
resolved "https://registry.yarnpkg.com/@gnosis.pm/safe-deployments/-/safe-deployments-1.4.0.tgz#d49d3d36cc014ef62306d09c0f4761895a17d7a6"
integrity sha512-q4salJNQ/Gx0DnZJytAFO/U4OwGI6xTGtTJSOZK+C9Fh2NW8sep+YfSunHQvCLcu4b7WgWEBhxnCV6rpyveLHg==

"@graphql-tools/batch-delegate@^6.2.4", "@graphql-tools/batch-delegate@^6.2.6":
version "6.2.6"
resolved "https://registry.yarnpkg.com/@graphql-tools/batch-delegate/-/batch-delegate-6.2.6.tgz#fbea98dc825f87ef29ea5f3f371912c2a2aa2f2c"